From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:27:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36F52642CA8; Mon, 7 Jun 2021 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvNH15zyz4qYK; Mon, 7 Jun 2021 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E3D14FD3; Mon, 7 Jun 2021 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570RwOc045622; Mon, 7 Jun 2021 00:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570RwYK045621; Mon, 7 Jun 2021 00:27:58 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:27:58 GMT Message-Id: <202106070027.1570RwYK045621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 920d813451e8 - stable/13 - vfs: fix MNT_SYNCHRONOUS check in vn_write MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 920d813451e80c1566fe6bc76a9a9989914bb52a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:27:59 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=920d813451e80c1566fe6bc76a9a9989914bb52a commit 920d813451e80c1566fe6bc76a9a9989914bb52a Author: Rich Ercolani AuthorDate: 2021-06-02 13:00:29 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:27:37 +0000 vfs: fix MNT_SYNCHRONOUS check in vn_write ca1ce50b2b5ef11d ("vfs: add more safety against concurrent forced unmount to vn_write") has a side effect of only checking MNT_SYNCHRONOUS if O_FSYNC is set. Reviewed By: mjg Differential Revision: https://reviews.freebsd.org/D30610 (cherry picked from commit a19ae1b099ad4d43588f15ef19b8506f606b27cb) --- sys/kern/vfs_vnops.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 6bf798cd73c5..4ce4678f292f 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1122,11 +1122,12 @@ vn_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, ioflag |= IO_NDELAY; if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; - if (fp->f_flag & O_FSYNC) { - mp = atomic_load_ptr(&vp->v_mount); - if (mp != NULL && mp->mnt_flag & MNT_SYNCHRONOUS) - ioflag |= IO_SYNC; - } + + mp = atomic_load_ptr(&vp->v_mount); + if ((fp->f_flag & O_FSYNC) || + (mp != NULL && (mp->mnt_flag & MNT_SYNCHRONOUS))) + ioflag |= IO_SYNC; + /* * For O_DSYNC we set both IO_SYNC and IO_DATASYNC, so that VOP_WRITE() * implementations that don't understand IO_DATASYNC fall back to full From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:30:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ABDD643006; Mon, 7 Jun 2021 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvQc40Zlz4qq8; Mon, 7 Jun 2021 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 719264CDB; Mon, 7 Jun 2021 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570U0NT046276; Mon, 7 Jun 2021 00:30:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570U0w7046265; Mon, 7 Jun 2021 00:30:00 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:30:00 GMT Message-Id: <202106070030.1570U0w7046265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 033820ace724 - stable/13 - nfs: even up value returned by nfsrv_parsename with copyinstr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 033820ace7241fce49066a88c622d15a194fac00 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:30:00 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=033820ace7241fce49066a88c622d15a194fac00 commit 033820ace7241fce49066a88c622d15a194fac00 Author: Mateusz Guzik AuthorDate: 2021-05-31 16:32:04 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:29:38 +0000 nfs: even up value returned by nfsrv_parsename with copyinstr Reported by: dim Reviewed by: rmacklem (cherry picked from commit 68c254426467e3f900f9a19de4dd9a234ea75388) --- sys/fs/nfsserver/nfs_nfsdsubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c index 49c5cac999c7..d407dad8367d 100644 --- a/sys/fs/nfsserver/nfs_nfsdsubs.c +++ b/sys/fs/nfsserver/nfs_nfsdsubs.c @@ -2064,7 +2064,7 @@ nfsrv_parsename(struct nfsrv_descript *nd, char *bufp, u_long *hashp, } } *tocp = '\0'; - *outlenp = (size_t)outlen; + *outlenp = (size_t)outlen + 1; if (hashp != NULL) *hashp = hash; nfsmout: From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:30:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D040D642F6C; Mon, 7 Jun 2021 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvQd4qmTz4qh2; Mon, 7 Jun 2021 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F5DD539E; Mon, 7 Jun 2021 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570U1jI047557; Mon, 7 Jun 2021 00:30:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570U1CK047546; Mon, 7 Jun 2021 00:30:01 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:30:01 GMT Message-Id: <202106070030.1570U1CK047546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 997332f9cda6 - stable/13 - ext2: add missing uio_td initialization to ext2_htree_append_block MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 997332f9cda66d7c42d51daac92e6e8ca83ed7a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:30:01 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=997332f9cda66d7c42d51daac92e6e8ca83ed7a0 commit 997332f9cda66d7c42d51daac92e6e8ca83ed7a0 Author: Mateusz Guzik AuthorDate: 2021-05-30 17:14:02 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:29:49 +0000 ext2: add missing uio_td initialization to ext2_htree_append_block Reported by: pho (cherry picked from commit 284cf3f18b5395e29e128702d50342d706813773) --- sys/fs/ext2fs/ext2_htree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/ext2fs/ext2_htree.c b/sys/fs/ext2fs/ext2_htree.c index 44120940236a..84f3d26d252a 100644 --- a/sys/fs/ext2fs/ext2_htree.c +++ b/sys/fs/ext2fs/ext2_htree.c @@ -439,6 +439,7 @@ ext2_htree_append_block(struct vnode *vp, char *data, auio.uio_iovcnt = 1; auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_SYSSPACE; + auio.uio_td = NULL; error = VOP_WRITE(vp, &auio, IO_SYNC, cnp->cn_cred); if (!error) dp->i_size = newsize; From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76642643391; Mon, 7 Jun 2021 00:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfL2k6cz4r7h; Mon, 7 Jun 2021 00:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45B21570D; Mon, 7 Jun 2021 00:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eAER062027; Mon, 7 Jun 2021 00:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eAKW062024; Mon, 7 Jun 2021 00:40:10 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:10 GMT Message-Id: <202106070040.1570eAKW062024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 0917d91b3344 - stable/13 - umtx: convert umtxq_lock to a macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0917d91b33444ca55b132954cc33f0d409f5a4cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:10 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0917d91b33444ca55b132954cc33f0d409f5a4cc commit 0917d91b33444ca55b132954cc33f0d409f5a4cc Author: Mateusz Guzik AuthorDate: 2021-05-22 20:51:37 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:52 +0000 umtx: convert umtxq_lock to a macro Then LOCK_PROFILING starts reporting callers instead of the inline. (cherry picked from commit 138f78e94bf83a8a92987d8be81f1e2c6c277cf8) --- sys/kern/kern_umtx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 784c10cb97ac..a1dca77fe991 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -272,7 +272,6 @@ static void umtx_shm_init(void); static void umtxq_sysinit(void *); static void umtxq_hash(struct umtx_key *key); static struct umtxq_chain *umtxq_getchain(struct umtx_key *key); -static void umtxq_lock(struct umtx_key *key); static void umtxq_unlock(struct umtx_key *key); static void umtxq_busy(struct umtx_key *key); static void umtxq_unbusy(struct umtx_key *key); @@ -501,15 +500,16 @@ umtxq_getchain(struct umtx_key *key) /* * Lock a chain. + * + * The code is a macro so that file/line information is taken from the caller. */ -static inline void -umtxq_lock(struct umtx_key *key) -{ - struct umtxq_chain *uc; - - uc = umtxq_getchain(key); - mtx_lock(&uc->uc_lock); -} +#define umtxq_lock(key) do { \ + struct umtx_key *_key = (key); \ + struct umtxq_chain *_uc; \ + \ + _uc = umtxq_getchain(_key); \ + mtx_lock(&_uc->uc_lock); \ +} while (0) /* * Unlock a chain. From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B722643439; Mon, 7 Jun 2021 00:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfM31T5z4rM0; Mon, 7 Jun 2021 00:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51142570E; Mon, 7 Jun 2021 00:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eB8k062288; Mon, 7 Jun 2021 00:40:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eBUK062285; Mon, 7 Jun 2021 00:40:11 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:11 GMT Message-Id: <202106070040.1570eBUK062285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 5d745b399d31 - stable/13 - vfs: elide vnode locking when it is only needed for audit if possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d745b399d31c0a48b634e7eae6786ba2675194b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:11 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5d745b399d31c0a48b634e7eae6786ba2675194b commit 5d745b399d31c0a48b634e7eae6786ba2675194b Author: Mateusz Guzik AuthorDate: 2021-05-23 19:28:26 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:52 +0000 vfs: elide vnode locking when it is only needed for audit if possible (cherry picked from commit a269183875f6d5141c81277d41b552871e2171e5) --- sys/kern/vfs_syscalls.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 26a8d31e4456..c18bb56fc632 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2802,9 +2802,11 @@ sys_fchflags(struct thread *td, struct fchflags_args *uap) if (error != 0) return (error); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE1(fp->f_vnode); - VOP_UNLOCK(fp->f_vnode); + if (AUDITING_TD(td)) { + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode); + } #endif error = setfflags(td, fp->f_vnode, uap->flags); fdrop(fp, td); @@ -3303,9 +3305,11 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, if (error != 0) return (error); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE1(fp->f_vnode); - VOP_UNLOCK(fp->f_vnode); + if (AUDITING_TD(td)) { + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode); + } #endif error = setutimes(td, fp->f_vnode, ts, 2, tptr == NULL); fdrop(fp, td); @@ -3337,9 +3341,11 @@ kern_futimens(struct thread *td, int fd, struct timespec *tptr, if (error != 0) return (error); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE1(fp->f_vnode); - VOP_UNLOCK(fp->f_vnode); + if (AUDITING_TD(td)) { + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode); + } #endif error = setutimes(td, fp->f_vnode, ts, 2, flags & UTIMENS_NULL); fdrop(fp, td); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 010B66431B0; Mon, 7 Jun 2021 00:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfN4R1Bz4rM5; Mon, 7 Jun 2021 00:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 706A1536F; Mon, 7 Jun 2021 00:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eClk062777; Mon, 7 Jun 2021 00:40:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eC6A062772; Mon, 7 Jun 2021 00:40:12 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:12 GMT Message-Id: <202106070040.1570eC6A062772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 666584a04da8 - stable/13 - proc: add PROC_WAIT_UNLOCKED MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 666584a04da84b6dae7a19b7525b23effd5060b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:13 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=666584a04da84b6dae7a19b7525b23effd5060b6 commit 666584a04da84b6dae7a19b7525b23effd5060b6 Author: Mateusz Guzik AuthorDate: 2021-05-27 14:29:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:53 +0000 proc: add PROC_WAIT_UNLOCKED (cherry picked from commit 528f8f38953d92aa917cbe70d3c72d89440624ca) --- sys/sys/proc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 05fdc83fd1e2..7a2210778a39 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -901,6 +901,7 @@ extern pid_t pid_max; #define PROC_TRYLOCK(p) mtx_trylock(&(p)->p_mtx) #define PROC_UNLOCK(p) mtx_unlock(&(p)->p_mtx) #define PROC_LOCKED(p) mtx_owned(&(p)->p_mtx) +#define PROC_WAIT_UNLOCKED(p) mtx_wait_unlocked(&(p)->p_mtx) #define PROC_LOCK_ASSERT(p, type) mtx_assert(&(p)->p_mtx, (type)) /* Lock and unlock a process group. */ From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCC0564343A; Mon, 7 Jun 2021 00:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfP4nb9z4r7s; Mon, 7 Jun 2021 00:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 891CD53C4; Mon, 7 Jun 2021 00:40:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eDFf063286; Mon, 7 Jun 2021 00:40:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eD36063282; Mon, 7 Jun 2021 00:40:13 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:13 GMT Message-Id: <202106070040.1570eD36063282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: b1203ecc7bb5 - stable/13 - vfs: retire unused vn_seqc_write_begin_unheld* MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1203ecc7bb520b9ea2d4fac97439948317e4768 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:14 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b1203ecc7bb520b9ea2d4fac97439948317e4768 commit b1203ecc7bb520b9ea2d4fac97439948317e4768 Author: Mateusz Guzik AuthorDate: 2021-05-29 02:26:19 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:54 +0000 vfs: retire unused vn_seqc_write_begin_unheld* (cherry picked from commit 3cf75ca220fb6a9006fa0481b97e154602f6f554) --- sys/kern/vfs_subr.c | 21 ++------------------- sys/sys/vnode.h | 2 -- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 3e6d11624197..bd4413edcb40 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6824,25 +6824,17 @@ vn_dir_check_exec(struct vnode *vp, struct componentname *cnp) * to prevent the vnode from getting freed. */ void -vn_seqc_write_begin_unheld_locked(struct vnode *vp) +vn_seqc_write_begin_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) seqc_sleepable_write_begin(&vp->v_seqc); } -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) { @@ -6852,15 +6844,6 @@ vn_seqc_write_begin(struct vnode *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); -} - void vn_seqc_write_end_locked(struct vnode *vp) { diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index d26c8aa70d8e..f492b3389d0e 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -785,8 +785,6 @@ int vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio); 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-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84C9F6430AF; Mon, 7 Jun 2021 00:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfQ6nGjz4r5r; Mon, 7 Jun 2021 00:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99F2456E5; Mon, 7 Jun 2021 00:40:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eE8Q063797; Mon, 7 Jun 2021 00:40:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eE0i063790; Mon, 7 Jun 2021 00:40:14 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:14 GMT Message-Id: <202106070040.1570eE0i063790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2c2035ca3d12 - stable/13 - fd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c2035ca3d125a1fc8b62d9942993a7d9803f236 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:15 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2c2035ca3d125a1fc8b62d9942993a7d9803f236 commit 2c2035ca3d125a1fc8b62d9942993a7d9803f236 Author: Mateusz Guzik AuthorDate: 2021-05-27 14:29:26 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:55 +0000 fd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd (cherry picked from commit 9bfddb3ac4ce8a2fbd5bb212a263747343a931e7) --- sys/kern/kern_descrip.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 168bddda9c45..585f2124eab1 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2200,13 +2200,28 @@ pdinit(struct pwddesc *pdp, bool keeplock) return (newpdp); } +/* + * Hold either filedesc or pwddesc of the passed process. + * + * The process lock is used to synchronize against the target exiting and + * freeing the data. + * + * Clearing can be ilustrated in 3 steps: + * 1. set the pointer to NULL. Either routine can race against it, hence + * atomic_load_ptr. + * 2. observe the process lock as not taken. Until then fdhold/pdhold can + * race to either still see the pointer or find NULL. It is still safe to + * grab a reference as clearing is stalled. + * 3. after the lock is observed as not taken, any fdhold/pdhold calls are + * guaranteed to see NULL, making it safe to finish clearing + */ static struct filedesc * fdhold(struct proc *p) { struct filedesc *fdp; PROC_LOCK_ASSERT(p, MA_OWNED); - fdp = p->p_fd; + fdp = atomic_load_ptr(&p->p_fd); if (fdp != NULL) refcount_acquire(&fdp->fd_holdcnt); return (fdp); @@ -2218,7 +2233,7 @@ pdhold(struct proc *p) struct pwddesc *pdp; PROC_LOCK_ASSERT(p, MA_OWNED); - pdp = p->p_pd; + pdp = atomic_load_ptr(&p->p_pd); if (pdp != NULL) refcount_acquire(&pdp->pd_refcount); return (pdp); @@ -2584,9 +2599,12 @@ fdescfree(struct thread *td) if (p->p_fdtol != NULL) fdclearlocks(td); - PROC_LOCK(p); - p->p_fd = NULL; - PROC_UNLOCK(p); + /* + * Check fdhold for an explanation. + */ + atomic_store_ptr(&p->p_fd, NULL); + atomic_thread_fence_seq_cst(); + PROC_WAIT_UNLOCKED(p); if (refcount_release(&fdp->fd_refcnt) == 0) return; @@ -2604,9 +2622,12 @@ pdescfree(struct thread *td) pdp = p->p_pd; MPASS(pdp != NULL); - PROC_LOCK(p); - p->p_pd = NULL; - PROC_UNLOCK(p); + /* + * Check pdhold for an explanation. + */ + atomic_store_ptr(&p->p_pd, NULL); + atomic_thread_fence_seq_cst(); + PROC_WAIT_UNLOCKED(p); pddrop(pdp); } From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09A41643490; Mon, 7 Jun 2021 00:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfS6Xqdz4r61; Mon, 7 Jun 2021 00:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3369570F; Mon, 7 Jun 2021 00:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eGjV064821; Mon, 7 Jun 2021 00:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eGqG064815; Mon, 7 Jun 2021 00:40:16 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:16 GMT Message-Id: <202106070040.1570eGqG064815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: a138a50c75e4 - stable/13 - vfs: use the sentinel trick in locked lookup path parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a138a50c75e4d4c92ca09d098a6d660551beaae0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:17 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a138a50c75e4d4c92ca09d098a6d660551beaae0 commit a138a50c75e4d4c92ca09d098a6d660551beaae0 Author: Mateusz Guzik AuthorDate: 2021-05-25 17:34:26 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:56 +0000 vfs: use the sentinel trick in locked lookup path parsing (cherry picked from commit d81aefa8b7dd8cbeffeda541fca9962802404983) --- sys/kern/vfs_lookup.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 5336bf87ec68..e0b98c9f5661 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -850,6 +850,7 @@ lookup(struct nameidata *ndp) { char *cp; /* pointer into pathname argument */ char *prev_ni_next; /* saved ndp->ni_next */ + char *nulchar; /* location of '\0' in cn_pnbuf */ struct vnode *dp = NULL; /* the directory we are searching */ struct vnode *tdp; /* saved dp */ struct mount *mp; /* mount table entry */ @@ -909,9 +910,23 @@ dirloop: * cnp->cn_nameptr for callers that need the name. Callers needing * the name set the SAVENAME flag. When done, they assume * responsibility for freeing the pathname buffer. + * + * Store / as a temporary sentinel so that we only have one character + * to test for. Pathnames tend to be short so this should not be + * resulting in cache misses. */ - for (cp = cnp->cn_nameptr; *cp != 0 && *cp != '/'; cp++) + nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; + KASSERT(*nulchar == '\0', + ("%s: expected nul at %p; string [%s]\n", __func__, nulchar, + cnp->cn_pnbuf)); + *nulchar = '/'; + for (cp = cnp->cn_nameptr; *cp != '/'; cp++) { + KASSERT(*cp != '\0', + ("%s: encountered unexpected nul; string [%s]\n", __func__, + cnp->cn_nameptr)); continue; + } + *nulchar = '\0'; cnp->cn_namelen = cp - cnp->cn_nameptr; if (cnp->cn_namelen > NAME_MAX) { error = ENAMETOOLONG; From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 905D96430C2; Mon, 7 Jun 2021 00:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfV0WFhz4r6F; Mon, 7 Jun 2021 00:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEBF855A0; Mon, 7 Jun 2021 00:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eHCN065345; Mon, 7 Jun 2021 00:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eHU5065339; Mon, 7 Jun 2021 00:40:17 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:17 GMT Message-Id: <202106070040.1570eHU5065339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 71622a3518c4 - stable/13 - tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71622a3518c4350140ec4c19326e4ed9288b1092 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:18 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=71622a3518c4350140ec4c19326e4ed9288b1092 commit 71622a3518c4350140ec4c19326e4ed9288b1092 Author: Mateusz Guzik AuthorDate: 2021-05-29 15:38:21 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:57 +0000 tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent The id field is immutable until the node gets freed. (cherry picked from commit 7fbeaf33b8e1a5e69af42a77c78a6fcb3029f1ca) --- sys/fs/tmpfs/tmpfs_subr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 8b75c58d69a2..df5bc12047be 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1436,10 +1436,7 @@ tmpfs_dir_getdotdotdent(struct tmpfs_mount *tm, struct tmpfs_node *node, if (parent == NULL) return (ENOENT); - TMPFS_NODE_LOCK(parent); dent.d_fileno = parent->tn_id; - TMPFS_NODE_UNLOCK(parent); - dent.d_off = next; dent.d_type = DT_DIR; dent.d_namlen = 2; From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3909B6433A5; Mon, 7 Jun 2021 00:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfS0Ckvz4rS2; Mon, 7 Jun 2021 00:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13C35517; Mon, 7 Jun 2021 00:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eFaJ064307; Mon, 7 Jun 2021 00:40:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eFrv064301; Mon, 7 Jun 2021 00:40:15 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:15 GMT Message-Id: <202106070040.1570eFrv064301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: a1ef0386c94f - stable/13 - Fix up macro use in lim_cur MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a1ef0386c94f9e2aa42f4443ea04d8f6c7931aff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:16 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a1ef0386c94f9e2aa42f4443ea04d8f6c7931aff commit a1ef0386c94f9e2aa42f4443ea04d8f6c7931aff Author: Mateusz Guzik AuthorDate: 2021-05-29 17:46:37 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:55 +0000 Fix up macro use in lim_cur (cherry picked from commit dde5c031ed0d93d080442b26133e9ea800bbcd22) --- sys/sys/resourcevar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h index e83b170ca291..d1c9e6d4985f 100644 --- a/sys/sys/resourcevar.h +++ b/sys/sys/resourcevar.h @@ -135,7 +135,7 @@ rlim_t lim_cur(struct thread *td, int which); int _which = (which); \ if (__builtin_constant_p(which) && which != RLIMIT_DATA && \ which != RLIMIT_STACK && which != RLIMIT_VMEM) { \ - _rlim = td->td_limit->pl_rlimit[which].rlim_cur; \ + _rlim = _td->td_limit->pl_rlimit[_which].rlim_cur; \ } else { \ _rlim = lim_cur(_td, _which); \ } \ From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA93C6430C9; Mon, 7 Jun 2021 00:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfW2KTVz4r6M; Mon, 7 Jun 2021 00:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3B8E5370; Mon, 7 Jun 2021 00:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eIc2065875; Mon, 7 Jun 2021 00:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eI1Y065869; Mon, 7 Jun 2021 00:40:18 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:18 GMT Message-Id: <202106070040.1570eI1Y065869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 32e5616359e5 - stable/13 - tmpfs: drop a redundant NULL check in tmpfs_alloc_vp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 32e5616359e5e7551e7a97ec54ee110d4af7e250 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:20 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=32e5616359e5e7551e7a97ec54ee110d4af7e250 commit 32e5616359e5e7551e7a97ec54ee110d4af7e250 Author: Mateusz Guzik AuthorDate: 2021-05-29 01:10:53 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:58 +0000 tmpfs: drop a redundant NULL check in tmpfs_alloc_vp (cherry picked from commit 439d942b9e7ab4df2bb7a628602069d31788df17) --- sys/fs/tmpfs/tmpfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index df5bc12047be..322641b5b853 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -831,7 +831,7 @@ loop: * Make sure the vnode is still there after * getting the interlock to avoid racing a free. */ - if (node->tn_vnode == NULL || node->tn_vnode != vp) { + if (node->tn_vnode != vp) { vput(vp); TMPFS_NODE_LOCK(node); goto loop; From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1831664336C; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfX1trrz4rMR; Mon, 7 Jun 2021 00:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1784B5518; Mon, 7 Jun 2021 00:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eJEB066374; Mon, 7 Jun 2021 00:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eJ7D066368; Mon, 7 Jun 2021 00:40:19 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:19 GMT Message-Id: <202106070040.1570eJ7D066368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 56687b27b87c - stable/13 - tmpfs: save on common case relocking in tmpfs_reclaim MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 56687b27b87c6fcd3516e56595b0d153225cddd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:21 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=56687b27b87c6fcd3516e56595b0d153225cddd2 commit 56687b27b87c6fcd3516e56595b0d153225cddd2 Author: Mateusz Guzik AuthorDate: 2021-05-29 01:36:50 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:59 +0000 tmpfs: save on common case relocking in tmpfs_reclaim (cherry picked from commit 331a7601c9c21c1e55c57c5338e7affced9c7b7c) --- sys/fs/tmpfs/tmpfs_vnops.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 43a2aa77dbbb..5d0d80639046 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1525,26 +1525,18 @@ tmpfs_reclaim(struct vop_reclaim_args *v) struct vnode *vp; struct tmpfs_mount *tmp; struct tmpfs_node *node; - bool unlock, tm_locked; + bool unlock; vp = v->a_vp; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - tm_locked = false; if (vp->v_type == VREG) tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); vp->v_object = NULL; -relock: + TMPFS_LOCK(tmp); TMPFS_NODE_LOCK(node); - if (!tm_locked && node->tn_links == 0 && - (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0) { - TMPFS_NODE_UNLOCK(node); - TMPFS_LOCK(tmp); - tm_locked = true; - goto relock; - } tmpfs_free_vp(vp); /* @@ -1552,19 +1544,16 @@ relock: * we must free its associated data structures (now that the vnode * is being reclaimed). */ + unlock = true; if (node->tn_links == 0 && (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0) { - MPASS(tm_locked); node->tn_vpstate = TMPFS_VNODE_DOOMED; unlock = !tmpfs_free_node_locked(tmp, node, true); - } else { - unlock = true; } if (unlock) { TMPFS_NODE_UNLOCK(node); - if (tm_locked) - TMPFS_UNLOCK(tmp); + TMPFS_UNLOCK(tmp); } MPASS(vp->v_data == NULL); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:40:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 923226433E4; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvfY2GNDz4r8Q; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CAD2517E; Mon, 7 Jun 2021 00:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570eL1m066874; Mon, 7 Jun 2021 00:40:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570eLjK066869; Mon, 7 Jun 2021 00:40:21 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:40:21 GMT Message-Id: <202106070040.1570eLjK066869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 4ece00cd403a - stable/13 - tmpfs: save on relocking the allnode lock in tmpfs_free_node_locked MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ece00cd403ac27ad304974f619cbdadf82d3c70 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:40:21 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4ece00cd403ac27ad304974f619cbdadf82d3c70 commit 4ece00cd403ac27ad304974f619cbdadf82d3c70 Author: Mateusz Guzik AuthorDate: 2021-05-27 08:57:59 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:34:59 +0000 tmpfs: save on relocking the allnode lock in tmpfs_free_node_locked (cherry picked from commit f4aa64528e4557cd18cdb376b0f88f4a34d69912) --- sys/fs/tmpfs/tmpfs_subr.c | 51 +++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 322641b5b853..b7dae82a71b4 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -578,53 +578,66 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, if (!last) return (false); + TMPFS_NODE_UNLOCK(node); + #ifdef INVARIANTS MPASS(node->tn_vnode == NULL); MPASS((node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0); -#endif - TMPFS_NODE_UNLOCK(node); - TMPFS_UNLOCK(tmp); + /* + * Make sure this is a node type we can deal with. Everything is explicitly + * enumerated without the 'default' clause so the the compiler can throw an + * error in case a new type is added. + */ switch (node->tn_type) { case VBLK: - /* FALLTHROUGH */ case VCHR: - /* FALLTHROUGH */ case VDIR: - /* FALLTHROUGH */ case VFIFO: - /* FALLTHROUGH */ case VSOCK: - break; - case VLNK: - symlink = node->tn_link_target; - atomic_store_ptr(&node->tn_link_target, NULL); - if (atomic_load_char(&node->tn_link_smr)) { - cache_symlink_free(symlink, node->tn_size + 1); - } else { - free(symlink, M_TMPFSNAME); - } + case VREG: break; + case VNON: + case VBAD: + case VMARKER: + panic("%s: bad type %d for node %p", __func__, (int)node->tn_type, node); + } +#endif + switch (node->tn_type) { case VREG: uobj = node->tn_reg.tn_aobj; if (uobj != NULL) { if (uobj->size != 0) atomic_subtract_long(&tmp->tm_pages_used, uobj->size); + } + + tmpfs_free_tmp(tmp); + + if (uobj != NULL) { KASSERT((uobj->flags & OBJ_TMPFS) == 0, ("leaked OBJ_TMPFS node %p vm_obj %p", node, uobj)); vm_object_deallocate(uobj); } break; + case VLNK: + tmpfs_free_tmp(tmp); + symlink = node->tn_link_target; + atomic_store_ptr(&node->tn_link_target, NULL); + if (atomic_load_char(&node->tn_link_smr)) { + cache_symlink_free(symlink, node->tn_size + 1); + } else { + free(symlink, M_TMPFSNAME); + } + break; default: - panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); + tmpfs_free_tmp(tmp); + break; } uma_zfree_smr(tmpfs_node_pool, node); - TMPFS_LOCK(tmp); - tmpfs_free_tmp(tmp); return (true); } From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:41:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED35A643AE6; Mon, 7 Jun 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyvh06RzWz4rjK; Mon, 7 Jun 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C61DD5723; Mon, 7 Jun 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570fa71071212; Mon, 7 Jun 2021 00:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570faLK071211; Mon, 7 Jun 2021 00:41:36 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:41:36 GMT Message-Id: <202106070041.1570faLK071211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b556a0eebf4d - stable/13 - arm64: correct END() copy-pasteo for generic_bs_fault MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b556a0eebf4dd3179d744acdab276f77f61da30f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:41:37 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b556a0eebf4dd3179d744acdab276f77f61da30f commit b556a0eebf4dd3179d744acdab276f77f61da30f Author: Ed Maste AuthorDate: 2021-05-28 00:10:26 +0000 Commit: Ed Maste CommitDate: 2021-06-07 00:41:17 +0000 arm64: correct END() copy-pasteo for generic_bs_fault PR: 256197 Reported by: Nick Reilly MFC after: 1 week Fixes: 95a85c125d0e67 ("Add NetBSD compatible bus_space...") Sponsored by: The FreeBSD Foundation (cherry picked from commit d097687b315671191b16494c938d3ceecd3eca4f) --- sys/arm64/arm64/bus_space_asm.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/bus_space_asm.S b/sys/arm64/arm64/bus_space_asm.S index 53e104c7fb4f..1fac678df971 100644 --- a/sys/arm64/arm64/bus_space_asm.S +++ b/sys/arm64/arm64/bus_space_asm.S @@ -400,7 +400,7 @@ END(generic_bs_wr_8) ENTRY(generic_bs_fault) mov x0, #-1 ret -END(bus_fault) +END(generic_bs_fault) ENTRY(generic_bs_peek_1) .globl generic_bs_peek_1f From owner-dev-commits-src-all@freebsd.org Mon Jun 7 00:49:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24753643B5C; Mon, 7 Jun 2021 00:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyvsX0LRGz4rwR; Mon, 7 Jun 2021 00:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E830B5734; Mon, 7 Jun 2021 00:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1570npfh072799; Mon, 7 Jun 2021 00:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1570npFM072798; Mon, 7 Jun 2021 00:49:51 GMT (envelope-from git) Date: Mon, 7 Jun 2021 00:49:51 GMT Message-Id: <202106070049.1570npFM072798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 70aba9512b53 - stable/13 - kqueue: replace kq_ncallouts loop with atomic_fetchadd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70aba9512b534a4b1a6601b8cbba1988da5b3718 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 00:49:52 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=70aba9512b534a4b1a6601b8cbba1988da5b3718 commit 70aba9512b534a4b1a6601b8cbba1988da5b3718 Author: Mateusz Guzik AuthorDate: 2021-06-02 15:14:58 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-07 00:49:46 +0000 kqueue: replace kq_ncallouts loop with atomic_fetchadd (cherry picked from commit c9f8dcda856c50325190326a618dc251311bc43a) --- sys/kern/kern_event.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 6b8ab11cb2dc..c277ac085d62 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -206,7 +206,7 @@ static struct filterops user_filtops = { }; static uma_zone_t knote_zone; -static unsigned int kq_ncallouts = 0; +static unsigned int __exclusive_cache_line kq_ncallouts; static unsigned int kq_calloutmax = 4 * 1024; SYSCTL_UINT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW, &kq_calloutmax, 0, "Maximum number of callouts allocated for kqueue"); @@ -813,18 +813,16 @@ filt_timerattach(struct knote *kn) { struct kq_timer_cb_data *kc; sbintime_t to; - unsigned int ncallouts; int error; error = filt_timervalidate(kn, &to); if (error != 0) return (error); - do { - ncallouts = kq_ncallouts; - if (ncallouts >= kq_calloutmax) - return (ENOMEM); - } while (!atomic_cmpset_int(&kq_ncallouts, ncallouts, ncallouts + 1)); + if (atomic_fetchadd_int(&kq_ncallouts, 1) + 1 > kq_calloutmax) { + atomic_subtract_int(&kq_ncallouts, 1); + return (ENOMEM); + } if ((kn->kn_sfflags & NOTE_ABSTIME) == 0) kn->kn_flags |= EV_CLEAR; /* automatically set */ From owner-dev-commits-src-all@freebsd.org Mon Jun 7 01:03:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0ED66440A2; Mon, 7 Jun 2021 01:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw8v456Qz4sKG; Mon, 7 Jun 2021 01:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 750D95BBC; Mon, 7 Jun 2021 01:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713BII099076; Mon, 7 Jun 2021 01:03:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713BQZ099075; Mon, 7 Jun 2021 01:03:11 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:11 GMT Message-Id: <202106070103.15713BQZ099075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d330127c17ec - stable/13 - x86: Fix lapic_ipi_alloc() on i386 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d330127c17ecc2360916d3125d310b4bac17866c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:11 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d330127c17ecc2360916d3125d310b4bac17866c commit d330127c17ecc2360916d3125d310b4bac17866c Author: Mark Johnston AuthorDate: 2021-05-31 22:51:14 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:00:18 +0000 x86: Fix lapic_ipi_alloc() on i386 The loop which checks to see if "dynamic" IDT entries are allocated needs to compare with the trampoline address of the reserved ISR. Otherwise it will never succeed. Reported by: Harry Schmalzbauer Tested by: Harry Schmalzbauer Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 18f55c67f746f0ad12fe972328234d340a621df9) --- sys/x86/x86/local_apic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 65ea602c0101..28443c43cfc9 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2115,6 +2115,10 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ +#ifdef __i386__ +extern uintptr_t setidt_disp; +#endif + /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. @@ -2143,6 +2147,9 @@ native_lapic_ipi_alloc(inthand_t *ipifunc) for (idx = IPI_DYN_FIRST; idx <= IPI_DYN_LAST; idx++) { ip = &idt[idx]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif if ((!pti && func == (uintptr_t)&IDTVEC(rsvd)) || (pti && func == (uintptr_t)&IDTVEC(rsvd_pti))) { vector = idx; @@ -2166,6 +2173,9 @@ native_lapic_ipi_free(int vector) mtx_lock_spin(&icu_lock); ip = &idt[vector]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif KASSERT(func != (uintptr_t)&IDTVEC(rsvd) && func != (uintptr_t)&IDTVEC(rsvd_pti), ("invalid idtfunc %#lx", func)); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 01:03:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DECBE643BF5; Mon, 7 Jun 2021 01:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw8w58dkz4sWT; Mon, 7 Jun 2021 01:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96D3F5946; Mon, 7 Jun 2021 01:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713CoR099097; Mon, 7 Jun 2021 01:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713Cgt099096; Mon, 7 Jun 2021 01:03:12 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:12 GMT Message-Id: <202106070103.15713Cgt099096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 10e697949ada - stable/13 - amd64: Avoid enabling interrupts when handling kernel mode prot faults MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 10e697949adaf82070c67f375712b73c099e2017 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:13 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10e697949adaf82070c67f375712b73c099e2017 commit 10e697949adaf82070c67f375712b73c099e2017 Author: Mark Johnston AuthorDate: 2021-05-31 22:49:33 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:02:27 +0000 amd64: Avoid enabling interrupts when handling kernel mode prot faults When PTI is enabled, we may have been on the trampoline stack when iret faults. So, we have to switch back to the regular stack before re-entering trap(). trap() has the somewhat strange behaviour of re-enabling interrupts when handling certain kernel-mode execeptions. In particular, it was doing this for exceptions raised during execution of iret. When switching away from the trampoline stack, however, the thread must not be migrated to a different CPU. Fix the problem by simply leaving interrupts disabled during the window. Reported by: syzbot+6cfa544fd86ad4647ffc@syzkaller.appspotmail.com Reported by: syzbot+cfdfc9e5a8f28f11a7f5@syzkaller.appspotmail.com Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 4a59cbc1253266ea70d6fa43b1a7c77cc33ec6cd) --- sys/amd64/amd64/trap.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 4ce31ce47a45..cc0b8fcf6c17 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -236,25 +236,31 @@ trap(struct trapframe *frame) * interrupts disabled until they are accidentally * enabled later. */ - if (TRAPF_USERMODE(frame)) + if (TRAPF_USERMODE(frame)) { uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); - else if (type != T_NMI && type != T_BPTFLT && - type != T_TRCTRAP) { - /* - * XXX not quite right, since this may be for a - * multiple fault in user mode. - */ - printf("kernel trap %d with interrupts disabled\n", - type); - - /* - * We shouldn't enable interrupts while holding a - * spin lock. - */ - if (td->td_md.md_spinlock_count == 0) - enable_intr(); + } else { + switch (type) { + case T_NMI: + case T_BPTFLT: + case T_TRCTRAP: + case T_PROTFLT: + case T_SEGNPFLT: + case T_STKFLT: + break; + default: + printf( + "kernel trap %d with interrupts disabled\n", + type); + + /* + * We shouldn't enable interrupts while holding a + * spin lock. + */ + if (td->td_md.md_spinlock_count == 0) + enable_intr(); + } } } @@ -444,6 +450,8 @@ trap(struct trapframe *frame) * Magic '5' is the number of qwords occupied by * the hardware trap frame. */ + KASSERT((read_rflags() & PSL_I) == 0, + ("interrupts enabled")); if (frame->tf_rip == (long)doreti_iret) { frame->tf_rip = (long)doreti_iret_fault; if ((PCPU_GET(curpmap)->pm_ucr3 != From owner-dev-commits-src-all@freebsd.org Mon Jun 7 01:03:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C8A4643BF7; Mon, 7 Jun 2021 01:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw8x61Spz4sN1; Mon, 7 Jun 2021 01:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B22DB5D91; Mon, 7 Jun 2021 01:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713DpF099125; Mon, 7 Jun 2021 01:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713D4H099124; Mon, 7 Jun 2021 01:03:13 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:13 GMT Message-Id: <202106070103.15713D4H099124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2a87d7c0139c - stable/13 - amd64: Relax the assertion added in commit 4a59cbc12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a87d7c0139c8bfd608eaa3d4eb84d8fa5ba61e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:14 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2a87d7c0139c8bfd608eaa3d4eb84d8fa5ba61e1 commit 2a87d7c0139c8bfd608eaa3d4eb84d8fa5ba61e1 Author: Mark Johnston AuthorDate: 2021-06-01 23:38:09 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:02:38 +0000 amd64: Relax the assertion added in commit 4a59cbc12 We only need to ensure that interrupts are disabled when handling a fault from iret. Otherwise it's possible to trigger the assertion legitimately, e.g., by copying in from an invalid address. Fixes: 4a59cbc12 Reported by: pho Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 6cda62755612d706f30a99f70ff13ffa0f3f2422) --- sys/amd64/amd64/trap.c | 70 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index cc0b8fcf6c17..e67e188bb4fd 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -172,6 +172,39 @@ SYSCTL_INT(_machdep, OID_AUTO, nmi_flush_l1d_sw, CTLFLAG_RWTUN, &nmi_flush_l1d_sw, 0, "Flush L1 Data Cache on NMI exit, software bhyve L1TF mitigation assist"); +/* + * Table of handlers for various segment load faults. + */ +static const struct { + uintptr_t faddr; + uintptr_t fhandler; +} sfhandlers[] = { + { + .faddr = (uintptr_t)ld_ds, + .fhandler = (uintptr_t)ds_load_fault, + }, + { + .faddr = (uintptr_t)ld_es, + .fhandler = (uintptr_t)es_load_fault, + }, + { + .faddr = (uintptr_t)ld_fs, + .fhandler = (uintptr_t)fs_load_fault, + }, + { + .faddr = (uintptr_t)ld_gs, + .fhandler = (uintptr_t)gs_load_fault, + }, + { + .faddr = (uintptr_t)ld_gsbase, + .fhandler = (uintptr_t)gsbase_load_fault + }, + { + .faddr = (uintptr_t)ld_fsbase, + .fhandler = (uintptr_t)fsbase_load_fault, + }, +}; + /* * Exception, fault, and trap interface to the FreeBSD kernel. * This common code is called from assembly language IDT gate entry @@ -186,6 +219,7 @@ trap(struct trapframe *frame) struct thread *td; struct proc *p; register_t addr, dr6; + size_t i; int pf, signo, ucode; u_int type; @@ -450,9 +484,9 @@ trap(struct trapframe *frame) * Magic '5' is the number of qwords occupied by * the hardware trap frame. */ - KASSERT((read_rflags() & PSL_I) == 0, - ("interrupts enabled")); if (frame->tf_rip == (long)doreti_iret) { + KASSERT((read_rflags() & PSL_I) == 0, + ("interrupts enabled")); frame->tf_rip = (long)doreti_iret_fault; if ((PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3) && @@ -463,30 +497,16 @@ trap(struct trapframe *frame) } return; } - if (frame->tf_rip == (long)ld_ds) { - frame->tf_rip = (long)ds_load_fault; - return; - } - if (frame->tf_rip == (long)ld_es) { - frame->tf_rip = (long)es_load_fault; - return; - } - if (frame->tf_rip == (long)ld_fs) { - frame->tf_rip = (long)fs_load_fault; - return; - } - if (frame->tf_rip == (long)ld_gs) { - frame->tf_rip = (long)gs_load_fault; - return; - } - if (frame->tf_rip == (long)ld_gsbase) { - frame->tf_rip = (long)gsbase_load_fault; - return; - } - if (frame->tf_rip == (long)ld_fsbase) { - frame->tf_rip = (long)fsbase_load_fault; - return; + + for (i = 0; i < nitems(sfhandlers); i++) { + if (frame->tf_rip == sfhandlers[i].faddr) { + KASSERT((read_rflags() & PSL_I) == 0, + ("interrupts enabled")); + frame->tf_rip = sfhandlers[i].fhandler; + return; + } } + if (curpcb->pcb_onfault != NULL) { frame->tf_rip = (long)curpcb->pcb_onfault; return; From owner-dev-commits-src-all@freebsd.org Mon Jun 7 01:03:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 487B9643FC3; Mon, 7 Jun 2021 01:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw931ZJvz4sNM; Mon, 7 Jun 2021 01:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F3415D6E; Mon, 7 Jun 2021 01:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713JPE099246; Mon, 7 Jun 2021 01:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713JAD099245; Mon, 7 Jun 2021 01:03:19 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:19 GMT Message-Id: <202106070103.15713JAD099245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cbced258dee4 - stable/12 - x86: Fix lapic_ipi_alloc() on i386 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cbced258dee43b4f65e62572aa2fcd67225eca20 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:19 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cbced258dee43b4f65e62572aa2fcd67225eca20 commit cbced258dee43b4f65e62572aa2fcd67225eca20 Author: Mark Johnston AuthorDate: 2021-05-31 22:51:14 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:00:32 +0000 x86: Fix lapic_ipi_alloc() on i386 The loop which checks to see if "dynamic" IDT entries are allocated needs to compare with the trampoline address of the reserved ISR. Otherwise it will never succeed. Reported by: Harry Schmalzbauer Tested by: Harry Schmalzbauer Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 18f55c67f746f0ad12fe972328234d340a621df9) --- sys/x86/x86/local_apic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 2a1c3ad56148..a34cfbb8b1c9 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2113,6 +2113,10 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ +#ifdef __i386__ +extern uintptr_t setidt_disp; +#endif + /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. @@ -2141,6 +2145,9 @@ native_lapic_ipi_alloc(inthand_t *ipifunc) for (idx = IPI_DYN_FIRST; idx <= IPI_DYN_LAST; idx++) { ip = &idt[idx]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif if ((!pti && func == (uintptr_t)&IDTVEC(rsvd)) || (pti && func == (uintptr_t)&IDTVEC(rsvd_pti))) { vector = idx; @@ -2164,6 +2171,9 @@ native_lapic_ipi_free(int vector) mtx_lock_spin(&icu_lock); ip = &idt[vector]; func = (ip->gd_hioffset << 16) | ip->gd_looffset; +#ifdef __i386__ + func -= setidt_disp; +#endif KASSERT(func != (uintptr_t)&IDTVEC(rsvd) && func != (uintptr_t)&IDTVEC(rsvd_pti), ("invalid idtfunc %#lx", func)); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 01:03:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 440796442E3; Mon, 7 Jun 2021 01:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw9k1KXLz4sl9; Mon, 7 Jun 2021 01:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15CB85D92; Mon, 7 Jun 2021 01:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713rmX099394; Mon, 7 Jun 2021 01:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713rZc099393; Mon, 7 Jun 2021 01:03:53 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:53 GMT Message-Id: <202106070103.15713rZc099393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d1b7ff3dac57 - stable/13 - ffs: Correct the input size check in sysctl_ffs_fsck() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d1b7ff3dac5727fba692e7de999e9b6834b72659 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:54 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d1b7ff3dac5727fba692e7de999e9b6834b72659 commit d1b7ff3dac5727fba692e7de999e9b6834b72659 Author: Mark Johnston AuthorDate: 2021-05-31 22:56:34 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:03:49 +0000 ffs: Correct the input size check in sysctl_ffs_fsck() Make sure we return an error if no input was specified, since SYSCTL_IN() will report success in that case. Reported by: KMSAN Reviewed by: mckusick Sponsored by: The FreeBSD Foundation (cherry picked from commit b2f9575646f89cdddcad76acae3e9305535506a2) --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index c7a1e2dec15e..c895c8c7bf07 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3211,9 +3211,9 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) cap_rights_t rights; int filetype, error; - if (req->newlen > sizeof cmd) + if (req->newptr == NULL || req->newlen > sizeof(cmd)) return (EBADRPC); - if ((error = SYSCTL_IN(req, &cmd, sizeof cmd)) != 0) + if ((error = SYSCTL_IN(req, &cmd, sizeof(cmd))) != 0) return (error); if (cmd.version != FFS_CMD_VERSION) return (ERPCMISMATCH); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 01:03:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E780464407E; Mon, 7 Jun 2021 01:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyw9n4cg5z4swS; Mon, 7 Jun 2021 01:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80C475D6F; Mon, 7 Jun 2021 01:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15713vri099512; Mon, 7 Jun 2021 01:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15713vBP099511; Mon, 7 Jun 2021 01:03:57 GMT (envelope-from git) Date: Mon, 7 Jun 2021 01:03:57 GMT Message-Id: <202106070103.15713vBP099511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f9b3922257ba - stable/12 - ffs: Correct the input size check in sysctl_ffs_fsck() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f9b3922257ba343c824784f727da1805e71ce8d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 01:03:58 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f9b3922257ba343c824784f727da1805e71ce8d8 commit f9b3922257ba343c824784f727da1805e71ce8d8 Author: Mark Johnston AuthorDate: 2021-05-31 22:56:34 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 01:03:38 +0000 ffs: Correct the input size check in sysctl_ffs_fsck() Make sure we return an error if no input was specified, since SYSCTL_IN() will report success in that case. Reported by: KMSAN Reviewed by: mckusick Sponsored by: The FreeBSD Foundation (cherry picked from commit b2f9575646f89cdddcad76acae3e9305535506a2) --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6d9b459ccfd7..842b88ec178c 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3153,9 +3153,9 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) int filetype, error; static struct fileops *origops, bufferedops; - if (req->newlen > sizeof cmd) + if (req->newptr == NULL || req->newlen > sizeof(cmd)) return (EBADRPC); - if ((error = SYSCTL_IN(req, &cmd, sizeof cmd)) != 0) + if ((error = SYSCTL_IN(req, &cmd, sizeof(cmd))) != 0) return (error); if (cmd.version != FFS_CMD_VERSION) return (ERPCMISMATCH); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 05:36:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A82F647C76; Mon, 7 Jun 2021 05:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz2Cz0Dkjz3hFm; Mon, 7 Jun 2021 05:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4DA211883; Mon, 7 Jun 2021 05:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1575aElj058291; Mon, 7 Jun 2021 05:36:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1575aEtv058290; Mon, 7 Jun 2021 05:36:14 GMT (envelope-from git) Date: Mon, 7 Jun 2021 05:36:14 GMT Message-Id: <202106070536.1575aEtv058290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: b3b695604de3 - main - stress2: Added a few syzkaller reproducers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3b695604de3304f4f71506dccb70a1d06f44026 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 05:36:15 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=b3b695604de3304f4f71506dccb70a1d06f44026 commit b3b695604de3304f4f71506dccb70a1d06f44026 Author: Peter Holm AuthorDate: 2021-06-07 05:33:32 +0000 Commit: Peter Holm CommitDate: 2021-06-07 05:33:32 +0000 stress2: Added a few syzkaller reproducers --- tools/test/stress2/misc/syzkaller39.sh | 244 ++++++++++++++++++++++++++++ tools/test/stress2/misc/syzkaller40.sh | 85 ++++++++++ tools/test/stress2/misc/syzkaller41.sh | 284 +++++++++++++++++++++++++++++++++ 3 files changed, 613 insertions(+) diff --git a/tools/test/stress2/misc/syzkaller39.sh b/tools/test/stress2/misc/syzkaller39.sh new file mode 100755 index 000000000000..e19f19d2c751 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller39.sh @@ -0,0 +1,244 @@ +#!/bin/sh + +# panic: ktrace_enter: flag set +# cpuid = 0 +# time = 1621577415 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01c0025670 +# vpanic() at vpanic+0x181/frame 0xfffffe01c00256c0 +# panic() at panic+0x43/frame 0xfffffe01c0025720 +# ktrnamei() at ktrnamei+0xdb/frame 0xfffffe01c0025750 +# namei() at namei+0x805/frame 0xfffffe01c0025800 +# vn_open_cred() at vn_open_cred+0x497/frame 0xfffffe01c0025970 +# sys_ktrace() at sys_ktrace+0x1a0/frame 0xfffffe01c0025ac0 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe01c0025bf0 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01c0025bf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x8003b054a, rsp = 0x7fffdfffdf68, rbp = 0x7fffdfffdf90 --- +# KDB: enter: panic +# [ thread pid 80729 tid 101297 ] +# Stopped at kdb_enter+0x37: movq $0,0x1281d9e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n246739-fc0dc94029d-dirty: Wed May 19 05:54:45 CEST 2021 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO +# db> + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller39.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void loop(void) +{ + int i, call, thread; + int collide = 0; +again: + for (call = 0; call < 3; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + if (collide && (call % 2) == 0) + break; + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); + if (!collide) { + collide = 1; + goto again; + } +} + +uint64_t r[1] = {0x0}; + +void execute_call(int call) +{ + intptr_t res = 0; + switch (call) { + case 0: + memcpy((void*)0x20000140, "./file0\000", 8); + syscall(SYS_open, 0x20000140ul, 0x200ul, 0ul); + break; + case 1: + res = syscall(SYS_getpid); + if (res != -1) + r[0] = res; + break; + case 2: + memcpy((void*)0x20000040, "./file0\000", 8); + syscall(SYS_ktrace, 0x20000040ul, 0ul, 0x4722db8820f38dbbul, r[0]); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + loop(); + return 0; +} +EOF +mycc -o /tmp/syzkaller39 -Wall -Wextra -O0 /tmp/syzkaller39.c -lpthread || + exit 1 + +(cd /tmp; timeout 3m ./syzkaller39) + +rm -rf /tmp/syzkaller39 syzkaller39.c /tmp/syzkaller.* +exit 0 diff --git a/tools/test/stress2/misc/syzkaller40.sh b/tools/test/stress2/misc/syzkaller40.sh new file mode 100755 index 000000000000..8c4d3e4ee54e --- /dev/null +++ b/tools/test/stress2/misc/syzkaller40.sh @@ -0,0 +1,85 @@ +#!/bin/sh + +# panic: mtx_lock() of spin mutex (null) @ ../../../kern/sys_socket.c:785 +# cpuid = 7 +# time = 1622878256 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01aaec6880 +# vpanic() at vpanic+0x181/frame 0xfffffe01aaec68d0 +# panic() at panic+0x43/frame 0xfffffe01aaec6930 +# __mtx_lock_flags() at __mtx_lock_flags+0x13c/frame 0xfffffe01aaec6980 +# soo_aio_cancel() at soo_aio_cancel+0x51/frame 0xfffffe01aaec69b0 +# aio_cancel_job() at aio_cancel_job+0x95/frame 0xfffffe01aaec69f0 +# aio_proc_rundown() at aio_proc_rundown+0xcf/frame 0xfffffe01aaec6a40 +# exit1() at exit1+0x36e/frame 0xfffffe01aaec6ab0 +# sys_sys_exit() at sys_sys_exit+0xd/frame 0xfffffe01aaec6ac0 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe01aaec6bf0 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01aaec6bf0 +# --- syscall (1, FreeBSD ELF64, sys_sys_exit), rip = 0x8003b230a, rsp = 0x7fffffffe528, rbp = 0x7fffffffe540 --- +# KDB: enter: panic +# [ thread pid 3000 tid 100365 ] +# Stopped at kdb_enter+0x37: movq $0,0x127fb8e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n247181-1b5bc3a54b6: Sat Jun 5 04:12:19 CEST 2021 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO +# db> + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller40.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t r[1] = {0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + intptr_t res = 0; + res = syscall(SYS_socket, 0x1cul, 1ul, 0); + if (res != -1) + r[0] = res; + *(uint32_t*)0x20000200 = r[0]; + *(uint64_t*)0x20000208 = 8; + *(uint64_t*)0x20000210 = 0; + *(uint64_t*)0x20000218 = 0; + *(uint32_t*)0x20000220 = 0x100; + *(uint32_t*)0x20000224 = 9; + *(uint64_t*)0x20000228 = 0x80000000; + *(uint32_t*)0x20000230 = 5; + *(uint32_t*)0x20000234 = 1; + *(uint64_t*)0x20000238 = 6; + *(uint64_t*)0x20000240 = 2; + *(uint64_t*)0x20000248 = 0; + *(uint32_t*)0x20000250 = 1; + *(uint32_t*)0x20000254 = 3; + *(uint64_t*)0x20000258 = 0x109; + *(uint32_t*)0x20000260 = 0; + syscall(SYS_aio_read, 0x20000200ul); + syscall(SYS_listen, r[0], 0x8273); + return 0; +} +EOF +mycc -o /tmp/syzkaller40 -Wall -Wextra -O0 /tmp/syzkaller40.c -lpthread || + exit 1 + +(cd /tmp; timeout 3m ./syzkaller40) + +rm -rf /tmp/syzkaller40 syzkaller40.c /tmp/syzkaller.* +exit 0 diff --git a/tools/test/stress2/misc/syzkaller41.sh b/tools/test/stress2/misc/syzkaller41.sh new file mode 100755 index 000000000000..762f155e33bf --- /dev/null +++ b/tools/test/stress2/misc/syzkaller41.sh @@ -0,0 +1,284 @@ +#!/bin/sh + +# Fatal trap 12: page fault while in kernel mode +# cpuid = 23; apic id = 2b +# fault virtual address = 0x0 +# fault code = supervisor read instruction, page not present +# instruction pointer = 0x20:0x0 +# stack pointer = 0x28:0xfffffe0131d05b78 +# frame pointer = 0x28:0xfffffe0131d05bb0 +# code segment = base 0x0, limit 0xfffff, type 0x1b +# = DPL 0, pres 1, long 1, def32 0, gran 1 +# processor eflags = interrupt enabled, resume, IOPL = 0 +# current process = 35 (soaiod1) +# trap number = 12 +# panic: page fault +# cpuid = 23 +# time = 1622994049 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0131d05820 +# vpanic() at vpanic+0x181/frame 0xfffffe0131d05870 +# panic() at panic+0x43/frame 0xfffffe0131d058d0 +# trap_fatal() at trap_fatal+0x387/frame 0xfffffe0131d05930 +# trap_pfault() at trap_pfault+0x97/frame 0xfffffe0131d05990 +# trap() at trap+0x294/frame 0xfffffe0131d05aa0 +# calltrap() at calltrap+0x8/frame 0xfffffe0131d05aa0 +# --- trap 0xc, rip = 0, rsp = 0xfffffe0131d05b78, rbp = 0xfffffe0131d05bb0 --- +# ??() at 0/frame 0xfffffe0131d05bb0 +# fork_exit() at fork_exit+0x80/frame 0xfffffe0131d05bf0 +# fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0131d05bf0 +# --- trap 0, rip = 0, rsp = 0, rbp = 0 --- +# KDB: enter: panic +# [ thread pid 35 tid 100272 ] +# Stopped at kdb_enter+0x37: movq $0,0x127fb8e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n247181-1b5bc3a54b6: Sat Jun 5 04:12:19 CEST 2021 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO +# db> + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller41.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void loop(void) +{ + int i, call, thread; + for (call = 0; call < 4; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); +} + +uint64_t r[1] = {0xffffffffffffffff}; + +void execute_call(int call) +{ + intptr_t res = 0; + switch (call) { + case 0: + res = syscall(SYS_socket, 0x1cul, 1ul, 0); + if (res != -1) + r[0] = res; + break; + case 1: + *(uint32_t*)0x20000300 = r[0]; + *(uint64_t*)0x20000308 = 0x9a6; + *(uint64_t*)0x20000310 = 0; + *(uint64_t*)0x20000318 = 0; + *(uint32_t*)0x20000320 = 0xffe; + *(uint32_t*)0x20000324 = 0x100; + *(uint64_t*)0x20000328 = 0x2b8; + *(uint32_t*)0x20000330 = 4; + *(uint32_t*)0x20000334 = 0xfff; + *(uint64_t*)0x20000338 = 3; + *(uint64_t*)0x20000340 = 0x80000001; + *(uint64_t*)0x20000348 = 0; + *(uint32_t*)0x20000350 = 4; + *(uint32_t*)0x20000354 = 0xb; + *(uint64_t*)0x20000358 = 9; + *(uint64_t*)0x20000360 = 0xa3c5; + *(uint64_t*)0x20000368 = 0xfffffffffffffff7; + *(uint64_t*)0x20000370 = 0x8000; + *(uint64_t*)0x20000378 = 3; + *(uint64_t*)0x20000380 = 0x498c; + *(uint64_t*)0x20000388 = 8; + *(uint64_t*)0x20000390 = 4; + *(uint64_t*)0x20000398 = 3; + syscall(SYS_aio_read, 0x20000300ul); + break; + case 2: + *(uint8_t*)0x20000000 = 0x1c; + *(uint8_t*)0x20000001 = 0x1c; + *(uint16_t*)0x20000002 = htobe16(0x4e21); + *(uint32_t*)0x20000004 = 0; + *(uint8_t*)0x20000008 = 0xfe; + *(uint8_t*)0x20000009 = 0x80; + memset((void*)0x2000000a, 0, 12); + *(uint8_t*)0x20000016 = 0; + *(uint8_t*)0x20000017 = 0xaa; + *(uint32_t*)0x20000018 = 1; + syscall(SYS_connect, r[0], 0x20000000ul, 0x1cul); + break; + case 3: + syscall(SYS_shutdown, r[0], 0ul); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + loop(); + return 0; +} +EOF +mycc -o /tmp/syzkaller41 -Wall -Wextra -O0 /tmp/syzkaller41.c -lpthread || + exit 1 + +(cd /tmp; timeout 3m ./syzkaller41) + +rm -rf /tmp/syzkaller41 syzkaller41.c /tmp/syzkaller.* +exit 0 From owner-dev-commits-src-all@freebsd.org Mon Jun 7 05:36:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41D7A647BB5; Mon, 7 Jun 2021 05:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz2D01D5xz3h2K; Mon, 7 Jun 2021 05:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 115BF117AC; Mon, 7 Jun 2021 05:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1575aFY1058318; Mon, 7 Jun 2021 05:36:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1575aFMR058317; Mon, 7 Jun 2021 05:36:15 GMT (envelope-from git) Date: Mon, 7 Jun 2021 05:36:15 GMT Message-Id: <202106070536.1575aFMR058317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 201434ecaca7 - main - stress2: Added two test scenarios based on Bug 256205 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 201434ecaca79cc0fea4bca7350fc5b7ac941a81 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 05:36:16 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=201434ecaca79cc0fea4bca7350fc5b7ac941a81 commit 201434ecaca79cc0fea4bca7350fc5b7ac941a81 Author: Peter Holm AuthorDate: 2021-06-07 05:35:10 +0000 Commit: Peter Holm CommitDate: 2021-06-07 05:35:10 +0000 stress2: Added two test scenarios based on Bug 256205 --- tools/test/stress2/misc/zfs12.sh | 133 +++++++++++++++++++++++++++++++++++++ tools/test/stress2/misc/zfs13.sh | 82 +++++++++++++++++++++++ tools/test/stress2/tools/lsholes.c | 86 ++++++++++++++++++++++++ 3 files changed, 301 insertions(+) diff --git a/tools/test/stress2/misc/zfs12.sh b/tools/test/stress2/misc/zfs12.sh new file mode 100755 index 000000000000..cfabca2b9f6f --- /dev/null +++ b/tools/test/stress2/misc/zfs12.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# 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. +# + +# lseek(SEEK_HOLE): finds hole +# Test scenario suggestion by: kib@ +# Related to: +# Bug 256205 - ZFS: data corruption with SEEK_HOLE/SEEK_DATA on dirty files ... + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +kldstat -v | grep -q zfs.ko || { kldload zfs.ko; loaded=1; } || + exit 0 + +. ../default.cfg + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > zfs12.c +mycc -o zfs12 -Wall -Wextra -O0 -g zfs12.c || exit 1 +rm -f zfs12.c +cc -o /tmp/lsholes -Wall -Wextra -O2 $here/../tools/lsholes.c | exit 1 + +mp1=/stress2_tank/test +u1=$mdstart +u2=$((u1 + 1)) + +set -e +mdconfig -l | grep -q md$u1 && mdconfig -d -u $u1 +mdconfig -l | grep -q md$u2 && mdconfig -d -u $u2 + +mdconfig -s 2g -u $u1 +mdconfig -s 2g -u $u2 + +zpool list | egrep -q "^stress2_tank" && zpool destroy stress2_tank +[ -d /stress2_tank ] && rm -rf /stress2_tank +zpool create stress2_tank md$u1 md$u2 +zfs create stress2_tank/test +set +e + +(cd $here/../testcases/swap; ./swap -t 2m -i 20 -l 100 -h > /dev/null) & +file1=$mp1/file # zfs path +sleep 20 +/tmp/zfs12 $file1 +/tmp/lsholes $file1 +s=$? +while pkill swap; do sleep 1; done +wait + +zfs umount stress2_tank/test +zfs destroy -r stress2_tank +zpool destroy stress2_tank +mdconfig -d -u $u1 +mdconfig -d -u $u2 +rm -f /tmp/zfs12 /tmp/lsholes +[ $loaded ] && kldunload zfs.ko +exit $s +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SIZ (500UL * 1024 * 1024) + +int +main(int argc __unused, char *argv[]) +{ + off_t hole; + size_t len; + int fd; + char *p, *path; + + len = SIZ; + + path = argv[1]; + if ((fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0622)) == -1) + err(1,"open()"); + if (ftruncate(fd, len) == -1) + err(1, "ftruncate"); + if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == + MAP_FAILED) { + if (errno == ENOMEM) + return (1); + err(1, "mmap(1)"); + } + p[1 * 1024] = 1; + p[2 * 1024] = 1; + p[4 * 1024] = 1; + + if (msync(p, len, MS_SYNC | MS_INVALIDATE) == -1) + err(1, "msync()"); + + if ((hole = lseek(fd, 0, SEEK_HOLE)) == -1) + err(1, "lseek(SEEK_HOLE)"); + if (hole != SIZ) + printf("--> hole = %jd, file size=%jd\n", + (intmax_t)hole, (intmax_t)SIZ); + close(fd); + + return (hole == SIZ ? 0 : 1); +} diff --git a/tools/test/stress2/misc/zfs13.sh b/tools/test/stress2/misc/zfs13.sh new file mode 100755 index 000000000000..2ccd4388270d --- /dev/null +++ b/tools/test/stress2/misc/zfs13.sh @@ -0,0 +1,82 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# 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. +# + +# Sparse files test. +# Delayed write observed. +# Related to: +# Bug 256205 - ZFS: data corruption with SEEK_HOLE/SEEK_DATA on dirty files ... + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +kldstat -v | grep -q zfs.ko || { kldload zfs.ko; loaded=1; } || + exit 0 + +. ../default.cfg + +here=`pwd` +cd /tmp +mycc -o /tmp/lsholes -Wall -Wextra -O0 -g $here/../tools/lsholes.c || exit 1 + +log1=/tmp/zfs13.sh.1.log +log2=/tmp/zfs13.sh.2.log +mp1=/stress2_tank/test +u1=$mdstart +u2=$((u1 + 1)) + +set -e +mdconfig -l | grep -q md$u1 && mdconfig -d -u $u1 +mdconfig -l | grep -q md$u2 && mdconfig -d -u $u2 + +mdconfig -s 2g -u $u1 +mdconfig -s 2g -u $u2 + +zpool list | egrep -q "^stress2_tank" && zpool destroy stress2_tank +[ -d /stress2_tank ] && rm -rf /stress2_tank +zpool create stress2_tank md$u1 md$u2 +zfs create stress2_tank/test +set +e + +cd $mp1 +dd if=/etc/passwd conv=notrunc oseek=32k of=output status=none +ls -ls | grep output | tee $log1 +/tmp/lsholes output +sleep 10 +ls -ls | grep output | tee $log2 +/tmp/lsholes output +cd $here + +zfs umount stress2_tank/test +zfs destroy -r stress2_tank +zpool destroy stress2_tank +mdconfig -d -u $u1 +mdconfig -d -u $u2 +cmp -s $log1 $log2 +s=$? +rm -f /tmp/lsholes $log1 $log2 +[ $loaded ] && kldunload zfs.ko +exit $s diff --git a/tools/test/stress2/tools/lsholes.c b/tools/test/stress2/tools/lsholes.c new file mode 100644 index 000000000000..a583c1315093 --- /dev/null +++ b/tools/test/stress2/tools/lsholes.c @@ -0,0 +1,86 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Peter Holm + * + * 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 +#include + +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct stat st; + off_t data, hole, pos; + long mx; + int fd, n; + char *name; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + exit(1); + } + + name = argv[1]; + if ((fd = open(name, O_RDONLY)) == -1) + err(1, "open(%s)", name); + if (fstat(fd, &st)) + err(1, "fstat()"); + if ((mx = fpathconf(fd, _PC_MIN_HOLE_SIZE)) == -1) + err(1, "fpathconf()"); + fprintf(stderr, "file \"%s\" size = %jd, _PC_MIN_HOLE_SIZE = %ld\n", + name, (intmax_t)st.st_size, mx); + n = 1; + pos = 0; + while (pos < st.st_size) { + if ((hole = lseek(fd, pos, SEEK_HOLE)) == -1) + err(1, "lseek(SEEK_HOLE)"); + if ((data = lseek(fd, hole, SEEK_DATA)) == -1) { + if (errno == ENXIO) { + if (hole == st.st_size) + break; + fprintf(stderr, + "No data after hole @ %jd\n", + (intmax_t)hole); + break; + } + err(1, "lseek(SEEK_DATA)"); + } + pos = data; + printf("hole #%d @ %jd (0x%jx), size=%jd (0x%jx)\n", + n, (intmax_t)hole, (intmax_t)hole, (intmax_t)(data - hole), + (intmax_t)(data - hole)); + n++; + } + close(fd); + if (hole != st.st_size) + errx(1, "No implicit hole at EOF"); +} From owner-dev-commits-src-all@freebsd.org Mon Jun 7 05:49:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B36364829B; Mon, 7 Jun 2021 05:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz2Wj6zT9z3hqT; Mon, 7 Jun 2021 05:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC99115C1; Mon, 7 Jun 2021 05:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1575nriQ072170; Mon, 7 Jun 2021 05:49:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1575nrKL072169; Mon, 7 Jun 2021 05:49:53 GMT (envelope-from git) Date: Mon, 7 Jun 2021 05:49:53 GMT Message-Id: <202106070549.1575nrKL072169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: fc2d7fb643f8 - stable/13 - libalias: Remove unused function LibAliasCheckNewLink MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc2d7fb643f83fff73b1038734b934fdafa946c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 05:49:54 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=fc2d7fb643f83fff73b1038734b934fdafa946c3 commit fc2d7fb643f83fff73b1038734b934fdafa946c3 Author: Lutz Donnerhacke AuthorDate: 2021-05-15 13:24:12 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-07 05:48:07 +0000 libalias: Remove unused function LibAliasCheckNewLink The functionality to detect a newly created link after processing a single packet is decoupled from the packet processing. Every new packet is processed asynchronously and will reset the indicator, hence the function is unusable. I made a Google search for third party code, which uses the function, and failed to find one. That's why the function should be removed: It unusable and unused. A much simplified API/ABI will remain in anything below 14. Discussed with: kp Reviewed by: manpages (bcr) Differential Revision: https://reviews.freebsd.org/D30275 (cherry picked from commit bfd41ba1fe1d0e40b6a813aeb0354cac8d884f5b) --- sys/netinet/libalias/alias.c | 2 -- sys/netinet/libalias/alias.h | 4 +++- sys/netinet/libalias/alias_db.c | 17 +++-------------- sys/netinet/libalias/alias_local.h | 4 ---- sys/netinet/libalias/libalias.3 | 12 +----------- 5 files changed, 7 insertions(+), 32 deletions(-) diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 0e2756affcb4..39e9b060623d 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -1330,7 +1330,6 @@ LibAliasInLocked(struct libalias *la, struct ip *pip, int maxpacketsize) goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); alias_addr = pip->ip_dst; /* Defense against mangled packets */ @@ -1461,7 +1460,6 @@ LibAliasOutLocked(struct libalias *la, goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); /* Defense against mangled packets */ if (ntohs(pip->ip_len) > maxpacketsize diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h index 36f1ca168823..558a750b4fd8 100644 --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -120,10 +120,12 @@ void *LibAliasGetFragment(struct libalias *, void *_ptr); int LibAliasSaveFragment(struct libalias *, void *_ptr); /* Miscellaneous functions. */ -int LibAliasCheckNewLink(struct libalias *); unsigned short LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes); void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr); +/* never used and never worked, to be removed in FreeBSD 14 */ +int LibAliasCheckNewLink(struct libalias *); + /* Transparent proxying routines. */ int LibAliasProxyRule(struct libalias *, const char *_cmd); diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 7a84cf310d5a..0273cc84773d 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1675,7 +1675,6 @@ FindOriginalAddress(struct libalias *la, struct in_addr alias_addr) lnk = FindLinkIn(la, ANY_ADDR, alias_addr, 0, 0, LINK_ADDR, 0); if (lnk == NULL) { - la->newDefaultLink = 1; if (la->targetAddress.s_addr == INADDR_ANY) return (alias_addr); else if (la->targetAddress.s_addr == INADDR_NONE) @@ -2052,13 +2051,6 @@ SetExpire(struct alias_link *lnk, int expire) } } -void -ClearCheckNewLink(struct libalias *la) -{ - LIBALIAS_LOCK_ASSERT(la); - la->newDefaultLink = 0; -} - void SetProtocolFlags(struct alias_link *lnk, int pflags) { @@ -2548,15 +2540,12 @@ getout: return (res); } +/* never used and never worked, to be removed in FreeBSD 14 */ int LibAliasCheckNewLink(struct libalias *la) { - int res; - - LIBALIAS_LOCK(la); - res = la->newDefaultLink; - LIBALIAS_UNLOCK(la); - return (res); + (void)la; + return (0); } #ifndef NO_FW_PUNCH diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h index 63bfd857f14f..61cd30737ce5 100644 --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -118,9 +118,6 @@ struct libalias { #else FILE *logDesc; #endif - /* Indicates if a new aliasing link has been created - * after a call to PacketAliasIn/Out(). */ - int newDefaultLink; #ifndef NO_FW_PUNCH /* File descriptor to be able to control firewall. @@ -323,7 +320,6 @@ int GetDeltaSeqOut(u_long, struct alias_link *lnk); void AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len, u_long th_seq, u_int th_off); void SetExpire (struct alias_link *_lnk, int _expire); -void ClearCheckNewLink(struct libalias *la); void SetProtocolFlags(struct alias_link *_lnk, int _pflags); int GetProtocolFlags(struct alias_link *_lnk); void SetDestCallId(struct alias_link *_lnk, u_int16_t _cid); diff --git a/sys/netinet/libalias/libalias.3 b/sys/netinet/libalias/libalias.3 index beef2ff7fca5..85ebe55f527c 100644 --- a/sys/netinet/libalias/libalias.3 +++ b/sys/netinet/libalias/libalias.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 1, 2020 +.Dd May 31, 2021 .Dt LIBALIAS 3 .Os .Sh NAME @@ -863,16 +863,6 @@ This allows external machines to talk directly to internal machines if they can route packets to the machine in question. .Ed .Pp -.Ft int -.Fn LibAliasCheckNewLink "struct libalias *" -.Bd -ragged -offset indent -This function returns a non-zero value when a new aliasing link is created. -In circumstances where incoming traffic is being sequentially sent to -different local servers, this function can be used to trigger when -.Fn LibAliasSetTarget -is called to change the default target address. -.Ed -.Pp .Ft u_short .Fn LibAliasInternetChecksum "struct libalias *" "u_short *buffer" "int nbytes" .Bd -ragged -offset indent From owner-dev-commits-src-all@freebsd.org Mon Jun 7 05:52:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F5ED648508; Mon, 7 Jun 2021 05:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz2Zz0sHFz3jCZ; Mon, 7 Jun 2021 05:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05B0011A75; Mon, 7 Jun 2021 05:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1575qgCr084672; Mon, 7 Jun 2021 05:52:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1575qgWw084671; Mon, 7 Jun 2021 05:52:42 GMT (envelope-from git) Date: Mon, 7 Jun 2021 05:52:42 GMT Message-Id: <202106070552.1575qgWw084671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 09a6fc8dbe2e - stable/12 - libalias: Remove unused function LibAliasCheckNewLink MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 09a6fc8dbe2e96317d8f88d4179e436df73d59fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 05:52:43 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=09a6fc8dbe2e96317d8f88d4179e436df73d59fd commit 09a6fc8dbe2e96317d8f88d4179e436df73d59fd Author: Lutz Donnerhacke AuthorDate: 2021-05-15 13:24:12 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-07 05:51:57 +0000 libalias: Remove unused function LibAliasCheckNewLink The functionality to detect a newly created link after processing a single packet is decoupled from the packet processing. Every new packet is processed asynchronously and will reset the indicator, hence the function is unusable. I made a Google search for third party code, which uses the function, and failed to find one. That's why the function should be removed: It unusable and unused. A much simplified API/ABI will remain in anything below 14. Discussed with: kp Reviewed by: manpages (bcr) Differential Revision: https://reviews.freebsd.org/D30275 (cherry picked from commit bfd41ba1fe1d0e40b6a813aeb0354cac8d884f5b) --- sys/netinet/libalias/alias.c | 2 -- sys/netinet/libalias/alias.h | 4 +++- sys/netinet/libalias/alias_db.c | 17 +++-------------- sys/netinet/libalias/alias_local.h | 4 ---- sys/netinet/libalias/libalias.3 | 12 +----------- 5 files changed, 7 insertions(+), 32 deletions(-) diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 8a18c61b452e..030177eb622d 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -1329,7 +1329,6 @@ LibAliasInLocked(struct libalias *la, struct ip *pip, int maxpacketsize) goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); alias_addr = pip->ip_dst; /* Defense against mangled packets */ @@ -1460,7 +1459,6 @@ LibAliasOutLocked(struct libalias *la, goto getout; } HouseKeeping(la); - ClearCheckNewLink(la); /* Defense against mangled packets */ if (ntohs(pip->ip_len) > maxpacketsize diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h index 36f1ca168823..558a750b4fd8 100644 --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -120,10 +120,12 @@ void *LibAliasGetFragment(struct libalias *, void *_ptr); int LibAliasSaveFragment(struct libalias *, void *_ptr); /* Miscellaneous functions. */ -int LibAliasCheckNewLink(struct libalias *); unsigned short LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes); void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr); +/* never used and never worked, to be removed in FreeBSD 14 */ +int LibAliasCheckNewLink(struct libalias *); + /* Transparent proxying routines. */ int LibAliasProxyRule(struct libalias *, const char *_cmd); diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index ff3072473d67..7c2faa62f7fc 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1675,7 +1675,6 @@ FindOriginalAddress(struct libalias *la, struct in_addr alias_addr) lnk = FindLinkIn(la, ANY_ADDR, alias_addr, 0, 0, LINK_ADDR, 0); if (lnk == NULL) { - la->newDefaultLink = 1; if (la->targetAddress.s_addr == INADDR_ANY) return (alias_addr); else if (la->targetAddress.s_addr == INADDR_NONE) @@ -2052,13 +2051,6 @@ SetExpire(struct alias_link *lnk, int expire) } } -void -ClearCheckNewLink(struct libalias *la) -{ - LIBALIAS_LOCK_ASSERT(la); - la->newDefaultLink = 0; -} - void SetProtocolFlags(struct alias_link *lnk, int pflags) { @@ -2548,15 +2540,12 @@ getout: return (res); } +/* never used and never worked, to be removed in FreeBSD 14 */ int LibAliasCheckNewLink(struct libalias *la) { - int res; - - LIBALIAS_LOCK(la); - res = la->newDefaultLink; - LIBALIAS_UNLOCK(la); - return (res); + (void)la; + return (0); } #ifndef NO_FW_PUNCH diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h index 63bfd857f14f..61cd30737ce5 100644 --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -118,9 +118,6 @@ struct libalias { #else FILE *logDesc; #endif - /* Indicates if a new aliasing link has been created - * after a call to PacketAliasIn/Out(). */ - int newDefaultLink; #ifndef NO_FW_PUNCH /* File descriptor to be able to control firewall. @@ -323,7 +320,6 @@ int GetDeltaSeqOut(u_long, struct alias_link *lnk); void AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len, u_long th_seq, u_int th_off); void SetExpire (struct alias_link *_lnk, int _expire); -void ClearCheckNewLink(struct libalias *la); void SetProtocolFlags(struct alias_link *_lnk, int _pflags); int GetProtocolFlags(struct alias_link *_lnk); void SetDestCallId(struct alias_link *_lnk, u_int16_t _cid); diff --git a/sys/netinet/libalias/libalias.3 b/sys/netinet/libalias/libalias.3 index 79b0dd15db97..7876c650ccf5 100644 --- a/sys/netinet/libalias/libalias.3 +++ b/sys/netinet/libalias/libalias.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 1, 2020 +.Dd May 31, 2021 .Dt LIBALIAS 3 .Os .Sh NAME @@ -863,16 +863,6 @@ This allows external machines to talk directly to internal machines if they can route packets to the machine in question. .Ed .Pp -.Ft int -.Fn LibAliasCheckNewLink "struct libalias *" -.Bd -ragged -offset indent -This function returns a non-zero value when a new aliasing link is created. -In circumstances where incoming traffic is being sequentially sent to -different local servers, this function can be used to trigger when -.Fn LibAliasSetTarget -is called to change the default target address. -.Ed -.Pp .Ft u_short .Fn LibAliasInternetChecksum "struct libalias *" "u_short *buffer" "int nbytes" .Bd -ragged -offset indent From owner-dev-commits-src-all@freebsd.org Mon Jun 7 06:32:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 332A4648BD3; Mon, 7 Jun 2021 06:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz3SV10Vjz3n1g; Mon, 7 Jun 2021 06:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00F39120BB; Mon, 7 Jun 2021 06:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1576W9rp035370; Mon, 7 Jun 2021 06:32:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1576W931035369; Mon, 7 Jun 2021 06:32:09 GMT (envelope-from git) Date: Mon, 7 Jun 2021 06:32:09 GMT Message-Id: <202106070632.1576W931035369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: aaa28628a3e4 - main - fifolog: Rename yyparse() to getdate_yyparse(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aaa28628a3e4f66d9642eb4b6e6c49b5b61d4dce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 06:32:10 -0000 The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=aaa28628a3e4f66d9642eb4b6e6c49b5b61d4dce commit aaa28628a3e4f66d9642eb4b6e6c49b5b61d4dce Author: Poul-Henning Kamp AuthorDate: 2021-06-07 06:30:34 +0000 Commit: Poul-Henning Kamp CommitDate: 2021-06-07 06:31:50 +0000 fifolog: Rename yyparse() to getdate_yyparse(). Remove config file for obsolete static analyzer FlexeLint --- usr.sbin/fifolog/flint.lnt | 55 ------------------------------------------ usr.sbin/fifolog/lib/getdate.y | 2 ++ 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/usr.sbin/fifolog/flint.lnt b/usr.sbin/fifolog/flint.lnt deleted file mode 100644 index 87e0c86cef07..000000000000 --- a/usr.sbin/fifolog/flint.lnt +++ /dev/null @@ -1,55 +0,0 @@ -// $FreeBSD$ -// FlexeLint file for fifolog tools -// -// -//-passes=3 -//-ffc -// -//// GCC -//-cgnu -//+d__FreeBSD__=7 -//+d__GNUC__=4 -//+d__GNUC_MINOR__=2 -//+d__FreeBSD_cc_version=700003 -//+d__attribute__()= -//-d__builtin_va_list=void* // used by stdarg.h -//// -d__builtin_stdarg_start()=_to_semi // ditto -//// -d__builtin_va_start(a,b)=((void)(b),(a)=0) // ditto -//// -d__builtin_va_end()=_to_semi // ditto -//+rw(__inline) // enable the (non-standard) __inline keyword -//+rw(__inline__) // enable the (non-standard) __inline__ keyword -// -//+d"__unused=/*lint -e{715} -e{818} */" -// -//-e537 // Repeated include file -//-elib(652) // #define of symbol '...' declared previously -//-function(exit,__assert) -//-function(exit,err) -//-function(exit,errx) -//-e716 // while(1) ... -//-e717 // do ... while(0) -// -//// Ignore return values --esym(534, memset) --esym(534, memcpy) --esym(534, strcpy) -//-esym(534, printf) --esym(534, time) --esym(534, fprintf) -//-esym(534, vfprintf) -// -//+libh(fifolog.h) -//+libh(miniobj.h) -//+libh(libfifolog.h) -// -//-e713 // loss of precision sign/unsigned -//-e732 // loss of sign -//-e734 // loss of precision assignment -//-e737 // loss of sign in promotion int->unsigned -//-e573 // sign/unsign mix in divide - --e712 // Loss of precision (___) (___ to ___) --e713 // Loss of precision (___) (___ to ___) --e716 // while(1) ... --e732 // Loss of sign (___) (___ to ___) --e747 // Significant prototype coercion (___) ___ to ___ diff --git a/usr.sbin/fifolog/lib/getdate.y b/usr.sbin/fifolog/lib/getdate.y index 53a515c4d17e..8e63e8112993 100644 --- a/usr.sbin/fifolog/lib/getdate.y +++ b/usr.sbin/fifolog/lib/getdate.y @@ -24,9 +24,11 @@ #include "libfifolog.h" +#define yyparse getdate_yyparse #define yylex getdate_yylex #define yyerror getdate_yyerror +static int yyparse(void); static int yylex(void); static int yyerror(const char *); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 09:01:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E40F64A3FF; Mon, 7 Jun 2021 09:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz6nC3KhFz4YRS; Mon, 7 Jun 2021 09:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59E3A1328D; Mon, 7 Jun 2021 09:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15791ptj008295; Mon, 7 Jun 2021 09:01:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15791pUX008294; Mon, 7 Jun 2021 09:01:51 GMT (envelope-from git) Date: Mon, 7 Jun 2021 09:01:51 GMT Message-Id: <202106070901.15791pUX008294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 1ceefa271e57 - stable/13 - sctp: fix another locking bug in COOKIE handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ceefa271e5759a1888cb6d153b85642bdf85984 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 09:01:51 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1ceefa271e5759a1888cb6d153b85642bdf85984 commit 1ceefa271e5759a1888cb6d153b85642bdf85984 Author: Michael Tuexen AuthorDate: 2021-05-12 21:02:31 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 09:01:28 +0000 sctp: fix another locking bug in COOKIE handling Thanks to Tolya Korniltsev for reporting the issue for the userland stack and testing the fix. (cherry picked from commit eec6aed5b8c848841ae8d25940e0a333e5039ce9) --- sys/netinet/sctp_input.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index f066cc100ac2..442e58afd0ff 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1752,17 +1752,23 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, struct sctpasochead *head; if (asoc->peer_supports_nat) { + struct sctp_tcb *local_stcb; + /* * This is a gross gross hack. Just call the * cookie_new code since we are allowing a duplicate * association. I hope this works... */ - return (sctp_process_cookie_new(m, iphlen, offset, src, dst, + local_stcb = sctp_process_cookie_new(m, iphlen, offset, src, dst, sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, mflowtype, mflowid, - vrf_id, port)); + vrf_id, port); + if (local_stcb == NULL) { + SCTP_TCB_UNLOCK(stcb); + } + return (local_stcb); } /* * case A in Section 5.2.4 Table 2: XXMM (peer restarted) From owner-dev-commits-src-all@freebsd.org Mon Jun 7 09:01:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13DF364AB00; Mon, 7 Jun 2021 09:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz6nD40rkz4Yj3; Mon, 7 Jun 2021 09:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 709DB1322A; Mon, 7 Jun 2021 09:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15791q8n008410; Mon, 7 Jun 2021 09:01:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15791qUa008332; Mon, 7 Jun 2021 09:01:52 GMT (envelope-from git) Date: Mon, 7 Jun 2021 09:01:52 GMT Message-Id: <202106070901.15791qUa008332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: fa50e98328b4 - stable/13 - mend MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa50e98328b48da4fa8dbd97d0a787962cf249f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 09:01:53 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fa50e98328b48da4fa8dbd97d0a787962cf249f5 commit fa50e98328b48da4fa8dbd97d0a787962cf249f5 Author: Michael Tuexen AuthorDate: 2021-04-18 14:08:08 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 09:01:28 +0000 mend --- share/man/man4/tcp.4 | 15 +- sys/netinet/tcp.h | 1 + sys/netinet/tcp_input.c | 48 ++++- sys/netinet/tcp_output.c | 80 ++++++-- sys/netinet/tcp_stacks/bbr.c | 38 +--- sys/netinet/tcp_stacks/rack.c | 26 +-- sys/netinet/tcp_subr.c | 462 ++++++++++++++++++++++++++++++++++++++++-- sys/netinet/tcp_syncache.c | 127 +++++++++--- sys/netinet/tcp_syncache.h | 12 +- sys/netinet/tcp_timewait.c | 84 ++++++-- sys/netinet/tcp_usrreq.c | 30 +++ sys/netinet/tcp_var.h | 27 ++- sys/netinet/toecore.c | 4 +- sys/netinet6/tcp6_var.h | 2 + sys/sys/mbuf.h | 1 + usr.bin/netstat/inet.c | 4 + usr.bin/sockstat/sockstat.1 | 6 +- usr.bin/sockstat/sockstat.c | 13 +- 18 files changed, 822 insertions(+), 158 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index d01505e58427..b5735a40b320 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 8, 2021 +.Dd April 18, 2021 .Dt TCP 4 .Os .Sh NAME @@ -329,6 +329,9 @@ currently executing. This is typically used after a process or thread inherits a listen socket from its parent, and sets its CPU affinity to a particular core. .El +.It Dv TCP_REMOTE_UDP_ENCAPS_PORT +Set and get the remote UDP encapsulation port. +It can only be set on a closed TCP socket. .El .Pp The option level for the @@ -752,6 +755,16 @@ A CSV list of template_spec=percent key-value pairs which controls the per template sampling rates when .Xr stats 3 sampling is enabled. +.It Va udp_tunneling_port +The local UDP encapsulation port. +A value of 0 indicates that UDP encapsulation is disabled. +The default is 0. +.It Va udp_tunneling_overhead +The overhead taken into account when using UDP encapsulation. +Since MSS clamping by middleboxes will most likely not work, values larger than +8 (the size of the UDP header) are also supported. +Supported values are between 8 and 1024. +The default is 8. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 0b71bd4658f8..d2bf1f8431fd 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -183,6 +183,7 @@ struct tcphdr { #define TCP_RXTLS_MODE 42 /* Receive TLS mode */ #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ +#define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP tunneling via the specified port */ #define TCP_DELACK 72 /* socket option for delayed ack */ #define TCP_FIN_IS_RST 73 /* A fin from the peer is treated has a RST */ #define TCP_LOG_LIMIT 74 /* Limit to number of records in tcp-log */ diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 397cbc5084e6..d36f9566ffba 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include #endif +#include #include @@ -573,7 +574,7 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) */ #ifdef INET6 int -tcp6_input(struct mbuf **mp, int *offp, int proto) +tcp6_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) { struct mbuf *m; struct in6_ifaddr *ia6; @@ -603,12 +604,19 @@ tcp6_input(struct mbuf **mp, int *offp, int proto) } *mp = m; - return (tcp_input(mp, offp, proto)); + return (tcp_input_with_port(mp, offp, proto, port)); +} + +int +tcp6_input(struct mbuf **mp, int *offp, int proto) +{ + + return(tcp6_input_with_port(mp, offp, proto, 0)); } #endif /* INET6 */ int -tcp_input(struct mbuf **mp, int *offp, int proto) +tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) { struct mbuf *m = *mp; struct tcphdr *th = NULL; @@ -664,6 +672,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) ip6 = mtod(m, struct ip6_hdr *); th = (struct tcphdr *)((caddr_t)ip6 + off0); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; + if (port) + goto skip6_csum; if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) th->th_sum = m->m_pkthdr.csum_data; @@ -677,7 +687,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) TCPSTAT_INC(tcps_rcvbadsum); goto drop; } - + skip6_csum: /* * Be proactive about unspecified IPv6 address in source. * As we use all-zero to indicate unbounded/unconnected pcb, @@ -718,6 +728,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) tlen = ntohs(ip->ip_len) - off0; iptos = ip->ip_tos; + if (port) + goto skip_csum; if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) th->th_sum = m->m_pkthdr.csum_data; @@ -747,8 +759,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) ip->ip_v = IPVERSION; ip->ip_hl = off0 >> 2; } - - if (th->th_sum) { + skip_csum: + if (th->th_sum && (port == 0)) { TCPSTAT_INC(tcps_rcvbadsum); goto drop; } @@ -1006,6 +1018,11 @@ findpcb: goto dropwithreset; } + if ((tp->t_port != port) && (tp->t_state > TCPS_LISTEN)) { + rstreason = BANDLIM_RST_CLOSEDPORT; + goto dropwithreset; + } + #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) { tcp_offload_input(tp, m); @@ -1077,7 +1094,7 @@ findpcb: * NB: syncache_expand() doesn't unlock * inp and tcpinfo locks. */ - rstreason = syncache_expand(&inc, &to, th, &so, m); + rstreason = syncache_expand(&inc, &to, th, &so, m, port); if (rstreason < 0) { /* * A failing TCP MD5 signature comparison @@ -1157,7 +1174,7 @@ tfo_socket_result: * causes. */ if (thflags & TH_RST) { - syncache_chkrst(&inc, th, m); + syncache_chkrst(&inc, th, m, port); goto dropunlock; } /* @@ -1179,7 +1196,7 @@ tfo_socket_result: log(LOG_DEBUG, "%s; %s: Listen socket: " "SYN|ACK invalid, segment rejected\n", s, __func__); - syncache_badack(&inc); /* XXX: Not needed! */ + syncache_badack(&inc, port); /* XXX: Not needed! */ TCPSTAT_INC(tcps_badsyn); rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; @@ -1336,7 +1353,8 @@ tfo_socket_result: #endif TCP_PROBE3(debug__input, tp, th, m); tcp_dooptions(&to, optp, optlen, TO_SYN); - if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, iptos)) + if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, iptos, + port)) goto tfo_socket_result; /* @@ -1467,6 +1485,12 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, struct socket *so, return (newsize); } +int +tcp_input(struct mbuf **mp, int *offp, int proto) +{ + return(tcp_input_with_port(mp, offp, proto, 0)); +} + void tcp_handle_wakeup(struct tcpcb *tp, struct socket *so) { @@ -3671,11 +3695,13 @@ tcp_mss_update(struct tcpcb *tp, int offer, int mtuoffer, sizeof (struct ip6_hdr) + sizeof (struct tcphdr) : sizeof (struct tcpiphdr); #else - const size_t min_protoh = sizeof(struct tcpiphdr); + size_t min_protoh = sizeof(struct tcpiphdr); #endif INP_WLOCK_ASSERT(tp->t_inpcb); + if (tp->t_port) + min_protoh += V_tcp_udp_tunneling_overhead; if (mtuoffer != -1) { KASSERT(offer == -1, ("%s: conflict", __func__)); offer = mtuoffer - min_protoh; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index e23cdc749e98..5bda2be14df0 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -101,6 +101,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include @@ -207,7 +209,7 @@ tcp_output(struct tcpcb *tp) #endif struct tcphdr *th; u_char opt[TCP_MAXOLEN]; - unsigned ipoptlen, optlen, hdrlen; + unsigned ipoptlen, optlen, hdrlen, ulen; #if defined(IPSEC) || defined(IPSEC_SUPPORT) unsigned ipsec_optlen = 0; #endif @@ -216,6 +218,7 @@ tcp_output(struct tcpcb *tp) struct sackhole *p; int tso, mtu; struct tcpopt to; + struct udphdr *udp = NULL; unsigned int wanted_cookie = 0; unsigned int dont_sendalot = 0; #if 0 @@ -558,6 +561,7 @@ after_sack_rexmit: #endif if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && + (tp->t_port == 0) && ((tp->t_flags & TF_SIGNATURE) == 0) && tp->rcv_numsacks == 0 && sack_rxmit == 0 && ipoptlen == 0 && !(flags & TH_SYN)) @@ -800,6 +804,8 @@ send: /* Maximum segment size. */ if (flags & TH_SYN) { to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); + if (tp->t_port) + to.to_mss -= V_tcp_udp_tunneling_overhead; to.to_flags |= TOF_MSS; /* @@ -887,7 +893,14 @@ send: !(to.to_flags & TOF_FASTOPEN)) len = 0; } - + if (tp->t_port) { + if (V_tcp_udp_tunneling_port == 0) { + /* The port was removed?? */ + SOCKBUF_UNLOCK(&so->so_snd); + return (EHOSTUNREACH); + } + hdrlen += sizeof(struct udphdr); + } /* * Adjust data length if insertion of options will * bump the packet length beyond the t_maxseg length. @@ -1140,8 +1153,17 @@ send: #ifdef INET6 if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); - th = (struct tcphdr *)(ip6 + 1); - tcpip_fillheaders(tp->t_inpcb, ip6, th); + if (tp->t_port) { + udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp->uh_sport = htons(V_tcp_udp_tunneling_port); + udp->uh_dport = tp->t_port; + ulen = hdrlen + len - sizeof(struct ip6_hdr); + udp->uh_ulen = htons(ulen); + th = (struct tcphdr *)(udp + 1); + } else { + th = (struct tcphdr *)(ip6 + 1); + } + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip6, th); } else #endif /* INET6 */ { @@ -1149,8 +1171,16 @@ send: #ifdef TCPDEBUG ipov = (struct ipovly *)ip; #endif - th = (struct tcphdr *)(ip + 1); - tcpip_fillheaders(tp->t_inpcb, ip, th); + if (tp->t_port) { + udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp->uh_sport = htons(V_tcp_udp_tunneling_port); + udp->uh_dport = tp->t_port; + ulen = hdrlen + len - sizeof(struct ip); + udp->uh_ulen = htons(ulen); + th = (struct tcphdr *)(udp + 1); + } else + th = (struct tcphdr *)(ip + 1); + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip, th); } /* @@ -1309,7 +1339,6 @@ send: * checksum extended header and data. */ m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) if (to.to_flags & TOF_SIGNATURE) { @@ -1336,9 +1365,19 @@ send: * There is no need to fill in ip6_plen right now. * It will be filled later by ip6_output. */ - m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; - th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + - optlen + len, IPPROTO_TCP, 0); + if (tp->t_port) { + m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); + udp->uh_sum = in6_cksum_pseudo(ip6, ulen, IPPROTO_UDP, 0); + th->th_sum = htons(0); + UDPSTAT_INC(udps_opackets); + } else { + m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + th->th_sum = in6_cksum_pseudo(ip6, + sizeof(struct tcphdr) + optlen + len, IPPROTO_TCP, + 0); + } } #endif #if defined(INET6) && defined(INET) @@ -1346,9 +1385,20 @@ send: #endif #ifdef INET { - m->m_pkthdr.csum_flags = CSUM_TCP; - th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); + if (tp->t_port) { + m->m_pkthdr.csum_flags = CSUM_UDP; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); + udp->uh_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(ulen + IPPROTO_UDP)); + th->th_sum = htons(0); + UDPSTAT_INC(udps_opackets); + } else { + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + + IPPROTO_TCP + len + optlen)); + } /* IP version must be set here for ipv4/ipv6 checking later */ KASSERT(ip->ip_v == IPVERSION, @@ -1473,8 +1523,10 @@ send: * NB: Don't set DF on small MTU/MSS to have a safe fallback. */ if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) { - ip->ip_off |= htons(IP_DF); tp->t_flags2 |= TF2_PLPMTU_PMTUD; + if (tp->t_port == 0 || len < V_tcp_minmss) { + ip->ip_off |= htons(IP_DF); + } } else { tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index cc20d6bf52ca..1ee8d26446fd 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -11969,14 +11969,10 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv) #endif struct tcp_bbr *bbr; struct tcphdr *th; -#ifdef NETFLIX_TCPOUDP struct udphdr *udp = NULL; -#endif u_char opt[TCP_MAXOLEN]; unsigned ipoptlen, optlen, hdrlen; -#ifdef NETFLIX_TCPOUDP unsigned ulen; -#endif uint32_t bbr_seq; uint32_t delay_calc=0; uint8_t doing_tlp = 0; @@ -12991,10 +12987,8 @@ send: /* Maximum segment size. */ if (flags & TH_SYN) { to.to_mss = tcp_mssopt(&inp->inp_inc); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) to.to_mss -= V_tcp_udp_tunneling_overhead; -#endif to.to_flags |= TOF_MSS; /* * On SYN or SYN|ACK transmits on TFO connections, @@ -13063,7 +13057,6 @@ send: !(to.to_flags & TOF_FASTOPEN)) len = 0; } -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { if (V_tcp_udp_tunneling_port == 0) { /* The port was removed?? */ @@ -13072,7 +13065,6 @@ send: } hdrlen += sizeof(struct udphdr); } -#endif #ifdef INET6 if (isipv6) ipoptlen = ip6_optlen(tp->t_inpcb); @@ -13408,7 +13400,6 @@ send: #ifdef INET6 if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13417,17 +13408,9 @@ send: udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); } else { -#endif th = (struct tcphdr *)(ip6 + 1); - -#ifdef NETFLIX_TCPOUDP } -#endif - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip6, th); + tcpip_fillheaders(inp, tp->t_port, ip6, th); } else #endif /* INET6 */ { @@ -13435,7 +13418,6 @@ send: #ifdef TCPDEBUG ipov = (struct ipovly *)ip; #endif -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13443,14 +13425,10 @@ send: ulen = hdrlen + len - sizeof(struct ip); udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); - } else -#endif + } else { th = (struct tcphdr *)(ip + 1); - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip, th); + } + tcpip_fillheaders(inp, tp->t_port, ip, th); } /* * If we are doing retransmissions, then snd_nxt will not reflect @@ -13600,7 +13578,6 @@ send: * ip6_plen is not need to be filled now, and will be filled * in ip6_output. */ -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); @@ -13608,14 +13585,11 @@ send: th->th_sum = htons(0); UDPSTAT_INC(udps_opackets); } else { -#endif csum_flags = m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + optlen + len, IPPROTO_TCP, 0); -#ifdef NETFLIX_TCPOUDP } -#endif } #endif #if defined(INET6) && defined(INET) @@ -13623,7 +13597,6 @@ send: #endif #ifdef INET { -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { m->m_pkthdr.csum_flags = CSUM_UDP; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); @@ -13632,15 +13605,12 @@ send: th->th_sum = htons(0); UDPSTAT_INC(udps_opackets); } else { -#endif csum_flags = m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); -#ifdef NETFLIX_TCPOUDP } -#endif /* IP version must be set here for ipv4/ipv6 checking later */ KASSERT(ip->ip_v == IPVERSION, ("%s: IP version incorrect: %d", __func__, ip->ip_v)); diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 0ee73a95a6d7..12827d1699d0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -13008,10 +13008,8 @@ send: if (flags & TH_SYN) { tp->snd_nxt = tp->iss; to.to_mss = tcp_mssopt(&inp->inp_inc); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) to.to_mss -= V_tcp_udp_tunneling_overhead; -#endif to.to_flags |= TOF_MSS; /* @@ -13088,7 +13086,6 @@ send: !(to.to_flags & TOF_FASTOPEN)) len = 0; } -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { if (V_tcp_udp_tunneling_port == 0) { /* The port was removed?? */ @@ -13097,7 +13094,6 @@ send: } hdrlen += sizeof(struct udphdr); } -#endif #ifdef INET6 if (isipv6) ipoptlen = ip6_optlen(tp->t_inpcb); @@ -13372,7 +13368,6 @@ send: #ifdef INET6 if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13380,14 +13375,10 @@ send: ulen = hdrlen + len - sizeof(struct ip6_hdr); udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); - } else -#endif + } else { th = (struct tcphdr *)(ip6 + 1); - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip6, th); + } + tcpip_fillheaders(inp, tp->t_port, ip6, th); } else #endif /* INET6 */ { @@ -13395,7 +13386,6 @@ send: #ifdef TCPDEBUG ipov = (struct ipovly *)ip; #endif -#ifdef NETFLIX_TCPOUDP if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); @@ -13403,14 +13393,10 @@ send: ulen = hdrlen + len - sizeof(struct ip); udp->uh_ulen = htons(ulen); th = (struct tcphdr *)(udp + 1); - } else -#endif + } else { th = (struct tcphdr *)(ip + 1); - tcpip_fillheaders(inp, -#ifdef NETFLIX_TCPOUDP - tp->t_port, -#endif - ip, th); + } + tcpip_fillheaders(inp, tp->t_port, ip, th); } /* * Fill in fields, remembering maximum advertised window for use in diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index dff7767cd9cf..6bdeb3984aee 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -126,6 +126,8 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include #endif +#include +#include #include @@ -501,6 +503,80 @@ tcp_switch_back_to_default(struct tcpcb *tp) } } +static void +tcp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *inp, + const struct sockaddr *sa, void *ctx) +{ + struct ip *iph; +#ifdef INET6 + struct ip6_hdr *ip6; +#endif + struct udphdr *uh; + struct tcphdr *th; + int thlen; + uint16_t port; + + TCPSTAT_INC(tcps_tunneled_pkts); + if ((m->m_flags & M_PKTHDR) == 0) { + /* Can't handle one that is not a pkt hdr */ + TCPSTAT_INC(tcps_tunneled_errs); + goto out; + } + thlen = sizeof(struct tcphdr); + if (m->m_len < off + sizeof(struct udphdr) + thlen && + (m = m_pullup(m, off + sizeof(struct udphdr) + thlen)) == NULL) { + TCPSTAT_INC(tcps_tunneled_errs); + goto out; + } + iph = mtod(m, struct ip *); + uh = (struct udphdr *)((caddr_t)iph + off); + th = (struct tcphdr *)(uh + 1); + thlen = th->th_off << 2; + if (m->m_len < off + sizeof(struct udphdr) + thlen) { + m = m_pullup(m, off + sizeof(struct udphdr) + thlen); + if (m == NULL) { + TCPSTAT_INC(tcps_tunneled_errs); + goto out; + } else { + iph = mtod(m, struct ip *); + uh = (struct udphdr *)((caddr_t)iph + off); + th = (struct tcphdr *)(uh + 1); + } + } + m->m_pkthdr.tcp_tun_port = port = uh->uh_sport; + bcopy(th, uh, m->m_len - off); + m->m_len -= sizeof(struct udphdr); + m->m_pkthdr.len -= sizeof(struct udphdr); + /* + * We use the same algorithm for + * both UDP and TCP for c-sum. So + * the code in tcp_input will skip + * the checksum. So we do nothing + * with the flag (m->m_pkthdr.csum_flags). + */ + switch (iph->ip_v) { +#ifdef INET + case IPVERSION: + iph->ip_len = htons(ntohs(iph->ip_len) - sizeof(struct udphdr)); + tcp_input_with_port(&m, &off, IPPROTO_TCP, port); + break; +#endif +#ifdef INET6 + case IPV6_VERSION >> 4: + ip6 = mtod(m, struct ip6_hdr *); + ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) - sizeof(struct udphdr)); + tcp6_input_with_port(&m, &off, IPPROTO_TCP, port); + break; +#endif + default: + goto out; + break; + } + return; +out: + m_freem(m); +} + static int sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) { @@ -598,6 +674,183 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, functions_available, NULL, 0, sysctl_net_inet_list_available, "A", "list available TCP Function sets"); +VNET_DEFINE(int, tcp_udp_tunneling_port) = TCP_TUNNELING_PORT_DEFAULT; + +#ifdef INET +VNET_DEFINE(struct socket *, udp4_tun_socket) = NULL; +#define V_udp4_tun_socket VNET(udp4_tun_socket) +#endif +#ifdef INET6 +VNET_DEFINE(struct socket *, udp6_tun_socket) = NULL; +#define V_udp6_tun_socket VNET(udp6_tun_socket) +#endif + +static void +tcp_over_udp_stop(void) +{ + /* + * This function assumes sysctl caller holds inp_rinfo_lock() + * for writting! + */ +#ifdef INET + if (V_udp4_tun_socket != NULL) { + soclose(V_udp4_tun_socket); + V_udp4_tun_socket = NULL; + } +#endif +#ifdef INET6 + if (V_udp6_tun_socket != NULL) { + soclose(V_udp6_tun_socket); + V_udp6_tun_socket = NULL; + } +#endif +} + +static int +tcp_over_udp_start(void) +{ + uint16_t port; + int ret; +#ifdef INET + struct sockaddr_in sin; +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; +#endif + /* + * This function assumes sysctl caller holds inp_info_rlock() + * for writting! + */ + port = V_tcp_udp_tunneling_port; + if (ntohs(port) == 0) { + /* Must have a port set */ + return (EINVAL); + } +#ifdef INET + if (V_udp4_tun_socket != NULL) { + /* Already running -- must stop first */ + return (EALREADY); + } +#endif +#ifdef INET6 + if (V_udp6_tun_socket != NULL) { + /* Already running -- must stop first */ + return (EALREADY); + } +#endif +#ifdef INET + if ((ret = socreate(PF_INET, &V_udp4_tun_socket, + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + tcp_over_udp_stop(); + return (ret); + } + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(V_udp4_tun_socket, + tcp_recv_udp_tunneled_packet, + tcp_ctlinput_viaudp, + NULL))) { + tcp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_family = AF_INET; + sin.sin_port = htons(port); + if ((ret = sobind(V_udp4_tun_socket, + (struct sockaddr *)&sin, curthread))) { + tcp_over_udp_stop(); + return (ret); + } +#endif +#ifdef INET6 + if ((ret = socreate(PF_INET6, &V_udp6_tun_socket, + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + tcp_over_udp_stop(); + return (ret); + } + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(V_udp6_tun_socket, + tcp_recv_udp_tunneled_packet, + tcp6_ctlinput_viaudp, + NULL))) { + tcp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_family = AF_INET6; + sin6.sin6_port = htons(port); + if ((ret = sobind(V_udp6_tun_socket, + (struct sockaddr *)&sin6, curthread))) { + tcp_over_udp_stop(); + return (ret); + } +#endif + return (0); +} + +static int +sysctl_net_inet_tcp_udp_tunneling_port_check(SYSCTL_HANDLER_ARGS) +{ + int error; + uint32_t old, new; + + old = V_tcp_udp_tunneling_port; + new = old; + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < TCP_TUNNELING_PORT_MIN) || + (new > TCP_TUNNELING_PORT_MAX)) { + error = EINVAL; + } else { + V_tcp_udp_tunneling_port = new; + if (old != 0) { + tcp_over_udp_stop(); + } + if (new != 0) { + error = tcp_over_udp_start(); + } + } + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_port, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &VNET_NAME(tcp_udp_tunneling_port), + 0, &sysctl_net_inet_tcp_udp_tunneling_port_check, "IU", + "Tunneling port for tcp over udp"); + +VNET_DEFINE(int, tcp_udp_tunneling_overhead) = TCP_TUNNELING_OVERHEAD_DEFAULT; + +static int +sysctl_net_inet_tcp_udp_tunneling_overhead_check(SYSCTL_HANDLER_ARGS) +{ + int error, new; + + new = V_tcp_udp_tunneling_overhead; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if ((new < TCP_TUNNELING_OVERHEAD_MIN) || + (new > TCP_TUNNELING_OVERHEAD_MAX)) + error = EINVAL; + else + V_tcp_udp_tunneling_overhead = new; + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_overhead, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &VNET_NAME(tcp_udp_tunneling_overhead), + 0, &sysctl_net_inet_tcp_udp_tunneling_overhead_check, "IU", + "MSS reduction when using tcp over udp"); + /* * Exports one (struct tcp_function_info) for each alias/name. */ @@ -1305,7 +1558,7 @@ tcp_fini(void *xtp) * of the tcpcb each time to conserve mbufs. */ void -tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) +tcpip_fillheaders(struct inpcb *inp, uint16_t port, void *ip_ptr, void *tcp_ptr) { struct tcphdr *th = (struct tcphdr *)tcp_ptr; @@ -1320,7 +1573,10 @@ tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) (inp->inp_flow & IPV6_FLOWINFO_MASK); ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | (IPV6_VERSION & IPV6_VERSION_MASK); - ip6->ip6_nxt = IPPROTO_TCP; + if (port == 0) + ip6->ip6_nxt = IPPROTO_TCP; + else + ip6->ip6_nxt = IPPROTO_UDP; ip6->ip6_plen = htons(sizeof(struct tcphdr)); ip6->ip6_src = inp->in6p_laddr; ip6->ip6_dst = inp->in6p_faddr; @@ -1342,7 +1598,10 @@ tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) ip->ip_off = 0; ip->ip_ttl = inp->inp_ip_ttl; ip->ip_sum = 0; - ip->ip_p = IPPROTO_TCP; + if (port == 0) + ip->ip_p = IPPROTO_TCP; + else + ip->ip_p = IPPROTO_UDP; ip->ip_src = inp->inp_laddr; ip->ip_dst = inp->inp_faddr; } @@ -1372,7 +1631,7 @@ tcpip_maketemplate(struct inpcb *inp) t = malloc(sizeof(*t), M_TEMP, M_NOWAIT); if (t == NULL) return (NULL); - tcpip_fillheaders(inp, (void *)&t->tt_ipgen, (void *)&t->tt_t); + tcpip_fillheaders(inp, 0, (void *)&t->tt_ipgen, (void *)&t->tt_t); return (t); } @@ -1398,14 +1657,16 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, struct inpcb *inp; struct ip *ip; struct mbuf *optm; + struct udphdr *uh = NULL; struct tcphdr *nth; u_char *optp; #ifdef INET6 struct ip6_hdr *ip6; int isipv6; #endif /* INET6 */ - int optlen, tlen, win; + int optlen, tlen, win, ulen; bool incl_opts; + uint16_t port; KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL")); NET_EPOCH_ASSERT(); @@ -1423,6 +1684,19 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, } else inp = NULL; + if (m != NULL) { +#ifdef INET6 + if (isipv6 && ip6 && (ip6->ip6_nxt == IPPROTO_UDP)) + port = m->m_pkthdr.tcp_tun_port; + else *** 1128 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Jun 7 09:02:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD30164A9C4; Mon, 7 Jun 2021 09:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz6pJ5KxNz4ZLX; Mon, 7 Jun 2021 09:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A061D132A1; Mon, 7 Jun 2021 09:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15792mxE009761; Mon, 7 Jun 2021 09:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15792mNG009760; Mon, 7 Jun 2021 09:02:48 GMT (envelope-from git) Date: Mon, 7 Jun 2021 09:02:48 GMT Message-Id: <202106070902.15792mNG009760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 95b7e4e0febd - stable/13 - tcp: fix man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 95b7e4e0febd88bf5257a0a9acf5cd62de7f4442 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 09:02:48 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=95b7e4e0febd88bf5257a0a9acf5cd62de7f4442 commit 95b7e4e0febd88bf5257a0a9acf5cd62de7f4442 Author: Michael Tuexen AuthorDate: 2021-04-24 20:31:36 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 09:02:31 +0000 tcp: fix man page Reviewed by: gbe, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D29963 (cherry picked from commit 6096814d3134234d48936f557d431a793e35d8b3) --- share/man/man4/tcp.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index b5735a40b320..0b59e2ec801d 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 18, 2021 +.Dd April 24, 2021 .Dt TCP 4 .Os .Sh NAME @@ -687,6 +687,7 @@ for the connection for some defined period of time. Disable the host cache. .It 1 Enable the host cache. (default) +.El .It Va hostcache.purgenow Immediately purge all entries once set to any value. Setting this to 2 will also reseed the hash salt. @@ -701,6 +702,7 @@ Do not purge all entries when pruning the host cache. (default) Purge all entries when doing the next pruning. .It 2 Purge all entries, and also reseed the hash salt. +.El .It Va hostcache.prune Time in seconds between pruning expired host cache entries. Defaults to 300 (5 minutes). From owner-dev-commits-src-all@freebsd.org Mon Jun 7 10:45:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C68F664BB88; Mon, 7 Jun 2021 10:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz94T52Yqz4jm2; Mon, 7 Jun 2021 10:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93B15143B2; Mon, 7 Jun 2021 10:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157AjDjk039844; Mon, 7 Jun 2021 10:45:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157AjDCU039843; Mon, 7 Jun 2021 10:45:13 GMT (envelope-from git) Date: Mon, 7 Jun 2021 10:45:13 GMT Message-Id: <202106071045.157AjDCU039843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 128a1db806da - main - linux: improve FUSE support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 128a1db806daac088a79314cee060b8a204e8481 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 10:45:13 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=128a1db806daac088a79314cee060b8a204e8481 commit 128a1db806daac088a79314cee060b8a204e8481 Author: Edward Tomasz Napierala AuthorDate: 2021-06-07 09:43:23 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-06-07 09:43:28 +0000 linux: improve FUSE support This fixes a number of AppImages; tested with scribus-1.5.6.1-linux-x86_64.AppImage. Reported By: @probonopd Reviewed By: asomers, emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30606 --- sys/compat/linux/linux_file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index a6cf467d6219..a5ab3506767e 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1320,12 +1320,11 @@ linux_mount(struct thread *td, struct linux_mount_args *args) strcpy(fstypename, "linprocfs"); } else if (strcmp(fstypename, "vfat") == 0) { strcpy(fstypename, "msdosfs"); - } else if (strcmp(fstypename, "fuse") == 0) { + } else if (strcmp(fstypename, "fuse") == 0 || + strncmp(fstypename, "fuse.", 5) == 0) { char *fuse_options, *fuse_option, *fuse_name; - if (strcmp(mntfromname, "fuse") == 0) - strcpy(mntfromname, "/dev/fuse"); - + strcpy(mntfromname, "/dev/fuse"); strcpy(fstypename, "fusefs"); data = malloc(MNAMELEN, M_TEMP, M_WAITOK); error = copyinstr(args->data, data, MNAMELEN - 1, NULL); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 10:52:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0379064BE27; Mon, 7 Jun 2021 10:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fz9DX6kh3z4kn6; Mon, 7 Jun 2021 10:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF6B414802; Mon, 7 Jun 2021 10:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157AqCvH051520; Mon, 7 Jun 2021 10:52:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157AqCxY051503; Mon, 7 Jun 2021 10:52:12 GMT (envelope-from git) Date: Mon, 7 Jun 2021 10:52:12 GMT Message-Id: <202106071052.157AqCxY051503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: dd869341b1e0 - main - Install the linux(4) man page also for aarch64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd869341b1e0b58eb50fd2700b3191094d97ef5b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 10:52:13 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=dd869341b1e0b58eb50fd2700b3191094d97ef5b commit dd869341b1e0b58eb50fd2700b3191094d97ef5b Author: Edward Tomasz Napierala AuthorDate: 2021-06-07 10:50:25 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-06-07 10:50:50 +0000 Install the linux(4) man page also for aarch64 Previously it was only installed on i386 and amd64. Reviewed By: emaste, gbe (manpages) Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30546 --- share/man/man4/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index f7626c80eeb1..88414801888f 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -820,7 +820,6 @@ _imcsmb.4= imcsmb.4 _ipmi.4= ipmi.4 _io.4= io.4 _itwd.4= itwd.4 -_linux.4= linux.4 _nda.4= nda.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 @@ -888,6 +887,7 @@ _nvme.4= nvme.4 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "aarch64" +_linux.4= linux.4 _ossl.4= ossl.4 .endif From owner-dev-commits-src-all@freebsd.org Mon Jun 7 12:12:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECCE364D175; Mon, 7 Jun 2021 12:12:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzC0h47yYz4pPP; Mon, 7 Jun 2021 12:12:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:c07f:3a0d:782c:bd56]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id 4EB08721E2809; Mon, 7 Jun 2021 14:11:59 +0200 (CEST) From: Michael Tuexen Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: fa50e98328b4 - stable/13 - mend Date: Mon, 7 Jun 2021 14:11:58 +0200 References: <202106070901.15791qUa008332@gitrepo.freebsd.org> To: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" In-Reply-To: <202106070901.15791qUa008332@gitrepo.freebsd.org> Message-Id: <1758EB9E-F9AC-4170-ACD0-C5B609405818@freebsd.org> X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4FzC0h47yYz4pPP X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE]; local_wl_from(0.00)[freebsd.org] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 12:12:05 -0000 > On 7. Jun 2021, at 11:01, Michael Tuexen wrote: >=20 > The branch stable/13 has been updated by tuexen: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dfa50e98328b48da4fa8dbd97d0a78796= 2cf249f5 >=20 > commit fa50e98328b48da4fa8dbd97d0a787962cf249f5 > Author: Michael Tuexen > AuthorDate: 2021-04-18 14:08:08 +0000 > Commit: Michael Tuexen > CommitDate: 2021-06-07 09:01:28 +0000 >=20 > mend Not sure how the commit ended up this way, but it is MFCing = https://cgit.FreeBSD.org/src/commit/?id=3D9e644c23000c2f5028b235f6263d17ff= b24d3605 and manually resolving the merge conflicts. Best regards Michael > --- > share/man/man4/tcp.4 | 15 +- > sys/netinet/tcp.h | 1 + > sys/netinet/tcp_input.c | 48 ++++- > sys/netinet/tcp_output.c | 80 ++++++-- > sys/netinet/tcp_stacks/bbr.c | 38 +--- > sys/netinet/tcp_stacks/rack.c | 26 +-- > sys/netinet/tcp_subr.c | 462 = ++++++++++++++++++++++++++++++++++++++++-- > sys/netinet/tcp_syncache.c | 127 +++++++++--- > sys/netinet/tcp_syncache.h | 12 +- > sys/netinet/tcp_timewait.c | 84 ++++++-- > sys/netinet/tcp_usrreq.c | 30 +++ > sys/netinet/tcp_var.h | 27 ++- > sys/netinet/toecore.c | 4 +- > sys/netinet6/tcp6_var.h | 2 + > sys/sys/mbuf.h | 1 + > usr.bin/netstat/inet.c | 4 + > usr.bin/sockstat/sockstat.1 | 6 +- > usr.bin/sockstat/sockstat.c | 13 +- > 18 files changed, 822 insertions(+), 158 deletions(-) >=20 > diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 > index d01505e58427..b5735a40b320 100644 > --- a/share/man/man4/tcp.4 > +++ b/share/man/man4/tcp.4 > @@ -34,7 +34,7 @@ > .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 > .\" $FreeBSD$ > .\" > -.Dd April 8, 2021 > +.Dd April 18, 2021 > .Dt TCP 4 > .Os > .Sh NAME > @@ -329,6 +329,9 @@ currently executing. > This is typically used after a process or thread inherits a listen > socket from its parent, and sets its CPU affinity to a particular = core. > .El > +.It Dv TCP_REMOTE_UDP_ENCAPS_PORT > +Set and get the remote UDP encapsulation port. > +It can only be set on a closed TCP socket. > .El > .Pp > The option level for the > @@ -752,6 +755,16 @@ A CSV list of template_spec=3Dpercent key-value = pairs which controls the per > template sampling rates when > .Xr stats 3 > sampling is enabled. > +.It Va udp_tunneling_port > +The local UDP encapsulation port. > +A value of 0 indicates that UDP encapsulation is disabled. > +The default is 0. > +.It Va udp_tunneling_overhead > +The overhead taken into account when using UDP encapsulation. > +Since MSS clamping by middleboxes will most likely not work, values = larger than > +8 (the size of the UDP header) are also supported. > +Supported values are between 8 and 1024. > +The default is 8. > .El > .Sh ERRORS > A socket operation may fail with one of the following errors returned: > diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h > index 0b71bd4658f8..d2bf1f8431fd 100644 > --- a/sys/netinet/tcp.h > +++ b/sys/netinet/tcp.h > @@ -183,6 +183,7 @@ struct tcphdr { > #define TCP_RXTLS_MODE 42 /* Receive TLS mode */ > #define TCP_CONGESTION 64 /* get/set congestion control = algorithm */ > #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific = options */ > +#define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP = tunneling via the specified port */ > #define TCP_DELACK 72 /* socket option for delayed ack */ > #define TCP_FIN_IS_RST 73 /* A fin from the peer is treated has a = RST */ > #define TCP_LOG_LIMIT 74 /* Limit to number of records in tcp-log = */ > diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c > index 397cbc5084e6..d36f9566ffba 100644 > --- a/sys/netinet/tcp_input.c > +++ b/sys/netinet/tcp_input.c > @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); > #ifdef TCP_OFFLOAD > #include > #endif > +#include >=20 > #include >=20 > @@ -573,7 +574,7 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr = *th, uint8_t iptos) > */ > #ifdef INET6 > int > -tcp6_input(struct mbuf **mp, int *offp, int proto) > +tcp6_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t = port) > { > struct mbuf *m; > struct in6_ifaddr *ia6; > @@ -603,12 +604,19 @@ tcp6_input(struct mbuf **mp, int *offp, int = proto) > } >=20 > *mp =3D m; > - return (tcp_input(mp, offp, proto)); > + return (tcp_input_with_port(mp, offp, proto, port)); > +} > + > +int > +tcp6_input(struct mbuf **mp, int *offp, int proto) > +{ > + > + return(tcp6_input_with_port(mp, offp, proto, 0)); > } > #endif /* INET6 */ >=20 > int > -tcp_input(struct mbuf **mp, int *offp, int proto) > +tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t = port) > { > struct mbuf *m =3D *mp; > struct tcphdr *th =3D NULL; > @@ -664,6 +672,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > ip6 =3D mtod(m, struct ip6_hdr *); > th =3D (struct tcphdr *)((caddr_t)ip6 + off0); > tlen =3D sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; > + if (port) > + goto skip6_csum; > if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { > if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) > th->th_sum =3D m->m_pkthdr.csum_data; > @@ -677,7 +687,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > TCPSTAT_INC(tcps_rcvbadsum); > goto drop; > } > - > + skip6_csum: > /* > * Be proactive about unspecified IPv6 address in = source. > * As we use all-zero to indicate unbounded/unconnected = pcb, > @@ -718,6 +728,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > tlen =3D ntohs(ip->ip_len) - off0; >=20 > iptos =3D ip->ip_tos; > + if (port) > + goto skip_csum; > if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { > if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) > th->th_sum =3D m->m_pkthdr.csum_data; > @@ -747,8 +759,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) > ip->ip_v =3D IPVERSION; > ip->ip_hl =3D off0 >> 2; > } > - > - if (th->th_sum) { > + skip_csum: > + if (th->th_sum && (port =3D=3D 0)) { > TCPSTAT_INC(tcps_rcvbadsum); > goto drop; > } > @@ -1006,6 +1018,11 @@ findpcb: > goto dropwithreset; > } >=20 > + if ((tp->t_port !=3D port) && (tp->t_state > TCPS_LISTEN)) { > + rstreason =3D BANDLIM_RST_CLOSEDPORT; > + goto dropwithreset; > + } > + > #ifdef TCP_OFFLOAD > if (tp->t_flags & TF_TOE) { > tcp_offload_input(tp, m); > @@ -1077,7 +1094,7 @@ findpcb: > * NB: syncache_expand() doesn't unlock > * inp and tcpinfo locks. > */ > - rstreason =3D syncache_expand(&inc, &to, th, = &so, m); > + rstreason =3D syncache_expand(&inc, &to, th, = &so, m, port); > if (rstreason < 0) { > /* > * A failing TCP MD5 signature = comparison > @@ -1157,7 +1174,7 @@ tfo_socket_result: > * causes. > */ > if (thflags & TH_RST) { > - syncache_chkrst(&inc, th, m); > + syncache_chkrst(&inc, th, m, port); > goto dropunlock; > } > /* > @@ -1179,7 +1196,7 @@ tfo_socket_result: > log(LOG_DEBUG, "%s; %s: Listen socket: " > "SYN|ACK invalid, segment = rejected\n", > s, __func__); > - syncache_badack(&inc); /* XXX: Not needed! */ > + syncache_badack(&inc, port); /* XXX: Not = needed! */ > TCPSTAT_INC(tcps_badsyn); > rstreason =3D BANDLIM_RST_OPENPORT; > goto dropwithreset; > @@ -1336,7 +1353,8 @@ tfo_socket_result: > #endif > TCP_PROBE3(debug__input, tp, th, m); > tcp_dooptions(&to, optp, optlen, TO_SYN); > - if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, = iptos)) > + if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL, = iptos, > + port)) > goto tfo_socket_result; >=20 > /* > @@ -1467,6 +1485,12 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr = *th, struct socket *so, > return (newsize); > } >=20 > +int > +tcp_input(struct mbuf **mp, int *offp, int proto) > +{ > + return(tcp_input_with_port(mp, offp, proto, 0)); > +} > + > void > tcp_handle_wakeup(struct tcpcb *tp, struct socket *so) > { > @@ -3671,11 +3695,13 @@ tcp_mss_update(struct tcpcb *tp, int offer, = int mtuoffer, > sizeof (struct ip6_hdr) + sizeof (struct = tcphdr) : > sizeof (struct tcpiphdr); > #else > - const size_t min_protoh =3D sizeof(struct tcpiphdr); > + size_t min_protoh =3D sizeof(struct tcpiphdr); > #endif >=20 > INP_WLOCK_ASSERT(tp->t_inpcb); >=20 > + if (tp->t_port) > + min_protoh +=3D V_tcp_udp_tunneling_overhead; > if (mtuoffer !=3D -1) { > KASSERT(offer =3D=3D -1, ("%s: conflict", __func__)); > offer =3D mtuoffer - min_protoh; > diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c > index e23cdc749e98..5bda2be14df0 100644 > --- a/sys/netinet/tcp_output.c > +++ b/sys/netinet/tcp_output.c > @@ -101,6 +101,8 @@ __FBSDID("$FreeBSD$"); >=20 > #include >=20 > +#include > +#include > #include >=20 > #include > @@ -207,7 +209,7 @@ tcp_output(struct tcpcb *tp) > #endif > struct tcphdr *th; > u_char opt[TCP_MAXOLEN]; > - unsigned ipoptlen, optlen, hdrlen; > + unsigned ipoptlen, optlen, hdrlen, ulen; > #if defined(IPSEC) || defined(IPSEC_SUPPORT) > unsigned ipsec_optlen =3D 0; > #endif > @@ -216,6 +218,7 @@ tcp_output(struct tcpcb *tp) > struct sackhole *p; > int tso, mtu; > struct tcpopt to; > + struct udphdr *udp =3D NULL; > unsigned int wanted_cookie =3D 0; > unsigned int dont_sendalot =3D 0; > #if 0 > @@ -558,6 +561,7 @@ after_sack_rexmit: > #endif >=20 > if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg = && > + (tp->t_port =3D=3D 0) && > ((tp->t_flags & TF_SIGNATURE) =3D=3D 0) && > tp->rcv_numsacks =3D=3D 0 && sack_rxmit =3D=3D 0 && > ipoptlen =3D=3D 0 && !(flags & TH_SYN)) > @@ -800,6 +804,8 @@ send: > /* Maximum segment size. */ > if (flags & TH_SYN) { > to.to_mss =3D tcp_mssopt(&tp->t_inpcb->inp_inc); > + if (tp->t_port) > + to.to_mss -=3D = V_tcp_udp_tunneling_overhead; > to.to_flags |=3D TOF_MSS; >=20 > /* > @@ -887,7 +893,14 @@ send: > !(to.to_flags & TOF_FASTOPEN)) > len =3D 0; > } > - > + if (tp->t_port) { > + if (V_tcp_udp_tunneling_port =3D=3D 0) { > + /* The port was removed?? */ > + SOCKBUF_UNLOCK(&so->so_snd); > + return (EHOSTUNREACH); > + } > + hdrlen +=3D sizeof(struct udphdr); > + } > /* > * Adjust data length if insertion of options will > * bump the packet length beyond the t_maxseg length. > @@ -1140,8 +1153,17 @@ send: > #ifdef INET6 > if (isipv6) { > ip6 =3D mtod(m, struct ip6_hdr *); > - th =3D (struct tcphdr *)(ip6 + 1); > - tcpip_fillheaders(tp->t_inpcb, ip6, th); > + if (tp->t_port) { > + udp =3D (struct udphdr *)((caddr_t)ip6 + = ipoptlen + sizeof(struct ip6_hdr)); > + udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > + udp->uh_dport =3D tp->t_port; > + ulen =3D hdrlen + len - sizeof(struct ip6_hdr); > + udp->uh_ulen =3D htons(ulen); > + th =3D (struct tcphdr *)(udp + 1); > + } else { > + th =3D (struct tcphdr *)(ip6 + 1); > + } > + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip6, th); > } else > #endif /* INET6 */ > { > @@ -1149,8 +1171,16 @@ send: > #ifdef TCPDEBUG > ipov =3D (struct ipovly *)ip; > #endif > - th =3D (struct tcphdr *)(ip + 1); > - tcpip_fillheaders(tp->t_inpcb, ip, th); > + if (tp->t_port) { > + udp =3D (struct udphdr *)((caddr_t)ip + ipoptlen = + sizeof(struct ip)); > + udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > + udp->uh_dport =3D tp->t_port; > + ulen =3D hdrlen + len - sizeof(struct ip); > + udp->uh_ulen =3D htons(ulen); > + th =3D (struct tcphdr *)(udp + 1); > + } else > + th =3D (struct tcphdr *)(ip + 1); > + tcpip_fillheaders(tp->t_inpcb, tp->t_port, ip, th); > } >=20 > /* > @@ -1309,7 +1339,6 @@ send: > * checksum extended header and data. > */ > m->m_pkthdr.len =3D hdrlen + len; /* in6_cksum() need this */ > - m->m_pkthdr.csum_data =3D offsetof(struct tcphdr, th_sum); >=20 > #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) > if (to.to_flags & TOF_SIGNATURE) { > @@ -1336,9 +1365,19 @@ send: > * There is no need to fill in ip6_plen right now. > * It will be filled later by ip6_output. > */ > - m->m_pkthdr.csum_flags =3D CSUM_TCP_IPV6; > - th->th_sum =3D in6_cksum_pseudo(ip6, sizeof(struct = tcphdr) + > - optlen + len, IPPROTO_TCP, 0); > + if (tp->t_port) { > + m->m_pkthdr.csum_flags =3D CSUM_UDP_IPV6; > + m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > + udp->uh_sum =3D in6_cksum_pseudo(ip6, ulen, = IPPROTO_UDP, 0); > + th->th_sum =3D htons(0); > + UDPSTAT_INC(udps_opackets); > + } else { > + m->m_pkthdr.csum_flags =3D CSUM_TCP_IPV6; > + m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > + th->th_sum =3D in6_cksum_pseudo(ip6, > + sizeof(struct tcphdr) + optlen + len, = IPPROTO_TCP, > + 0); > + } > } > #endif > #if defined(INET6) && defined(INET) > @@ -1346,9 +1385,20 @@ send: > #endif > #ifdef INET > { > - m->m_pkthdr.csum_flags =3D CSUM_TCP; > - th->th_sum =3D in_pseudo(ip->ip_src.s_addr, = ip->ip_dst.s_addr, > - htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + = optlen)); > + if (tp->t_port) { > + m->m_pkthdr.csum_flags =3D CSUM_UDP; > + m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > + udp->uh_sum =3D in_pseudo(ip->ip_src.s_addr, > + ip->ip_dst.s_addr, htons(ulen + = IPPROTO_UDP)); > + th->th_sum =3D htons(0); > + UDPSTAT_INC(udps_opackets); > + } else { > + m->m_pkthdr.csum_flags =3D CSUM_TCP; > + m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > + th->th_sum =3D in_pseudo(ip->ip_src.s_addr, > + ip->ip_dst.s_addr, htons(sizeof(struct = tcphdr) + > + IPPROTO_TCP + len + optlen)); > + } >=20 > /* IP version must be set here for ipv4/ipv6 checking = later */ > KASSERT(ip->ip_v =3D=3D IPVERSION, > @@ -1473,8 +1523,10 @@ send: > * NB: Don't set DF on small MTU/MSS to have a safe fallback. > */ > if (V_path_mtu_discovery && tp->t_maxseg > V_tcp_minmss) { > - ip->ip_off |=3D htons(IP_DF); > tp->t_flags2 |=3D TF2_PLPMTU_PMTUD; > + if (tp->t_port =3D=3D 0 || len < V_tcp_minmss) { > + ip->ip_off |=3D htons(IP_DF); > + } > } else { > tp->t_flags2 &=3D ~TF2_PLPMTU_PMTUD; > } > diff --git a/sys/netinet/tcp_stacks/bbr.c = b/sys/netinet/tcp_stacks/bbr.c > index cc20d6bf52ca..1ee8d26446fd 100644 > --- a/sys/netinet/tcp_stacks/bbr.c > +++ b/sys/netinet/tcp_stacks/bbr.c > @@ -11969,14 +11969,10 @@ bbr_output_wtime(struct tcpcb *tp, const = struct timeval *tv) > #endif > struct tcp_bbr *bbr; > struct tcphdr *th; > -#ifdef NETFLIX_TCPOUDP > struct udphdr *udp =3D NULL; > -#endif > u_char opt[TCP_MAXOLEN]; > unsigned ipoptlen, optlen, hdrlen; > -#ifdef NETFLIX_TCPOUDP > unsigned ulen; > -#endif > uint32_t bbr_seq; > uint32_t delay_calc=3D0; > uint8_t doing_tlp =3D 0; > @@ -12991,10 +12987,8 @@ send: > /* Maximum segment size. */ > if (flags & TH_SYN) { > to.to_mss =3D tcp_mssopt(&inp->inp_inc); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) > to.to_mss -=3D = V_tcp_udp_tunneling_overhead; > -#endif > to.to_flags |=3D TOF_MSS; > /* > * On SYN or SYN|ACK transmits on TFO = connections, > @@ -13063,7 +13057,6 @@ send: > !(to.to_flags & TOF_FASTOPEN)) > len =3D 0; > } > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > if (V_tcp_udp_tunneling_port =3D=3D 0) { > /* The port was removed?? */ > @@ -13072,7 +13065,6 @@ send: > } > hdrlen +=3D sizeof(struct udphdr); > } > -#endif > #ifdef INET6 > if (isipv6) > ipoptlen =3D ip6_optlen(tp->t_inpcb); > @@ -13408,7 +13400,6 @@ send: > #ifdef INET6 > if (isipv6) { > ip6 =3D mtod(m, struct ip6_hdr *); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip6 + = ipoptlen + sizeof(struct ip6_hdr)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13417,17 +13408,9 @@ send: > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > } else { > -#endif > th =3D (struct tcphdr *)(ip6 + 1); > - > -#ifdef NETFLIX_TCPOUDP > } > -#endif > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip6, th); > + tcpip_fillheaders(inp, tp->t_port, ip6, th); > } else > #endif /* INET6 */ > { > @@ -13435,7 +13418,6 @@ send: > #ifdef TCPDEBUG > ipov =3D (struct ipovly *)ip; > #endif > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip + ipoptlen = + sizeof(struct ip)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13443,14 +13425,10 @@ send: > ulen =3D hdrlen + len - sizeof(struct ip); > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > - } else > -#endif > + } else { > th =3D (struct tcphdr *)(ip + 1); > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip, th); > + } > + tcpip_fillheaders(inp, tp->t_port, ip, th); > } > /* > * If we are doing retransmissions, then snd_nxt will not = reflect > @@ -13600,7 +13578,6 @@ send: > * ip6_plen is not need to be filled now, and will be = filled > * in ip6_output. > */ > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > m->m_pkthdr.csum_flags =3D CSUM_UDP_IPV6; > m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > @@ -13608,14 +13585,11 @@ send: > th->th_sum =3D htons(0); > UDPSTAT_INC(udps_opackets); > } else { > -#endif > csum_flags =3D m->m_pkthdr.csum_flags =3D = CSUM_TCP_IPV6; > m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > th->th_sum =3D in6_cksum_pseudo(ip6, = sizeof(struct tcphdr) + > optlen + len, IPPROTO_TCP, 0); > -#ifdef NETFLIX_TCPOUDP > } > -#endif > } > #endif > #if defined(INET6) && defined(INET) > @@ -13623,7 +13597,6 @@ send: > #endif > #ifdef INET > { > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > m->m_pkthdr.csum_flags =3D CSUM_UDP; > m->m_pkthdr.csum_data =3D offsetof(struct = udphdr, uh_sum); > @@ -13632,15 +13605,12 @@ send: > th->th_sum =3D htons(0); > UDPSTAT_INC(udps_opackets); > } else { > -#endif > csum_flags =3D m->m_pkthdr.csum_flags =3D = CSUM_TCP; > m->m_pkthdr.csum_data =3D offsetof(struct = tcphdr, th_sum); > th->th_sum =3D in_pseudo(ip->ip_src.s_addr, > ip->ip_dst.s_addr, htons(sizeof(struct = tcphdr) + > IPPROTO_TCP + len + optlen)); > -#ifdef NETFLIX_TCPOUDP > } > -#endif > /* IP version must be set here for ipv4/ipv6 checking = later */ > KASSERT(ip->ip_v =3D=3D IPVERSION, > ("%s: IP version incorrect: %d", __func__, = ip->ip_v)); > diff --git a/sys/netinet/tcp_stacks/rack.c = b/sys/netinet/tcp_stacks/rack.c > index 0ee73a95a6d7..12827d1699d0 100644 > --- a/sys/netinet/tcp_stacks/rack.c > +++ b/sys/netinet/tcp_stacks/rack.c > @@ -13008,10 +13008,8 @@ send: > if (flags & TH_SYN) { > tp->snd_nxt =3D tp->iss; > to.to_mss =3D tcp_mssopt(&inp->inp_inc); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) > to.to_mss -=3D = V_tcp_udp_tunneling_overhead; > -#endif > to.to_flags |=3D TOF_MSS; >=20 > /* > @@ -13088,7 +13086,6 @@ send: > !(to.to_flags & TOF_FASTOPEN)) > len =3D 0; > } > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > if (V_tcp_udp_tunneling_port =3D=3D 0) { > /* The port was removed?? */ > @@ -13097,7 +13094,6 @@ send: > } > hdrlen +=3D sizeof(struct udphdr); > } > -#endif > #ifdef INET6 > if (isipv6) > ipoptlen =3D ip6_optlen(tp->t_inpcb); > @@ -13372,7 +13368,6 @@ send: > #ifdef INET6 > if (isipv6) { > ip6 =3D mtod(m, struct ip6_hdr *); > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip6 + = ipoptlen + sizeof(struct ip6_hdr)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13380,14 +13375,10 @@ send: > ulen =3D hdrlen + len - sizeof(struct ip6_hdr); > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > - } else > -#endif > + } else { > th =3D (struct tcphdr *)(ip6 + 1); > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip6, th); > + } > + tcpip_fillheaders(inp, tp->t_port, ip6, th); > } else > #endif /* INET6 */ > { > @@ -13395,7 +13386,6 @@ send: > #ifdef TCPDEBUG > ipov =3D (struct ipovly *)ip; > #endif > -#ifdef NETFLIX_TCPOUDP > if (tp->t_port) { > udp =3D (struct udphdr *)((caddr_t)ip + ipoptlen = + sizeof(struct ip)); > udp->uh_sport =3D = htons(V_tcp_udp_tunneling_port); > @@ -13403,14 +13393,10 @@ send: > ulen =3D hdrlen + len - sizeof(struct ip); > udp->uh_ulen =3D htons(ulen); > th =3D (struct tcphdr *)(udp + 1); > - } else > -#endif > + } else { > th =3D (struct tcphdr *)(ip + 1); > - tcpip_fillheaders(inp, > -#ifdef NETFLIX_TCPOUDP > - tp->t_port, > -#endif > - ip, th); > + } > + tcpip_fillheaders(inp, tp->t_port, ip, th); > } > /* > * Fill in fields, remembering maximum advertised window for use = in > diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c > index dff7767cd9cf..6bdeb3984aee 100644 > --- a/sys/netinet/tcp_subr.c > +++ b/sys/netinet/tcp_subr.c > @@ -126,6 +126,8 @@ __FBSDID("$FreeBSD$"); > #ifdef TCP_OFFLOAD > #include > #endif > +#include > +#include >=20 > #include >=20 > @@ -501,6 +503,80 @@ tcp_switch_back_to_default(struct tcpcb *tp) > } > } >=20 > +static void > +tcp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb = *inp, > + const struct sockaddr *sa, void *ctx) > +{ > + struct ip *iph; > +#ifdef INET6 > + struct ip6_hdr *ip6; > +#endif > + struct udphdr *uh; > + struct tcphdr *th; > + int thlen; > + uint16_t port; > + > + TCPSTAT_INC(tcps_tunneled_pkts); > + if ((m->m_flags & M_PKTHDR) =3D=3D 0) { > + /* Can't handle one that is not a pkt hdr */ > + TCPSTAT_INC(tcps_tunneled_errs); > + goto out; > + } > + thlen =3D sizeof(struct tcphdr); > + if (m->m_len < off + sizeof(struct udphdr) + thlen && > + (m =3D m_pullup(m, off + sizeof(struct udphdr) + thlen)) =3D=3D= NULL) { > + TCPSTAT_INC(tcps_tunneled_errs); > + goto out; > + } > + iph =3D mtod(m, struct ip *); > + uh =3D (struct udphdr *)((caddr_t)iph + off); > + th =3D (struct tcphdr *)(uh + 1); > + thlen =3D th->th_off << 2; > + if (m->m_len < off + sizeof(struct udphdr) + thlen) { > + m =3D m_pullup(m, off + sizeof(struct udphdr) + thlen); > + if (m =3D=3D NULL) { > + TCPSTAT_INC(tcps_tunneled_errs); > + goto out; > + } else { > + iph =3D mtod(m, struct ip *); > + uh =3D (struct udphdr *)((caddr_t)iph + off); > + th =3D (struct tcphdr *)(uh + 1); > + } > + } > + m->m_pkthdr.tcp_tun_port =3D port =3D uh->uh_sport; > + bcopy(th, uh, m->m_len - off); > + m->m_len -=3D sizeof(struct udphdr); > + m->m_pkthdr.len -=3D sizeof(struct udphdr); > + /* > + * We use the same algorithm for > + * both UDP and TCP for c-sum. So > + * the code in tcp_input will skip > + * the checksum. So we do nothing > + * with the flag (m->m_pkthdr.csum_flags). > + */ > + switch (iph->ip_v) { > +#ifdef INET > + case IPVERSION: > + iph->ip_len =3D htons(ntohs(iph->ip_len) - sizeof(struct = udphdr)); > + tcp_input_with_port(&m, &off, IPPROTO_TCP, port); > + break; > +#endif > +#ifdef INET6 > + case IPV6_VERSION >> 4: > + ip6 =3D mtod(m, struct ip6_hdr *); > + ip6->ip6_plen =3D htons(ntohs(ip6->ip6_plen) - = sizeof(struct udphdr)); > + tcp6_input_with_port(&m, &off, IPPROTO_TCP, port); > + break; > +#endif > + default: > + goto out; > + break; > + } > + return; > +out: > + m_freem(m); > +} > + > static int > sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) > { > @@ -598,6 +674,183 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, = functions_available, > NULL, 0, sysctl_net_inet_list_available, "A", > "list available TCP Function sets"); >=20 > +VNET_DEFINE(int, tcp_udp_tunneling_port) =3D = TCP_TUNNELING_PORT_DEFAULT; > + > +#ifdef INET > +VNET_DEFINE(struct socket *, udp4_tun_socket) =3D NULL; > +#define V_udp4_tun_socket VNET(udp4_tun_socket) > +#endif > +#ifdef INET6 > +VNET_DEFINE(struct socket *, udp6_tun_socket) =3D NULL; > +#define V_udp6_tun_socket VNET(udp6_tun_socket) > +#endif > + > +static void > +tcp_over_udp_stop(void) > +{ > + /* > + * This function assumes sysctl caller holds inp_rinfo_lock() > + * for writting! > + */ > +#ifdef INET > + if (V_udp4_tun_socket !=3D NULL) { > + soclose(V_udp4_tun_socket); > + V_udp4_tun_socket =3D NULL; > + } > +#endif > +#ifdef INET6 > + if (V_udp6_tun_socket !=3D NULL) { > + soclose(V_udp6_tun_socket); > + V_udp6_tun_socket =3D NULL; > + } > +#endif > +} > + > +static int > +tcp_over_udp_start(void) > +{ > + uint16_t port; > + int ret; > +#ifdef INET > + struct sockaddr_in sin; > +#endif > +#ifdef INET6 > + struct sockaddr_in6 sin6; > +#endif > + /* > + * This function assumes sysctl caller holds inp_info_rlock() > + * for writting! > + */ > + port =3D V_tcp_udp_tunneling_port; > + if (ntohs(port) =3D=3D 0) { > + /* Must have a port set */ > + return (EINVAL); > + } > +#ifdef INET > + if (V_udp4_tun_socket !=3D NULL) { > + /* Already running -- must stop first */ > + return (EALREADY); > + } > +#endif > +#ifdef INET6 > + if (V_udp6_tun_socket !=3D NULL) { > + /* Already running -- must stop first */ > + return (EALREADY); > + } > +#endif > +#ifdef INET > + if ((ret =3D socreate(PF_INET, &V_udp4_tun_socket, > + SOCK_DGRAM, IPPROTO_UDP, > + curthread->td_ucred, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Call the special UDP hook. */ > + if ((ret =3D udp_set_kernel_tunneling(V_udp4_tun_socket, > + tcp_recv_udp_tunneled_packet, > + tcp_ctlinput_viaudp, > + NULL))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Ok, we have a socket, bind it to the port. */ > + memset(&sin, 0, sizeof(struct sockaddr_in)); > + sin.sin_len =3D sizeof(struct sockaddr_in); > + sin.sin_family =3D AF_INET; > + sin.sin_port =3D htons(port); > + if ((ret =3D sobind(V_udp4_tun_socket, > + (struct sockaddr *)&sin, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > +#endif > +#ifdef INET6 > + if ((ret =3D socreate(PF_INET6, &V_udp6_tun_socket, > + SOCK_DGRAM, IPPROTO_UDP, > + curthread->td_ucred, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Call the special UDP hook. */ > + if ((ret =3D udp_set_kernel_tunneling(V_udp6_tun_socket, > + tcp_recv_udp_tunneled_packet, > + tcp6_ctlinput_viaudp, > + NULL))) { > + tcp_over_udp_stop(); > + return (ret); > + } > + /* Ok, we have a socket, bind it to the port. */ > + memset(&sin6, 0, sizeof(struct sockaddr_in6)); > + sin6.sin6_len =3D sizeof(struct sockaddr_in6); > + sin6.sin6_family =3D AF_INET6; > + sin6.sin6_port =3D htons(port); > + if ((ret =3D sobind(V_udp6_tun_socket, > + (struct sockaddr *)&sin6, curthread))) { > + tcp_over_udp_stop(); > + return (ret); > + } > +#endif > + return (0); > +} > + > +static int > +sysctl_net_inet_tcp_udp_tunneling_port_check(SYSCTL_HANDLER_ARGS) > +{ > + int error; > + uint32_t old, new; > + > + old =3D V_tcp_udp_tunneling_port; > + new =3D old; > + error =3D sysctl_handle_int(oidp, &new, 0, req); > + if ((error =3D=3D 0) && > + (req->newptr !=3D NULL)) { > + if ((new < TCP_TUNNELING_PORT_MIN) || > + (new > TCP_TUNNELING_PORT_MAX)) { > + error =3D EINVAL; > + } else { > + V_tcp_udp_tunneling_port =3D new; > + if (old !=3D 0) { > + tcp_over_udp_stop(); > + } > + if (new !=3D 0) { > + error =3D tcp_over_udp_start(); > + } > + } > + } > + return (error); > +} > + > +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_port, > + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > + &VNET_NAME(tcp_udp_tunneling_port), > + 0, &sysctl_net_inet_tcp_udp_tunneling_port_check, "IU", > + "Tunneling port for tcp over udp"); > + > +VNET_DEFINE(int, tcp_udp_tunneling_overhead) =3D = TCP_TUNNELING_OVERHEAD_DEFAULT; > + > +static int > +sysctl_net_inet_tcp_udp_tunneling_overhead_check(SYSCTL_HANDLER_ARGS) > +{ > + int error, new; > + > + new =3D V_tcp_udp_tunneling_overhead; > + error =3D sysctl_handle_int(oidp, &new, 0, req); > + if (error =3D=3D 0 && req->newptr) { > + if ((new < TCP_TUNNELING_OVERHEAD_MIN) || > + (new > TCP_TUNNELING_OVERHEAD_MAX)) > + error =3D EINVAL; > + else > + V_tcp_udp_tunneling_overhead =3D new; > + } > + return (error); > +} > + > +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, udp_tunneling_overhead, > + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > + &VNET_NAME(tcp_udp_tunneling_overhead), > + 0, &sysctl_net_inet_tcp_udp_tunneling_overhead_check, "IU", > + "MSS reduction when using tcp over udp"); > + > /* > * Exports one (struct tcp_function_info) for each alias/name. > */ > @@ -1305,7 +1558,7 @@ tcp_fini(void *xtp) > * of the tcpcb each time to conserve mbufs. > */ > void > -tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) > +tcpip_fillheaders(struct inpcb *inp, uint16_t port, void *ip_ptr, = void *tcp_ptr) > { > struct tcphdr *th =3D (struct tcphdr *)tcp_ptr; >=20 > @@ -1320,7 +1573,10 @@ tcpip_fillheaders(struct inpcb *inp, void = *ip_ptr, void *tcp_ptr) > (inp->inp_flow & IPV6_FLOWINFO_MASK); > ip6->ip6_vfc =3D (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | > (IPV6_VERSION & IPV6_VERSION_MASK); > - ip6->ip6_nxt =3D IPPROTO_TCP; > + if (port =3D=3D 0) > + ip6->ip6_nxt =3D IPPROTO_TCP; > + else > + ip6->ip6_nxt =3D IPPROTO_UDP; > ip6->ip6_plen =3D htons(sizeof(struct tcphdr)); > ip6->ip6_src =3D inp->in6p_laddr; > ip6->ip6_dst =3D inp->in6p_faddr; > @@ -1342,7 +1598,10 @@ tcpip_fillheaders(struct inpcb *inp, void = *ip_ptr, void *tcp_ptr) > ip->ip_off =3D 0; > ip->ip_ttl =3D inp->inp_ip_ttl; > ip->ip_sum =3D 0; > - ip->ip_p =3D IPPROTO_TCP; > + if (port =3D=3D 0) > + ip->ip_p =3D IPPROTO_TCP; > + else > + ip->ip_p =3D IPPROTO_UDP; > ip->ip_src =3D inp->inp_laddr; > ip->ip_dst =3D inp->inp_faddr; > } > @@ -1372,7 +1631,7 @@ tcpip_maketemplate(struct inpcb *inp) > t =3D malloc(sizeof(*t), M_TEMP, M_NOWAIT); > if (t =3D=3D NULL) > return (NULL); > - tcpip_fillheaders(inp, (void *)&t->tt_ipgen, (void *)&t->tt_t); > + tcpip_fillheaders(inp, 0, (void *)&t->tt_ipgen, (void = *)&t->tt_t); > return (t); > } >=20 > @@ -1398,14 +1657,16 @@ tcp_respond(struct tcpcb *tp, void *ipgen, = struct tcphdr *th, struct mbuf *m, > struct inpcb *inp; > struct ip *ip; > struct mbuf *optm; > + struct udphdr *uh =3D NULL; > struct tcphdr *nth; > u_char *optp; > #ifdef INET6 > struct ip6_hdr *ip6; > int isipv6; > #endif /* INET6 */ > - int optlen, tlen, win; > + int optlen, tlen, win, ulen; > bool incl_opts; > + uint16_t port; >=20 > KASSERT(tp !=3D NULL || m !=3D NULL, ("tcp_respond: tp and m = both NULL")); > NET_EPOCH_ASSERT(); > @@ -1423,6 +1684,19 @@ tcp_respond(struct tcpcb *tp, void *ipgen, = struct tcphdr *th, struct mbuf *m, > } else > inp =3D NULL; >=20 > + if (m !=3D NULL) { > +#ifdef INET6 > + if (isipv6 && ip6 && (ip6->ip6_nxt =3D=3D IPPROTO_UDP)) > + port =3D m->m_pkthdr.tcp_tun_port; > + else > *** 1128 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Jun 7 13:55:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4622C64E4E6; Mon, 7 Jun 2021 13:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzFJP0vZDz3CWG; Mon, 7 Jun 2021 13:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 079D716BA4; Mon, 7 Jun 2021 13:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Dtm00091792; Mon, 7 Jun 2021 13:55:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157DtmJ0091791; Mon, 7 Jun 2021 13:55:48 GMT (envelope-from git) Date: Mon, 7 Jun 2021 13:55:48 GMT Message-Id: <202106071355.157DtmJ0091791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: 35b8fd0b699a - main - usr.bin/calendar: do not treat // in text as comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35b8fd0b699a20f71d5636069347b243eb336979 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 13:55:49 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=35b8fd0b699a20f71d5636069347b243eb336979 commit 35b8fd0b699a20f71d5636069347b243eb336979 Author: Stefan Eßer AuthorDate: 2021-06-07 13:46:24 +0000 Commit: Stefan Eßer CommitDate: 2021-06-07 13:55:23 +0000 usr.bin/calendar: do not treat // in text as comment The C++-style comment marker "//" has been added with the rewrite of the preprocessor features. Since this character sequence occurs in ULRS, the reminder of the URL was considered a comment and stripped from the calendar line. Change parsing of "//" to only start a comment at the begin of a line or when preceeded by a white-space character. PR: 256455 Reported by: Philippe Michel (philippe.michel7 at free.fr) MFC after: 3 days --- usr.bin/calendar/io.c | 22 ++++++++++++++-------- usr.bin/calendar/tests/calendar.comment | 3 ++- usr.bin/calendar/tests/regress.comment.out | 2 ++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 24966399c179..5afcb1a33314 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -405,7 +405,7 @@ cal_parse(FILE *in, FILE *out) { char *mylocale = NULL; char *line = NULL; - char *buf; + char *buf, *bufp; size_t linecap = 0; ssize_t linelen; ssize_t l; @@ -443,21 +443,27 @@ cal_parse(FILE *in, FILE *out) } } if (!incomment) { + bufp = buf; do { - c = strstr(buf, "//"); - cc = strstr(buf, "/*"); + c = strstr(bufp, "//"); + cc = strstr(bufp, "/*"); if (c != NULL && (cc == NULL || c - cc < 0)) { - /* single line comment */ - *c = '\0'; - linelen = c - buf; - break; + bufp = c + 2; + /* ignore "//" within string to allow it in an URL */ + if (c == buf || isspace(c[-1])) { + /* single line comment */ + *c = '\0'; + linelen = c - buf; + break; + } } else if (cc != NULL) { c = strstr(cc + 2, "*/"); - if (c != NULL) { + if (c != NULL) { // 'a /* b */ c' -- cc=2, c=7+2 /* multi-line comment ending on same line */ c += 2; memmove(cc, c, buf + linelen + 1 - c); linelen -= c - cc; + bufp = cc; } else { /* multi-line comment */ *cc = '\0'; diff --git a/usr.bin/calendar/tests/calendar.comment b/usr.bin/calendar/tests/calendar.comment index 6af037ec7e9d..837e5af9e89e 100644 --- a/usr.bin/calendar/tests/calendar.comment +++ b/usr.bin/calendar/tests/calendar.comment @@ -7,4 +7,5 @@ 1/* comment */ 6 jan 6 1 7 jan 7 // /* comment */ comment 1 1/* comment */1 jan /* comment */11 // comment - +1 12 http://localhost.local/ +1 13 http://localhost.local/ // URL with additional comment diff --git a/usr.bin/calendar/tests/regress.comment.out b/usr.bin/calendar/tests/regress.comment.out index 1ba3d8cc640e..fb58fd29ff05 100644 --- a/usr.bin/calendar/tests/regress.comment.out +++ b/usr.bin/calendar/tests/regress.comment.out @@ -6,3 +6,5 @@ Jan 5 jan 5 Jan 6 jan 6 Jan 7 jan 7 Jan 11 jan 11 +Jan 12 http://localhost.local/ +Jan 13 http://localhost.local/ From owner-dev-commits-src-all@freebsd.org Mon Jun 7 14:32:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F59064F026; Mon, 7 Jun 2021 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzG6l38bHz3Frw; Mon, 7 Jun 2021 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 552CC174AE; Mon, 7 Jun 2021 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157EWV4j044656; Mon, 7 Jun 2021 14:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157EWVIk044655; Mon, 7 Jun 2021 14:32:31 GMT (envelope-from git) Date: Mon, 7 Jun 2021 14:32:31 GMT Message-Id: <202106071432.157EWVIk044655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 05c2d94a081d - main - LinuxKPI: add pr_err_once MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05c2d94a081d5948560a01c26c7f432960cde606 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 14:32:31 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=05c2d94a081d5948560a01c26c7f432960cde606 commit 05c2d94a081d5948560a01c26c7f432960cde606 Author: Greg V AuthorDate: 2021-06-07 14:30:18 +0000 Commit: Ed Maste CommitDate: 2021-06-07 14:31:48 +0000 LinuxKPI: add pr_err_once Reviewed by: hselasky, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30672 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 807138334fdd..f34179d9566b 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -251,6 +251,8 @@ extern int linuxkpi_debug; log(LOG_CRIT, pr_fmt(fmt), ##__VA_ARGS__) #define pr_err(fmt, ...) \ log(LOG_ERR, pr_fmt(fmt), ##__VA_ARGS__) +#define pr_err_once(fmt, ...) \ + log_once(LOG_ERR, pr_fmt(fmt), ##__VA_ARGS__) #define pr_warning(fmt, ...) \ log(LOG_WARNING, pr_fmt(fmt), ##__VA_ARGS__) #define pr_warn(...) \ From owner-dev-commits-src-all@freebsd.org Mon Jun 7 15:43:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEE0264FD22; Mon, 7 Jun 2021 15:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzHhB4wVkz3Mn9; Mon, 7 Jun 2021 15:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91D6D184A8; Mon, 7 Jun 2021 15:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Fh6Rq037206; Mon, 7 Jun 2021 15:43:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Fh6m8037205; Mon, 7 Jun 2021 15:43:06 GMT (envelope-from git) Date: Mon, 7 Jun 2021 15:43:06 GMT Message-Id: <202106071543.157Fh6m8037205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 09cb8c812b2f - stable/12 - pf tests: Make killstate:match more robust MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 09cb8c812b2fdf1d1e95cf6237a14c616169c1bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 15:43:06 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=09cb8c812b2fdf1d1e95cf6237a14c616169c1bb commit 09cb8c812b2fdf1d1e95cf6237a14c616169c1bb Author: Kristof Provost AuthorDate: 2021-06-03 13:22:19 +0000 Commit: Kristof Provost CommitDate: 2021-06-07 08:35:45 +0000 pf tests: Make killstate:match more robust The killstate:match test starts nc as a background process. There was no guarantee that the nc process would have connected by the time we check for states, so this test occasionally failed without good reason. Teach the test to wait for at least some states to turn up before executing the critical checks. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 70dd30d49c29a27e1ef159660a7e3dbb84082674) --- tests/sys/netpfil/pf/killstate.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index b811befc08c5..2b77ea189294 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -312,6 +312,17 @@ match_head() atf_set require.user root } +wait_for_state() +{ + jail=$1 + addr=$2 + + while ! jexec $jail pfctl -s s | grep $addr >/dev/null; + do + sleep .1 + done +} + match_body() { pft_init @@ -340,6 +351,7 @@ match_body() "pass all" nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Expect two states states=$(jexec alcatraz pfctl -s s | wc -l) @@ -360,6 +372,7 @@ match_body() jexec alcatraz pfctl -F states nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Kill matching states, expect all of them to be gone jexec alcatraz pfctl -M -k 192.0.2.1 From owner-dev-commits-src-all@freebsd.org Mon Jun 7 15:43:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56B5264FEA6; Mon, 7 Jun 2021 15:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzHhD1v8pz3Mwk; Mon, 7 Jun 2021 15:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CE0A18601; Mon, 7 Jun 2021 15:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Fh7xB037306; Mon, 7 Jun 2021 15:43:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Fh7W9037305; Mon, 7 Jun 2021 15:43:07 GMT (envelope-from git) Date: Mon, 7 Jun 2021 15:43:07 GMT Message-Id: <202106071543.157Fh7W9037305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: dedd9ee84bb0 - stable/13 - pf tests: Make killstate:match more robust MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dedd9ee84bb0a93d0afc3c1df4a8bf4e7e8b85c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 15:43:08 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dedd9ee84bb0a93d0afc3c1df4a8bf4e7e8b85c7 commit dedd9ee84bb0a93d0afc3c1df4a8bf4e7e8b85c7 Author: Kristof Provost AuthorDate: 2021-06-03 13:22:19 +0000 Commit: Kristof Provost CommitDate: 2021-06-07 15:42:19 +0000 pf tests: Make killstate:match more robust The killstate:match test starts nc as a background process. There was no guarantee that the nc process would have connected by the time we check for states, so this test occasionally failed without good reason. Teach the test to wait for at least some states to turn up before executing the critical checks. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 70dd30d49c29a27e1ef159660a7e3dbb84082674) --- tests/sys/netpfil/pf/killstate.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index b3d94a245548..f53ede8c7578 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -384,6 +384,17 @@ match_head() atf_set require.user root } +wait_for_state() +{ + jail=$1 + addr=$2 + + while ! jexec $jail pfctl -s s | grep $addr >/dev/null; + do + sleep .1 + done +} + match_body() { pft_init @@ -412,6 +423,7 @@ match_body() "pass all" nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Expect two states states=$(jexec alcatraz pfctl -s s | wc -l) @@ -432,6 +444,7 @@ match_body() jexec alcatraz pfctl -F states nc 198.51.100.2 7 & + wait_for_state alcatraz 192.0.2.1 # Kill matching states, expect all of them to be gone jexec alcatraz pfctl -M -k 192.0.2.1 From owner-dev-commits-src-all@freebsd.org Mon Jun 7 16:33:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8C31650906; Mon, 7 Jun 2021 16:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJnr4bdrz3hCC; Mon, 7 Jun 2021 16:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8600418E45; Mon, 7 Jun 2021 16:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX4lt004098; Mon, 7 Jun 2021 16:33:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX4pR004097; Mon, 7 Jun 2021 16:33:04 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:04 GMT Message-Id: <202106071633.157GX4pR004097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 620a48f64d08 - stable/13 - kern linker: do not allow more than one kldload and kldunload syscalls simultaneously MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 620a48f64d0848ce4ef698b3c2aae960a146cc42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=620a48f64d0848ce4ef698b3c2aae960a146cc42 commit 620a48f64d0848ce4ef698b3c2aae960a146cc42 Author: Konstantin Belousov AuthorDate: 2021-05-20 14:50:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 kern linker: do not allow more than one kldload and kldunload syscalls simultaneously (cherry picked from commit e266a0f7f001c7886eab56d8c058d92d87010400) --- sys/kern/kern_linker.c | 86 +++++++++++++++++++++++++++++++++++++++----------- sys/sys/linker.h | 9 ++++++ 2 files changed, 77 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index e54546eec7b4..dbbf240a2f56 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -106,6 +106,7 @@ MALLOC_DEFINE(M_LINKER, "linker", "kernel linker"); linker_file_t linker_kernel_file; static struct sx kld_sx; /* kernel linker lock */ +static bool kld_busy; /* * Load counter used by clients to determine if a linker file has been @@ -1050,6 +1051,49 @@ linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, M_WAITOK)); } +int +linker_kldload_busy(int flags) +{ + int error; + + MPASS((flags & ~(LINKER_UB_UNLOCK | LINKER_UB_LOCKED | + LINKER_UB_PCATCH)) == 0); + if ((flags & LINKER_UB_LOCKED) != 0) + sx_assert(&kld_sx, SA_XLOCKED); + + if ((flags & LINKER_UB_LOCKED) == 0) + sx_xlock(&kld_sx); + while (kld_busy) { + error = sx_sleep(&kld_busy, &kld_sx, + (flags & LINKER_UB_PCATCH) != 0 ? PCATCH : 0, + "kldbusy", 0); + if (error != 0) { + if ((flags & LINKER_UB_UNLOCK) != 0) + sx_xunlock(&kld_sx); + return (error); + } + } + kld_busy = true; + if ((flags & LINKER_UB_UNLOCK) != 0) + sx_xunlock(&kld_sx); + return (0); +} + +void +linker_kldload_unbusy(int flags) +{ + MPASS((flags & ~LINKER_UB_LOCKED) == 0); + if ((flags & LINKER_UB_LOCKED) != 0) + sx_assert(&kld_sx, SA_XLOCKED); + + if ((flags & LINKER_UB_LOCKED) == 0) + sx_xlock(&kld_sx); + MPASS(kld_busy); + kld_busy = false; + wakeup(&kld_busy); + sx_xunlock(&kld_sx); +} + /* * Syscalls. */ @@ -1066,12 +1110,6 @@ kern_kldload(struct thread *td, const char *file, int *fileid) if ((error = priv_check(td, PRIV_KLD_LOAD)) != 0) return (error); - /* - * It is possible that kldloaded module will attach a new ifnet, - * so vnet context must be set when this ocurs. - */ - CURVNET_SET(TD_TO_VNET(td)); - /* * If file does not contain a qualified name or any dot in it * (kldname.ko, or kldname.ver.ko) treat it as an interface @@ -1085,19 +1123,27 @@ kern_kldload(struct thread *td, const char *file, int *fileid) modname = file; } - sx_xlock(&kld_sx); - error = linker_load_module(kldname, modname, NULL, NULL, &lf); - if (error) { + error = linker_kldload_busy(LINKER_UB_PCATCH); + if (error != 0) { sx_xunlock(&kld_sx); - goto done; + return (error); } - lf->userrefs++; - if (fileid != NULL) - *fileid = lf->id; - sx_xunlock(&kld_sx); -done: + /* + * It is possible that kldloaded module will attach a new ifnet, + * so vnet context must be set when this ocurs. + */ + CURVNET_SET(TD_TO_VNET(td)); + + error = linker_load_module(kldname, modname, NULL, NULL, &lf); CURVNET_RESTORE(); + + if (error == 0) { + lf->userrefs++; + if (fileid != NULL) + *fileid = lf->id; + } + linker_kldload_unbusy(LINKER_UB_LOCKED); return (error); } @@ -1132,8 +1178,13 @@ kern_kldunload(struct thread *td, int fileid, int flags) if ((error = priv_check(td, PRIV_KLD_UNLOAD)) != 0) return (error); + error = linker_kldload_busy(LINKER_UB_PCATCH); + if (error != 0) { + sx_xunlock(&kld_sx); + return (error); + } + CURVNET_SET(TD_TO_VNET(td)); - sx_xlock(&kld_sx); lf = linker_find_file_by_id(fileid); if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); @@ -1153,9 +1204,8 @@ kern_kldunload(struct thread *td, int fileid, int flags) } } else error = ENOENT; - sx_xunlock(&kld_sx); - CURVNET_RESTORE(); + linker_kldload_unbusy(LINKER_UB_LOCKED); return (error); } diff --git a/sys/sys/linker.h b/sys/sys/linker.h index 13274ecd1a7c..6423a3989a02 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -196,6 +196,15 @@ int linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, /* HWPMC helper */ void *linker_hwpmc_list_objects(void); +/* kldload/kldunload syscalls blocking */ +#define LINKER_UB_UNLOCK 0x0001 /* busy: unlock kld_sx locked on + return */ +#define LINKER_UB_LOCKED 0x0002 /* busy/unbusy: kld_sx locked on + entry */ +#define LINKER_UB_PCATCH 0x0004 /* busy: sleep interruptible */ +int linker_kldload_busy(int flags); +void linker_kldload_unbusy(int flags); + #endif /* _KERNEL */ /* From owner-dev-commits-src-all@freebsd.org Mon Jun 7 16:33:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C54FA650908; Mon, 7 Jun 2021 16:33:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJns5Hgtz3R6B; Mon, 7 Jun 2021 16:33:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E9B518A68; Mon, 7 Jun 2021 16:33:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX519004126; Mon, 7 Jun 2021 16:33:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX5B0004125; Mon, 7 Jun 2021 16:33:05 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:05 GMT Message-Id: <202106071633.157GX5B0004125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 664aff03fae2 - stable/13 - kern_thread.c: wrap too long lines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 664aff03fae2594e7db640c06c9edac5cb57bc7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:05 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=664aff03fae2594e7db640c06c9edac5cb57bc7f commit 664aff03fae2594e7db640c06c9edac5cb57bc7f Author: Konstantin Belousov AuthorDate: 2021-05-25 18:09:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 kern_thread.c: wrap too long lines (cherry picked from commit 845d77974b3b6ab78297836ead2d2acbcdebeba7) --- sys/kern/kern_thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index c16b6dd3c791..7370fd919203 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -541,7 +541,8 @@ threadinit(void) TASK_INIT(&thread_reap_task, 0, thread_reap_task_cb, NULL); callout_init(&thread_reap_callout, 1); - callout_reset(&thread_reap_callout, 5 * hz, thread_reap_callout_cb, NULL); + callout_reset(&thread_reap_callout, 5 * hz, + thread_reap_callout_cb, NULL); } /* @@ -704,7 +705,8 @@ thread_reap_callout_cb(void *arg __unused) if (wantreap) taskqueue_enqueue(taskqueue_thread, &thread_reap_task); - callout_reset(&thread_reap_callout, 5 * hz, thread_reap_callout_cb, NULL); + callout_reset(&thread_reap_callout, 5 * hz, + thread_reap_callout_cb, NULL); } /* From owner-dev-commits-src-all@freebsd.org Mon Jun 7 16:33:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 048A465005B; Mon, 7 Jun 2021 16:33:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJnt6NwMz3R1C; Mon, 7 Jun 2021 16:33:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C145118EB7; Mon, 7 Jun 2021 16:33:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX6aG004147; Mon, 7 Jun 2021 16:33:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX6gu004146; Mon, 7 Jun 2021 16:33:06 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:06 GMT Message-Id: <202106071633.157GX6gu004146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b25cbead39ca - stable/13 - quisce_cpus(): add special handling for PDROP MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b25cbead39ca3e23de6f2a61f089da972b9f3157 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b25cbead39ca3e23de6f2a61f089da972b9f3157 commit b25cbead39ca3e23de6f2a61f089da972b9f3157 Author: Konstantin Belousov AuthorDate: 2021-05-28 17:10:47 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 quisce_cpus(): add special handling for PDROP (cherry picked from commit 3a68546d2377d6e9776060043372d66f07022543) --- sys/kern/subr_smp.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index d4f8aac9e751..935fb6ee977c 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -943,25 +943,31 @@ smp_rendezvous_cpus_done(struct smp_rendezvous_cpus_retry_arg *arg) } /* + * If (prio & PDROP) == 0: * Wait for specified idle threads to switch once. This ensures that even * preempted threads have cycled through the switch function once, * exiting their codepaths. This allows us to change global pointers * with no other synchronization. + * If (prio & PDROP) != 0: + * Force the specified CPUs to switch context at least once. */ int quiesce_cpus(cpuset_t map, const char *wmesg, int prio) { struct pcpu *pcpu; - u_int gen[MAXCPU]; + u_int *gen; int error; int cpu; error = 0; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (!CPU_ISSET(cpu, &map) || CPU_ABSENT(cpu)) - continue; - pcpu = pcpu_find(cpu); - gen[cpu] = pcpu->pc_idlethread->td_generation; + if ((prio & PDROP) == 0) { + gen = malloc(sizeof(u_int) * MAXCPU, M_TEMP, M_WAITOK); + for (cpu = 0; cpu <= mp_maxid; cpu++) { + if (!CPU_ISSET(cpu, &map) || CPU_ABSENT(cpu)) + continue; + pcpu = pcpu_find(cpu); + gen[cpu] = pcpu->pc_idlethread->td_generation; + } } for (cpu = 0; cpu <= mp_maxid; cpu++) { if (!CPU_ISSET(cpu, &map) || CPU_ABSENT(cpu)) @@ -970,8 +976,10 @@ quiesce_cpus(cpuset_t map, const char *wmesg, int prio) thread_lock(curthread); sched_bind(curthread, cpu); thread_unlock(curthread); + if ((prio & PDROP) != 0) + continue; while (gen[cpu] == pcpu->pc_idlethread->td_generation) { - error = tsleep(quiesce_cpus, prio, wmesg, 1); + error = tsleep(quiesce_cpus, prio & ~PDROP, wmesg, 1); if (error != EWOULDBLOCK) goto out; error = 0; @@ -981,6 +989,8 @@ out: thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); + if ((prio & PDROP) == 0) + free(gen, M_TEMP); return (error); } From owner-dev-commits-src-all@freebsd.org Mon Jun 7 16:33:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CC1465005F; Mon, 7 Jun 2021 16:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzJnw04bMz3RHq; Mon, 7 Jun 2021 16:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCCE318DD6; Mon, 7 Jun 2021 16:33:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157GX7ol004170; Mon, 7 Jun 2021 16:33:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157GX7pL004169; Mon, 7 Jun 2021 16:33:07 GMT (envelope-from git) Date: Mon, 7 Jun 2021 16:33:07 GMT Message-Id: <202106071633.157GX7pL004169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8c30192804eb - stable/13 - Add thread_reap_barrier() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c30192804eb91b2b976e92d0ca52fd034520062 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 16:33:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8c30192804eb91b2b976e92d0ca52fd034520062 commit 8c30192804eb91b2b976e92d0ca52fd034520062 Author: Konstantin Belousov AuthorDate: 2021-05-25 18:51:00 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-07 16:32:42 +0000 Add thread_reap_barrier() (cherry picked from commit f62c7e54e9cc692603081328597ba0ba0d1f21cf) (cherry picked from commit d3f7975fcb346ea28dde079a9c04cff5ef20a8d7) --- sys/kern/kern_thread.c | 29 +++++++++++++++++++++++++++++ sys/sys/proc.h | 1 + 2 files changed, 30 insertions(+) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 7370fd919203..48aac8e057b8 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -709,6 +709,35 @@ thread_reap_callout_cb(void *arg __unused) thread_reap_callout_cb, NULL); } +/* + * Calling this function guarantees that any thread that exited before + * the call is reaped when the function returns. By 'exited' we mean + * a thread removed from the process linkage with thread_unlink(). + * Practically this means that caller must lock/unlock corresponding + * process lock before the call, to synchronize with thread_exit(). + */ +void +thread_reap_barrier(void) +{ + struct task *t; + + /* + * First do context switches to each CPU to ensure that all + * PCPU pc_deadthreads are moved to zombie list. + */ + quiesce_all_cpus("", PDROP); + + /* + * Second, fire the task in the same thread as normal + * thread_reap() is done, to serialize reaping. + */ + t = malloc(sizeof(*t), M_TEMP, M_WAITOK); + TASK_INIT(t, 0, thread_reap_task_cb, t); + taskqueue_enqueue(taskqueue_thread, t); + taskqueue_drain(taskqueue_thread, t); + free(t, M_TEMP); +} + /* * Allocate a thread. */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 7a2210778a39..b0fc13a449cb 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1177,6 +1177,7 @@ int thread_create(struct thread *td, struct rtprio *rtp, void thread_exit(void) __dead2; void thread_free(struct thread *td); void thread_link(struct thread *td, struct proc *p); +void thread_reap_barrier(void); int thread_single(struct proc *p, int how); void thread_single_end(struct proc *p, int how); void thread_stash(struct thread *td); From owner-dev-commits-src-all@freebsd.org Mon Jun 7 20:47:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6ECBA653D03; Mon, 7 Jun 2021 20:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzQR61gDgz4Z0Q; Mon, 7 Jun 2021 20:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A6991C515; Mon, 7 Jun 2021 20:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157KlD02034944; Mon, 7 Jun 2021 20:47:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157KlDgD034943; Mon, 7 Jun 2021 20:47:13 GMT (envelope-from git) Date: Mon, 7 Jun 2021 20:47:13 GMT Message-Id: <202106072047.157KlDgD034943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 887c753c9f45 - main - Fix handling of D_GIANTOK MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 887c753c9f451322cae3efbf9b63f53f3d9011c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 20:47:14 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=887c753c9f451322cae3efbf9b63f53f3d9011c8 commit 887c753c9f451322cae3efbf9b63f53f3d9011c8 Author: Mark Johnston AuthorDate: 2021-06-07 18:25:26 +0000 Commit: Mark Johnston CommitDate: 2021-06-07 20:45:50 +0000 Fix handling of D_GIANTOK It was meant to suppress only the printf(), not the subsequent injection of Giant-protected thunks for various file operations. Fixes: fbeb4ccac9 Reported by: pho Tested by: pho MFC after: 6 days Pointy hat: markj --- sys/kern/kern_conf.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 42435c0b8740..cb575114571a 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -665,10 +665,13 @@ prep_cdevsw(struct cdevsw *devsw, int flags) devsw->d_kqfilter = dead_kqfilter; } - if ((devsw->d_flags & (D_NEEDGIANT | D_GIANTOK)) == D_NEEDGIANT) { - printf("WARNING: Device \"%s\" is Giant locked and may be " - "deleted before FreeBSD 14.0.\n", - devsw->d_name == NULL ? "???" : devsw->d_name); + if ((devsw->d_flags & D_NEEDGIANT) != 0) { + if ((devsw->d_flags & D_GIANTOK) == 0) { + printf( + "WARNING: Device \"%s\" is Giant locked and may be " + "deleted before FreeBSD 14.0.\n", + devsw->d_name == NULL ? "???" : devsw->d_name); + } if (devsw->d_gianttrick == NULL) { memcpy(dsw2, devsw, sizeof *dsw2); devsw->d_gianttrick = dsw2; From owner-dev-commits-src-all@freebsd.org Mon Jun 7 20:51:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F28FB653BA3; Mon, 7 Jun 2021 20:51:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzQXL5pY5z4ZJR; Mon, 7 Jun 2021 20:51:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF6E91C69B; Mon, 7 Jun 2021 20:51:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Kpk9Y044343; Mon, 7 Jun 2021 20:51:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Kpkfm044342; Mon, 7 Jun 2021 20:51:46 GMT (envelope-from git) Date: Mon, 7 Jun 2021 20:51:46 GMT Message-Id: <202106072051.157Kpkfm044342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 03c81af24920 - main - nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03c81af24920e14bd977f34edcd3eb7fb122db19 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 20:51:47 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=03c81af24920e14bd977f34edcd3eb7fb122db19 commit 03c81af24920e14bd977f34edcd3eb7fb122db19 Author: Rick Macklem AuthorDate: 2021-06-07 20:48:25 +0000 Commit: Rick Macklem CommitDate: 2021-06-07 20:48:25 +0000 nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems Pre-r318997 the code looked like: if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0]) vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0]; Doing this assignment got lost by r318997 and, as such, NFSv4 mounts of servers with trees of file systems on the server is broken, due to duplicate fileno values for the same st_dev/va_fsid. Although I could have re-introduced the assignment, since the value of na_filesid[0] is not guaranteed to be unique across the server file systems, I felt it was better to always do the hash for na_filesid[0,1]. Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash. There is a slight chance of a hash conflict where 2 different na_filesid values map to same va_fsid, which will be documented in the BUGS section of the man page for mount_nfs(8). Using a table to keep track of mappings to catch conflicts would not easily scale to 10,000+ server file systems and, when the conflict occurs, it only results in fts(3) reporting a "directory cycle" under certain circumstances. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30660 --- sys/fs/nfsclient/nfs_clport.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 4676f09f8e86..90d403334155 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -441,6 +441,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, struct nfsmount *nmp; struct timespec mtime_save; int error, force_fid_err; + dev_t topfsid; error = 0; @@ -504,28 +505,30 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, } /* - * For NFSv4, if the node's fsid is not equal to the mount point's - * fsid, return the low order 32bits of the node's fsid. This - * allows getcwd(3) to work. There is a chance that the fsid might - * be the same as a local fs, but since this is in an NFS mount - * point, I don't think that will cause any problems? + * For NFSv4, the server's export may be a tree of file systems + * where a fileno is a unique value within each file system. + * na_filesid[0,1] uniquely identify the server file system + * and nm_fsid[0,1] is the value for the root file system mounted. + * As such, the value of va_fsid generated by vn_fsid() represents + * the root file system on the server and a different value for + * va_fsid is needed for the other server file systems. This + * va_fsid is ideally unique for all of the server file systems, + * so a 64bit hash on na_filesid[0,1] is calculated. + * Although highly unlikely that the fnv_64_hash() will be + * the same as the root, test for this case and recalculate the hash. */ + vn_fsid(vp, vap); if (NFSHASNFSV4(nmp) && NFSHASHASSETFSID(nmp) && (nmp->nm_fsid[0] != np->n_vattr.na_filesid[0] || nmp->nm_fsid[1] != np->n_vattr.na_filesid[1])) { - /* - * va_fsid needs to be set to some value derived from - * np->n_vattr.na_filesid that is not equal - * vp->v_mount->mnt_stat.f_fsid[0], so that it changes - * from the value used for the top level server volume - * in the mounted subtree. - */ - vn_fsid(vp, vap); - if ((uint32_t)vap->va_fsid == np->n_vattr.na_filesid[0]) - vap->va_fsid = hash32_buf( - np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); - } else - vn_fsid(vp, vap); + topfsid = vap->va_fsid; + vap->va_fsid = FNV1_64_INIT; + do { + vap->va_fsid = fnv_64_buf(np->n_vattr.na_filesid, + sizeof(np->n_vattr.na_filesid), vap->va_fsid); + } while (vap->va_fsid == topfsid); + } + np->n_attrstamp = time_second; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { From owner-dev-commits-src-all@freebsd.org Mon Jun 7 22:52:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01F4265538D; Mon, 7 Jun 2021 22:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzTC45Hy6z4k2p; Mon, 7 Jun 2021 22:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F7331DF16; Mon, 7 Jun 2021 22:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Mq09E006750; Mon, 7 Jun 2021 22:52:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Mq0h2006749; Mon, 7 Jun 2021 22:52:00 GMT (envelope-from git) Date: Mon, 7 Jun 2021 22:52:00 GMT Message-Id: <202106072252.157Mq0h2006749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 225605ec1681 - main - Cirrus-CI: Use the default Git history depth MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 225605ec1681d5ac08b297aa4efbc64bcb950fc2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 22:52:01 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=225605ec1681d5ac08b297aa4efbc64bcb950fc2 commit 225605ec1681d5ac08b297aa4efbc64bcb950fc2 Author: Fedor Korotkov AuthorDate: 2021-01-29 14:22:54 +0000 Commit: Ed Maste CommitDate: 2021-06-07 22:50:18 +0000 Cirrus-CI: Use the default Git history depth Which is `50`. I saw a few errors like `Failed to force reset to SHA: object not found!` which seems is happening because the SHA is not available because there were two commits pushed almost simultaneously and the second from the top fails with this error because the SHA is not in the history. Pull Request: https://github.com/freebsd/freebsd-src/pull/454 Comments on re-commit from emaste: Originally committed as fcb4797c90f3 and reverted in 80a840b8ba03 due to the clone operation taking significantly longer. However, I have seen many failures due to the "object not found" issue recently. 7 of 37 recent runs failed because of this, and intermittent failures like this makes CI much less useful. Prefer longer-running runs to intermittent failures. --- .cirrus.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 823d8bc2e1b0..db0e4e4c0543 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -10,9 +10,6 @@ compute_engine_instance: memory: 24G disk: 40 -env: - CIRRUS_CLONE_DEPTH: 1 - task: name: World and kernel amd64 build and boot smoke test timeout_in: 120m From owner-dev-commits-src-all@freebsd.org Mon Jun 7 22:53:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82F4465549D; Mon, 7 Jun 2021 22:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzTDY27PYz4k3Q; Mon, 7 Jun 2021 22:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 328221DF54; Mon, 7 Jun 2021 22:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157MrHRP006971; Mon, 7 Jun 2021 22:53:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157MrH2k006970; Mon, 7 Jun 2021 22:53:17 GMT (envelope-from git) Date: Mon, 7 Jun 2021 22:53:17 GMT Message-Id: <202106072253.157MrH2k006970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: 096104e790fb - main - linuxkpi: Add rom and romlen to struct pci_dev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 096104e790fb182d230f25f169792cc610b8f41c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 22:53:17 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=096104e790fb182d230f25f169792cc610b8f41c commit 096104e790fb182d230f25f169792cc610b8f41c Author: Neel Chauhan AuthorDate: 2021-06-07 22:50:46 +0000 Commit: Neel Chauhan CommitDate: 2021-06-07 22:53:24 +0000 linuxkpi: Add rom and romlen to struct pci_dev Approved by: bz (src), hselasky (src) Differential Reivison: https://reviews.freebsd.org/D30686 --- sys/compat/linuxkpi/common/include/linux/pci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index f1b928b792fa..36a82e81b4bc 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -230,6 +230,8 @@ struct pci_dev { uint32_t class; uint8_t revision; bool msi_enabled; + phys_addr_t rom; + size_t romlen; TAILQ_HEAD(, pci_mmio_region) mmio; }; From owner-dev-commits-src-all@freebsd.org Mon Jun 7 22:53:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CC8F655522; Mon, 7 Jun 2021 22:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzTDZ3F73z4kDt; Mon, 7 Jun 2021 22:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55A171DE5F; Mon, 7 Jun 2021 22:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157MrISV006994; Mon, 7 Jun 2021 22:53:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157MrItr006993; Mon, 7 Jun 2021 22:53:18 GMT (envelope-from git) Date: Mon, 7 Jun 2021 22:53:18 GMT Message-Id: <202106072253.157MrItr006993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: 37d64dcdfa51 - main - linuxkpi: Include pr_err_once() in printk.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37d64dcdfa519157aff9711f1f226ad7bd778f46 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 22:53:18 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=37d64dcdfa519157aff9711f1f226ad7bd778f46 commit 37d64dcdfa519157aff9711f1f226ad7bd778f46 Author: Neel Chauhan AuthorDate: 2021-06-07 22:52:37 +0000 Commit: Neel Chauhan CommitDate: 2021-06-07 22:53:24 +0000 linuxkpi: Include pr_err_once() in printk.h Approved by: bz (src), hselasky (src) Differential Reivison: https://reviews.freebsd.org/D30687 --- sys/compat/linuxkpi/common/include/linux/printk.h | 3 +++ sys/sys/param.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/printk.h b/sys/compat/linuxkpi/common/include/linux/printk.h index e6510e9e9834..ac3fdb9f31ae 100644 --- a/sys/compat/linuxkpi/common/include/linux/printk.h +++ b/sys/compat/linuxkpi/common/include/linux/printk.h @@ -127,4 +127,7 @@ print_hex_dump_bytes(const char *prefix_str, const int prefix_type, #define pr_info_ratelimited(fmt, ...) \ printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_err_once(fmt, ...) \ + printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) + #endif /* _LINUX_PRINTK_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index c63452973daf..d3a6fae783d4 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400018 +#define __FreeBSD_version 1400019 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Mon Jun 7 23:37:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BCDD655BB7; Mon, 7 Jun 2021 23:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzVC91rxJz4m0T; Mon, 7 Jun 2021 23:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C111E469; Mon, 7 Jun 2021 23:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157Nb9ID060172; Mon, 7 Jun 2021 23:37:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157Nb9vU060171; Mon, 7 Jun 2021 23:37:09 GMT (envelope-from git) Date: Mon, 7 Jun 2021 23:37:09 GMT Message-Id: <202106072337.157Nb9vU060171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 68d6663afbae - stable/13 - This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 68d6663afbae7e49e04bcabc1662df5db3edd738 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 23:37:09 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=68d6663afbae7e49e04bcabc1662df5db3edd738 commit 68d6663afbae7e49e04bcabc1662df5db3edd738 Author: Randall Stewart AuthorDate: 2021-01-26 16:54:42 +0000 Commit: Michael Tuexen CommitDate: 2021-06-07 23:18:32 +0000 This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D28357 (cherry picked from commit 1a714ff204193b9eb810426048e03f5d76e9730e) --- sys/net/if_lagg.c | 11 + sys/net/if_var.h | 2 + sys/net/if_vlan.c | 30 +++ sys/netinet/in_pcb.c | 9 + sys/netinet/tcp_log_buf.h | 2 +- sys/netinet/tcp_ratelimit.c | 584 +++++++++++++++++++++++++++--------------- sys/netinet/tcp_ratelimit.h | 24 +- sys/netinet/tcp_stacks/bbr.c | 4 +- sys/netinet/tcp_stacks/rack.c | 14 +- 9 files changed, 464 insertions(+), 216 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 3144f86901b2..9a3c22789fa5 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -151,6 +151,7 @@ static int lagg_snd_tag_modify(struct m_snd_tag *, static int lagg_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); static void lagg_snd_tag_free(struct m_snd_tag *); +static struct m_snd_tag *lagg_next_snd_tag(struct m_snd_tag *); static void lagg_ratelimit_query(struct ifnet *, struct if_ratelimit_query_results *); #endif @@ -585,6 +586,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) ifp->if_snd_tag_modify = lagg_snd_tag_modify; ifp->if_snd_tag_query = lagg_snd_tag_query; ifp->if_snd_tag_free = lagg_snd_tag_free; + ifp->if_next_snd_tag = lagg_next_snd_tag; ifp->if_ratelimit_query = lagg_ratelimit_query; #endif ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; @@ -1834,6 +1836,15 @@ lagg_snd_tag_alloc(struct ifnet *ifp, return (0); } +static struct m_snd_tag * +lagg_next_snd_tag(struct m_snd_tag *mst) +{ + struct lagg_snd_tag *lst; + + lst = mst_to_lst(mst); + return (lst->tag); +} + static int lagg_snd_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index bb364fd10974..291a7781d73c 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -278,6 +278,7 @@ typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params * typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); typedef void (if_snd_tag_free_t)(struct m_snd_tag *); +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); typedef void (if_ratelimit_query_t)(struct ifnet *, struct if_ratelimit_query_results *); typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t); @@ -422,6 +423,7 @@ struct ifnet { if_snd_tag_modify_t *if_snd_tag_modify; if_snd_tag_query_t *if_snd_tag_query; if_snd_tag_free_t *if_snd_tag_free; + if_next_send_tag_t *if_next_snd_tag; if_ratelimit_query_t *if_ratelimit_query; if_ratelimit_setup_t *if_ratelimit_setup; diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 40b042b56248..bd3a5335a97f 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -295,6 +295,9 @@ static int vlan_snd_tag_modify(struct m_snd_tag *, static int vlan_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); static void vlan_snd_tag_free(struct m_snd_tag *); +static struct m_snd_tag *vlan_next_snd_tag(struct m_snd_tag *); +static void vlan_ratelimit_query(struct ifnet *, + struct if_ratelimit_query_results *); #endif static void vlan_qflush(struct ifnet *ifp); static int vlan_setflag(struct ifnet *ifp, int flag, int status, @@ -1099,6 +1102,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifp->if_snd_tag_modify = vlan_snd_tag_modify; ifp->if_snd_tag_query = vlan_snd_tag_query; ifp->if_snd_tag_free = vlan_snd_tag_free; + ifp->if_next_snd_tag = vlan_next_snd_tag; + ifp->if_ratelimit_query = vlan_ratelimit_query; #endif ifp->if_flags = VLAN_IFFLAGS; ether_ifattach(ifp, eaddr); @@ -2108,6 +2113,15 @@ vlan_snd_tag_alloc(struct ifnet *ifp, return (0); } +static struct m_snd_tag * +vlan_next_snd_tag(struct m_snd_tag *mst) +{ + struct vlan_snd_tag *vst; + + vst = mst_to_vst(mst); + return (vst->tag); +} + static int vlan_snd_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) @@ -2137,4 +2151,20 @@ vlan_snd_tag_free(struct m_snd_tag *mst) m_snd_tag_rele(vst->tag); free(vst, M_VLAN); } + +static void +vlan_ratelimit_query(struct ifnet *ifp __unused, struct if_ratelimit_query_results *q) +{ + /* + * For vlan, we have an indirect + * interface. The caller needs to + * get a ratelimit tag on the actual + * interface the flow will go on. + */ + q->rate_table = NULL; + q->flags = RT_IS_INDIRECT; + q->max_flows = 0; + q->number_of_rates = 0; +} + #endif diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 857119e8213b..8b109bce9dff 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -224,6 +224,8 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, "allocation before switching to a random one"); #ifdef RATELIMIT +counter_u64_t rate_limit_new; +counter_u64_t rate_limit_chg; counter_u64_t rate_limit_active; counter_u64_t rate_limit_alloc_fail; counter_u64_t rate_limit_set_ok; @@ -236,6 +238,11 @@ SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, alloc_fail, CTLFLAG_RD, &rate_limit_alloc_fail, "Rate limited connection failures"); SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, set_ok, CTLFLAG_RD, &rate_limit_set_ok, "Rate limited setting succeeded"); +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, newrl, CTLFLAG_RD, + &rate_limit_new, "Total Rate limit new attempts"); +SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, chgrl, CTLFLAG_RD, + &rate_limit_chg, "Total Rate limited change attempts"); + #endif /* RATELIMIT */ #endif /* INET */ @@ -3591,6 +3598,8 @@ in_pcboutput_eagain(struct inpcb *inp) static void rl_init(void *st) { + rate_limit_new = counter_u64_alloc(M_WAITOK); + rate_limit_chg = counter_u64_alloc(M_WAITOK); rate_limit_active = counter_u64_alloc(M_WAITOK); rate_limit_alloc_fail = counter_u64_alloc(M_WAITOK); rate_limit_set_ok = counter_u64_alloc(M_WAITOK); diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 0d9b14a08f53..436383124dce 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -221,7 +221,7 @@ enum tcp_log_events { BBR_LOG_SETTINGS_CHG, /* Settings changed for loss response 48 */ BBR_LOG_SRTT_GAIN_EVENT, /* SRTT gaining -- now not used 49 */ TCP_LOG_REASS, /* Reassembly buffer logging 50 */ - TCP_HDWR_TLS, /* TCP Hardware TLS logs 51 */ + TCP_HDWR_PACE_SIZE, /* TCP pacing size set (rl and rack uses this) 51 */ BBR_LOG_HDWR_PACE, /* TCP Hardware pacing log 52 */ BBR_LOG_TSTMP_VAL, /* Temp debug timestamp validation 53 */ TCP_LOG_CONNEND, /* End of connection 54 */ diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index 97f066be69e0..aeb1ed6906b5 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #endif +#include +#include #include #ifndef USECS_IN_SECOND #define USECS_IN_SECOND 1000000 @@ -154,108 +156,77 @@ const uint64_t desired_rates[] = { 180500, /* 1.44Mpbs - rate 2 common rate */ 375000, /* 3Mbps - rate 3 */ 625000, /* 5Mbps - rate 4 */ - 875000, /* 7Mbps - rate 5 */ - 1125000, /* 9Mbps - rate 6 */ - 1375000, /* 11Mbps - rate 7 */ - 1625000, /* 13Mbps - rate 8 */ - 2625000, /* 21Mbps - rate 9 */ - 3875000, /* 31Mbps - rate 10 */ - 5125000, /* 41Meg - rate 11 */ - 12500000, /* 100Mbps - rate 12 */ - 25000000, /* 200Mbps - rate 13 */ - 50000000, /* 400Mbps - rate 14 */ - 63750000, /* 51Mbps - rate 15 */ + 1250000, /* 10Mbps - rate 5 */ + 1875000, /* 15Mbps - rate 6 */ + 2500000, /* 20Mbps - rate 7 */ + 3125000, /* 25Mbps - rate 8 */ + 3750000, /* 30Mbps - rate 9 */ + 4375000, /* 35Mbps - rate 10 */ + 5000000, /* 40Meg - rate 11 */ + 6250000, /* 50Mbps - rate 12 */ + 12500000, /* 100Mbps - rate 13 */ + 25000000, /* 200Mbps - rate 14 */ + 50000000, /* 400Mbps - rate 15 */ 100000000, /* 800Mbps - rate 16 */ - 1875000, /* 15Mbps - rate 17 */ - 2125000, /* 17Mbps - rate 18 */ - 2375000, /* 19Mbps - rate 19 */ - 2875000, /* 23Mbps - rate 20 */ - 3125000, /* 25Mbps - rate 21 */ - 3375000, /* 27Mbps - rate 22 */ - 3625000, /* 29Mbps - rate 23 */ - 4125000, /* 33Mbps - rate 24 */ - 4375000, /* 35Mbps - rate 25 */ - 4625000, /* 37Mbps - rate 26 */ - 4875000, /* 39Mbps - rate 27 */ - 5375000, /* 43Mbps - rate 28 */ - 5625000, /* 45Mbps - rate 29 */ - 5875000, /* 47Mbps - rate 30 */ - 6125000, /* 49Mbps - rate 31 */ - 6625000, /* 53Mbps - rate 32 */ - 6875000, /* 55Mbps - rate 33 */ - 7125000, /* 57Mbps - rate 34 */ - 7375000, /* 59Mbps - rate 35 */ - 7625000, /* 61Mbps - rate 36 */ - 7875000, /* 63Mbps - rate 37 */ - 8125000, /* 65Mbps - rate 38 */ - 8375000, /* 67Mbps - rate 39 */ - 8625000, /* 69Mbps - rate 40 */ - 8875000, /* 71Mbps - rate 41 */ - 9125000, /* 73Mbps - rate 42 */ - 9375000, /* 75Mbps - rate 43 */ - 9625000, /* 77Mbps - rate 44 */ - 9875000, /* 79Mbps - rate 45 */ - 10125000, /* 81Mbps - rate 46 */ - 10375000, /* 83Mbps - rate 47 */ - 10625000, /* 85Mbps - rate 48 */ - 10875000, /* 87Mbps - rate 49 */ - 11125000, /* 89Mbps - rate 50 */ - 11375000, /* 91Mbps - rate 51 */ - 11625000, /* 93Mbps - rate 52 */ - 11875000, /* 95Mbps - rate 53 */ - 13125000, /* 105Mbps - rate 54 */ - 13750000, /* 110Mbps - rate 55 */ - 14375000, /* 115Mbps - rate 56 */ - 15000000, /* 120Mbps - rate 57 */ - 15625000, /* 125Mbps - rate 58 */ - 16250000, /* 130Mbps - rate 59 */ - 16875000, /* 135Mbps - rate 60 */ - 17500000, /* 140Mbps - rate 61 */ - 18125000, /* 145Mbps - rate 62 */ - 18750000, /* 150Mbps - rate 64 */ - 20000000, /* 160Mbps - rate 65 */ - 21250000, /* 170Mbps - rate 66 */ - 22500000, /* 180Mbps - rate 67 */ - 23750000, /* 190Mbps - rate 68 */ - 26250000, /* 210Mbps - rate 69 */ - 27500000, /* 220Mbps - rate 70 */ - 28750000, /* 230Mbps - rate 71 */ - 30000000, /* 240Mbps - rate 72 */ - 31250000, /* 250Mbps - rate 73 */ - 34375000, /* 275Mbps - rate 74 */ - 37500000, /* 300Mbps - rate 75 */ - 40625000, /* 325Mbps - rate 76 */ - 43750000, /* 350Mbps - rate 77 */ - 46875000, /* 375Mbps - rate 78 */ - 53125000, /* 425Mbps - rate 79 */ - 56250000, /* 450Mbps - rate 80 */ - 59375000, /* 475Mbps - rate 81 */ - 62500000, /* 500Mbps - rate 82 */ - 68750000, /* 550Mbps - rate 83 */ - 75000000, /* 600Mbps - rate 84 */ - 81250000, /* 650Mbps - rate 85 */ - 87500000, /* 700Mbps - rate 86 */ - 93750000, /* 750Mbps - rate 87 */ - 106250000, /* 850Mbps - rate 88 */ - 112500000, /* 900Mbps - rate 89 */ - 125000000, /* 1Gbps - rate 90 */ - 156250000, /* 1.25Gps - rate 91 */ - 187500000, /* 1.5Gps - rate 92 */ - 218750000, /* 1.75Gps - rate 93 */ - 250000000, /* 2Gbps - rate 94 */ - 281250000, /* 2.25Gps - rate 95 */ - 312500000, /* 2.5Gbps - rate 96 */ - 343750000, /* 2.75Gbps - rate 97 */ - 375000000, /* 3Gbps - rate 98 */ - 500000000, /* 4Gbps - rate 99 */ - 625000000, /* 5Gbps - rate 100 */ - 750000000, /* 6Gbps - rate 101 */ - 875000000, /* 7Gbps - rate 102 */ - 1000000000, /* 8Gbps - rate 103 */ - 1125000000, /* 9Gbps - rate 104 */ - 1250000000, /* 10Gbps - rate 105 */ - 1875000000, /* 15Gbps - rate 106 */ - 2500000000 /* 20Gbps - rate 107 */ + 5625000, /* 45Mbps - rate 17 */ + 6875000, /* 55Mbps - rate 19 */ + 7500000, /* 60Mbps - rate 20 */ + 8125000, /* 65Mbps - rate 21 */ + 8750000, /* 70Mbps - rate 22 */ + 9375000, /* 75Mbps - rate 23 */ + 10000000, /* 80Mbps - rate 24 */ + 10625000, /* 85Mbps - rate 25 */ + 11250000, /* 90Mbps - rate 26 */ + 11875000, /* 95Mbps - rate 27 */ + 12500000, /* 100Mbps - rate 28 */ + 13750000, /* 110Mbps - rate 29 */ + 15000000, /* 120Mbps - rate 30 */ + 16250000, /* 130Mbps - rate 31 */ + 17500000, /* 140Mbps - rate 32 */ + 18750000, /* 150Mbps - rate 33 */ + 20000000, /* 160Mbps - rate 34 */ + 21250000, /* 170Mbps - rate 35 */ + 22500000, /* 180Mbps - rate 36 */ + 23750000, /* 190Mbps - rate 37 */ + 26250000, /* 210Mbps - rate 38 */ + 27500000, /* 220Mbps - rate 39 */ + 28750000, /* 230Mbps - rate 40 */ + 30000000, /* 240Mbps - rate 41 */ + 31250000, /* 250Mbps - rate 42 */ + 34375000, /* 275Mbps - rate 43 */ + 37500000, /* 300Mbps - rate 44 */ + 40625000, /* 325Mbps - rate 45 */ + 43750000, /* 350Mbps - rate 46 */ + 46875000, /* 375Mbps - rate 47 */ + 53125000, /* 425Mbps - rate 48 */ + 56250000, /* 450Mbps - rate 49 */ + 59375000, /* 475Mbps - rate 50 */ + 62500000, /* 500Mbps - rate 51 */ + 68750000, /* 550Mbps - rate 52 */ + 75000000, /* 600Mbps - rate 53 */ + 81250000, /* 650Mbps - rate 54 */ + 87500000, /* 700Mbps - rate 55 */ + 93750000, /* 750Mbps - rate 56 */ + 106250000, /* 850Mbps - rate 57 */ + 112500000, /* 900Mbps - rate 58 */ + 125000000, /* 1Gbps - rate 59 */ + 156250000, /* 1.25Gps - rate 60 */ + 187500000, /* 1.5Gps - rate 61 */ + 218750000, /* 1.75Gps - rate 62 */ + 250000000, /* 2Gbps - rate 63 */ + 281250000, /* 2.25Gps - rate 64 */ + 312500000, /* 2.5Gbps - rate 65 */ + 343750000, /* 2.75Gbps - rate 66 */ + 375000000, /* 3Gbps - rate 67 */ + 500000000, /* 4Gbps - rate 68 */ + 625000000, /* 5Gbps - rate 69 */ + 750000000, /* 6Gbps - rate 70 */ + 875000000, /* 7Gbps - rate 71 */ + 1000000000, /* 8Gbps - rate 72 */ + 1125000000, /* 9Gbps - rate 73 */ + 1250000000, /* 10Gbps - rate 74 */ + 1875000000, /* 15Gbps - rate 75 */ + 2500000000 /* 20Gbps - rate 76 */ }; #define MAX_HDWR_RATES (sizeof(desired_rates)/sizeof(uint64_t)) @@ -283,6 +254,10 @@ static struct head_tcp_rate_set int_rs; static struct mtx rs_mtx; uint32_t rs_number_alive; uint32_t rs_number_dead; +static uint32_t rs_floor_mss = 0; +static uint32_t wait_time_floor = 8000; /* 8 ms */ +static uint32_t rs_hw_floor_mss = 16; +static uint32_t num_of_waits_allowed = 1; /* How many time blocks are we willing to wait */ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Ratelimit stats"); @@ -292,6 +267,20 @@ SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, CTLFLAG_RW, SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, dead, CTLFLAG_RW, &rs_number_dead, 0, "Number of interfaces departing from ratelimiting"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, floor_mss, CTLFLAG_RW, + &rs_floor_mss, 0, + "Number of MSS that will override the normal minimums (0 means don't enforce)"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, wait_floor, CTLFLAG_RW, + &wait_time_floor, 2000, + "Has b/w increases what is the wait floor we are willing to wait at the end?"); +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, time_blocks, CTLFLAG_RW, + &num_of_waits_allowed, 1, + "How many time blocks on the end should software pacing be willing to wait?"); + +SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, hw_floor_mss, CTLFLAG_RW, + &rs_hw_floor_mss, 16, + "Number of mss that are a minum for hardware pacing?"); + static void rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) @@ -383,6 +372,17 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); + SYSCTL_ADD_U64(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "using", CTLFLAG_RD, + &rs->rs_rlt[i].using, 0, + "Number of flows using"); + SYSCTL_ADD_U64(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "enobufs", CTLFLAG_RD, + &rs->rs_rlt[i].rs_num_enobufs, 0, + "Number of enobufs logged on this rate"); + } } #endif @@ -443,6 +443,8 @@ rs_defer_destroy(struct tcp_rate_set *rs) } #ifdef INET +extern counter_u64_t rate_limit_new; +extern counter_u64_t rate_limit_chg; extern counter_u64_t rate_limit_set_ok; extern counter_u64_t rate_limit_active; extern counter_u64_t rate_limit_alloc_fail; @@ -519,6 +521,7 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) int i; struct if_ratelimit_query_results rl; struct sysctl_oid *rl_sysctl_root; + struct epoch_tracker et; /* * We expect to enter with the * mutex locked. @@ -562,9 +565,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } else if ((rl.flags & RT_IS_INDIRECT) == RT_IS_INDIRECT) { memset(rs, 0, sizeof(struct tcp_rate_set)); @@ -580,9 +585,11 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } else if ((rl.flags & RT_IS_FIXED_TABLE) == RT_IS_FIXED_TABLE) { /* Mellanox C4 likely */ @@ -671,6 +678,8 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; + rs->rs_rlt[i].using = 0; + rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -741,18 +750,24 @@ handle_err: CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_INSERT_HEAD(&int_rs, rs, next); mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); return (rs); } +/* + * For an explanation of why the argument is volatile please + * look at the comments around rt_setup_rate(). + */ static const struct tcp_hwrate_limit_table * -tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, - uint64_t bytes_per_sec, uint32_t flags) +tcp_int_find_suitable_rate(const volatile struct tcp_rate_set *rs, + uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) { struct tcp_hwrate_limit_table *arte = NULL, *rte = NULL; - uint64_t mbits_per_sec, ind_calc; + uint64_t mbits_per_sec, ind_calc, previous_rate = 0; int i; mbits_per_sec = (bytes_per_sec * 8); @@ -763,6 +778,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, * Smaller than 1Meg, only * 3 entries can match it. */ + previous_rate = 0; for(i = rs->rs_lowest_valid; i < 3; i++) { if (bytes_per_sec <= rs->rs_rlt[i].rate) { rte = &rs->rs_rlt[i]; @@ -770,6 +786,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, } else if (rs->rs_rlt[i].flags & HDWRPACE_INITED) { arte = &rs->rs_rlt[i]; } + previous_rate = rs->rs_rlt[i].rate; } goto done; } else if ((mbits_per_sec > RS_ONE_GIGABIT_PERSEC) && @@ -782,6 +799,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, rte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; else arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; goto done; } /* @@ -800,8 +818,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, ind_calc = ALL_HARDWARE_RATES-1; } if ((ind_calc >= rs->rs_lowest_valid) && - (ind_calc <= rs->rs_highest_valid)) - rte = &rs->rs_rlt[ind_calc]; + (ind_calc <= rs->rs_highest_valid)) { + rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; + } } else if (flags & RS_PACING_EXACT_MATCH) { if ((mbits_per_sec < RS_ONE_MEGABIT_PERSEC) && (rs->rs_lowest_valid <= 2)){ @@ -840,10 +861,16 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, for (i=2; i>=rs->rs_lowest_valid; i--) { if (bytes_per_sec < rs->rs_rlt[i].rate) { rte = &rs->rs_rlt[i]; + if (i >= 1) { + previous_rate = rs->rs_rlt[(i-1)].rate; + } break; } else if ((flags & RS_PACING_GEQ) && (bytes_per_sec == rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; + if (i >= 1) { + previous_rate = rs->rs_rlt[(i-1)].rate; + } break; } else { arte = &rs->rs_rlt[i]; /* new alternate */ @@ -863,6 +890,7 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, /* The top rate is an alternative */ arte = &rs->rs_rlt[(ALL_HARDWARE_RATES-1)]; } + previous_rate = rs->rs_rlt[(ALL_HARDWARE_RATES-2)].rate; } else { /* Its in our range 1Meg - 1Gig */ if (flags & RS_PACING_GEQ) { @@ -873,6 +901,8 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, ind_calc = (ALL_HARDWARE_RATES-1); } rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; } goto done; } @@ -882,8 +912,11 @@ tcp_int_find_suitable_rate(const struct tcp_rate_set *rs, /* This should not happen */ ind_calc = ALL_HARDWARE_RATES-1; } - if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) + if (rs->rs_rlt[ind_calc].flags & HDWRPACE_INITED) { rte = &rs->rs_rlt[ind_calc]; + if (ind_calc >= 1) + previous_rate = rs->rs_rlt[(ind_calc-1)].rate; + } } } done: @@ -893,11 +926,17 @@ done: /* We can use the substitute */ rte = arte; } + if (lower_rate) + *lower_rate = previous_rate; return (rte); } +/* + * For an explanation of why the argument is volatile please + * look at the comments around rt_setup_rate(). + */ static const struct tcp_hwrate_limit_table * -tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, uint32_t flags) +tcp_find_suitable_rate(const volatile struct tcp_rate_set *rs, uint64_t bytes_per_sec, uint32_t flags, uint64_t *lower_rate) { /** * Hunt the rate table with the restrictions in flags and find a @@ -911,6 +950,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui */ int i, matched; struct tcp_hwrate_limit_table *rte = NULL; + uint64_t previous_rate = 0; if ((rs->rs_flags & RS_INT_TBL) && (rs->rs_rate_cnt >= ALL_HARDWARE_RATES)) { @@ -920,7 +960,7 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui * from 1Meg - 1000Meg in 1Meg increments. * Use an alternate method to "lookup". */ - return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags)); + return (tcp_int_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate)); } if ((flags & RS_PACING_LT) || (flags & RS_PACING_EXACT_MATCH)) { @@ -934,13 +974,18 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui (bytes_per_sec == rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; matched = 1; + if (lower_rate != NULL) + *lower_rate = previous_rate; break; } else if ((flags & RS_PACING_LT) && (bytes_per_sec <= rs->rs_rlt[i].rate)) { rte = &rs->rs_rlt[i]; matched = 1; + if (lower_rate != NULL) + *lower_rate = previous_rate; break; } + previous_rate = rs->rs_rlt[i].rate; if (bytes_per_sec > rs->rs_rlt[i].rate) break; } @@ -979,6 +1024,8 @@ tcp_find_suitable_rate(const struct tcp_rate_set *rs, uint64_t bytes_per_sec, ui * We found a table entry that is smaller, * stop there will be none greater or equal. */ + if (lower_rate != NULL) + *lower_rate = rs->rs_rlt[i].rate; break; } } @@ -995,10 +1042,10 @@ static struct ifnet * rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) { struct ifnet *tifp; - struct m_snd_tag *tag; + struct m_snd_tag *tag, *ntag; union if_snd_tag_alloc_params params = { .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, - .rate_limit.hdr.flowid = 1, + .rate_limit.hdr.flowid = inp->inp_flowid, .rate_limit.hdr.numa_domain = inp->inp_numa_domain, .rate_limit.max_rate = COMMON_RATE, .rate_limit.flags = M_NOWAIT, @@ -1017,38 +1064,92 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) *error = err; return (NULL); } - tifp = tag->ifp; + ntag = tag; + while(ntag->ifp->if_next_snd_tag != NULL) { + ntag = ntag->ifp->if_next_snd_tag(ntag); + } + tifp = ntag->ifp; m_snd_tag_rele(tag); return (tifp); } +static void +rl_increment_using(const struct tcp_hwrate_limit_table *rte) +{ + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->using, 1); +} + +static void +rl_decrement_using(const struct tcp_hwrate_limit_table *rte) +{ + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_subtract_long(&decon_rte->using, 1); +} + +void +tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) +{ + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->rs_num_enobufs, 1); +} + +/* + * Do NOT take the __noinline out of the + * find_rs_for_ifp() function. If you do the inline + * of it for the rt_setup_rate() will show you a + * compiler bug. For some reason the compiler thinks + * the list can never be empty. The consequence of + * this will be a crash when we dereference NULL + * if an ifp is removed just has a hw rate limit + * is attempted. If you are working on the compiler + * and want to "test" this go ahead and take the noinline + * out otherwise let sleeping dogs ly until such time + * as we get a compiler fix 10/2/20 -- RRS + */ +static __noinline struct tcp_rate_set * +find_rs_for_ifp(struct ifnet *ifp) +{ + struct tcp_rate_set *rs; + + CK_LIST_FOREACH(rs, &int_rs, next) { + if ((rs->rs_ifp == ifp) && + (rs->rs_if_dunit == ifp->if_dunit)) { + /* Ok we found it */ + return (rs); + } + } + return (NULL); +} + + static const struct tcp_hwrate_limit_table * rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t bytes_per_sec, - uint32_t flags, int *error) + uint32_t flags, int *error, uint64_t *lower_rate) { /* First lets find the interface if it exists */ const struct tcp_hwrate_limit_table *rte; - struct tcp_rate_set *rs; + /* + * So why is rs volatile? This is to defeat a + * compiler bug where in the compiler is convinced + * that rs can never be NULL (which is not true). Because + * of its conviction it nicely optimizes out the if ((rs == NULL + * below which means if you get a NULL back you dereference it. + */ + volatile struct tcp_rate_set *rs; struct epoch_tracker et; + struct ifnet *oifp = ifp; int err; NET_EPOCH_ENTER(et); use_real_interface: - CK_LIST_FOREACH(rs, &int_rs, next) { - /* - * Note we don't look with the lock since we either see a - * new entry or will get one when we try to add it. - */ - if (rs->rs_flags & RS_IS_DEAD) { - /* The dead are not looked at */ - continue; - } - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - /* Ok we found it */ - break; - } - } + rs = find_rs_for_ifp(ifp); if ((rs == NULL) || (rs->rs_flags & RS_INTF_NO_SUP) || (rs->rs_flags & RS_IS_DEAD)) { @@ -1063,14 +1164,14 @@ use_real_interface: * might be arguable, but its impossible * to tell from the departing case. */ - if (rs->rs_disable && error) + if (error) *error = ENODEV; NET_EPOCH_EXIT(et); return (NULL); } if ((rs == NULL) || (rs->rs_disable != 0)) { - if (rs->rs_disable && error) + if (error) *error = ENOSPC; NET_EPOCH_EXIT(et); return (NULL); @@ -1086,6 +1187,10 @@ use_real_interface: NET_EPOCH_EXIT(et); return (NULL); } + KASSERT((tifp != ifp), + ("Lookup failure ifp:%p inp:%p rt_find_real_interface() returns the same interface tifp:%p?\n", + ifp, inp, tifp)); + ifp = tifp; goto use_real_interface; } if (rs->rs_flow_limit && @@ -1095,9 +1200,9 @@ use_real_interface: NET_EPOCH_EXIT(et); return (NULL); } - rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags); + rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags, lower_rate); if (rte) { - err = in_pcbattach_txrtlmt(inp, rs->rs_ifp, + err = in_pcbattach_txrtlmt(inp, oifp, inp->inp_flowtype, inp->inp_flowid, rte->rate, @@ -1107,6 +1212,11 @@ use_real_interface: if (error) *error = err; rte = NULL; + } else { + KASSERT((inp->inp_snd_tag != NULL) , + ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", + inp, rte, rte->rate, rs)); + counter_u64_add(rate_limit_new, 1); } } if (rte) { @@ -1125,6 +1235,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state) { int error; struct tcp_rate_set *rs; + struct epoch_tracker et; if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || (link_state != LINK_STATE_UP)) { @@ -1134,53 +1245,56 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state) */ return; } + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); - CK_LIST_FOREACH(rs, &int_rs, next) { - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - /* We already have initialized this guy */ - mtx_unlock(&rs_mtx); - return; - } + rs = find_rs_for_ifp(ifp); + if (rs) { + /* We already have initialized this guy */ + mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); + return; } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); rt_setup_new_rs(ifp, &error); } static void tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) { - struct tcp_rate_set *rs, *nrs; + struct tcp_rate_set *rs; + struct epoch_tracker et; int i; + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); - CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { - if ((rs->rs_ifp == ifp) && - (rs->rs_if_dunit == ifp->if_dunit)) { - CK_LIST_REMOVE(rs, next); - rs_number_alive--; - rs->rs_flags |= RS_IS_DEAD; - for (i = 0; i < rs->rs_rate_cnt; i++) { - if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { - in_pcbdetach_tag(rs->rs_rlt[i].tag); - rs->rs_rlt[i].tag = NULL; - } - rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; + rs = find_rs_for_ifp(ifp); + if (rs) { + CK_LIST_REMOVE(rs, next); + rs_number_alive--; + rs->rs_flags |= RS_IS_DEAD; + for (i = 0; i < rs->rs_rate_cnt; i++) { + if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) { + in_pcbdetach_tag(rs->rs_rlt[i].tag); + rs->rs_rlt[i].tag = NULL; } - if (rs->rs_flows_using == 0) - rs_defer_destroy(rs); - break; + rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED; } + if (rs->rs_flows_using == 0) + rs_defer_destroy(rs); } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); } static void tcp_rl_shutdown(void *arg __unused, int howto __unused) { struct tcp_rate_set *rs, *nrs; + struct epoch_tracker et; int i; + NET_EPOCH_ENTER(et); mtx_lock(&rs_mtx); CK_LIST_FOREACH_SAFE(rs, &int_rs, next, nrs) { CK_LIST_REMOVE(rs, next); @@ -1197,11 +1311,12 @@ tcp_rl_shutdown(void *arg __unused, int howto __unused) rs_defer_destroy(rs); } mtx_unlock(&rs_mtx); + NET_EPOCH_EXIT(et); } const struct tcp_hwrate_limit_table * tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, - uint64_t bytes_per_sec, int flags, int *error) + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) { const struct tcp_hwrate_limit_table *rte; #ifdef KERN_TLS @@ -1233,7 +1348,9 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, } } #endif - rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error); + rte = rt_setup_rate(tp->t_inpcb, ifp, bytes_per_sec, flags, error, lower_rate); + if (rte) + rl_increment_using(rte); #ifdef KERN_TLS if (rte != NULL && tls != NULL && tls->snd_tag != NULL) { /* @@ -1253,22 +1370,23 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *ifp, *error = EINVAL; rte = NULL; } - tp->t_pacing_rate = rte->rate; - *error = 0; + if (rte != NULL) { + tp->t_pacing_rate = rte->rate; + *error = 0; + } return (rte); } const struct tcp_hwrate_limit_table * tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, struct tcpcb *tp, struct ifnet *ifp, - uint64_t bytes_per_sec, int flags, int *error) + uint64_t bytes_per_sec, int flags, int *error, uint64_t *lower_rate) { const struct tcp_hwrate_limit_table *nrte; const struct tcp_rate_set *rs; #ifdef KERN_TLS struct ktls_session *tls = NULL; #endif - int is_indirect = 0; int err; INP_WLOCK_ASSERT(tp->t_inpcb); @@ -1307,41 +1425,13 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if ((rs->rs_flags & RS_IS_DEAD) || (crte->flags & HDWRPACE_IFPDEPARTED)) { /* Release the rate, and try anew */ -re_rate: + tcp_rel_pacing_rate(crte, tp); *** 388 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Jun 7 23:37:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F19665565E; Mon, 7 Jun 2021 23:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzVCG3cMTz4m0k; Mon, 7 Jun 2021 23:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51F581E56A; Mon, 7 Jun 2021 23:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 157NbEKN060294; Mon, 7 Jun 2021 23:37:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 157NbEVW060293; Mon, 7 Jun 2021 23:37:14 GMT (envelope-from git) Date: Mon, 7 Jun 2021 23:37:14 GMT Message-Id: <202106072337.157NbEVW060293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: 1b602f641a89 - main - linuxkpi: Fix build from redefined pr_err_once() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b602f641a8982e839c74230aeab953901f24d73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 23:37:14 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1b602f641a8982e839c74230aeab953901f24d73 commit 1b602f641a8982e839c74230aeab953901f24d73 Author: Neel Chauhan AuthorDate: 2021-06-07 23:37:21 +0000 Commit: Neel Chauhan CommitDate: 2021-06-07 23:37:21 +0000 linuxkpi: Fix build from redefined pr_err_once() --- sys/compat/linuxkpi/common/include/linux/printk.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/printk.h b/sys/compat/linuxkpi/common/include/linux/printk.h index ac3fdb9f31ae..e6510e9e9834 100644 --- a/sys/compat/linuxkpi/common/include/linux/printk.h +++ b/sys/compat/linuxkpi/common/include/linux/printk.h @@ -127,7 +127,4 @@ print_hex_dump_bytes(const char *prefix_str, const int prefix_type, #define pr_info_ratelimited(fmt, ...) \ printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) -#define pr_err_once(fmt, ...) \ - printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) - #endif /* _LINUX_PRINTK_H_ */ From owner-dev-commits-src-all@freebsd.org Tue Jun 8 05:18:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 291C0659754; Tue, 8 Jun 2021 05:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzdnB0h3Nz57Gy; Tue, 8 Jun 2021 05:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0039F22FB6; Tue, 8 Jun 2021 05:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1585IbDI011370; Tue, 8 Jun 2021 05:18:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1585IbC5011369; Tue, 8 Jun 2021 05:18:37 GMT (envelope-from git) Date: Tue, 8 Jun 2021 05:18:37 GMT Message-Id: <202106080518.1585IbC5011369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: f570a6723e14 - main - Fix copyright, remove "all rights reserved". MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f570a6723e145ae585bfb402f3f42260687666d3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 05:18:38 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f570a6723e145ae585bfb402f3f42260687666d3 commit f570a6723e145ae585bfb402f3f42260687666d3 Author: Dmitry Chagin AuthorDate: 2021-06-08 05:18:00 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-08 05:18:00 +0000 Fix copyright, remove "all rights reserved". The eventfd code was written by me, rdivacky@ copyrigth applicable only to epoll part of the Linuxulator code. Roman is ok to retire his copyright from sys/kern/sys_eventfd.c and 'All rights reserved.' lines from sys/compat/linux/linux_event.[c|h] and sys/kern/sys_eventfd.c files. Reviewed by: kib, emaste Approved by: rdivacky Differential Revision: https://reviews.freebsd.org/D30677 MFC after: 2 weeks --- sys/kern/sys_eventfd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/sys_eventfd.c b/sys/kern/sys_eventfd.c index 3fdb4afc7850..8a884e4c9a55 100644 --- a/sys/kern/sys_eventfd.c +++ b/sys/kern/sys_eventfd.c @@ -1,9 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2007 Roman Divacky * Copyright (c) 2014 Dmitry Chagin - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-dev-commits-src-all@freebsd.org Tue Jun 8 09:09:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4552065C30A; Tue, 8 Jun 2021 09:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzkvf1DV4z3kFJ; Tue, 8 Jun 2021 09:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1291626151; Tue, 8 Jun 2021 09:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15899XrA014834; Tue, 8 Jun 2021 09:09:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15899XEk014833; Tue, 8 Jun 2021 09:09:33 GMT (envelope-from git) Date: Tue, 8 Jun 2021 09:09:33 GMT Message-Id: <202106080909.15899XEk014833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 2362ad457a01 - main - linux: implement statx(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2362ad457a01d56d87e74823599578ab37bdbfb9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 09:09:34 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=2362ad457a01d56d87e74823599578ab37bdbfb9 commit 2362ad457a01d56d87e74823599578ab37bdbfb9 Author: Philippe Michaud-Boudreault AuthorDate: 2021-06-08 08:24:10 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-06-08 09:08:56 +0000 linux: implement statx(2) PR: 252106 Reviewed By: dchagin Differential Revision: https://reviews.freebsd.org/D30466 --- sys/compat/linux/linux.h | 42 ++++++++++++++++++++++++++ sys/compat/linux/linux_dummy.c | 2 -- sys/compat/linux/linux_stats.c | 67 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 48217959951c..18eafa88a432 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -205,4 +205,46 @@ int linux_to_bsd_bits_(int value, struct bsd_to_linux_bitmap *bitmap, int bsd_to_linux_errno(int error); void linux_check_errtbl(void); +#define STATX_BASIC_STATS 0x07ff +#define STATX_BTIME 0x0800 +#define STATX_ALL 0x0fff + +#define STATX_ATTR_COMPRESSED 0x0004 +#define STATX_ATTR_IMMUTABLE 0x0010 +#define STATX_ATTR_APPEND 0x0020 +#define STATX_ATTR_NODUMP 0x0040 +#define STATX_ATTR_ENCRYPTED 0x0800 +#define STATX_ATTR_AUTOMOUNT 0x1000 + +struct l_statx_timestamp { + int64_t tv_sec; + int32_t tv_nsec; + int32_t __spare0; +}; + +struct l_statx { + uint32_t stx_mask; + uint32_t stx_blksize; + uint64_t stx_attributes; + uint32_t stx_nlink; + uint32_t stx_uid; + uint32_t stx_gid; + uint16_t stx_mode; + uint16_t __spare0[1]; + uint64_t stx_ino; + uint64_t stx_size; + uint64_t stx_blocks; + uint64_t stx_attributes_mask; + struct l_statx_timestamp stx_atime; + struct l_statx_timestamp stx_btime; + struct l_statx_timestamp stx_ctime; + struct l_statx_timestamp stx_mtime; + uint32_t stx_rdev_major; + uint32_t stx_rdev_minor; + uint32_t stx_dev_major; + uint32_t stx_dev_minor; + uint64_t stx_mnt_id; + uint64_t __spare2[13]; +}; + #endif /* _LINUX_MI_H_ */ diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index fef09809822b..aa579d762c93 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -147,8 +147,6 @@ DUMMY(faccessat2); DUMMY(process_madvise); DUMMY(epoll_pwait2); DUMMY(mount_setattr); -/* Linux 4.11: */ -DUMMY(statx); /* Linux 4.18: */ DUMMY(io_pgetevents); DUMMY(rseq); diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index c88f6f53bdd7..4e6304500a8b 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -196,6 +196,40 @@ newstat_copyout(struct stat *buf, void *ubuf) return (copyout(&tbuf, ubuf, sizeof(tbuf))); } +static int +statx_copyout(struct stat *buf, void *ubuf) +{ + struct l_statx tbuf; + + bzero(&tbuf, sizeof(tbuf)); + tbuf.stx_mask = STATX_ALL; + tbuf.stx_blksize = buf->st_blksize; + tbuf.stx_attributes = 0; + tbuf.stx_nlink = buf->st_nlink; + tbuf.stx_uid = buf->st_uid; + tbuf.stx_gid = buf->st_gid; + tbuf.stx_mode = buf->st_mode; + tbuf.stx_ino = buf->st_ino; + tbuf.stx_size = buf->st_size; + tbuf.stx_blocks = buf->st_blocks; + + tbuf.stx_atime.tv_sec = buf->st_atim.tv_sec; + tbuf.stx_atime.tv_nsec = buf->st_atim.tv_nsec; + tbuf.stx_btime.tv_sec = buf->st_birthtim.tv_sec; + tbuf.stx_btime.tv_nsec = buf->st_birthtim.tv_nsec; + tbuf.stx_ctime.tv_sec = buf->st_ctim.tv_sec; + tbuf.stx_ctime.tv_nsec = buf->st_ctim.tv_nsec; + tbuf.stx_mtime.tv_sec = buf->st_mtim.tv_sec; + tbuf.stx_mtime.tv_nsec = buf->st_mtim.tv_nsec; + + tbuf.stx_rdev_major = buf->st_rdev >> 8; + tbuf.stx_rdev_minor = buf->st_rdev & 0xff; + tbuf.stx_dev_major = buf->st_dev >> 8; + tbuf.stx_dev_minor = buf->st_dev & 0xff; + + return (copyout(&tbuf, ubuf, sizeof(tbuf))); +} + #ifdef LINUX_LEGACY_SYSCALLS int linux_newstat(struct thread *td, struct linux_newstat_args *args) @@ -730,3 +764,36 @@ linux_syncfs(struct thread *td, struct linux_syncfs_args *args) vrele(vp); return (error); } + +int +linux_statx(struct thread *td, struct linux_statx_args *args) +{ + char *path; + int error, dirfd, flags; + struct stat buf; + + if (args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) { + linux_msg(td, "statx unsupported flags 0x%x", args->flags); + return (EINVAL); + } + + flags = (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) ? + AT_SYMLINK_NOFOLLOW : 0; + flags |= (args->flags & LINUX_AT_EMPTY_PATH) ? + AT_EMPTY_PATH : 0; + + dirfd = (args->dirfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dirfd; + if (!LUSECONVPATH(td)) { + error = linux_kern_statat(td, flags, dirfd, args->pathname, + UIO_USERSPACE, &buf); + } else { + LCONVPATHEXIST_AT(td, args->pathname, &path, dirfd); + error = linux_kern_statat(td, flags, dirfd, path, UIO_SYSSPACE, &buf); + LFREEPATH(path); + } + if (error == 0) + error = statx_copyout(&buf, args->statxbuf); + + return (error); +} + From owner-dev-commits-src-all@freebsd.org Tue Jun 8 09:20:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1B9465C524; Tue, 8 Jun 2021 09:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzl8f5cPyz3lBf; Tue, 8 Jun 2021 09:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8B6C26071; Tue, 8 Jun 2021 09:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1589Ko6T036680; Tue, 8 Jun 2021 09:20:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1589KoGY036679; Tue, 8 Jun 2021 09:20:50 GMT (envelope-from git) Date: Tue, 8 Jun 2021 09:20:50 GMT Message-Id: <202106080920.1589KoGY036679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: f102b61d0ecf - main - linux: make sure to zero the l_siginfo structure for ptrace(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f102b61d0ecffc6d9cc322fa7a48e0927391421b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 09:20:50 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f102b61d0ecffc6d9cc322fa7a48e0927391421b commit f102b61d0ecffc6d9cc322fa7a48e0927391421b Author: Edward Tomasz Napierala AuthorDate: 2021-06-08 09:18:29 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-06-08 09:18:29 +0000 linux: make sure to zero the l_siginfo structure for ptrace(2) Reported By: dchagin Sponsored By: EPSRC --- sys/amd64/linux/linux_ptrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 32d736d49095..67d8b121fbf1 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -379,6 +379,7 @@ linux_ptrace_getsiginfo(struct thread *td, pid_t pid, l_ulong data) } sig = bsd_to_linux_signal(lwpinfo.pl_siginfo.si_signo); + memset(&l_siginfo, 0, sizeof(l_siginfo)); siginfo_to_lsiginfo(&lwpinfo.pl_siginfo, &l_siginfo, sig); error = copyout(&l_siginfo, (void *)data, sizeof(l_siginfo)); return (error); From owner-dev-commits-src-all@freebsd.org Tue Jun 8 10:15:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 362C365D224; Tue, 8 Jun 2021 10:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzmMY0pjfz3sgx; Tue, 8 Jun 2021 10:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03EF426E2A; Tue, 8 Jun 2021 10:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158AFKoP007532; Tue, 8 Jun 2021 10:15:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158AFKAt007531; Tue, 8 Jun 2021 10:15:20 GMT (envelope-from git) Date: Tue, 8 Jun 2021 10:15:20 GMT Message-Id: <202106081015.158AFKAt007531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: f18b7f239dcd - stable/13 - ng_parse: IP address parsing in netgraph eating too many characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f18b7f239dcd75a192891232bc1fc099805f7d76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 10:15:21 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=f18b7f239dcd75a192891232bc1fc099805f7d76 commit f18b7f239dcd75a192891232bc1fc099805f7d76 Author: Markus Stoff AuthorDate: 2021-05-18 20:35:33 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 10:14:34 +0000 ng_parse: IP address parsing in netgraph eating too many characters Once the final component of the IP address has been parsed, the offset on the input must not be advanced, as this would remove an unparsed character from the input. Submitted by: Markus Stoff Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D26489 (cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c) --- sys/netgraph/ng_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c index 8050edbba562..c3c2126bdef5 100644 --- a/sys/netgraph/ng_parse.c +++ b/sys/netgraph/ng_parse.c @@ -960,9 +960,11 @@ ng_ipaddr_parse(const struct ng_parse_type *type, if ((error = ng_int8_parse(&ng_parse_int8_type, s, off, start, buf + i, buflen)) != 0) return (error); - if (i < 3 && s[*off] != '.') - return (EINVAL); - (*off)++; + if (i < 3) { + if (s[*off] != '.') + return (EINVAL); + (*off)++; + } } *buflen = 4; return (0); From owner-dev-commits-src-all@freebsd.org Tue Jun 8 10:24:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F7AE65D177; Tue, 8 Jun 2021 10:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzmZ33t20z3tGW; Tue, 8 Jun 2021 10:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DA3E27497; Tue, 8 Jun 2021 10:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158AORtD021422; Tue, 8 Jun 2021 10:24:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158AOR1C021421; Tue, 8 Jun 2021 10:24:27 GMT (envelope-from git) Date: Tue, 8 Jun 2021 10:24:27 GMT Message-Id: <202106081024.158AOR1C021421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 39917ef2a85f - stable/12 - ng_parse: IP address parsing in netgraph eating too many characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 39917ef2a85fa92a641bd6be346068f6097c8e98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 10:24:27 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=39917ef2a85fa92a641bd6be346068f6097c8e98 commit 39917ef2a85fa92a641bd6be346068f6097c8e98 Author: Markus Stoff AuthorDate: 2021-05-18 20:35:33 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 10:23:49 +0000 ng_parse: IP address parsing in netgraph eating too many characters Once the final component of the IP address has been parsed, the offset on the input must not be advanced, as this would remove an unparsed character from the input. Submitted by: Markus Stoff Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D26489 (cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c) --- sys/netgraph/ng_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c index b08cecd102e9..7297756c796d 100644 --- a/sys/netgraph/ng_parse.c +++ b/sys/netgraph/ng_parse.c @@ -961,9 +961,11 @@ ng_ipaddr_parse(const struct ng_parse_type *type, if ((error = ng_int8_parse(&ng_parse_int8_type, s, off, start, buf + i, buflen)) != 0) return (error); - if (i < 3 && s[*off] != '.') - return (EINVAL); - (*off)++; + if (i < 3) { + if (s[*off] != '.') + return (EINVAL); + (*off)++; + } } *buflen = 4; return (0); From owner-dev-commits-src-all@freebsd.org Tue Jun 8 10:27:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE12265D40A; Tue, 8 Jun 2021 10:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzmd15qnmz3tbR; Tue, 8 Jun 2021 10:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B04B1271A2; Tue, 8 Jun 2021 10:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158AR1UE021817; Tue, 8 Jun 2021 10:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158AR1iF021816; Tue, 8 Jun 2021 10:27:01 GMT (envelope-from git) Date: Tue, 8 Jun 2021 10:27:01 GMT Message-Id: <202106081027.158AR1iF021816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 90e161ec6d11 - stable/11 - ng_parse: IP address parsing in netgraph eating too many characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 90e161ec6d1127f30f92bf0b8c59dd4bd5a8bc26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 10:27:01 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=90e161ec6d1127f30f92bf0b8c59dd4bd5a8bc26 commit 90e161ec6d1127f30f92bf0b8c59dd4bd5a8bc26 Author: Markus Stoff AuthorDate: 2021-05-18 20:35:33 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 10:26:09 +0000 ng_parse: IP address parsing in netgraph eating too many characters Once the final component of the IP address has been parsed, the offset on the input must not be advanced, as this would remove an unparsed character from the input. Submitted by: Markus Stoff Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D26489 (cherry picked from commit 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c) --- sys/netgraph/ng_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c index b08cecd102e9..7297756c796d 100644 --- a/sys/netgraph/ng_parse.c +++ b/sys/netgraph/ng_parse.c @@ -961,9 +961,11 @@ ng_ipaddr_parse(const struct ng_parse_type *type, if ((error = ng_int8_parse(&ng_parse_int8_type, s, off, start, buf + i, buflen)) != 0) return (error); - if (i < 3 && s[*off] != '.') - return (EINVAL); - (*off)++; + if (i < 3) { + if (s[*off] != '.') + return (EINVAL); + (*off)++; + } } *buflen = 4; return (0); From owner-dev-commits-src-all@freebsd.org Tue Jun 8 10:49:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4515065D379; Tue, 8 Jun 2021 10:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzn7K1Xkxz4RwX; Tue, 8 Jun 2021 10:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D3CD273EF; Tue, 8 Jun 2021 10:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158AnnJ8048664; Tue, 8 Jun 2021 10:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Ann8V048663; Tue, 8 Jun 2021 10:49:49 GMT (envelope-from git) Date: Tue, 8 Jun 2021 10:49:49 GMT Message-Id: <202106081049.158Ann8V048663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 09307dbfb888 - main - tests/netgraph: Allow receiving answers to messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09307dbfb888a98232096c751a96ecb3344aa77c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 10:49:49 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=09307dbfb888a98232096c751a96ecb3344aa77c commit 09307dbfb888a98232096c751a96ecb3344aa77c Author: Lutz Donnerhacke AuthorDate: 2021-06-05 22:37:22 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 10:49:04 +0000 tests/netgraph: Allow receiving answers to messages Add msg_handler in order to receive messages from netgraph nodes to be tested. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30657 --- tests/sys/netgraph/util.c | 17 ++++++++++++----- tests/sys/netgraph/util.h | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/sys/netgraph/util.c b/tests/sys/netgraph/util.c index 37d005393e91..450a176971a7 100644 --- a/tests/sys/netgraph/util.c +++ b/tests/sys/netgraph/util.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -59,9 +58,10 @@ struct data_handler { SLIST_ENTRY(data_handler) next; }; static SLIST_HEAD(, data_handler) data_head = SLIST_HEAD_INITIALIZER(data_head); +static ng_msg_handler_t msg_handler = NULL; static void handle_data(void *ctx); -static void handle_msg(void); +static void handle_msg(void *ctx); void ng_connect(char const *path1, char const *hook1, @@ -143,14 +143,21 @@ ng_send_data(char const *hook, CHECK(, -1 != NgSendData(ds, hook, data, len)); } +void +ng_register_msg(ng_msg_handler_t proc) { + msg_handler = proc; +} + static void -handle_msg(void) { +handle_msg(void *ctx) { struct ng_mesg *m; char path[NG_PATHSIZ]; ATF_REQUIRE(-1 != NgAllocRecvMsg(cs, &m, path)); - printf("Got message from %s\n", path); + if(msg_handler != NULL) + (*msg_handler)(path, m, ctx); + free(m); } @@ -191,7 +198,7 @@ retry: return 0; default: /* something to do */ if (FD_ISSET(cs, &fds)) - handle_msg(); + handle_msg(context); if (FD_ISSET(ds, &fds)) handle_data(context); return 1; diff --git a/tests/sys/netgraph/util.h b/tests/sys/netgraph/util.h index 73afa5a24805..93ddc91f79bc 100644 --- a/tests/sys/netgraph/util.h +++ b/tests/sys/netgraph/util.h @@ -46,6 +46,8 @@ typedef void (*ng_data_handler_t)(void *, size_t, void *ctx); void ng_register_data(char const *hook, ng_data_handler_t proc); void ng_send_data(char const *hook, void const *, size_t); +typedef void (*ng_msg_handler_t)(char const *, struct ng_mesg *, void *); +void ng_register_msg(ng_msg_handler_t proc); int ng_send_msg(char const *path, char const *msg); int ng_handle_event (unsigned int ms, void *ctx); From owner-dev-commits-src-all@freebsd.org Tue Jun 8 11:03:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23FCB65D3DB; Tue, 8 Jun 2021 11:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FznRD0KtQz4T26; Tue, 8 Jun 2021 11:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7941279E7; Tue, 8 Jun 2021 11:03:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158B3ZB5075468; Tue, 8 Jun 2021 11:03:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158B3ZuE075467; Tue, 8 Jun 2021 11:03:35 GMT (envelope-from git) Date: Tue, 8 Jun 2021 11:03:35 GMT Message-Id: <202106081103.158B3ZuE075467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Grehan Subject: git: 054accac71e0 - main - Add a virtio-input device emulation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 054accac71e0944ab588c3ab052bea6947df7885 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 11:03:36 -0000 The branch main has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=054accac71e0944ab588c3ab052bea6947df7885 commit 054accac71e0944ab588c3ab052bea6947df7885 Author: Corvin Köhne AuthorDate: 2021-06-08 08:56:43 +0000 Commit: Peter Grehan CommitDate: 2021-06-08 09:05:09 +0000 Add a virtio-input device emulation. This will be used to inject keyboard/mouse input events into a guest. The command line syntax is: -s ,virtio-input,/dev/input/eventX Reviewed by: jhb (bhyve), grehan Obtained from: Corvin Köhne MFC after: 3 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D30020 --- usr.sbin/bhyve/Makefile | 1 + usr.sbin/bhyve/bhyve.8 | 10 + usr.sbin/bhyve/bhyve_config.5 | 11 + usr.sbin/bhyve/pci_virtio_input.c | 782 ++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/virtio.c | 10 +- usr.sbin/bhyve/virtio.h | 16 + 6 files changed, 828 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index e35d528ab605..772c0988090e 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -50,6 +50,7 @@ SRCS= \ pci_virtio_9p.c \ pci_virtio_block.c \ pci_virtio_console.c \ + pci_virtio_input.c \ pci_virtio_net.c \ pci_virtio_rnd.c \ pci_virtio_scsi.c \ diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 79b6d9bfb240..fcf47ec65513 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -306,6 +306,8 @@ Virtio RNG interface. Virtio console interface, which exposes multiple ports to the guest in the form of simple char devices for simple IO between the guest and host userspaces. +.It Cm virtio-input +Virtio input interface. .It Cm ahci AHCI controller attached to arbitrary devices. .It Cm ahci-cd @@ -539,6 +541,14 @@ resize at present. Emergency write is advertised, but no-op at present. .El .Pp +Virtio input device backends: +.Bl -tag -width 10n +.It Ar /dev/input/eventX +Send input events of +.Ar /dev/input/eventX +to guest by VirtIO Input Interface. +.El +.Pp Framebuffer devices backends: .Bl -bullet .Sm off diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index 1a77b1bbacb4..a2221d5bc4bf 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -221,6 +221,8 @@ VirtIO 9p (VirtFS) interface. VirtIO block storage interface. .It Li virtio-console VirtIO console interface. +.It Li virtio-input +VirtIO input interface. .It Li virtio-net VirtIO network interface. .It Li virtio-rnd @@ -528,6 +530,15 @@ The name of the port exposed to the guest. .It Va path Ta path Ta Ta The path of a UNIX domain socket providing the host connection for the port. .El +.Ss VirtIO Input Interface Settings +Each VirtIO Input device contains one input event device. +All input events of the input event device are send to the guest by VirtIO Input interface. +VirtIO Input Interfaces support the following variables: +.Bl -column "Name" "Format" "Default" +.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description +.It Va path Ta path Ta Ta +The path of the input event device exposed to the guest +.El .Ss VirtIO Network Interface Settings In addition to the network backend settings, VirtIO network interfaces support the following variables: diff --git a/usr.sbin/bhyve/pci_virtio_input.c b/usr.sbin/bhyve/pci_virtio_input.c new file mode 100644 index 000000000000..4517333b1603 --- /dev/null +++ b/usr.sbin/bhyve/pci_virtio_input.c @@ -0,0 +1,782 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG + * 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 + * in this position and unchanged. + * 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. + */ + +/* + * virtio input device emulation. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#ifndef WITHOUT_CAPSICUM +#include + +#include +#endif +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bhyverun.h" +#include "config.h" +#include "debug.h" +#include "mevent.h" +#include "pci_emul.h" +#include "virtio.h" + +#define VTINPUT_RINGSZ 64 + +#define VTINPUT_MAX_PKT_LEN 10 + +/* + * Queue definitions. + */ +#define VTINPUT_EVENTQ 0 +#define VTINPUT_STATUSQ 1 + +#define VTINPUT_MAXQ 2 + +static int pci_vtinput_debug; +#define DPRINTF(params) \ + if (pci_vtinput_debug) \ + PRINTLN params +#define WPRINTF(params) PRINTLN params + +enum vtinput_config_select { + VTINPUT_CFG_UNSET = 0x00, + VTINPUT_CFG_ID_NAME = 0x01, + VTINPUT_CFG_ID_SERIAL = 0x02, + VTINPUT_CFG_ID_DEVIDS = 0x03, + VTINPUT_CFG_PROP_BITS = 0x10, + VTINPUT_CFG_EV_BITS = 0x11, + VTINPUT_CFG_ABS_INFO = 0x12 +}; + +struct vtinput_absinfo { + uint32_t min; + uint32_t max; + uint32_t fuzz; + uint32_t flat; + uint32_t res; +} __packed; + +struct vtinput_devids { + uint16_t bustype; + uint16_t vendor; + uint16_t product; + uint16_t version; +} __packed; + +struct vtinput_config { + uint8_t select; + uint8_t subsel; + uint8_t size; + uint8_t reserved[5]; + union { + char string[128]; + uint8_t bitmap[128]; + struct vtinput_absinfo abs; + struct vtinput_devids ids; + } u; +} __packed; + +struct vtinput_event { + uint16_t type; + uint16_t code; + uint32_t value; +} __packed; + +struct vtinput_event_elem { + struct vtinput_event event; + struct iovec iov; + uint16_t idx; +}; + +struct vtinput_eventqueue { + struct vtinput_event_elem *events; + uint32_t size; + uint32_t idx; +}; + +/* + * Per-device softc + */ +struct pci_vtinput_softc { + struct virtio_softc vsc_vs; + struct vqueue_info vsc_queues[VTINPUT_MAXQ]; + pthread_mutex_t vsc_mtx; + const char *vsc_evdev; + int vsc_fd; + struct vtinput_config vsc_config; + int vsc_config_valid; + struct mevent *vsc_evp; + struct vtinput_eventqueue vsc_eventqueue; +}; + +static void pci_vtinput_reset(void *); +static int pci_vtinput_cfgread(void *, int, int, uint32_t *); +static int pci_vtinput_cfgwrite(void *, int, int, uint32_t); + +static struct virtio_consts vtinput_vi_consts = { + "vtinput", /* our name */ + VTINPUT_MAXQ, /* we support 1 virtqueue */ + sizeof(struct vtinput_config), /* config reg size */ + pci_vtinput_reset, /* reset */ + NULL, /* device-wide qnotify -- not used */ + pci_vtinput_cfgread, /* read virtio config */ + pci_vtinput_cfgwrite, /* write virtio config */ + NULL, /* apply negotiated features */ + 0, /* our capabilities */ +}; + +static void +pci_vtinput_reset(void *vsc) +{ + struct pci_vtinput_softc *sc = vsc; + + DPRINTF(("%s: device reset requested", __func__)); + vi_reset_dev(&sc->vsc_vs); +} + +static void +pci_vtinput_notify_eventq(void *vsc, struct vqueue_info *vq) +{ + DPRINTF(("%s", __func__)); +} + +static void +pci_vtinput_notify_statusq(void *vsc, struct vqueue_info *vq) +{ + struct pci_vtinput_softc *sc = vsc; + + while (vq_has_descs(vq)) { + /* get descriptor chain */ + struct iovec iov; + struct vi_req req; + const int n = vq_getchain(vq, &iov, 1, &req); + if (n <= 0) { + WPRINTF(("%s: invalid descriptor: %d", __func__, n)); + return; + } + + /* get event */ + struct vtinput_event event; + memcpy(&event, iov.iov_base, sizeof(event)); + + /* + * on multi touch devices: + * - host send EV_MSC to guest + * - guest sends EV_MSC back to host + * - host writes EV_MSC to evdev + * - evdev saves EV_MSC in it's event buffer + * - host receives an extra EV_MSC by reading the evdev event + * buffer + * - frames become larger and larger + * avoid endless loops by ignoring EV_MSC + */ + if (event.type == EV_MSC) { + vq_relchain(vq, req.idx, sizeof(event)); + continue; + } + + /* send event to evdev */ + struct input_event host_event; + host_event.type = event.type; + host_event.code = event.code; + host_event.value = event.value; + if (gettimeofday(&host_event.time, NULL) != 0) { + WPRINTF(("%s: failed gettimeofday", __func__)); + } + if (write(sc->vsc_fd, &host_event, sizeof(host_event)) == -1) { + WPRINTF(("%s: failed to write host_event", __func__)); + } + + vq_relchain(vq, req.idx, sizeof(event)); + } + vq_endchains(vq, 1); +} + +static int +pci_vtinput_get_bitmap(struct pci_vtinput_softc *sc, int cmd, int count) +{ + if (count <= 0 || !sc) { + return (-1); + } + + /* query bitmap */ + memset(sc->vsc_config.u.bitmap, 0, sizeof(sc->vsc_config.u.bitmap)); + if (ioctl(sc->vsc_fd, cmd, sc->vsc_config.u.bitmap) < 0) { + return (-1); + } + + /* get number of set bytes in bitmap */ + for (int i = count - 1; i >= 0; i--) { + if (sc->vsc_config.u.bitmap[i]) { + return i + 1; + } + } + + return (-1); +} + +static int +pci_vtinput_read_config_id_name(struct pci_vtinput_softc *sc) +{ + char name[128]; + if (ioctl(sc->vsc_fd, EVIOCGNAME(sizeof(name) - 1), name) < 0) { + return (1); + } + + memcpy(sc->vsc_config.u.string, name, sizeof(name)); + sc->vsc_config.size = strnlen(name, sizeof(name)); + + return (0); +} + +static int +pci_vtinput_read_config_id_serial(struct pci_vtinput_softc *sc) +{ + /* serial isn't supported */ + sc->vsc_config.size = 0; + + return (0); +} + +static int +pci_vtinput_read_config_id_devids(struct pci_vtinput_softc *sc) +{ + struct input_id devids; + if (ioctl(sc->vsc_fd, EVIOCGID, &devids)) { + return (1); + } + + sc->vsc_config.u.ids.bustype = devids.bustype; + sc->vsc_config.u.ids.vendor = devids.vendor; + sc->vsc_config.u.ids.product = devids.product; + sc->vsc_config.u.ids.version = devids.version; + sc->vsc_config.size = sizeof(struct vtinput_devids); + + return (0); +} + +static int +pci_vtinput_read_config_prop_bits(struct pci_vtinput_softc *sc) +{ + /* + * Evdev bitmap countains 1 bit per count. Additionally evdev bitmaps + * are arrays of longs instead of chars. Calculate how many longs are + * required for evdev bitmap. Multiply that with sizeof(long) to get the + * number of elements. + */ + const int count = howmany(INPUT_PROP_CNT, sizeof(long) * 8) * + sizeof(long); + const unsigned int cmd = EVIOCGPROP(count); + const int size = pci_vtinput_get_bitmap(sc, cmd, count); + if (size <= 0) { + return (1); + } + + sc->vsc_config.size = size; + + return (0); +} + +static int +pci_vtinput_read_config_ev_bits(struct pci_vtinput_softc *sc, uint8_t type) +{ + int count; + + switch (type) { + case EV_KEY: + count = KEY_CNT; + break; + case EV_REL: + count = REL_CNT; + break; + case EV_ABS: + count = ABS_CNT; + break; + case EV_MSC: + count = MSC_CNT; + break; + case EV_SW: + count = SW_CNT; + break; + case EV_LED: + count = LED_CNT; + break; + default: + return (1); + } + + /* + * Evdev bitmap countains 1 bit per count. Additionally evdev bitmaps + * are arrays of longs instead of chars. Calculate how many longs are + * required for evdev bitmap. Multiply that with sizeof(long) to get the + * number of elements. + */ + count = howmany(count, sizeof(long) * 8) * sizeof(long); + const unsigned int cmd = EVIOCGBIT(sc->vsc_config.subsel, count); + const int size = pci_vtinput_get_bitmap(sc, cmd, count); + if (size <= 0) { + return (1); + } + + sc->vsc_config.size = size; + + return (0); +} + +static int +pci_vtinput_read_config_abs_info(struct pci_vtinput_softc *sc) +{ + /* check if evdev has EV_ABS */ + if (!pci_vtinput_read_config_ev_bits(sc, EV_ABS)) { + return (1); + } + + /* get abs information */ + struct input_absinfo abs; + if (ioctl(sc->vsc_fd, EVIOCGABS(sc->vsc_config.subsel), &abs) < 0) { + return (1); + } + + /* save abs information */ + sc->vsc_config.u.abs.min = abs.minimum; + sc->vsc_config.u.abs.max = abs.maximum; + sc->vsc_config.u.abs.fuzz = abs.fuzz; + sc->vsc_config.u.abs.flat = abs.flat; + sc->vsc_config.u.abs.res = abs.resolution; + sc->vsc_config.size = sizeof(struct vtinput_absinfo); + + return (0); +} + +static int +pci_vtinput_read_config(struct pci_vtinput_softc *sc) +{ + switch (sc->vsc_config.select) { + case VTINPUT_CFG_UNSET: + return (0); + case VTINPUT_CFG_ID_NAME: + return pci_vtinput_read_config_id_name(sc); + case VTINPUT_CFG_ID_SERIAL: + return pci_vtinput_read_config_id_serial(sc); + case VTINPUT_CFG_ID_DEVIDS: + return pci_vtinput_read_config_id_devids(sc); + case VTINPUT_CFG_PROP_BITS: + return pci_vtinput_read_config_prop_bits(sc); + case VTINPUT_CFG_EV_BITS: + return pci_vtinput_read_config_ev_bits( + sc, sc->vsc_config.subsel); + case VTINPUT_CFG_ABS_INFO: + return pci_vtinput_read_config_abs_info(sc); + default: + return (1); + } +} + +static int +pci_vtinput_cfgread(void *vsc, int offset, int size, uint32_t *retval) +{ + struct pci_vtinput_softc *sc = vsc; + + /* check for valid offset and size */ + if (offset + size > sizeof(struct vtinput_config)) { + WPRINTF(("%s: read to invalid offset/size %d/%d", __func__, + offset, size)); + memset(retval, 0, size); + return (0); + } + + /* read new config values, if select and subsel changed. */ + if (!sc->vsc_config_valid) { + if (pci_vtinput_read_config(sc) != 0) { + DPRINTF(("%s: could not read config %d/%d", __func__, + sc->vsc_config.select, sc->vsc_config.subsel)); + memset(retval, 0, size); + return (0); + } + sc->vsc_config_valid = 1; + } + + uint8_t *ptr = (uint8_t *)&sc->vsc_config; + memcpy(retval, ptr + offset, size); + + return (0); +} + +static int +pci_vtinput_cfgwrite(void *vsc, int offset, int size, uint32_t value) +{ + struct pci_vtinput_softc *sc = vsc; + + /* guest can only write to select and subsel fields */ + if (offset + size > 2) { + WPRINTF(("%s: write to readonly reg %d", __func__, offset)); + return (1); + } + + /* copy value into config */ + uint8_t *ptr = (uint8_t *)&sc->vsc_config; + memcpy(ptr + offset, &value, size); + + /* select/subsel changed, query new config on next cfgread */ + sc->vsc_config_valid = 0; + + return (0); +} + +static int +vtinput_eventqueue_add_event( + struct vtinput_eventqueue *queue, struct input_event *e) +{ + /* check if queue is full */ + if (queue->idx >= queue->size) { + /* alloc new elements for queue */ + const uint32_t newSize = queue->idx; + const void *newPtr = realloc(queue->events, + queue->size * sizeof(struct vtinput_event_elem)); + if (newPtr == NULL) { + WPRINTF(("%s: realloc memory for eventqueue failed!", + __func__)); + return (1); + } + /* save new size and eventqueue */ + queue->events = (struct vtinput_event_elem *)newPtr; + queue->size = newSize; + } + + /* save event */ + struct vtinput_event *event = &queue->events[queue->idx].event; + event->type = e->type; + event->code = e->code; + event->value = e->value; + queue->idx++; + + return (0); +} + +static void +vtinput_eventqueue_clear(struct vtinput_eventqueue *queue) +{ + /* just reset index to clear queue */ + queue->idx = 0; +} + +static void +vtinput_eventqueue_send_events( + struct vtinput_eventqueue *queue, struct vqueue_info *vq) +{ + /* + * First iteration through eventqueue: + * Get descriptor chains. + */ + for (uint32_t i = 0; i < queue->idx; ++i) { + /* get descriptor */ + if (!vq_has_descs(vq)) { + /* + * We don't have enough descriptors for all events. + * Return chains back to guest. + */ + vq_retchains(vq, i); + WPRINTF(( + "%s: not enough available descriptors, dropping %d events", + __func__, queue->idx)); + goto done; + } + + /* get descriptor chain */ + struct iovec iov; + struct vi_req req; + const int n = vq_getchain(vq, &iov, 1, &req); + if (n <= 0) { + WPRINTF(("%s: invalid descriptor: %d", __func__, n)); + return; + } + if (n != 1) { + WPRINTF( + ("%s: invalid number of descriptors in chain: %d", + __func__, n)); + /* release invalid chain */ + vq_relchain(vq, req.idx, 0); + return; + } + if (iov.iov_len < sizeof(struct vtinput_event)) { + WPRINTF(("%s: invalid descriptor length: %lu", __func__, + iov.iov_len)); + /* release invalid chain */ + vq_relchain(vq, req.idx, 0); + return; + } + + /* save descriptor */ + queue->events[i].iov = iov; + queue->events[i].idx = req.idx; + } + + /* + * Second iteration through eventqueue: + * Send events to guest by releasing chains + */ + for (uint32_t i = 0; i < queue->idx; ++i) { + struct vtinput_event_elem event = queue->events[i]; + memcpy(event.iov.iov_base, &event.event, + sizeof(struct vtinput_event)); + vq_relchain(vq, event.idx, sizeof(struct vtinput_event)); + } +done: + /* clear queue and send interrupt to guest */ + vtinput_eventqueue_clear(queue); + vq_endchains(vq, 1); + + return; +} + +static int +vtinput_read_event_from_host(int fd, struct input_event *event) +{ + const int len = read(fd, event, sizeof(struct input_event)); + if (len != sizeof(struct input_event)) { + if (len == -1 && errno != EAGAIN) { + WPRINTF(("%s: event read failed! len = %d, errno = %d", + __func__, len, errno)); + } + + /* host doesn't have more events for us */ + return (1); + } + + return (0); +} + +static void +vtinput_read_event(int fd __attribute((unused)), + enum ev_type t __attribute__((unused)), void *arg __attribute__((unused))) +{ + struct pci_vtinput_softc *sc = arg; + + /* skip if driver isn't ready */ + if (!(sc->vsc_vs.vs_status & VIRTIO_CONFIG_STATUS_DRIVER_OK)) + return; + + /* read all events from host */ + struct input_event event; + while (vtinput_read_event_from_host(sc->vsc_fd, &event) == 0) { + /* add events to our queue */ + vtinput_eventqueue_add_event(&sc->vsc_eventqueue, &event); + + /* only send events to guest on EV_SYN or SYN_REPORT */ + if (event.type != EV_SYN || event.type != SYN_REPORT) { + continue; + } + + /* send host events to guest */ + vtinput_eventqueue_send_events( + &sc->vsc_eventqueue, &sc->vsc_queues[VTINPUT_EVENTQ]); + } +} + +static int +pci_vtinput_legacy_config(nvlist_t *nvl, const char *opts) +{ + if (opts == NULL) + return (-1); + + /* + * parse opts: + * virtio-input,/dev/input/eventX + */ + char *cp = strchr(opts, ','); + if (cp == NULL) { + set_config_value_node(nvl, "path", opts); + return (0); + } + char *path = strndup(opts, cp - opts); + set_config_value_node(nvl, "path", path); + free(path); + + return (pci_parse_legacy_config(nvl, cp + 1)); +} + +static int +pci_vtinput_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) +{ + struct pci_vtinput_softc *sc; + + /* + * Keep it here. + * Else it's possible to access it uninitialized by jumping to failed. + */ + pthread_mutexattr_t mtx_attr = NULL; + + sc = calloc(1, sizeof(struct pci_vtinput_softc)); + + sc->vsc_evdev = get_config_value_node(nvl, "path"); + if (sc->vsc_evdev == NULL) { + WPRINTF(("%s: missing required path config value", __func__)); + goto failed; + } + + /* + * open evdev by using non blocking I/O: + * read from /dev/input/eventX would block our thread otherwise + */ + sc->vsc_fd = open(sc->vsc_evdev, O_RDWR | O_NONBLOCK); + if (sc->vsc_fd < 0) { + WPRINTF(("%s: failed to open %s", __func__, sc->vsc_evdev)); + goto failed; + } + + /* check if evdev is really a evdev */ + int evversion; + int error = ioctl(sc->vsc_fd, EVIOCGVERSION, &evversion); + if (error < 0) { + WPRINTF(("%s: %s is no evdev", __func__, sc->vsc_evdev)); + goto failed; + } + + /* gain exclusive access to evdev */ + error = ioctl(sc->vsc_fd, EVIOCGRAB, 1); + if (error < 0) { + WPRINTF(("%s: failed to grab %s", __func__, sc->vsc_evdev)); + goto failed; + } + + if (pthread_mutexattr_init(&mtx_attr)) { + WPRINTF(("%s: init mutexattr failed", __func__)); + goto failed; + } + if (pthread_mutexattr_settype(&mtx_attr, PTHREAD_MUTEX_RECURSIVE)) { + WPRINTF(("%s: settype mutexattr failed", __func__)); + goto failed; + } + if (pthread_mutex_init(&sc->vsc_mtx, &mtx_attr)) { + WPRINTF(("%s: init mutex failed", __func__)); + goto failed; + } + + /* init softc */ + sc->vsc_eventqueue.idx = 0; + sc->vsc_eventqueue.size = VTINPUT_MAX_PKT_LEN; + sc->vsc_eventqueue.events = calloc( + sc->vsc_eventqueue.size, sizeof(struct vtinput_event_elem)); + sc->vsc_config_valid = 0; + if (sc->vsc_eventqueue.events == NULL) { + WPRINTF(("%s: failed to alloc eventqueue", __func__)); + goto failed; + } + + /* register event handler */ + sc->vsc_evp = mevent_add(sc->vsc_fd, EVF_READ, vtinput_read_event, sc); + if (sc->vsc_evp == NULL) { + WPRINTF(("%s: could not register mevent", __func__)); + goto failed; + } + +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (caph_rights_limit(sc->vsc_fd, &rights) == -1) { + errx(EX_OSERR, "Unable to apply rights for sandbox"); + } +#endif + + /* link virtio to softc */ + vi_softc_linkup( + &sc->vsc_vs, &vtinput_vi_consts, sc, pi, sc->vsc_queues); + sc->vsc_vs.vs_mtx = &sc->vsc_mtx; + + /* init virtio queues */ + sc->vsc_queues[VTINPUT_EVENTQ].vq_qsize = VTINPUT_RINGSZ; + sc->vsc_queues[VTINPUT_EVENTQ].vq_notify = pci_vtinput_notify_eventq; + sc->vsc_queues[VTINPUT_STATUSQ].vq_qsize = VTINPUT_RINGSZ; + sc->vsc_queues[VTINPUT_STATUSQ].vq_notify = pci_vtinput_notify_statusq; + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_INPUT); + pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_INPUTDEV); + pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_INPUTDEV_OTHER); + pci_set_cfgdata8(pi, PCIR_REVID, VIRTIO_REV_INPUT); + pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_SUBDEV_INPUT); + pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_SUBVEN_INPUT); + + /* add MSI-X table BAR */ + if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) + goto failed; + /* add virtio register */ + vi_set_io_bar(&sc->vsc_vs, 0); + + return (0); + +failed: + if (sc == NULL) { + return (-1); + } + + if (sc->vsc_evp) + mevent_delete(sc->vsc_evp); + if (sc->vsc_eventqueue.events) + free(sc->vsc_eventqueue.events); + if (sc->vsc_mtx) + pthread_mutex_destroy(&sc->vsc_mtx); + if (mtx_attr) + pthread_mutexattr_destroy(&mtx_attr); + if (sc->vsc_fd) + close(sc->vsc_fd); + + free(sc); + + return (-1); +} + +struct pci_devemu pci_de_vinput = { + .pe_emu = "virtio-input", + .pe_init = pci_vtinput_init, + .pe_legacy_config = pci_vtinput_legacy_config, + .pe_barwrite = vi_pci_write, + .pe_barread = vi_pci_read, +}; +PCI_EMUL_SET(pci_de_vinput); diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c index 7f0485cbb826..a08964e28563 100644 --- a/usr.sbin/bhyve/virtio.c +++ b/usr.sbin/bhyve/virtio.c @@ -603,7 +603,10 @@ vi_pci_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, max = vc->vc_cfgsize ? vc->vc_cfgsize : 0x100000000; if (newoff + size > max) goto bad; - error = (*vc->vc_cfgread)(DEV_SOFTC(vs), newoff, size, &value); + if (vc->vc_cfgread != NULL) + error = (*vc->vc_cfgread)(DEV_SOFTC(vs), newoff, size, &value); + else + error = 0; if (!error) goto done; } @@ -719,7 +722,10 @@ vi_pci_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, max = vc->vc_cfgsize ? vc->vc_cfgsize : 0x100000000; if (newoff + size > max) goto bad; - error = (*vc->vc_cfgwrite)(DEV_SOFTC(vs), newoff, size, value); + if (vc->vc_cfgwrite != NULL) + error = (*vc->vc_cfgwrite)(DEV_SOFTC(vs), newoff, size, value); + else + error = 0; if (!error) goto done; } diff --git a/usr.sbin/bhyve/virtio.h b/usr.sbin/bhyve/virtio.h index e03fd5f710d1..4c7b9de83125 100644 --- a/usr.sbin/bhyve/virtio.h +++ b/usr.sbin/bhyve/virtio.h @@ -171,6 +171,22 @@ #define VIRTIO_DEV_RANDOM 0x1005 #define VIRTIO_DEV_SCSI 0x1008 #define VIRTIO_DEV_9P 0x1009 +#define VIRTIO_DEV_INPUT 0x1052 + +/* + * PCI revision IDs + */ +#define VIRTIO_REV_INPUT 1 + +/* + * PCI subvendor IDs + */ +#define VIRTIO_SUBVEN_INPUT 0x108E + +/* + * PCI subdevice IDs + */ +#define VIRTIO_SUBDEV_INPUT 0x1100 /* From section 2.3, "Virtqueue Configuration", of the virtio specification */ static inline int From owner-dev-commits-src-all@freebsd.org Tue Jun 8 11:31:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39D6365DED7; Tue, 8 Jun 2021 11:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzp3418Gjz4XYS; Tue, 8 Jun 2021 11:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F87318A; Tue, 8 Jun 2021 11:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158BVCrg011292; Tue, 8 Jun 2021 11:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158BVCYW011291; Tue, 8 Jun 2021 11:31:12 GMT (envelope-from git) Date: Tue, 8 Jun 2021 11:31:12 GMT Message-Id: <202106081131.158BVCYW011291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 61814702398c - main - tests/netgraph: Tests for ng_bridge MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61814702398ce29430b2bef75cbdd6fd2c07ad12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 11:31:12 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=61814702398ce29430b2bef75cbdd6fd2c07ad12 commit 61814702398ce29430b2bef75cbdd6fd2c07ad12 Author: Lutz Donnerhacke AuthorDate: 2021-06-04 10:59:00 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 11:27:23 +0000 tests/netgraph: Tests for ng_bridge Test functionality of ng_bridge(4): - replicating traffic to anything but the sending hook - persistence - detect loops - unicast to only one link of many - stretch to implementation limits on broadcast Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30647 --- tests/sys/netgraph/Makefile | 2 + tests/sys/netgraph/bridge.c | 654 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 656 insertions(+) diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile index 9f220a620bbe..7376cb5c1227 100644 --- a/tests/sys/netgraph/Makefile +++ b/tests/sys/netgraph/Makefile @@ -11,8 +11,10 @@ TEST_METADATA.ng_macfilter_test+= required_user="root" TEST_METADATA.ng_macfilter_test+= required_programs="perl" ATF_TESTS_C+= basic \ + bridge \ SRCS.basic= basic.c util.c +SRCS.bridge= bridge.c util.c LIBADD+= netgraph diff --git a/tests/sys/netgraph/bridge.c b/tests/sys/netgraph/bridge.c new file mode 100644 index 000000000000..41d2346b527b --- /dev/null +++ b/tests/sys/netgraph/bridge.c @@ -0,0 +1,654 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2021 Lutz Donnerhacke + * + * 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. + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 +#include +#include + +#include +#include +#include +#include + +#include "util.h" +#include + +static void get_data0(void *data, size_t len, void *ctx); +static void get_data1(void *data, size_t len, void *ctx); +static void get_data2(void *data, size_t len, void *ctx); +static void get_data3(void *data, size_t len, void *ctx); + +static void get_tablesize(char const *source, struct ng_mesg *msg, void *ctx); +struct gettable +{ + u_int32_t tok; + int cnt; +}; + +struct frame4 +{ + struct ether_header eh; + struct ip ip; + char data[64]; +}; +struct frame6 +{ + struct ether_header eh; + struct ip6_hdr ip; + char data[64]; +}; + +static struct frame4 msg4 = { + .ip.ip_v = 4, + .ip.ip_hl = 5, + .ip.ip_ttl = 1, + .ip.ip_p = 254, + .ip.ip_src = {htonl(0x0a00dead)}, + .ip.ip_dst = {htonl(0x0a00beef)}, + .ip.ip_len = 32, + .eh.ether_type = ETHERTYPE_IP, + .eh.ether_shost = {2, 4, 6}, + .eh.ether_dhost = {2, 4, 6}, +}; + + +ATF_TC(basic); +ATF_TC_HEAD(basic, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(basic, dummy) +{ + int r[4]; + struct gettable rm; + + ng_init(); + ng_errors(PASS); + ng_shutdown("bridge:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "bridge", "link0"); + ng_name("a", "bridge"); + ng_connect(".", "b", "bridge:", "link1"); + ng_connect(".", "c", "bridge:", "link2"); + + /* do not bounce back */ + ng_register_data("a", get_data0); + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + ng_send_data("a", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0); + + /* send to others */ + ng_register_data("b", get_data1); + ng_register_data("c", get_data2); + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + ng_send_data("a", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1); + + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 2; + ng_send_data("b", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1); + + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 3; + ng_send_data("c", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 1 && r[2] == 0); + + /* send to learned unicast */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + msg4.eh.ether_dhost[5] = 3; + ng_send_data("a", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1); + + /* inspect mac table */ + ng_register_msg(get_tablesize); + rm.tok = ng_send_msg("bridge:", "gettable"); + rm.cnt = 0; + ng_handle_events(50, &rm); + ATF_CHECK(rm.cnt == 3); + + /* remove a link */ + ng_rmhook(".", "b"); + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + msg4.eh.ether_dhost[5] = 0; + ng_send_data("a", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1); + + /* inspect mac table */ + ng_register_msg(get_tablesize); + rm.tok = ng_send_msg("bridge:", "gettable"); + rm.cnt = 0; + ng_handle_events(50, &rm); + ATF_CHECK(rm.cnt == 2); + + ng_shutdown("bridge:"); +} + +ATF_TC(persistence); +ATF_TC_HEAD(persistence, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(persistence, dummy) +{ + ng_init(); + ng_errors(PASS); + ng_shutdown("bridge:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "bridge", "link0"); + ng_name("a", "bridge"); + + ng_send_msg("bridge:", "setpersistent"); + ng_rmhook(".", "a"); + + ng_shutdown("bridge:"); +} + +ATF_TC(loop); +ATF_TC_HEAD(loop, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(loop, dummy) +{ + int r[4], i; + + ng_init(); + ng_errors(PASS); + ng_shutdown("bridge1:"); + ng_shutdown("bridge2:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "bridge", "link0"); + ng_name("a", "bridge1"); + ng_mkpeer(".", "b", "bridge", "link1"); + ng_name("b", "bridge2"); + + ng_register_data("a", get_data0); + ng_register_data("b", get_data1); + + /*- + * Open loop + * + * /-- bridge1 + * . < | + * \-- bridge2 + */ + ng_connect("bridge1:", "link11", "bridge2:", "link11"); + + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + ng_send_data("a", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1); + + /*- + * Closed loop, DANGEROUS! + * + * /-- bridge1 -\ + * . < | | + * \-- bridge2 -/ + */ + ng_connect("bridge1:", "link12", "bridge2:", "link12"); + + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + ng_errors(PASS); + ng_send_data("a", &msg4, sizeof(msg4)); + ATF_CHECK_ERRNO(ELOOP, errno != 0); /* loop might be detected */ + ng_errors(FAIL); + for (i = 0; i < 10; i++) /* don't run forever */ + if (!ng_handle_event(50, &r)) + break; + ATF_CHECK(r[0] == 0 && r[1] == 1); + + ng_shutdown("bridge1:"); + ng_shutdown("bridge2:"); +} + +ATF_TC(many_unicasts); +ATF_TC_HEAD(many_unicasts, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(many_unicasts, dummy) +{ + int r[4], i; + const int HOOKS = 1000; + struct gettable rm; + + ng_init(); + ng_errors(PASS); + ng_shutdown("bridge:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "bridge", "link0"); + ng_name("a", "bridge"); + ng_register_data("a", get_data0); + + /* learn MAC */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[3] = 0xff; + ng_send_data("a", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0); + + /* use learned MAC as destination */ + msg4.eh.ether_shost[3] = 0; + msg4.eh.ether_dhost[3] = 0xff; + + /* now send */ + bzero(r, sizeof(r)); + for (i = 1; i <= HOOKS; i++) + { + char hook[20]; + + snprintf(hook, sizeof(hook), "link%d", i); + ng_connect(".", hook, "bridge:", hook); + ng_register_data(hook, get_data2); + + msg4.eh.ether_shost[4] = i >> 8; + msg4.eh.ether_shost[5] = i & 0xff; + ng_errors(PASS); + ng_send_data(hook, &msg4, sizeof(msg4)); + ng_errors(FAIL); + if (errno != 0) + break; + ng_handle_events(50, &r); + } + ATF_CHECK(r[0] == HOOKS && r[2] == 0); + + /* inspect mac table */ + ng_register_msg(get_tablesize); + rm.cnt = 0; + ng_errors(PASS); + rm.tok = ng_send_msg("bridge:", "gettable"); + ng_errors(FAIL); + if (rm.tok == (u_int32_t)-1) + { + ATF_CHECK_ERRNO(ENOBUFS, 1); + atf_tc_expect_fail("response too large"); + } + ng_handle_events(50, &rm); + ATF_CHECK(rm.cnt == HOOKS + 1); + atf_tc_expect_pass(); + + ng_shutdown("bridge:"); +} + +ATF_TC(many_broadcasts); +ATF_TC_HEAD(many_broadcasts, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(many_broadcasts, dummy) +{ + int r[4], i; + const int HOOKS = 1000; + + ng_init(); + ng_errors(PASS); + ng_shutdown("bridge:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "bridge", "link0"); + ng_name("a", "bridge"); + ng_register_data("a", get_data0); + + /* learn MAC */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[3] = 0xff; + ng_send_data("a", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0); + + /* use broadcast MAC */ + msg4.eh.ether_shost[3] = 0; + memset(msg4.eh.ether_dhost, 0xff, sizeof(msg4.eh.ether_dhost)); + + /* now send */ + bzero(r, sizeof(r)); + for (i = 1; i <= HOOKS; i++) + { + char hook[20]; + + snprintf(hook, sizeof(hook), "link%d", i); + ng_connect(".", hook, "bridge:", hook); + ng_register_data(hook, get_data3); + + msg4.eh.ether_shost[4] = i >> 8; + msg4.eh.ether_shost[5] = i & 0xff; + ng_errors(PASS); + ng_send_data(hook, &msg4, sizeof(msg4)); + ng_errors(FAIL); + if (errno != 0) + break; + ng_handle_events(50, &r); + } + ATF_CHECK(r[0] > 100 && r[3] > 100); + if (i < HOOKS) + atf_tc_expect_fail("netgraph queue full (%d)", i); + ATF_CHECK(r[0] == HOOKS); + atf_tc_expect_pass(); + + ng_shutdown("bridge:"); +} + +ATF_TC(uplink_private); +ATF_TC_HEAD(uplink_private, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(uplink_private, dummy) +{ + int r[4]; + struct gettable rm; + + ng_init(); + ng_errors(PASS); + ng_shutdown("bridge:"); + + ng_mkpeer(".", "u1", "bridge", "uplink1"); + if (errno > 0) + atf_tc_skip("uplinks are not supported."); + ng_errors(FAIL); + ng_name("u1", "bridge"); + ng_register_data("u1", get_data1); + ng_connect(".", "u2", "bridge:", "uplink2"); + ng_register_data("u2", get_data2); + ng_connect(".", "l0", "bridge:", "link0"); + ng_register_data("l0", get_data0); + ng_connect(".", "l3", "bridge:", "link3"); + ng_register_data("l3", get_data3); + + /* unknown unicast 0 from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1 && r[3] == 0); + + /* unknown unicast 2 from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + msg4.eh.ether_dhost[5] = 2; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 0); + + /* known unicast 0 from uplink2 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 2; + msg4.eh.ether_dhost[5] = 0; + ng_send_data("u2", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); + + /* known unicast 0 from link3 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 3; + msg4.eh.ether_dhost[5] = 0; + ng_send_data("l3", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); + + /* (un)known unicast 2 from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + msg4.eh.ether_dhost[5] = 2; + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1 && r[3] == 0); + + /* (un)known unicast 2 from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 0); + + /* unknown multicast 2 from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + msg4.eh.ether_dhost[0] = 0xff; + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); + + /* unknown multicast 2 from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); + + /* broadcast from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + memset(msg4.eh.ether_dhost, 0xff, sizeof(msg4.eh.ether_dhost)); + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); + + /* broadcast from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); + + /* inspect mac table */ + ng_register_msg(get_tablesize); + rm.tok = ng_send_msg("bridge:", "gettable"); + rm.cnt = 0; + ng_handle_events(50, &rm); + ATF_CHECK(rm.cnt == 2); + + ng_shutdown("bridge:"); +} + +ATF_TC(uplink_classic); +ATF_TC_HEAD(uplink_classic, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(uplink_classic, dummy) +{ + int r[4]; + struct gettable rm; + + ng_init(); + ng_errors(PASS); + ng_shutdown("bridge:"); + + ng_mkpeer(".", "l0", "bridge", "link0"); + if (errno > 0) + atf_tc_skip("uplinks are not supported."); + ng_errors(FAIL); + ng_name("l0", "bridge"); + ng_register_data("l0", get_data0); + ng_connect(".", "u1", "bridge:", "uplink1"); + ng_register_data("u1", get_data1); + ng_connect(".", "u2", "bridge:", "uplink2"); + ng_register_data("u2", get_data2); + ng_connect(".", "l3", "bridge:", "link3"); + ng_register_data("l3", get_data3); + + /* unknown unicast 0 from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); + + /* unknown unicast 2 from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + msg4.eh.ether_dhost[5] = 2; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); + + /* known unicast 0 from uplink2 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 2; + msg4.eh.ether_dhost[5] = 0; + ng_send_data("u2", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); + + /* known unicast 0 from link3 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 3; + msg4.eh.ether_dhost[5] = 0; + ng_send_data("l3", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); + + /* (un)known unicast 2 from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + msg4.eh.ether_dhost[5] = 2; + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); + + /* (un)known unicast 2 from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); + + /* unknown multicast 2 from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + msg4.eh.ether_dhost[0] = 0xff; + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); + + /* unknown multicast 2 from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); + + /* broadcast from uplink1 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 1; + memset(msg4.eh.ether_dhost, 0xff, sizeof(msg4.eh.ether_dhost)); + ng_send_data("u1", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); + + /* broadcast from link0 */ + bzero(r, sizeof(r)); + msg4.eh.ether_shost[5] = 0; + ng_send_data("l0", &msg4, sizeof(msg4)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); + + /* inspect mac table */ + ng_register_msg(get_tablesize); + rm.tok = ng_send_msg("bridge:", "gettable"); + rm.cnt = 0; + ng_handle_events(50, &rm); + ATF_CHECK(rm.cnt == 2); + + ng_shutdown("bridge:"); +} + +ATF_TP_ADD_TCS(bridge) +{ + ATF_TP_ADD_TC(bridge, basic); + ATF_TP_ADD_TC(bridge, loop); + ATF_TP_ADD_TC(bridge, persistence); + ATF_TP_ADD_TC(bridge, many_unicasts); + ATF_TP_ADD_TC(bridge, many_broadcasts); + ATF_TP_ADD_TC(bridge, uplink_private); + ATF_TP_ADD_TC(bridge, uplink_classic); + + return atf_no_error(); +} + +static inline void +_get_data(void *data, size_t len, void *ctx, int i) +{ + int *cnt = ctx; + + (void)data; + fprintf(stderr, "[%d] Got %zu bytes of data.\n", i, len); + cnt[i]++; +} + +#define GD(x) static void \ +get_data##x(void *data, size_t len, void *ctx) {\ + _get_data(data, len, ctx, x); \ +} + +GD(0) +GD(1) +GD(2) +GD(3) + +static void +get_tablesize(char const *source, struct ng_mesg *msg, void *ctx) +{ + struct gettable *rm = ctx; + struct ng_bridge_host_ary *gt = (void *)msg->data; + + fprintf(stderr, "Response from %s to query %d\n", source, msg->header.token); + if (rm->tok == msg->header.token) + rm->cnt = gt->numHosts; +} From owner-dev-commits-src-all@freebsd.org Tue Jun 8 13:37:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0173565F572; Tue, 8 Jun 2021 13:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsJ6f4lz4qVT; Tue, 8 Jun 2021 13:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC9821B2F; Tue, 8 Jun 2021 13:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dbu2J074747; Tue, 8 Jun 2021 13:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dbuii074746; Tue, 8 Jun 2021 13:37:56 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:37:56 GMT Message-Id: <202106081337.158Dbuii074746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1adf2f76c0c8 - stable/12 - pf: Avoid leaking pad bytes in struct pfr_astats when copying out MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:37:57 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a commit 1adf2f76c0c89db1beb2de4ac03a0b70db84bb6a Author: Mark Johnston AuthorDate: 2021-06-01 14:56:23 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:37:48 +0000 pf: Avoid leaking pad bytes in struct pfr_astats when copying out There is padding between pfr_astats.pfras_a and pfras_packets that was not getting initialized. Reported by: KMSAN Reviewed by: kp, imp Sponsored by: The FreeBSD Foundation (cherry picked from commit 60a38abb8982e11ee71559057dd7128bd097043e) --- sys/netpfil/pf/pf_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 58b453cd550c..e9fd5f133c3f 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -1029,6 +1029,7 @@ pfr_copyout_astats(struct pfr_astats *as, const struct pfr_kentry *ke, int dir, op; const struct pfr_kcounters *kc = &ke->pfrke_counters; + bzero(as, sizeof(*as)); pfr_copyout_addr(&as->pfras_a, ke); as->pfras_tzero = kc->pfrkc_tzero; From owner-dev-commits-src-all@freebsd.org Tue Jun 8 13:37:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22EE865F6CD; Tue, 8 Jun 2021 13:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsL0PFNz4q9j; Tue, 8 Jun 2021 13:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E87351B30; Tue, 8 Jun 2021 13:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158DbvCa074771; Tue, 8 Jun 2021 13:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158DbvXT074770; Tue, 8 Jun 2021 13:37:57 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:37:57 GMT Message-Id: <202106081337.158DbvXT074770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0a41a2899eb2 - stable/12 - i386: Make setidt_disp a size_t instead of uintptr_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0a41a2899eb226d34996b2470cf239d670ff186e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:37:58 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a41a2899eb226d34996b2470cf239d670ff186e commit 0a41a2899eb226d34996b2470cf239d670ff186e Author: Mark Johnston AuthorDate: 2021-06-01 14:28:57 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:37:48 +0000 i386: Make setidt_disp a size_t instead of uintptr_t setidt_disp is the offset of the ISR trampoline relative to the address of the routines in exception.s, so uintptr_t is not quite right. Also remove a bogus declaration I added in commit 18f55c67f7, it is not required after all. Reported by: jrtc27 Reviewed by: jrtc27, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit cbe59a6475b6c36fac4073bcfc328099fc873420) --- sys/i386/i386/machdep.c | 2 +- sys/i386/include/md_var.h | 2 +- sys/x86/x86/local_apic.c | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 4ef37861b151..1aed12f422bc 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1527,7 +1527,7 @@ static struct soft_segment_descriptor ldt_segs[] = { .ssd_gran = 1 }, }; -uintptr_t setidt_disp; +size_t setidt_disp; void setidt(int idx, inthand_t *func, int typ, int dpl, int selec) diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 53e1861c8fff..0f0177012f3a 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -49,7 +49,7 @@ extern int sz_lcall_tramp; #endif extern uint32_t *vm_page_dump; extern vm_offset_t proc0kstack; -extern uintptr_t setidt_disp; +extern size_t setidt_disp; struct segment_descriptor; union savefpu; diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index a34cfbb8b1c9..759c1ae8625a 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2113,10 +2113,6 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ -#ifdef __i386__ -extern uintptr_t setidt_disp; -#endif - /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. From owner-dev-commits-src-all@freebsd.org Tue Jun 8 13:38:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1F6765F6CF; Tue, 8 Jun 2021 13:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsQ5TLDz4qLY; Tue, 8 Jun 2021 13:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4D491D80; Tue, 8 Jun 2021 13:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dc2XJ074916; Tue, 8 Jun 2021 13:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dc2Nr074915; Tue, 8 Jun 2021 13:38:02 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:38:02 GMT Message-Id: <202106081338.158Dc2Nr074915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5a7d63129a67 - stable/13 - pf: Avoid leaking pad bytes in struct pfr_astats when copying out MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a7d63129a67ab5b343ef3054fa1ac4122218506 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:38:02 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5a7d63129a67ab5b343ef3054fa1ac4122218506 commit 5a7d63129a67ab5b343ef3054fa1ac4122218506 Author: Mark Johnston AuthorDate: 2021-06-01 14:56:23 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:27:07 +0000 pf: Avoid leaking pad bytes in struct pfr_astats when copying out There is padding between pfr_astats.pfras_a and pfras_packets that was not getting initialized. Reported by: KMSAN Reviewed by: kp, imp Sponsored by: The FreeBSD Foundation (cherry picked from commit 60a38abb8982e11ee71559057dd7128bd097043e) --- sys/netpfil/pf/pf_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index af2f614c9e8c..f643790ff620 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -1028,6 +1028,7 @@ pfr_copyout_astats(struct pfr_astats *as, const struct pfr_kentry *ke, int dir, op; const struct pfr_kcounters *kc = &ke->pfrke_counters; + bzero(as, sizeof(*as)); pfr_copyout_addr(&as->pfras_a, ke); as->pfras_tzero = kc->pfrkc_tzero; From owner-dev-commits-src-all@freebsd.org Tue Jun 8 13:38:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A92C65F6D0; Tue, 8 Jun 2021 13:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsR6mnxz4qJ6; Tue, 8 Jun 2021 13:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C83521D07; Tue, 8 Jun 2021 13:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dc3DO074942; Tue, 8 Jun 2021 13:38:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dc3DX074941; Tue, 8 Jun 2021 13:38:03 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:38:03 GMT Message-Id: <202106081338.158Dc3DX074941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 949fb4f9627b - stable/13 - i386: Make setidt_disp a size_t instead of uintptr_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 949fb4f9627b2727e4e3775d24dbc76638e885de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:38:04 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=949fb4f9627b2727e4e3775d24dbc76638e885de commit 949fb4f9627b2727e4e3775d24dbc76638e885de Author: Mark Johnston AuthorDate: 2021-06-01 14:28:57 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:27:32 +0000 i386: Make setidt_disp a size_t instead of uintptr_t setidt_disp is the offset of the ISR trampoline relative to the address of the routines in exception.s, so uintptr_t is not quite right. Also remove a bogus declaration I added in commit 18f55c67f7, it is not required after all. Reported by: jrtc27 Reviewed by: jrtc27, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit cbe59a6475b6c36fac4073bcfc328099fc873420) --- sys/i386/i386/machdep.c | 2 +- sys/i386/include/md_var.h | 2 +- sys/x86/x86/local_apic.c | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 888550eab6ad..6b622c826265 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1514,7 +1514,7 @@ static struct soft_segment_descriptor ldt_segs[] = { .ssd_gran = 1 }, }; -uintptr_t setidt_disp; +size_t setidt_disp; void setidt(int idx, inthand_t *func, int typ, int dpl, int selec) diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index c41de85b9bc9..95f4907a61d0 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -48,7 +48,7 @@ extern int szosigcode; extern int sz_lcall_tramp; #endif extern vm_offset_t proc0kstack; -extern uintptr_t setidt_disp; +extern size_t setidt_disp; struct segment_descriptor; union savefpu; diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 28443c43cfc9..ee549559f5b1 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2115,10 +2115,6 @@ native_lapic_ipi_vectored(u_int vector, int dest) #endif /* SMP */ -#ifdef __i386__ -extern uintptr_t setidt_disp; -#endif - /* * Since the IDT is shared by all CPUs the IPI slot update needs to be globally * visible. From owner-dev-commits-src-all@freebsd.org Tue Jun 8 13:38:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BDA465F90D; Tue, 8 Jun 2021 13:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzrsT1Fpnz4qJ9; Tue, 8 Jun 2021 13:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB01A1D81; Tue, 8 Jun 2021 13:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Dc43J074975; Tue, 8 Jun 2021 13:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Dc4tL074974; Tue, 8 Jun 2021 13:38:04 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:38:04 GMT Message-Id: <202106081338.158Dc4tL074974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cb5fe9aa9fa0 - stable/13 - amd64: Clear the local TSS when creating a new thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb5fe9aa9fa0376078abc173b27605b6096dc681 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:38:05 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cb5fe9aa9fa0376078abc173b27605b6096dc681 commit cb5fe9aa9fa0376078abc173b27605b6096dc681 Author: Mark Johnston AuthorDate: 2021-06-01 23:38:22 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:33:59 +0000 amd64: Clear the local TSS when creating a new thread Otherwise it is copied from the creating thread. Then, if either thread exits, the other is left with a dangling pointer, typically resulting in a page fault upon the next context switch. Reported by: syzkaller Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 8cd05b883330049d536a40e2f4c9ff92d0e6944e) --- sys/amd64/amd64/vm_machdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 1acc5dc55c85..7d65269410e0 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -189,6 +189,8 @@ copy_thread(struct thread *td1, struct thread *td2) * pcb2->pcb_[fg]sbase: cloned above */ + pcb2->pcb_tssp = NULL; + /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; From owner-dev-commits-src-all@freebsd.org Tue Jun 8 13:50:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8A0665FBB1; Tue, 8 Jun 2021 13:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzs7n5CLBz4rhb; Tue, 8 Jun 2021 13:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C1FB1B67; Tue, 8 Jun 2021 13:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158DoTlk096313; Tue, 8 Jun 2021 13:50:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158DoTmi096312; Tue, 8 Jun 2021 13:50:29 GMT (envelope-from git) Date: Tue, 8 Jun 2021 13:50:29 GMT Message-Id: <202106081350.158DoTmi096312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 97993d1ebf59 - main - hyperv: Fix vmbus after the i386 4/4 split MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97993d1ebf592ac6689a498d5d0d2afb46758680 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 13:50:29 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97993d1ebf592ac6689a498d5d0d2afb46758680 commit 97993d1ebf592ac6689a498d5d0d2afb46758680 Author: Mark Johnston AuthorDate: 2021-06-08 13:40:30 +0000 Commit: Mark Johnston CommitDate: 2021-06-08 13:40:30 +0000 hyperv: Fix vmbus after the i386 4/4 split The vmbus ISR needs to live in a trampoline. Dynamically allocating a trampoline at driver initialization time poses some difficulties due to the fact that the KENTER macro assumes that the offset relative to tramp_idleptd is fixed at static link time. Another problem is that native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline offset. Rather than fight this, move the Hyper-V ISR to i386/exception.s. Add a new HYPERV kernel option to make this optional, and configure it by default on i386. This is sufficient to make use of vmbus(4) after the 4/4 split. Note that vmbus cannot be loaded dynamically and both the HYPERV option and device must be configured together. I think this is not too onerous a requirement, since vmbus(4) was previously non-functional. Reported by: Harry Schmalzbauer Tested by: Harry Schmalzbauer Reviewed by: whu, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30577 --- sys/conf/files.i386 | 1 - sys/conf/options.i386 | 3 +++ sys/dev/hyperv/vmbus/i386/vmbus_vector.S | 6 +++++- sys/i386/conf/GENERIC | 4 +++- sys/i386/i386/exception.s | 9 +++++++++ sys/modules/hyperv/vmbus/Makefile | 5 ++++- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 331ad5fec79a..10e286dae271 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -102,7 +102,6 @@ dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb dev/hyperv/vmbus/i386/hyperv_machdep.c optional hyperv -dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv dev/le/if_le_isa.c optional le isa dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 4249fa1dfd0a..5e7ea446089b 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -101,6 +101,9 @@ NPX_DEBUG opt_npx.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h +# Hyper-V support +HYPERV opt_hyperv.h + XENHVM opt_global.h # options for the Intel C600 SAS driver (isci) diff --git a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S index 0570c6b49e1c..d119cfdc5b12 100644 --- a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S +++ b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S @@ -35,6 +35,9 @@ /* * This is the Hyper-V vmbus channel direct callback interrupt. * Only used when it is running on Hyper-V. + * + * Note that this file is not compiled directly, it is included into + * i386/exception.s. */ .text SUPERALIGN_TEXT @@ -45,6 +48,7 @@ IDTVEC(vmbus_isr) cld KENTER pushl %esp - call vmbus_handle_intr + mov $vmbus_handle_intr, %eax + call *%eax add $4, %esp jmp doreti diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 1b4d853fe1d4..288968d84af1 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -339,7 +339,9 @@ device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers and enhancement support -device hyperv # HyperV drivers +# NOTE: HYPERV depends on hyperv. They must be added or removed together. +options HYPERV # Kernel support for HyperV drivers +device hyperv # HyperV drivers # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 6989d3e2828a..f47ab92f1987 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -39,6 +39,7 @@ #include "opt_apic.h" #include "opt_atpic.h" #include "opt_hwpmc_hooks.h" +#include "opt_hyperv.h" #include "assym.inc" @@ -404,6 +405,14 @@ ENTRY(fork_trampoline) #ifdef DEV_APIC #include +#endif + +#ifdef HYPERV + .data + .p2align 4 + .text + SUPERALIGN_TEXT +#include #endif .data diff --git a/sys/modules/hyperv/vmbus/Makefile b/sys/modules/hyperv/vmbus/Makefile index 435106c7e9bd..47a83e76204a 100644 --- a/sys/modules/hyperv/vmbus/Makefile +++ b/sys/modules/hyperv/vmbus/Makefile @@ -13,8 +13,11 @@ SRCS= hyperv.c \ vmbus_et.c \ vmbus_if.c \ vmbus_res.c \ - vmbus_vector.S \ vmbus_xact.c + +.if ${MACHINE_CPUARCH} != "i386" +SRCS+= vmbus_vector.S +.endif SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h pci_if.h pcib_if.h vmbus_if.h # XXX: for assym.inc From owner-dev-commits-src-all@freebsd.org Tue Jun 8 14:15:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ABF563804C for ; Tue, 8 Jun 2021 14:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzshx6flxz4vC1; Tue, 8 Jun 2021 14:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCB842585; Tue, 8 Jun 2021 14:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158EFj4a035033; Tue, 8 Jun 2021 14:15:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158EFj9W035032; Tue, 8 Jun 2021 14:15:45 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:15:45 GMT Message-Id: <202106081415.158EFj9W035032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 3522f57b6ada - vendor/openzfs/master - vendor branch created MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: 3522f57b6ada25bb58a88307971544ce49f39c66 X-Git-Oldrev: 0000000000000000000000000000000000000000 X-Git-Newrev: 3522f57b6ada25bb58a88307971544ce49f39c66 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:15:46 -0000 The branch vendor/openzfs/master has been created by mm: URL: https://cgit.FreeBSD.org/src/log/?id=3522f57b6ada f1ca4da6f797 Initial commit. All spl source written up to this point wrapped in an initial reasonable autoconf style build system. This does not yet build but the configure system does appear to work properly and integrate with the kernel. Hopefully the next commit gets us back to a buildable version we can run the test suite against. 8f48c2c853b6 Whoops, I knew I'd miss something small in the build system. Fix it 564f6d1509f7 User space build fixes: - Add list handling compatibility library - Drop uu_* list handling in favor of local list implementation - libtoolize - generic makefile cleanup 3d4ea0ced6c2 More build fixes, I have the kernel module almost building and its feeling a lot more sane, cleaner, and linuxy. I may finish this tonight. f1b59d2620ae Lots of build fixes. This is turning out to be a very good idea since it forcefully codifing the ABI. Since the shim layer is no longer linked at build time in to the test suite we can;'t cut any corners and get away with it. 15821fd660fd Move dir ce58df922657 Move dir d01858a1ca78 Move dir 032d12a90053 Move dir 1735fa73f4ac New approach a0aadf5666d5 OK, everything builds now. My initial intent was to place all of the directories at the top level but that proved troublesome. The kernel buildsystem and autoconf were conflicting too much. To resolve the issue I moved the kernel bits in to a modules directory which can then only use the kernel build system. We just pass along the likely make targets to the kernel build system. e4009e98c756 Quiet libtool 70eadc19583d OK, it builds... and the modules load... now for some more cleanup to remove the remaining vestages of the time it lives with the ZFS code. 7c50328b40df More cleanup. - Removed all references to kzt and replaced with splat - Moved portions of include files which do not need to be available to all source files in to local.h files in proper source subdirs. 07d339d46733 Add top level make check target which runs the validation suite. Careful with this right now one of the tests still causes a lockup on the node. This happened before the move from the ZFS repo so its not a new issue. 596e65b4e8e9 OK, I think this is the last of major cleanup and restructuring. We've dropped all the linux- prefixes on the file in favor of spl- which makes more sense. And we've cleaned up some of the includes so everybody should be including their own dependencies properly. All a module which wants to use the spl support needs to do in include spl.h and ensure it has access to Module.symvers. 09b414e880b0 Minor nit, SOLARIS should be SPL f4b377415b4b Reorganize /include/ to add a /sys/, this way we don't need to muck with #includes in existing Solaris style source to get it to find the right stuff. ea70970ff5a3 Almost dropped this! d5f087adef0e Remaining lose ends dbb484ec6002 Stub out some missing headers which are expected. I'll fill in what the contents need to be as I encounter the warnings about missing prototypes, symbols, and such. 14c5326ccd05 More stub headers, moved generic to sysmacros, added some more macros for kernel compatibility 48f940b94399 Fix type 23f28c4f75b6 Remove spl.h, just include the headers you need. Add a few more stubs. a713518f5d9e Checkpoint for the night, added a few more stub headers, fleshed out a few stub headers, added a FIXME file, added various compatibility macros 77b1fe8fa868 Add highbit func, Add sloopy atomic declaration which will need to be fixed (eventually) Fill out more of the Solaris VM hooks Adjust the create_thread function ed61a7d05eb9 Add some missing rw_lock symbols b0dd3380aae2 Minor atomic cleanup, this needs to be done right. Fixed a bug in the timer code Added missing macros 3b3ba48fe9a6 Add missing cred.h functions Resolve compiler warning with kmem_free (unused len) Add stub for byteorder.h Add zlib shim for compress2 and uncompress functions 0b3cf046cb5b Add the initial vestigates of vnode support 05ae387b5024 Add somre debugging support 12472b242dc3 Just filling in more of the env. 6adf99e7d6c1 Add missing headers 4098c921b68e Fix systemic naming mistake 51f443a0741b Add some typedefs to make it clearer when we passing a function, Add fm_panic define Add another bad atomic hack (need to do this right) ee4766827a6e Remap gethrestime() with #define to new symbol and export that new symbol to avoid direct use of GPL only symbol. b123971fc2f9 Two more GPL only symbols moved to helper functions in the spl module. 9490c1483593 Apply fix from bug239 for rwlock deadlock. 4b17158506d5 - Implemented vnode interfaces and 6 test cases to the test suite. - Re-implmented kobj support based on the vnode support. - Add TESTS option to check.sh, and removed delay after module load. 2f5d55aac5bf Add copyin/copyout mapping Fix some vnode types 36e6f8614643 - Add some more missing headers - Map the LE/BE_* byteorder macros to the linux versions - More minor vnodes fixes 73e540a0d1cc Drop unicode support, provided in ZFS tree libport Update uio support 8ddd0ee4154e Add two more missing headers ea19fbed0538 Add missing headers af828292e585 Add missing headers Rework vnodes to be based on the slab cache, just like on Solaris. 79b31f3601af Fix KMEM_DEBUG support (enable by default) Add vmem_alloc/vmem_free support (and test case) Add missing time functions c19c06f3b05a Fix kmem memory accounting 2bdb28fbe07d Missing headers, more minor fixes 1ec74a114cc4 Minimal signal handling interface. 5d86345d3753 Initial pass at a file API getf/releasef hooks e4f1d29f89b7 OK, some pretty substantial rework here. I've merged the spl-file stuff which only inclused the getf()/releasef() in to the vnode area where it will only really be used. These calls allow a user to grab an open file struct given only the known open fd for a particular user context. ZFS makes use of these, but they're a bit tricky to test from within the kernel since you already need the file open and know the fd. So we basically spook the system calls to setup the environment we need for the splat test case and verify given just the know fd we can get the file, create the needed vnode, and then use the vnode interface as usual to read and write from it. 4e62fd4104e9 OK, a first reasonable attempt at a solaris module/chdev shim layer. This should handle the absolute minimum I need for ZFS. It will register the chdev with the right callbacks. Then the generic registered linux callback will find the right registered solaris callback for the function and munge the args just right before passing it on. Should work, but untested (just compiled), so I expect bugs. 336bb0c0c1e0 Two fixes to the module interface. Could be worse! 8ac547ec4c96 Relocated to zfs repo d429b03d85ee - Thinko fix to the SPL module interface - Enhanse the VERIFY() support to output the values which failed to compare as expected before crashing. This make debugging much much much easier. 4a4295b26736 Remove minor lingering CDDL tait of copied headers. Required headers rewritten to include minimally what we need. 9f4c835a0efd Correctly functioning 64-bit atomic shim layer. It's not what I would call effecient but it does have the advantage of being correct which is all I need right now. I added a regression test as well. e487ee08fb0b Fixed that. 8d0f1ee907d4 Add some crude debugging support. It leaves alot to be desired, but it should allow more easy kernel debugging for now. 4fd2f7eea565 Add vmem_zalloc support. e966e04fd52e Ensure all file ops pointer are NULL or we may end up calling garbage pointers on open/close etc and get what look like random crashes. 6a585c61de0f Double large kmalloc warning size to 4 pages. It was 2 pages, and ideally it should be dropped to one page but in the short term we should be able to easily live with 4 page allocations. 0998fdd6dba7 Apparently it's OK for done to be NULL, which was not clear in the Solaris man page. Anyway, since apparently this usage is accectable I've updated the function to handle it. 0a6fd143fd6d - Remapped ldi_handle_t to struct block_device * which is much more useful - Added liunx block device headers to sunldi.h - Made __taskq_dispatch safe for interrupt context where it turns out we need to be useing it. - Fixed NULL const/dest bug for kmem slab caches - Places debug __dprintf debugging messages under a spin_lock_irqsave so it's safe to use then in interrupt handlers. For debugging only! 996faa68697e Correctly implement atomic_cas_ptr() function. Ideally all of these atomic operations will be rewritten anyway with the correct arch specific assembly. But not today. 968eccd1d1cb Update the thread shim to use the current kernel threading API. We need to use kthread_create() here for a few reasons. First off to old kernel_thread() API functioin will be going away. Secondly, and more importantly if I use kthread_create() we can then properly implement a thread_exit() function which terminates the kernel thread at any point with do_exit(). This fixes our cleanup bug which was caused by dropping a mutex twice after thread_exit() didn't really exit. 728b9dd80074 - Fix write-only behavior in vn-open() - Ensure we have at least 1 write-only splat test - Fix return codes for vn_* Solaris does not use negative return codes in the kernel. So linux errno's must be inverted. 79f92663e369 Fix race in rwlock implementation which can occur when your task is rescheduled to a different cpu after you've taken the lock but before calling RW_LOCK_HELD is called. We need the spinlock to ensure there is a wmb() there. 115aed0dd8ea - Add more strict in_atomic() checking to the mutex entry function just to be extra safety and paranoid. 12ea923056d9 Adjust the condition variables to simply sleep uninteruptibly. This way we don't have to contend with superious wakeups which it appears ZFS is not so careful to handle anyway. So this is probably for the best. f23e92fabf09 Add hw_serial support based on a usermodehelper which runs at spl module load time can calls hostid. The resolved hostid is then fed back in to a proc entry for latter use. It's not a pretty thing, but it will work for now. The hw_serial is required for things such as 'zpool status' to work. c5fd77fcbf20 Just cleanup up an error case to avoid overspamming the console. We get the stack once from the BUG() no reason to dump it twice. d61e12af5af3 - Add some spinlocks to cover all the private data in the mutex. I don't think this should fix anything but it's a good idea regardless. 55152ebbb46f * modules/spl/spl-kmem.c : Make sure to disable interrupts when necessary to avoid deadlocks. We were seeing the deadlock when calling kmem_cache_generic_constructor() and then an interrupt forced us to end up calling kmem_cache_generic_destructor() which caused our deadlock. 57d1b1885897 First commit of lustre style internal debug support. These changes bring over everything lustre had for debugging with two exceptions. I dropped by the debug daemon and upcalls just because it made things a little easier. They can be readded easily enough if we feel they are needed. ce86265693be Whoops need this! 2fae1b3d0af1 Frist minor batch of fixes. Catch a dropped ;, and use SBUG instead of BUG. 937879f11db1 Update SPL to use new debug infrastructure. This means: - Replacing all BUG_ON()'s with proper ASSERT()'s - Using ENTRY,EXIT,GOTO, and RETURN macro to instument call paths 892d51061e04 Handful of minor stack checking fixes a8ac0b89668d Whoops, missed an instance where we could recursively stack check... bad. e5bbd245e351 Added 4 missing subsystem flags *** 6569 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Jun 8 14:26:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10C8263850F; Tue, 8 Jun 2021 14:26:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzsx05YQSz3BqD; Tue, 8 Jun 2021 14:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6F9824DA; Tue, 8 Jun 2021 14:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158EQC6o081380; Tue, 8 Jun 2021 14:26:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158EQChA081379; Tue, 8 Jun 2021 14:26:12 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:26:12 GMT Message-Id: <202106081426.158EQChA081379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: ed9215c8e05f - main - zfs: merge openzfs/zfs@3522f57b6 (master) to main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed9215c8e05f06c00683bb0624e82644796d4385 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:26:13 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=ed9215c8e05f06c00683bb0624e82644796d4385 commit ed9215c8e05f06c00683bb0624e82644796d4385 Merge: 97993d1ebf59 3522f57b6ada Author: Martin Matuska AuthorDate: 2021-06-08 14:23:50 +0000 Commit: Martin Matuska CommitDate: 2021-06-08 14:25:14 +0000 zfs: merge openzfs/zfs@3522f57b6 (master) to main This changes branch tracking of sys/contrib/openzfs to a new direct-import branch vendor/openzfs/master. No functional changes. OpenZFS tag: 2.1.0-rc1 sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 1 + sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 1 + sys/contrib/openzfs/scripts/zfs-images | 1 + 3 files changed, 3 insertions(+) diff --cc sys/contrib/openzfs/scripts/zfs-images index 000000000000,3331601f6dc5..3331601f6dc5 mode 000000,160000..160000 --- a/sys/contrib/openzfs/scripts/zfs-images +++ b/sys/contrib/openzfs/scripts/zfs-images From owner-dev-commits-src-all@freebsd.org Tue Jun 8 14:29:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D68256384C3 for ; Tue, 8 Jun 2021 14:29:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzt0K5l1Kz3C42; Tue, 8 Jun 2021 14:29:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD52427DB; Tue, 8 Jun 2021 14:29:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158ET55q082832; Tue, 8 Jun 2021 14:29:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158ET5cI082831; Tue, 8 Jun 2021 14:29:05 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:29:05 GMT Message-Id: <202106081429.158ET5cI082831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 3522f57b6ada..75b4cbf62590 - vendor/openzfs/master - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: 75b4cbf62590c23fac3667537961a2a75fdc2cc3 X-Git-Oldrev: 3522f57b6ada25bb58a88307971544ce49f39c66 X-Git-Newrev: 75b4cbf62590c23fac3667537961a2a75fdc2cc3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:29:05 -0000 The branch vendor/openzfs/master has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=3522f57b6ada..75b4cbf62590 9ac82cab2d8e Update META 67859aedd14e Add compatibility file sets (ZoL 0.6.1, 0.6.4, OpenZFS 2.1) 0c2eb3f54075 fsck.zfs: implement 4/8 exit codes as suggested in manpage 19c9247d5754 Fixing m4 iops rename check 9f9e1b5425ff CI: Increase free space in workflow 3ba10f9a6ae3 Atomically check and set dropped zevent count 032a213e2e6b Don't scale zfs_zevent_len_max by CPU count c05eec32a7f7 Allow pool names that look like Solaris disk names fe6babced2f3 Bump libzfs.so and libzpool.so versions 02aaf11fc793 FreeBSD: Fix stable/12 after AT_BENEATH removal dce31763491e Avoid taking global lock to destroy zfsdev state 583e32054697 ZTS: inheritance/inherit_001_pos is flaky 3ef80eefff37 zed: set names for all threads ca2ce9c50b6b zed: use separate reaper thread and collect ZEDLETs asynchronously 02a0fa19995a zed: remove unused zed_file_close_on_exec() 73218f41b441 zed: allow limiting concurrent jobs c0af3c7b2c7b Add RELEASES.md file 943df59ed942 bash_completion.d: always call zfs/zpool binaries directly bf169e9f15ef Fix various typos ec580225d2b2 ZTS: pool_checkpoint improvements 61b50107a58a libzutil: zfs_isnumber(): return false if input empty d35708b18705 man: fix wrong .Xr macros usages 57a1214e3aa2 zpool-features.5: remove "booting not possible with this feature"s bbcec73783c5 kmem_alloc(KM_SLEEP) should use kvmalloc() a03b288cf08f zfs get -p only outputs 3 columns if "clones" property is empty 55419e0a721f i-t: fix root=zfs:AUTO aa5a4eb5d0d7 i-t: don't brokenly set the scheduler for root pool vdev's disks d5ef91af0266 Obsolete earlier packages due to version bump cfd4a25fcec3 fix misplaced quotes in kmod-preamble 7367be0da935 Add kmodtool fix to detect different System.map location 3bc3eef9c3f1 zed: print combined system/user time after ZEDLET death 64c03a0a27a4 zed: implement close_from() in terms of /proc/self/fd, if available ed519ad495db zed: purge all mentions of a configuration file c52612ba0315 zed.8: don't pretend an unprivileged user could change the script owner 1a05182ba0dd zed: bump zfs_zevent_len_max if we miss any events 0d0720eb52c1 zed: remove unused zed_file_read_n() 3d62acf0adbc zed: merge all _NOT_IMPLEMENTED_ events 54f6daea7ae0 zed: replace zed_file_write_n() with write(2), purge it 509a2dcf7dcf zed.8: the Diagnosis Engine is implemented c9c6537731d2 zed: only go up to current limit in close_from() fallback e778b0485baa Ratelimit deadman zevents as with delay zevents 383401589e0f ZTS: Tests using zhack may fail on FreeBSD 9c3b926b0ed7 Fix double sha1/sha1.o line in module/icp/Makefile.in 600a1dc54cad Use dsl_scan_setup_check() to setup a scrub 46fb4783260f Added check for broken alien version 5d508d92d2dd ZTS: Improve cleanup in removal_with_export 161ed825ca08 zpl_inode.c: Fix SMACK interoperability 1dff54527806 Eliminate zfsdev_get_state_impl a631283b745e Move zfsdev_state_{init,destroy} to common code ea4541e4c6c1 zstreamdump: exec zstream dump 519aec83f574 zvol_wait: fix for zvols with spaces in name, optimise 0f2915602e9d arc_summary3: just read /s/m/{mod}/version instead of spawning cat e09318829b94 contrib/bpftrace: exec bpftrace, remove useless cat ecbf7c670787 zfs_ids_to_path: the -v comes after the executable name 4640baab69cd zfs_ids_to_path: print correct wrong values d08dc34515cf zvol_wait: properly handle zvol_volmode sysctl being 3/none 2ec0b0dd71b7 kmod-zfs should obsolete kmod-spl as well as spl-kmod 099fa7e475d3 Allow zfs to send replication streams with missing snapshots 83cc6bbf7990 zed: print out licence string as one big chunk d622f16b6bb1 zed: untangle -h option listing 88bf37d91a12 zed: _zed_conf_display_help(): be consistent about what got_err means d09bd1962919 zed: remove zed_conf::syslog_facility 46d50eaf56ea zed: remove zed_conf::{min,max}_events and ZED_{MIN,MAX}_EVENTS 346c85b72298 zed: don't malloc() global zed_conf instance, optimise zed_conf layout e0779d1e2044 zed: untangle _zed_conf_parse_path() 0241dfac473d zfs-[un]jail(8): fix "zfs-jail [un]jail" leftovers 0395cf92e02d zfprops(8): fix spacing in jailed= arguments e568853f9668 libzfs_crypto.c: remove unused key_locator enum 0fc401a7ef63 libzfs: zfs_crypto_create() requires a new key by definition: set newkey 92ffd87aafd2 libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fds 10b575d04cda lib/: set O_CLOEXEC on all fds ea3cd8e420c9 ZTS: Add known exceptions 458f82319a74 Balance parentheses in parameter descriptions 4ef03d077cb4 Update libzfs.abi for zfs_send() change 888700bc6b4e ZTS: fix removal_condense_export test case e086db16568e Improvements to the 'compatibility' property 722b7f9a4c8f libuutil: purge unused functions ee6615e07a8b cmd/zfs receive: allow dry-run (-n) to check property args 53e9540e41d5 .gitmodules: link to openzfs github repository d8c09f3fccd3 FreeBSD: add support for lockless symlink lookup 5ad86e973ce4 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr *** 207 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Jun 8 14:29:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7357638647 for ; Tue, 8 Jun 2021 14:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzt1848V5z3Bw1; Tue, 8 Jun 2021 14:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77C7623F7; Tue, 8 Jun 2021 14:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158ETmjH084406; Tue, 8 Jun 2021 14:29:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158ETmR7084405; Tue, 8 Jun 2021 14:29:48 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:29:48 GMT Message-Id: <202106081429.158ETmR7084405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 3522f57b6ada - vendor/openzfs/zfs-2.1-release - vendor branch created MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/zfs-2.1-release X-Git-Reftype: branch X-Git-Commit: 3522f57b6ada25bb58a88307971544ce49f39c66 X-Git-Oldrev: 0000000000000000000000000000000000000000 X-Git-Newrev: 3522f57b6ada25bb58a88307971544ce49f39c66 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:29:48 -0000 The branch vendor/openzfs/zfs-2.1-release has been created by mm: URL: https://cgit.FreeBSD.org/src/log/?id=3522f57b6ada f1ca4da6f797 Initial commit. All spl source written up to this point wrapped in an initial reasonable autoconf style build system. This does not yet build but the configure system does appear to work properly and integrate with the kernel. Hopefully the next commit gets us back to a buildable version we can run the test suite against. 8f48c2c853b6 Whoops, I knew I'd miss something small in the build system. Fix it 564f6d1509f7 User space build fixes: - Add list handling compatibility library - Drop uu_* list handling in favor of local list implementation - libtoolize - generic makefile cleanup 3d4ea0ced6c2 More build fixes, I have the kernel module almost building and its feeling a lot more sane, cleaner, and linuxy. I may finish this tonight. f1b59d2620ae Lots of build fixes. This is turning out to be a very good idea since it forcefully codifing the ABI. Since the shim layer is no longer linked at build time in to the test suite we can;'t cut any corners and get away with it. 15821fd660fd Move dir ce58df922657 Move dir d01858a1ca78 Move dir 032d12a90053 Move dir 1735fa73f4ac New approach a0aadf5666d5 OK, everything builds now. My initial intent was to place all of the directories at the top level but that proved troublesome. The kernel buildsystem and autoconf were conflicting too much. To resolve the issue I moved the kernel bits in to a modules directory which can then only use the kernel build system. We just pass along the likely make targets to the kernel build system. e4009e98c756 Quiet libtool 70eadc19583d OK, it builds... and the modules load... now for some more cleanup to remove the remaining vestages of the time it lives with the ZFS code. 7c50328b40df More cleanup. - Removed all references to kzt and replaced with splat - Moved portions of include files which do not need to be available to all source files in to local.h files in proper source subdirs. 07d339d46733 Add top level make check target which runs the validation suite. Careful with this right now one of the tests still causes a lockup on the node. This happened before the move from the ZFS repo so its not a new issue. 596e65b4e8e9 OK, I think this is the last of major cleanup and restructuring. We've dropped all the linux- prefixes on the file in favor of spl- which makes more sense. And we've cleaned up some of the includes so everybody should be including their own dependencies properly. All a module which wants to use the spl support needs to do in include spl.h and ensure it has access to Module.symvers. 09b414e880b0 Minor nit, SOLARIS should be SPL f4b377415b4b Reorganize /include/ to add a /sys/, this way we don't need to muck with #includes in existing Solaris style source to get it to find the right stuff. ea70970ff5a3 Almost dropped this! d5f087adef0e Remaining lose ends dbb484ec6002 Stub out some missing headers which are expected. I'll fill in what the contents need to be as I encounter the warnings about missing prototypes, symbols, and such. 14c5326ccd05 More stub headers, moved generic to sysmacros, added some more macros for kernel compatibility 48f940b94399 Fix type 23f28c4f75b6 Remove spl.h, just include the headers you need. Add a few more stubs. a713518f5d9e Checkpoint for the night, added a few more stub headers, fleshed out a few stub headers, added a FIXME file, added various compatibility macros 77b1fe8fa868 Add highbit func, Add sloopy atomic declaration which will need to be fixed (eventually) Fill out more of the Solaris VM hooks Adjust the create_thread function ed61a7d05eb9 Add some missing rw_lock symbols b0dd3380aae2 Minor atomic cleanup, this needs to be done right. Fixed a bug in the timer code Added missing macros 3b3ba48fe9a6 Add missing cred.h functions Resolve compiler warning with kmem_free (unused len) Add stub for byteorder.h Add zlib shim for compress2 and uncompress functions 0b3cf046cb5b Add the initial vestigates of vnode support 05ae387b5024 Add somre debugging support 12472b242dc3 Just filling in more of the env. 6adf99e7d6c1 Add missing headers 4098c921b68e Fix systemic naming mistake 51f443a0741b Add some typedefs to make it clearer when we passing a function, Add fm_panic define Add another bad atomic hack (need to do this right) ee4766827a6e Remap gethrestime() with #define to new symbol and export that new symbol to avoid direct use of GPL only symbol. b123971fc2f9 Two more GPL only symbols moved to helper functions in the spl module. 9490c1483593 Apply fix from bug239 for rwlock deadlock. 4b17158506d5 - Implemented vnode interfaces and 6 test cases to the test suite. - Re-implmented kobj support based on the vnode support. - Add TESTS option to check.sh, and removed delay after module load. 2f5d55aac5bf Add copyin/copyout mapping Fix some vnode types 36e6f8614643 - Add some more missing headers - Map the LE/BE_* byteorder macros to the linux versions - More minor vnodes fixes 73e540a0d1cc Drop unicode support, provided in ZFS tree libport Update uio support 8ddd0ee4154e Add two more missing headers ea19fbed0538 Add missing headers af828292e585 Add missing headers Rework vnodes to be based on the slab cache, just like on Solaris. 79b31f3601af Fix KMEM_DEBUG support (enable by default) Add vmem_alloc/vmem_free support (and test case) Add missing time functions c19c06f3b05a Fix kmem memory accounting 2bdb28fbe07d Missing headers, more minor fixes 1ec74a114cc4 Minimal signal handling interface. 5d86345d3753 Initial pass at a file API getf/releasef hooks e4f1d29f89b7 OK, some pretty substantial rework here. I've merged the spl-file stuff which only inclused the getf()/releasef() in to the vnode area where it will only really be used. These calls allow a user to grab an open file struct given only the known open fd for a particular user context. ZFS makes use of these, but they're a bit tricky to test from within the kernel since you already need the file open and know the fd. So we basically spook the system calls to setup the environment we need for the splat test case and verify given just the know fd we can get the file, create the needed vnode, and then use the vnode interface as usual to read and write from it. 4e62fd4104e9 OK, a first reasonable attempt at a solaris module/chdev shim layer. This should handle the absolute minimum I need for ZFS. It will register the chdev with the right callbacks. Then the generic registered linux callback will find the right registered solaris callback for the function and munge the args just right before passing it on. Should work, but untested (just compiled), so I expect bugs. 336bb0c0c1e0 Two fixes to the module interface. Could be worse! 8ac547ec4c96 Relocated to zfs repo d429b03d85ee - Thinko fix to the SPL module interface - Enhanse the VERIFY() support to output the values which failed to compare as expected before crashing. This make debugging much much much easier. 4a4295b26736 Remove minor lingering CDDL tait of copied headers. Required headers rewritten to include minimally what we need. 9f4c835a0efd Correctly functioning 64-bit atomic shim layer. It's not what I would call effecient but it does have the advantage of being correct which is all I need right now. I added a regression test as well. e487ee08fb0b Fixed that. 8d0f1ee907d4 Add some crude debugging support. It leaves alot to be desired, but it should allow more easy kernel debugging for now. 4fd2f7eea565 Add vmem_zalloc support. e966e04fd52e Ensure all file ops pointer are NULL or we may end up calling garbage pointers on open/close etc and get what look like random crashes. 6a585c61de0f Double large kmalloc warning size to 4 pages. It was 2 pages, and ideally it should be dropped to one page but in the short term we should be able to easily live with 4 page allocations. 0998fdd6dba7 Apparently it's OK for done to be NULL, which was not clear in the Solaris man page. Anyway, since apparently this usage is accectable I've updated the function to handle it. 0a6fd143fd6d - Remapped ldi_handle_t to struct block_device * which is much more useful - Added liunx block device headers to sunldi.h - Made __taskq_dispatch safe for interrupt context where it turns out we need to be useing it. - Fixed NULL const/dest bug for kmem slab caches - Places debug __dprintf debugging messages under a spin_lock_irqsave so it's safe to use then in interrupt handlers. For debugging only! 996faa68697e Correctly implement atomic_cas_ptr() function. Ideally all of these atomic operations will be rewritten anyway with the correct arch specific assembly. But not today. 968eccd1d1cb Update the thread shim to use the current kernel threading API. We need to use kthread_create() here for a few reasons. First off to old kernel_thread() API functioin will be going away. Secondly, and more importantly if I use kthread_create() we can then properly implement a thread_exit() function which terminates the kernel thread at any point with do_exit(). This fixes our cleanup bug which was caused by dropping a mutex twice after thread_exit() didn't really exit. 728b9dd80074 - Fix write-only behavior in vn-open() - Ensure we have at least 1 write-only splat test - Fix return codes for vn_* Solaris does not use negative return codes in the kernel. So linux errno's must be inverted. 79f92663e369 Fix race in rwlock implementation which can occur when your task is rescheduled to a different cpu after you've taken the lock but before calling RW_LOCK_HELD is called. We need the spinlock to ensure there is a wmb() there. 115aed0dd8ea - Add more strict in_atomic() checking to the mutex entry function just to be extra safety and paranoid. 12ea923056d9 Adjust the condition variables to simply sleep uninteruptibly. This way we don't have to contend with superious wakeups which it appears ZFS is not so careful to handle anyway. So this is probably for the best. f23e92fabf09 Add hw_serial support based on a usermodehelper which runs at spl module load time can calls hostid. The resolved hostid is then fed back in to a proc entry for latter use. It's not a pretty thing, but it will work for now. The hw_serial is required for things such as 'zpool status' to work. c5fd77fcbf20 Just cleanup up an error case to avoid overspamming the console. We get the stack once from the BUG() no reason to dump it twice. d61e12af5af3 - Add some spinlocks to cover all the private data in the mutex. I don't think this should fix anything but it's a good idea regardless. 55152ebbb46f * modules/spl/spl-kmem.c : Make sure to disable interrupts when necessary to avoid deadlocks. We were seeing the deadlock when calling kmem_cache_generic_constructor() and then an interrupt forced us to end up calling kmem_cache_generic_destructor() which caused our deadlock. 57d1b1885897 First commit of lustre style internal debug support. These changes bring over everything lustre had for debugging with two exceptions. I dropped by the debug daemon and upcalls just because it made things a little easier. They can be readded easily enough if we feel they are needed. ce86265693be Whoops need this! 2fae1b3d0af1 Frist minor batch of fixes. Catch a dropped ;, and use SBUG instead of BUG. 937879f11db1 Update SPL to use new debug infrastructure. This means: - Replacing all BUG_ON()'s with proper ASSERT()'s - Using ENTRY,EXIT,GOTO, and RETURN macro to instument call paths 892d51061e04 Handful of minor stack checking fixes a8ac0b89668d Whoops, missed an instance where we could recursively stack check... bad. e5bbd245e351 Added 4 missing subsystem flags *** 6569 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Jun 8 14:38:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF90E638986; Tue, 8 Jun 2021 14:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FztBq61H6z3CZR; Tue, 8 Jun 2021 14:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6CB92A8F; Tue, 8 Jun 2021 14:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158EcBgv097242; Tue, 8 Jun 2021 14:38:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158EcB96097241; Tue, 8 Jun 2021 14:38:11 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:38:11 GMT Message-Id: <202106081438.158EcB96097241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 84b8d2bc9ba8 - stable/13 - zfs: merge openzfs/zfs@3522f57b6 (zfs-2.1-release) to stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 84b8d2bc9ba898c3c2939c25f83912a7547c0ea7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:38:11 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=84b8d2bc9ba898c3c2939c25f83912a7547c0ea7 commit 84b8d2bc9ba898c3c2939c25f83912a7547c0ea7 Merge: cb5fe9aa9fa0 3522f57b6ada Author: Martin Matuska AuthorDate: 2021-06-08 14:36:23 +0000 Commit: Martin Matuska CommitDate: 2021-06-08 14:36:23 +0000 zfs: merge openzfs/zfs@3522f57b6 (zfs-2.1-release) to stable/13 This changes branch tracking of sys/contrib/openzfs to a new direct-import branch vendor/openzfs/zfs-2.1-release. No functional changes. OpenZFS tag: 2.1.0-rc1 sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 1 + sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 1 + sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c | 3 --- sys/contrib/openzfs/scripts/zfs-images | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --cc sys/contrib/openzfs/scripts/zfs-images index 000000000000,3331601f6dc5..3331601f6dc5 mode 000000,160000..160000 --- a/sys/contrib/openzfs/scripts/zfs-images +++ b/sys/contrib/openzfs/scripts/zfs-images From owner-dev-commits-src-all@freebsd.org Tue Jun 8 14:40:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 285AB6385F8 for ; Tue, 8 Jun 2021 14:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FztFG0hb8z3CrK; Tue, 8 Jun 2021 14:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0043827FF; Tue, 8 Jun 2021 14:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158EeHk8004639; Tue, 8 Jun 2021 14:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158EeHOp004636; Tue, 8 Jun 2021 14:40:17 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:40:17 GMT Message-Id: <202106081440.158EeHOp004636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 3522f57b6ada..7d9f3ef0ef5c - vendor/openzfs/zfs-2.1-release - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/zfs-2.1-release X-Git-Reftype: branch X-Git-Commit: 7d9f3ef0ef5c26424d6f1eab2c7d4dfa3e7f9950 X-Git-Oldrev: 3522f57b6ada25bb58a88307971544ce49f39c66 X-Git-Newrev: 7d9f3ef0ef5c26424d6f1eab2c7d4dfa3e7f9950 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:40:18 -0000 The branch vendor/openzfs/zfs-2.1-release has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=3522f57b6ada..7d9f3ef0ef5c bfdd001679e2 Add compatibility file sets (ZoL 0.6.1, 0.6.4, OpenZFS 2.1) dc52c0d725ee fsck.zfs: implement 4/8 exit codes as suggested in manpage e783fa09257a Fixing m4 iops rename check 6613ea3b3385 CI: Increase free space in workflow 917f4b334c31 Atomically check and set dropped zevent count 7f789e150f8d Don't scale zfs_zevent_len_max by CPU count 895d39aa832a Allow pool names that look like Solaris disk names ec311430e2fd Bump libzfs.so and libzpool.so versions 003f2d04b6da FreeBSD: Fix stable/12 after AT_BENEATH removal 202e7545dc12 ZTS: inheritance/inherit_001_pos is flaky d539b7793469 Add RELEASES.md file 35cce6ea6375 bash_completion.d: always call zfs/zpool binaries directly ca7af7f675bb Fix various typos e2f5074c0f63 ZTS: pool_checkpoint improvements d09e1c134307 libzutil: zfs_isnumber(): return false if input empty 2aed1ab13d3f man: fix wrong .Xr macros usages 71a3487a89e4 zpool-features.5: remove "booting not possible with this feature"s 1bb4b5a5aee3 zfs get -p only outputs 3 columns if "clones" property is empty 46aec6d43948 i-t: fix root=zfs:AUTO 04344d5bc33e i-t: don't brokenly set the scheduler for root pool vdev's disks 0bf91beab9e4 Obsolete earlier packages due to version bump 506ffdf64846 fix misplaced quotes in kmod-preamble 7474d775c7f4 Tag 2.1.0-rc2 84c1652a0aa2 zed: set names for all threads 9160c441a442 zed: use separate reaper thread and collect ZEDLETs asynchronously dbf8baf8dd6f zed: remove unused zed_file_close_on_exec() fa991f2a47af zed: allow limiting concurrent jobs b73e40a5ad1d zed: print combined system/user time after ZEDLET death 0a51083e3949 zed: implement close_from() in terms of /proc/self/fd, if available 01219379cf26 zed: purge all mentions of a configuration file 718ee43362f4 zed.8: don't pretend an unprivileged user could change the script owner cb97db792e6f zed: bump zfs_zevent_len_max if we miss any events 48b60cffda51 zed: remove unused zed_file_read_n() 018560b1537a zed: merge all _NOT_IMPLEMENTED_ events ea30225fdb2a zed: replace zed_file_write_n() with write(2), purge it b3a7e6e7f333 zed.8: the Diagnosis Engine is implemented 55780d8ec0bc zed: only go up to current limit in close_from() fallback 52f65648e015 zed: print out licence string as one big chunk 5a674a1b42e1 zed: untangle -h option listing 487cd2df1131 zed: _zed_conf_display_help(): be consistent about what got_err means c30fef252313 zed: remove zed_conf::syslog_facility f96dbd7a2936 zed: remove zed_conf::{min,max}_events and ZED_{MIN,MAX}_EVENTS 32cc3f0837f9 zed: don't malloc() global zed_conf instance, optimise zed_conf layout bb8db9d92770 zed: untangle _zed_conf_parse_path() 96e15d29fab0 Add kmodtool fix to detect different System.map location 7822c01eb6b7 Ratelimit deadman zevents as with delay zevents 72a9750ac850 ZTS: Tests using zhack may fail on FreeBSD a35cadcf143c Fix double sha1/sha1.o line in module/icp/Makefile.in f17d146ca616 Use dsl_scan_setup_check() to setup a scrub 1eee2c7b278d Added check for broken alien version ad342153647f ZTS: Improve cleanup in removal_with_export 30f5b2fbe2cc zpl_inode.c: Fix SMACK interoperability 9d47853c74a0 zstreamdump: exec zstream dump 2ae2892235a0 zvol_wait: fix for zvols with spaces in name, optimise b3bb604a4c3a arc_summary3: just read /s/m/{mod}/version instead of spawning cat 8bc955f54616 contrib/bpftrace: exec bpftrace, remove useless cat 5f3f4def8348 zfs_ids_to_path: the -v comes after the executable name 2a667acfcb12 zfs_ids_to_path: print correct wrong values afe2a5ca12ed zvol_wait: properly handle zvol_volmode sysctl being 3/none f8631d0fe065 kmod-zfs should obsolete kmod-spl as well as spl-kmod 07d64c07e06e Allow zfs to send replication streams with missing snapshots 17792783d05a zfs-[un]jail(8): fix "zfs-jail [un]jail" leftovers 5faeaa136502 zfprops(8): fix spacing in jailed= arguments aa52015d45b5 libzfs_crypto.c: remove unused key_locator enum 54aaed5c45dd libzfs: zfs_crypto_create() requires a new key by definition: set newkey ab88e9e264c0 libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fds 2453d0263d1c lib/: set O_CLOEXEC on all fds 4a9b29375e98 ZTS: Add known exceptions dfd301504850 Balance parentheses in parameter descriptions 44ccb1d20fdb Update libzfs.abi for zfs_send() change 7de1797cee8b ZTS: fix removal_condense_export test case 1f3de97374b6 Improvements to the 'compatibility' property 8b03fce28986 cmd/zfs receive: allow dry-run (-n) to check property args ffc2e74f79f1 .gitmodules: link to openzfs github repository 4568b5cfba92 FreeBSD: add support for lockless symlink lookup a6b82cc0bbbd FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr 2aa0d643fd48 FreeBSD: use vnlru_free_vfsops if available ecd6ad66b0b8 libzfs: zfs_mount_at(): load key for encryption root if MS_CRYPT 4a30a0b94750 linux/libspl: getextmntent(): don't leak mnttab FILE* 25cd7b520d2f Obsolete earlier packages due to version bump 7bf3959601b9 Fix vdev health padding in zpool list -v *** 91 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Jun 8 14:53:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 533DE638A77; Tue, 8 Jun 2021 14:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FztXn1sMfz3GMG; Tue, 8 Jun 2021 14:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 289002D1D; Tue, 8 Jun 2021 14:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158ErjVK025235; Tue, 8 Jun 2021 14:53:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Eri7k025234; Tue, 8 Jun 2021 14:53:44 GMT (envelope-from git) Date: Tue, 8 Jun 2021 14:53:44 GMT Message-Id: <202106081453.158Eri7k025234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 160388166736 - main - zfs: merge openzfs/zfs@75b4cbf62 (master) into main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1603881667360c015f6685131f2f25474fa67a72 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 14:53:45 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=1603881667360c015f6685131f2f25474fa67a72 commit 1603881667360c015f6685131f2f25474fa67a72 Merge: ed9215c8e05f 75b4cbf62590 Author: Martin Matuska AuthorDate: 2021-06-08 14:48:37 +0000 Commit: Martin Matuska CommitDate: 2021-06-08 14:52:44 +0000 zfs: merge openzfs/zfs@75b4cbf62 (master) into main Notable upstream pull request merges: #11710 Allow zfs to send replication streams with missing snapshots #11751 Avoid taking global lock to destroy zfsdev state #11786 Ratelimit deadman zevents as with delay zevents #11803 ZFS traverse_visitbp optimization to limit prefetch #11813 Allow pool names that look like Solaris disk names #11822 Atomically check and set dropped zevent count #11822 Don't scale zfs_zevent_len_max by CPU count #11833 Refactor zfsdev state init/destroy to share common code #11837 zfs get -p only outputs 3 columns if "clones" property is empty #11843 libzutil: zfs_isnumber(): return false if input empty #11849 Use dsl_scan_setup_check() to setup a scrub #11861 Improvements to the 'compatibility' property #11862 cmd/zfs receive: allow dry-run (-n) to check property args #11864 receive: don't fail inheriting (-x) properties on wrong dataset type #11877 Combine zio caches if possible #11881 FreeBSD: use vnlru_free_vfsops if available #11883 FreeBSD: add support for lockless symlink lookup #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr #11896 Fix crash in zio_done error reporting #11905 zfs-send(8): Restore sorting of flags #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir #11930 vdev_mirror: don't scrub/resilver devices that can't be read #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines #11955 zfs get: don't lookup mount options when using "-s local" #11956 libzfs: add keylocation=https://, backed by fetch(3) or libcurl #11959 vdev_id: variable not getting expanded under map_slot() #11966 Scale worker threads and taskqs with number of CPUs #11994 Clean up use of zfs_log_create in zfs_dir #11997 FreeBSD: Don't force xattr mount option #11997 FreeBSD: Implement xattr=sa #11997 FreeBSD: Use SET_ERROR to trace xattr name errors #11998 Simplify/fix dnode_move() for dn_zfetch #12003 FreeBSD: Initialize/destroy zp->z_lock #12010 Fix dRAID self-healing short columns #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots" #12040 Reinstate the old zpool read label logic as a fallback #12046 Improve scrub maxinflight_bytes math #12049 FreeBSD: avoid memory allocation in arc_prune_async #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI #12061 Fix dRAID sequential resilver silent damage handling #12072 Let zfs diff be more permissive #12077 FreeBSD: Retry OCF ENOMEM errors. #12088 Propagate vdev state due to invalid label corruption #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat #12097 FreeBSD: Update dataset_kstats for zvols in dev mode #12104 FreeBSD boot code reminder after zpool upgrade #12114 Introduce write-mostly sums Obtained from: OpenZFS OpenZFS commit: 75b4cbf62590c23fac3667537961a2a75fdc2cc3 cddl/share/zfs/compatibility.d/Makefile | 4 + .../openzfs/.github/ISSUE_TEMPLATE/config.yml | 2 +- .../.github/workflows/zfs-tests-functional.yml | 8 +- .../openzfs/.github/workflows/zfs-tests-sanity.yml | 8 +- sys/contrib/openzfs/.gitmodules | 2 +- sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/Makefile.am | 54 +- sys/contrib/openzfs/RELEASES.md | 37 + sys/contrib/openzfs/cmd/Makefile.am | 8 +- sys/contrib/openzfs/cmd/arc_summary/arc_summary2 | 97 +- sys/contrib/openzfs/cmd/arc_summary/arc_summary3 | 50 +- sys/contrib/openzfs/cmd/fsck_zfs/.gitignore | 1 + sys/contrib/openzfs/cmd/fsck_zfs/Makefile.am | 5 + sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs | 9 - sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in | 44 + sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c | 7 +- sys/contrib/openzfs/cmd/raidz_test/raidz_test.c | 21 +- sys/contrib/openzfs/cmd/vdev_id/Makefile.am | 2 + sys/contrib/openzfs/cmd/vdev_id/vdev_id | 7 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 251 +- sys/contrib/openzfs/cmd/zed/Makefile.am | 4 +- sys/contrib/openzfs/cmd/zed/agents/zfs_agents.c | 1 + sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c | 1 + sys/contrib/openzfs/cmd/zed/zed.c | 48 +- sys/contrib/openzfs/cmd/zed/zed.d/Makefile.am | 1 + sys/contrib/openzfs/cmd/zed/zed.d/data-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/generic-notify.sh | 2 +- .../zed/zed.d/history_event-zfs-list-cacher.sh.in | 4 +- .../openzfs/cmd/zed/zed.d/scrub_finish-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/statechange-led.sh | 90 +- .../openzfs/cmd/zed/zed.d/statechange-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/trim_finish-notify.sh | 2 +- sys/contrib/openzfs/cmd/zed/zed.d/zed-functions.sh | 100 +- sys/contrib/openzfs/cmd/zed/zed.d/zed.rc | 17 + sys/contrib/openzfs/cmd/zed/zed.h | 17 +- sys/contrib/openzfs/cmd/zed/zed_conf.c | 218 +- sys/contrib/openzfs/cmd/zed/zed_conf.h | 38 +- sys/contrib/openzfs/cmd/zed/zed_disk_event.c | 1 + sys/contrib/openzfs/cmd/zed/zed_event.c | 82 +- sys/contrib/openzfs/cmd/zed/zed_event.h | 2 +- sys/contrib/openzfs/cmd/zed/zed_exec.c | 255 +- sys/contrib/openzfs/cmd/zed/zed_exec.h | 8 +- sys/contrib/openzfs/cmd/zed/zed_file.c | 120 +- sys/contrib/openzfs/cmd/zed/zed_file.h | 8 +- sys/contrib/openzfs/cmd/zed/zed_log.c | 2 +- sys/contrib/openzfs/cmd/zed/zed_log.h | 2 +- sys/contrib/openzfs/cmd/zed/zed_strings.c | 2 +- sys/contrib/openzfs/cmd/zed/zed_strings.h | 2 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 49 +- .../openzfs/cmd/zfs_ids_to_path/zfs_ids_to_path.c | 8 +- sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c | 18 +- sys/contrib/openzfs/cmd/zhack/zhack.c | 3 +- sys/contrib/openzfs/cmd/zpool/Makefile.am | 5 + .../cmd/zpool/compatibility.d/openzfs-2.1-freebsd | 34 + .../cmd/zpool/compatibility.d/openzfs-2.1-linux | 35 + .../openzfs/cmd/zpool/compatibility.d/zol-0.6.1 | 4 + .../openzfs/cmd/zpool/compatibility.d/zol-0.6.4 | 10 + .../openzfs/cmd/zpool/os/freebsd/zpool_vdev_os.c | 15 + .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 5 + sys/contrib/openzfs/cmd/zpool/zpool.d/smart | 15 +- sys/contrib/openzfs/cmd/zpool/zpool_iter.c | 15 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 259 +- sys/contrib/openzfs/cmd/zpool/zpool_util.c | 16 + sys/contrib/openzfs/cmd/zpool/zpool_util.h | 2 + sys/contrib/openzfs/cmd/zpool/zpool_vdev.c | 2 +- .../openzfs/cmd/zpool_influxdb/zpool_influxdb.c | 11 +- sys/contrib/openzfs/cmd/zstream/Makefile.am | 3 + sys/contrib/openzfs/cmd/zstream/zstream.c | 5 + sys/contrib/openzfs/cmd/zstream/zstream_redup.c | 1 - sys/contrib/openzfs/cmd/zstreamdump/Makefile.am | 1 - sys/contrib/openzfs/cmd/zstreamdump/zstreamdump | 3 - sys/contrib/openzfs/cmd/ztest/ztest.c | 275 +- sys/contrib/openzfs/cmd/zvol_wait/Makefile.am | 2 + sys/contrib/openzfs/cmd/zvol_wait/zvol_wait | 43 +- sys/contrib/openzfs/config/Abigail.am | 2 +- sys/contrib/openzfs/config/CppCheck.am | 2 +- sys/contrib/openzfs/config/Rules.am | 1 + sys/contrib/openzfs/config/Shellcheck.am | 22 + sys/contrib/openzfs/config/Substfiles.am | 4 +- sys/contrib/openzfs/config/always-shellcheck.m4 | 10 + sys/contrib/openzfs/config/ax_python_devel.m4 | 3 +- sys/contrib/openzfs/config/deb.am | 22 +- sys/contrib/openzfs/config/kernel-acl.m4 | 25 +- sys/contrib/openzfs/config/kernel-bdi.m4 | 4 +- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 8 +- .../config/kernel-block-device-operations.m4 | 32 + .../openzfs/config/kernel-generic_fillattr.m4 | 2 +- .../openzfs/config/kernel-is_owner_or_cap.m4 | 4 + sys/contrib/openzfs/config/kernel-percpu.m4 | 27 + sys/contrib/openzfs/config/kernel-rename.m4 | 1 + sys/contrib/openzfs/config/kernel-siginfo.m4 | 21 + sys/contrib/openzfs/config/kernel-signal-stop.m4 | 21 + sys/contrib/openzfs/config/kernel-special-state.m4 | 21 + sys/contrib/openzfs/config/kernel-tmpfile.m4 | 28 +- sys/contrib/openzfs/config/kernel.m4 | 6 + sys/contrib/openzfs/config/user-libatomic.m4 | 34 + sys/contrib/openzfs/config/user-libfetch.m4 | 71 + sys/contrib/openzfs/config/user.m4 | 2 + sys/contrib/openzfs/config/zfs-build.m4 | 24 + sys/contrib/openzfs/configure.ac | 2 +- sys/contrib/openzfs/contrib/Makefile.am | 4 + .../openzfs/contrib/bash_completion.d/.gitignore | 1 + .../openzfs/contrib/bash_completion.d/Makefile.am | 10 +- .../contrib/bash_completion.d/{zfs => zfs.in} | 87 +- sys/contrib/openzfs/contrib/bpftrace/Makefile.am | 4 + sys/contrib/openzfs/contrib/bpftrace/zfs-trace.sh | 4 +- .../dracut/02zfsexpandknowledge/Makefile.am | 1 + .../dracut/02zfsexpandknowledge/module-setup.sh.in | 54 +- .../openzfs/contrib/dracut/90zfs/Makefile.am | 4 + .../contrib/dracut/90zfs/module-setup.sh.in | 23 +- .../openzfs/contrib/dracut/90zfs/mount-zfs.sh.in | 10 +- .../openzfs/contrib/dracut/90zfs/parse-zfs.sh.in | 3 +- .../contrib/dracut/90zfs/zfs-env-bootfs.service.in | 2 +- .../contrib/dracut/90zfs/zfs-generator.sh.in | 79 +- .../openzfs/contrib/dracut/90zfs/zfs-lib.sh.in | 57 +- .../contrib/dracut/90zfs/zfs-load-key.sh.in | 45 +- .../dracut/90zfs/zfs-rollback-bootfs.service.in | 2 +- .../dracut/90zfs/zfs-snapshot-bootfs.service.in | 2 +- sys/contrib/openzfs/contrib/dracut/Makefile.am | 3 + sys/contrib/openzfs/contrib/initramfs/Makefile.am | 3 + .../openzfs/contrib/initramfs/hooks/Makefile.am | 1 + sys/contrib/openzfs/contrib/initramfs/hooks/zfs.in | 132 +- .../openzfs/contrib/initramfs/hooks/zfsunlock.in | 16 +- .../openzfs/contrib/initramfs/scripts/Makefile.am | 7 +- .../initramfs/scripts/local-top/Makefile.am | 2 + .../contrib/initramfs/scripts/local-top/zfs | 21 +- sys/contrib/openzfs/contrib/initramfs/scripts/zfs | 124 +- .../pyzfs/libzfs_core/test/test_libzfs_core.py | 4 +- sys/contrib/openzfs/copy-builtin | 45 +- sys/contrib/openzfs/etc/Makefile.am | 4 + sys/contrib/openzfs/etc/default/Makefile.am | 4 + sys/contrib/openzfs/etc/init.d/Makefile.am | 3 + sys/contrib/openzfs/etc/init.d/zfs-import.in | 26 +- sys/contrib/openzfs/etc/init.d/zfs-mount.in | 49 +- sys/contrib/openzfs/etc/init.d/zfs-share.in | 6 +- sys/contrib/openzfs/etc/init.d/zfs-zed.in | 31 +- sys/contrib/openzfs/etc/systemd/Makefile.am | 3 + .../etc/systemd/system-generators/Makefile.am | 14 +- .../system-generators/zfs-mount-generator.c | 1083 ++ .../system-generators/zfs-mount-generator.in | 473 - sys/contrib/openzfs/etc/zfs/Makefile.am | 3 + sys/contrib/openzfs/etc/zfs/zfs-functions.in | 99 +- sys/contrib/openzfs/include/Makefile.am | 1 - sys/contrib/openzfs/include/cityhash.h | 4 +- sys/contrib/openzfs/include/libuutil.h | 28 - sys/contrib/openzfs/include/libuutil_impl.h | 6 - sys/contrib/openzfs/include/libzfs.h | 520 +- sys/contrib/openzfs/include/libzutil.h | 71 +- .../openzfs/include/os/freebsd/spl/sys/Makefile.am | 2 +- .../openzfs/include/os/freebsd/spl/sys/console.h | 35 - .../openzfs/include/os/freebsd/spl/sys/vfs.h | 2 - .../openzfs/include/os/freebsd/spl/sys/vnode.h | 5 - .../include/os/freebsd/spl/sys/vnode_impl.h | 2 +- .../openzfs/include/os/freebsd/spl/sys/wmsum.h | 72 + .../include/os/freebsd/zfs/sys/zfs_vfsops_os.h | 1 - .../include/os/freebsd/zfs/sys/zfs_znode_impl.h | 4 +- .../include/os/linux/kernel/linux/blkdev_compat.h | 22 +- .../include/os/linux/kernel/linux/mod_compat.h | 2 +- .../openzfs/include/os/linux/spl/sys/Makefile.am | 2 +- .../openzfs/include/os/linux/spl/sys/atomic.h | 4 + .../openzfs/include/os/linux/spl/sys/console.h | 30 - .../openzfs/include/os/linux/spl/sys/signal.h | 18 +- .../openzfs/include/os/linux/spl/sys/thread.h | 13 + .../openzfs/include/os/linux/spl/sys/wmsum.h | 76 + .../include/os/linux/zfs/sys/zfs_vfsops_os.h | 1 - sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 5 + sys/contrib/openzfs/include/sys/aggsum.h | 7 +- sys/contrib/openzfs/include/sys/dataset_kstats.h | 20 +- sys/contrib/openzfs/include/sys/dsl_scan.h | 1 + sys/contrib/openzfs/include/sys/fm/util.h | 1 - sys/contrib/openzfs/include/sys/fs/zfs.h | 104 +- sys/contrib/openzfs/include/sys/spa.h | 21 - sys/contrib/openzfs/include/sys/vdev_draid.h | 2 +- sys/contrib/openzfs/include/sys/vdev_impl.h | 5 +- sys/contrib/openzfs/include/sys/vdev_raidz_impl.h | 3 +- sys/contrib/openzfs/include/sys/vdev_rebuild.h | 2 +- sys/contrib/openzfs/include/sys/zfs_context.h | 6 +- sys/contrib/openzfs/include/sys/zfs_ioctl.h | 1 - sys/contrib/openzfs/include/sys/zfs_ioctl_impl.h | 5 + sys/contrib/openzfs/include/sys/zfs_sysfs.h | 4 +- sys/contrib/openzfs/include/sys/zio.h | 17 - sys/contrib/openzfs/include/sys/zio_checksum.h | 7 +- sys/contrib/openzfs/include/zfeature_common.h | 17 +- sys/contrib/openzfs/include/zfs_comutil.h | 17 +- sys/contrib/openzfs/include/zfs_deleg.h | 10 +- sys/contrib/openzfs/include/zfs_fletcher.h | 49 +- sys/contrib/openzfs/include/zfs_namecheck.h | 28 +- sys/contrib/openzfs/include/zfs_prop.h | 50 +- sys/contrib/openzfs/lib/libefi/rdwr_efi.c | 13 +- sys/contrib/openzfs/lib/libnvpair/libnvpair.abi | 4815 ++++---- sys/contrib/openzfs/lib/libnvpair/libnvpair_json.c | 15 +- sys/contrib/openzfs/lib/libshare/Makefile.am | 1 + sys/contrib/openzfs/lib/libshare/libshare.c | 1 - sys/contrib/openzfs/lib/libshare/libshare_impl.h | 4 + sys/contrib/openzfs/lib/libshare/nfs.c | 157 + sys/contrib/openzfs/lib/libshare/nfs.h | 9 + sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c | 170 +- sys/contrib/openzfs/lib/libshare/os/linux/nfs.c | 166 +- sys/contrib/openzfs/lib/libshare/os/linux/smb.c | 4 +- sys/contrib/openzfs/lib/libspl/Makefile.am | 29 +- .../openzfs/lib/libspl/asm-generic/.gitignore | 1 - sys/contrib/openzfs/lib/libspl/asm-i386/atomic.S | 840 -- sys/contrib/openzfs/lib/libspl/asm-x86_64/atomic.S | 691 -- sys/contrib/openzfs/lib/libspl/assert.c | 4 +- .../openzfs/lib/libspl/{asm-generic => }/atomic.c | 196 +- .../{libuutil/uu_open.c => libspl/getexecname.c} | 61 +- sys/contrib/openzfs/lib/libspl/include/assert.h | 2 +- sys/contrib/openzfs/lib/libspl/include/atomic.h | 43 + .../openzfs/lib/libspl/include/sys/Makefile.am | 1 + sys/contrib/openzfs/lib/libspl/include/sys/wmsum.h | 68 + sys/contrib/openzfs/lib/libspl/libspl_impl.h | 24 + .../openzfs/lib/libspl/os/freebsd/getexecname.c | 49 +- sys/contrib/openzfs/lib/libspl/os/freebsd/mnttab.c | 4 +- .../openzfs/lib/libspl/os/linux/getexecname.c | 37 +- .../openzfs/lib/libspl/os/linux/gethostid.c | 41 +- .../openzfs/lib/libspl/os/linux/getmntany.c | 9 +- sys/contrib/openzfs/lib/libspl/page.c | 2 +- sys/contrib/openzfs/lib/libuutil/Makefile.am | 2 - sys/contrib/openzfs/lib/libuutil/libuutil.abi | 2952 +++-- sys/contrib/openzfs/lib/libuutil/uu_dprintf.c | 130 - sys/contrib/openzfs/lib/libuutil/uu_misc.c | 27 - sys/contrib/openzfs/lib/libzfs/Makefile.am | 6 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 11230 +++++++++++-------- sys/contrib/openzfs/lib/libzfs/libzfs_changelist.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 200 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 60 +- sys/contrib/openzfs/lib/libzfs/libzfs_diff.c | 50 +- .../openzfs/{include => lib/libzfs}/libzfs_impl.h | 108 +- sys/contrib/openzfs/lib/libzfs/libzfs_import.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_iter.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 53 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 304 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 169 +- sys/contrib/openzfs/lib/libzfs/libzfs_status.c | 28 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 80 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_compat.c | 63 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_zmount.c | 7 +- .../openzfs/lib/libzfs/os/linux/libzfs_mount_os.c | 2 +- .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c | 12 +- .../lib/libzfs/os/linux/libzfs_sendrecv_os.c | 4 +- .../openzfs/lib/libzfs/os/linux/libzfs_util_os.c | 6 +- .../openzfs/lib/libzfs_core/libzfs_core.abi | 5638 ++++++---- sys/contrib/openzfs/lib/libzfs_core/libzfs_core.c | 12 +- .../openzfs/lib/libzfsbootenv/lzbe_device.c | 9 +- sys/contrib/openzfs/lib/libzpool/Makefile.am | 2 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 8 +- sys/contrib/openzfs/lib/libzpool/util.c | 2 +- .../lib/libzutil/os/freebsd/zutil_import_os.c | 2 +- .../lib/libzutil/os/linux/zutil_device_path_os.c | 30 +- .../lib/libzutil/os/linux/zutil_import_os.c | 15 +- .../openzfs/lib/libzutil/zutil_device_path.c | 38 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 116 +- sys/contrib/openzfs/lib/libzutil/zutil_nicenum.c | 3 + sys/contrib/openzfs/man/man1/arcstat.1 | 650 +- sys/contrib/openzfs/man/man1/cstyle.1 | 258 +- sys/contrib/openzfs/man/man1/raidz_test.1 | 153 +- sys/contrib/openzfs/man/man1/zhack.1 | 162 +- sys/contrib/openzfs/man/man1/ztest.1 | 327 +- sys/contrib/openzfs/man/man1/zvol_wait.1 | 37 +- .../openzfs/man/man5/spl-module-parameters.5 | 464 +- sys/contrib/openzfs/man/man5/vdev_id.conf.5 | 423 +- sys/contrib/openzfs/man/man5/zfs-events.5 | 1069 +- .../openzfs/man/man5/zfs-module-parameters.5 | 6038 ++++------ sys/contrib/openzfs/man/man5/zpool-features.5 | 1700 ++- sys/contrib/openzfs/man/man8/fsck.zfs.8 | 96 +- sys/contrib/openzfs/man/man8/mount.zfs.8 | 182 +- sys/contrib/openzfs/man/man8/vdev_id.8 | 154 +- sys/contrib/openzfs/man/man8/zdb.8 | 126 +- sys/contrib/openzfs/man/man8/zed.8.in | 409 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 201 +- sys/contrib/openzfs/man/man8/zfs-bookmark.8 | 24 +- sys/contrib/openzfs/man/man8/zfs-clone.8 | 27 +- sys/contrib/openzfs/man/man8/zfs-create.8 | 25 +- sys/contrib/openzfs/man/man8/zfs-destroy.8 | 20 +- sys/contrib/openzfs/man/man8/zfs-diff.8 | 63 +- sys/contrib/openzfs/man/man8/zfs-hold.8 | 24 +- sys/contrib/openzfs/man/man8/zfs-jail.8 | 108 +- sys/contrib/openzfs/man/man8/zfs-list.8 | 48 +- sys/contrib/openzfs/man/man8/zfs-load-key.8 | 176 +- .../openzfs/man/man8/zfs-mount-generator.8.in | 388 +- sys/contrib/openzfs/man/man8/zfs-mount.8 | 30 +- sys/contrib/openzfs/man/man8/zfs-program.8 | 415 +- sys/contrib/openzfs/man/man8/zfs-project.8 | 98 +- sys/contrib/openzfs/man/man8/zfs-promote.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-receive.8 | 123 +- sys/contrib/openzfs/man/man8/zfs-rename.8 | 5 +- sys/contrib/openzfs/man/man8/zfs-rollback.8 | 18 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 286 +- sys/contrib/openzfs/man/man8/zfs-set.8 | 86 +- sys/contrib/openzfs/man/man8/zfs-share.8 | 14 +- sys/contrib/openzfs/man/man8/zfs-snapshot.8 | 27 +- sys/contrib/openzfs/man/man8/zfs-upgrade.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-userspace.8 | 80 +- sys/contrib/openzfs/man/man8/zfs-wait.8 | 30 +- sys/contrib/openzfs/man/man8/zfs.8 | 482 +- sys/contrib/openzfs/man/man8/zfs_ids_to_path.8 | 25 +- sys/contrib/openzfs/man/man8/zfsconcepts.8 | 64 +- sys/contrib/openzfs/man/man8/zfsprops.8 | 740 +- sys/contrib/openzfs/man/man8/zgenhostid.8 | 23 +- sys/contrib/openzfs/man/man8/zinject.8 | 378 +- sys/contrib/openzfs/man/man8/zpool-add.8 | 47 +- sys/contrib/openzfs/man/man8/zpool-attach.8 | 25 +- sys/contrib/openzfs/man/man8/zpool-checkpoint.8 | 40 +- sys/contrib/openzfs/man/man8/zpool-clear.8 | 24 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 136 +- sys/contrib/openzfs/man/man8/zpool-destroy.8 | 17 +- sys/contrib/openzfs/man/man8/zpool-detach.8 | 21 +- sys/contrib/openzfs/man/man8/zpool-events.8 | 38 +- sys/contrib/openzfs/man/man8/zpool-export.8 | 23 +- sys/contrib/openzfs/man/man8/zpool-get.8 | 50 +- sys/contrib/openzfs/man/man8/zpool-history.8 | 16 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 119 +- sys/contrib/openzfs/man/man8/zpool-initialize.8 | 28 +- sys/contrib/openzfs/man/man8/zpool-iostat.8 | 236 +- sys/contrib/openzfs/man/man8/zpool-labelclear.8 | 16 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 43 +- sys/contrib/openzfs/man/man8/zpool-offline.8 | 29 +- sys/contrib/openzfs/man/man8/zpool-reguid.8 | 15 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 18 +- sys/contrib/openzfs/man/man8/zpool-reopen.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-replace.8 | 44 +- sys/contrib/openzfs/man/man8/zpool-resilver.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 31 +- sys/contrib/openzfs/man/man8/zpool-split.8 | 52 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 52 +- sys/contrib/openzfs/man/man8/zpool-sync.8 | 30 +- sys/contrib/openzfs/man/man8/zpool-trim.8 | 47 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 43 +- sys/contrib/openzfs/man/man8/zpool-wait.8 | 54 +- sys/contrib/openzfs/man/man8/zpool.8 | 366 +- sys/contrib/openzfs/man/man8/zpool_influxdb.8 | 141 +- sys/contrib/openzfs/man/man8/zpoolconcepts.8 | 275 +- sys/contrib/openzfs/man/man8/zpoolprops.8 | 124 +- sys/contrib/openzfs/man/man8/zstream.8 | 29 +- sys/contrib/openzfs/man/man8/zstreamdump.8 | 59 +- sys/contrib/openzfs/module/avl/avl.c | 2 +- sys/contrib/openzfs/module/icp/Makefile.in | 7 +- sys/contrib/openzfs/module/icp/algs/edonr/edonr.c | 2 +- sys/contrib/openzfs/module/icp/algs/modes/gcm.c | 4 +- .../module/icp/asm-x86_64/sha1/sha1-x86_64.S | 24 +- .../module/icp/asm-x86_64/sha2/sha256_impl.S | 26 + .../module/icp/asm-x86_64/sha2/sha512_impl.S | 26 + .../openzfs/module/os/freebsd/spl/acl_common.c | 6 +- sys/contrib/openzfs/module/os/freebsd/spl/callb.c | 16 +- sys/contrib/openzfs/module/os/freebsd/spl/list.c | 17 +- .../openzfs/module/os/freebsd/spl/spl_kmem.c | 6 +- .../openzfs/module/os/freebsd/spl/spl_kstat.c | 14 +- .../openzfs/module/os/freebsd/spl/spl_string.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_sysevent.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_uio.c | 4 +- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 6 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 5 +- sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 16 +- .../openzfs/module/os/freebsd/zfs/crypto_os.c | 8 +- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 45 +- .../openzfs/module/os/freebsd/zfs/kmod_core.c | 64 +- sys/contrib/openzfs/module/os/freebsd/zfs/spa_os.c | 83 +- .../openzfs/module/os/freebsd/zfs/vdev_file.c | 7 +- .../openzfs/module/os/freebsd/zfs/vdev_geom.c | 20 +- .../openzfs/module/os/freebsd/zfs/vdev_label_os.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 73 +- .../openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 22 +- .../openzfs/module/os/freebsd/zfs/zfs_debug.c | 5 +- .../openzfs/module/os/freebsd/zfs/zfs_dir.c | 27 +- .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c | 17 + .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 44 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 606 +- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 117 +- .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 19 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 14 +- .../openzfs/module/os/linux/spl/spl-generic.c | 4 +- .../openzfs/module/os/linux/spl/spl-kmem-cache.c | 11 +- sys/contrib/openzfs/module/os/linux/spl/spl-kmem.c | 14 + sys/contrib/openzfs/module/os/linux/spl/spl-proc.c | 105 +- .../openzfs/module/os/linux/spl/spl-thread.c | 51 + sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_file_os.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 87 +- .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 8 - .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 34 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 8 +- .../openzfs/module/os/linux/zfs/zio_crypt.c | 17 +- .../openzfs/module/os/linux/zfs/zpl_export.c | 12 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 5 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 41 +- .../openzfs/module/os/linux/zfs/zpl_xattr.c | 39 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 2 + sys/contrib/openzfs/module/unicode/u8_textprep.c | 2 +- sys/contrib/openzfs/module/zcommon/zfs_comutil.c | 2 +- .../openzfs/module/zcommon/zfs_fletcher_avx512.c | 8 +- sys/contrib/openzfs/module/zcommon/zfs_namecheck.c | 6 - sys/contrib/openzfs/module/zcommon/zfs_prop.c | 6 +- sys/contrib/openzfs/module/zfs/abd.c | 2 +- sys/contrib/openzfs/module/zfs/aggsum.c | 125 +- sys/contrib/openzfs/module/zfs/arc.c | 84 +- sys/contrib/openzfs/module/zfs/dataset_kstats.c | 48 +- sys/contrib/openzfs/module/zfs/dbuf.c | 2 - sys/contrib/openzfs/module/zfs/dmu_recv.c | 4 +- sys/contrib/openzfs/module/zfs/dmu_traverse.c | 67 +- sys/contrib/openzfs/module/zfs/dnode.c | 8 +- sys/contrib/openzfs/module/zfs/dsl_bookmark.c | 6 +- sys/contrib/openzfs/module/zfs/dsl_crypt.c | 11 +- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 65 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 42 +- sys/contrib/openzfs/module/zfs/fm.c | 321 +- sys/contrib/openzfs/module/zfs/spa.c | 92 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 2 +- sys/contrib/openzfs/module/zfs/vdev.c | 14 +- sys/contrib/openzfs/module/zfs/vdev_draid.c | 49 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 12 +- sys/contrib/openzfs/module/zfs/vdev_mirror.c | 9 + sys/contrib/openzfs/module/zfs/vdev_raidz.c | 11 +- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 6 +- sys/contrib/openzfs/module/zfs/vdev_removal.c | 4 - sys/contrib/openzfs/module/zfs/zfs_fm.c | 8 +- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 120 +- sys/contrib/openzfs/module/zfs/zio.c | 32 +- sys/contrib/openzfs/module/zfs/zvol.c | 4 - sys/contrib/openzfs/module/zstd/README.md | 2 +- .../module/zstd/include/zstd_compat_wrapper.h | 2 +- sys/contrib/openzfs/module/zstd/zfs_zstd.c | 4 +- sys/contrib/openzfs/rpm/generic/zfs-dkms.spec.in | 2 +- sys/contrib/openzfs/rpm/generic/zfs.spec.in | 64 +- sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 5 +- sys/contrib/openzfs/scripts/Makefile.am | 17 +- sys/contrib/openzfs/scripts/commitcheck.sh | 4 +- sys/contrib/openzfs/scripts/dkms.mkconf | 12 +- sys/contrib/openzfs/scripts/dkms.postbuild | 7 +- sys/contrib/openzfs/scripts/kmodtool | 30 +- sys/contrib/openzfs/scripts/make_gitrev.sh | 4 +- sys/contrib/openzfs/scripts/mancheck.sh | 43 + sys/contrib/openzfs/scripts/paxcheck.sh | 3 +- sys/contrib/openzfs/scripts/zfs-tests.sh | 1 - sys/contrib/openzfs/scripts/zfs.sh | 4 +- sys/contrib/openzfs/scripts/zimport.sh | 23 +- sys/contrib/openzfs/scripts/zloop.sh | 17 +- sys/contrib/openzfs/tests/Makefile.am | 5 + sys/contrib/openzfs/tests/runfiles/common.run | 29 +- sys/contrib/openzfs/tests/runfiles/linux.run | 8 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 5 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 25 +- .../openzfs/tests/test-runner/man/test-runner.1 | 598 +- .../openzfs/tests/zfs-tests/cmd/draid/draid.c | 8 +- .../tests/zfs-tests/cmd/file_check/file_check.c | 3 - .../tests/zfs-tests/cmd/file_write/file_write.c | 2 +- .../tests/zfs-tests/cmd/xattrtest/xattrtest.c | 2 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 58 +- .../openzfs/tests/zfs-tests/include/tunables.cfg | 1 + .../tests/functional/atime/root_atime_off.ksh | 2 +- .../tests/functional/atime/root_atime_on.ksh | 2 +- .../tests/functional/atime/root_relatime_on.ksh | 2 +- .../tests/functional/cli_root/zdb/zdb_checksum.ksh | 1 + .../functional/cli_root/zdb/zdb_objset_id.ksh | 1 + .../zfs_destroy/zfs_clone_livelist_dedup.ksh | 88 + .../cli_root/zfs_destroy/zfs_destroy_015_pos.ksh | 2 +- .../cli_root/zfs_get/zfs_get_001_pos.ksh | 12 +- .../cli_root/zfs_get/zfs_get_common.kshlib | 10 +- .../tests/functional/cli_root/zfs_load-key/HEXKEY | 1 + .../functional/cli_root/zfs_load-key/Makefile.am | 6 +- .../functional/cli_root/zfs_load-key/PASSPHRASE | 1 + .../tests/functional/cli_root/zfs_load-key/RAWKEY | 1 + .../functional/cli_root/zfs_load-key/cleanup.ksh | 2 + .../functional/cli_root/zfs_load-key/setup.ksh | 5 +- .../cli_root/zfs_load-key/zfs_load-key.cfg | 31 + .../cli_root/zfs_load-key/zfs_load-key_all.ksh | 10 + .../zfs_load-key/zfs_load-key_common.kshlib | 63 + .../cli_root/zfs_load-key/zfs_load-key_https.ksh | 78 + .../zfs_load-key/zfs_load-key_location.ksh | 5 + .../zfs_load-key/zfs_load-key_recursive.ksh | 6 + .../cli_root/zfs_mount/zfs_mount_test_race.ksh | 9 +- .../zfs_receive/receive-o-x_props_override.ksh | 15 +- .../tests/functional/cli_root/zfs_send/Makefile.am | 3 +- .../cli_root/zfs_send/zfs_send_skip_missing.ksh | 77 + .../cli_root/zfs_set/zfs_set_keylocation.ksh | 23 +- .../cli_root/zpool_add/zpool_add_dryrun_output.ksh | 4 +- .../zpool_events/zpool_events_duplicates.ksh | 3 +- .../cli_user/misc/arc_summary_001_pos.ksh | 3 + .../cli_user/zfs_list/zfs_list_002_pos.ksh | 2 +- .../zpool_iostat/zpool_iostat_-c_homedir.ksh | 2 +- .../zpool_iostat/zpool_iostat_-c_searchpath.ksh | 2 +- .../zpool_status/zpool_status_-c_homedir.ksh | 2 +- .../zpool_status/zpool_status_-c_searchpath.ksh | 2 +- .../zfs-tests/tests/functional/deadman/Makefile.am | 1 + .../tests/functional/deadman/deadman_ratelimit.ksh | 78 + .../tests/functional/deadman/deadman_sync.ksh | 6 +- .../zfs-tests/tests/functional/events/.gitignore | 1 + .../zfs-tests/tests/functional/events/Makefile.am | 9 +- .../zfs-tests/tests/functional/events/cleanup.ksh | 2 +- .../tests/functional/events/events_002_pos.ksh | 4 +- .../tests/functional/events/zed_fd_spill-zedlet.c | 36 + .../tests/functional/events/zed_fd_spill.ksh | 77 + .../tests/functional/events/zed_rc_filter.ksh | 1 + .../functional/fault/auto_offline_001_pos.ksh | 4 +- .../pool_checkpoint/checkpoint_big_rewind.ksh | 3 +- .../pool_checkpoint/checkpoint_capacity.ksh | 7 +- .../pool_checkpoint/checkpoint_discard_busy.ksh | 3 +- .../pool_checkpoint/pool_checkpoint.kshlib | 9 +- .../functional/pool_names/pool_names_002_neg.ksh | 8 +- .../tests/functional/redundancy/Makefile.am | 2 + .../tests/functional/redundancy/redundancy.kshlib | 24 +- .../functional/redundancy/redundancy_draid.ksh | 248 + .../functional/redundancy/redundancy_draid3.ksh | 2 +- .../redundancy/redundancy_draid_damaged.ksh | 153 + .../redundancy/redundancy_draid_spare1.ksh | 31 +- .../redundancy/redundancy_draid_spare3.ksh | 46 +- .../functional/redundancy/redundancy_raidz.ksh | 52 +- .../functional/redundancy/redundancy_stripe.ksh | 4 +- .../functional/removal/removal_condense_export.ksh | 2 + .../functional/removal/removal_with_export.ksh | 2 +- .../functional/replacement/attach_multiple.ksh | 6 +- .../functional/replacement/replace_import.ksh | 2 +- .../replacement/resilver_restart_001.ksh | 2 +- .../functional/reservation/reservation_006_pos.ksh | 2 +- .../functional/rsend/send_encrypted_files.ksh | 2 +- .../zfs-tests/tests/functional/slog/cleanup.ksh | 4 - .../zfs-tests/tests/functional/slog/setup.ksh | 4 - .../tests/functional/userquota/Makefile.am | 3 +- .../userquota/userspace_send_encrypted.ksh | 108 - .../tests/functional/xattr/xattr_002_neg.ksh | 4 +- .../zfs-tests/tests/perf/scripts/prefetch_io.sh | 42 +- sys/contrib/openzfs/udev/rules.d/.gitignore | 5 +- sys/modules/zfs/zfs_config.h | 6 +- 523 files changed, 31415 insertions(+), 28284 deletions(-) diff --cc cddl/share/zfs/compatibility.d/Makefile index 8bc18bcd6391,000000000000..255f4a3542b3 mode 100644,000000..100644 --- a/cddl/share/zfs/compatibility.d/Makefile +++ b/cddl/share/zfs/compatibility.d/Makefile @@@ -1,49 -1,0 +1,53 @@@ +# $FreeBSD$ + +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs + +.PATH: ${ZFSTOP}/cmd/zpool/compatibility.d + +FILES= \ + compat-2018 \ + compat-2019 \ + compat-2020 \ + compat-2021 \ + freebsd-11.0 \ + freebsd-11.2 \ + freebsd-11.3 \ + freenas-9.10.2 \ + grub2 \ + openzfsonosx-1.7.0 \ + openzfsonosx-1.8.1 \ + openzfsonosx-1.9.3 \ + openzfs-2.0-freebsd \ + openzfs-2.0-linux \ ++ openzfs-2.1-freebsd \ ++ openzfs-2.1-linux \ ++ zol-0.6.1 \ ++ zol-0.6.4 \ + zol-0.6.5 \ + zol-0.7 \ + zol-0.8 + +FILESDIR= ${SHAREDIR}/zfs/compatibility.d + +LINKS= \ + ${FILESDIR}/compat-2018 ${FILESDIR}/2018 \ + ${FILESDIR}/compat-2019 ${FILESDIR}/2019 \ + ${FILESDIR}/compat-2020 ${FILESDIR}/2020 \ + ${FILESDIR}/compat-2021 ${FILESDIR}/2021 \ + ${FILESDIR}/freebsd-11.0 ${FILESDIR}/freebsd-11.1 \ + ${FILESDIR}/freebsd-11.0 ${FILESDIR}/freenas-11.0 \ + ${FILESDIR}/freebsd-11.2 ${FILESDIR}/freenas-11.2 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-11.4 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.0 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.1 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.2 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freenas-11.3 \ + ${FILESDIR}/freenas-11.0 ${FILESDIR}/freenas-11.1 \ + ${FILESDIR}/openzfsonosx-1.9.3 ${FILESDIR}/openzfsonosx-1.9.4 \ + ${FILESDIR}/openzfs-2.0-freebsd ${FILESDIR}/truenas-12.0 \ + ${FILESDIR}/zol-0.7 ${FILESDIR}/ubuntu-18.04 \ + ${FILESDIR}/zol-0.8 ${FILESDIR}/ubuntu-20.04 + +LINKMODE= ${NOBINMODE} + +.include diff --cc sys/contrib/openzfs/RELEASES.md index 000000000000,55bfdb80ef6e..55bfdb80ef6e mode 000000,100644..100644 --- a/sys/contrib/openzfs/RELEASES.md +++ b/sys/contrib/openzfs/RELEASES.md diff --cc sys/contrib/openzfs/cmd/fsck_zfs/.gitignore index 000000000000,0edf0309e94a..0edf0309e94a mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/fsck_zfs/.gitignore +++ b/sys/contrib/openzfs/cmd/fsck_zfs/.gitignore diff --cc sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in index 000000000000,37096902cb94..37096902cb94 mode 000000,100755..100755 --- a/sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in +++ b/sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd index 000000000000,9fde997e8c60..9fde997e8c60 mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux index 000000000000,c3ff176bf8f2..c3ff176bf8f2 mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 index 000000000000,9bc963ddccab..9bc963ddccab mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 index 000000000000,82a2698c8c5c..82a2698c8c5c mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 diff --cc sys/contrib/openzfs/config/Shellcheck.am index 000000000000,6b805b797d12..6b805b797d12 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/Shellcheck.am +++ b/sys/contrib/openzfs/config/Shellcheck.am diff --cc sys/contrib/openzfs/config/always-shellcheck.m4 index 000000000000,2a9a099746f4..2a9a099746f4 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/always-shellcheck.m4 +++ b/sys/contrib/openzfs/config/always-shellcheck.m4 diff --cc sys/contrib/openzfs/config/kernel-siginfo.m4 index 000000000000,6ddb0dcc37d2..6ddb0dcc37d2 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-siginfo.m4 +++ b/sys/contrib/openzfs/config/kernel-siginfo.m4 diff --cc sys/contrib/openzfs/config/kernel-signal-stop.m4 index 000000000000,6cb86e7c4cde..6cb86e7c4cde mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-signal-stop.m4 +++ b/sys/contrib/openzfs/config/kernel-signal-stop.m4 diff --cc sys/contrib/openzfs/config/kernel-special-state.m4 index 000000000000,aa60aabebc43..aa60aabebc43 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-special-state.m4 +++ b/sys/contrib/openzfs/config/kernel-special-state.m4 diff --cc sys/contrib/openzfs/config/user-libatomic.m4 index 000000000000,14a60bbea9d0..14a60bbea9d0 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/user-libatomic.m4 +++ b/sys/contrib/openzfs/config/user-libatomic.m4 diff --cc sys/contrib/openzfs/config/user-libfetch.m4 index 000000000000,f5149fc1a5d7..f5149fc1a5d7 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/user-libfetch.m4 +++ b/sys/contrib/openzfs/config/user-libfetch.m4 diff --cc sys/contrib/openzfs/contrib/bash_completion.d/.gitignore index 000000000000,0fd9cc63af2a..0fd9cc63af2a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/bash_completion.d/.gitignore +++ b/sys/contrib/openzfs/contrib/bash_completion.d/.gitignore diff --cc sys/contrib/openzfs/etc/systemd/system-generators/zfs-mount-generator.c index 000000000000,b806339deb2f..b806339deb2f mode 000000,100644..100644 --- a/sys/contrib/openzfs/etc/systemd/system-generators/zfs-mount-generator.c +++ b/sys/contrib/openzfs/etc/systemd/system-generators/zfs-mount-generator.c diff --cc sys/contrib/openzfs/include/os/freebsd/spl/sys/wmsum.h index 000000000000,9fdd1901b7ee..9fdd1901b7ee mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/wmsum.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/wmsum.h diff --cc sys/contrib/openzfs/include/os/linux/spl/sys/wmsum.h index 000000000000,0871bd69504c..0871bd69504c mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/os/linux/spl/sys/wmsum.h +++ b/sys/contrib/openzfs/include/os/linux/spl/sys/wmsum.h diff --cc sys/contrib/openzfs/lib/libshare/nfs.c index 000000000000,44d3e93d42f0..44d3e93d42f0 mode 000000,100644..100644 --- a/sys/contrib/openzfs/lib/libshare/nfs.c +++ b/sys/contrib/openzfs/lib/libshare/nfs.c diff --cc sys/contrib/openzfs/lib/libspl/include/sys/wmsum.h index 000000000000,0679af73ce91..0679af73ce91 mode 000000,100644..100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/wmsum.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/wmsum.h diff --cc sys/contrib/openzfs/lib/libspl/libspl_impl.h index 000000000000,cda56e64c962..cda56e64c962 mode 000000,100644..100644 --- a/sys/contrib/openzfs/lib/libspl/libspl_impl.h +++ b/sys/contrib/openzfs/lib/libspl/libspl_impl.h diff --cc sys/contrib/openzfs/man/man8/zstreamdump.8 index f499be442a47,c6721daf11de..c6721daf11de mode 100644,120000..120000 --- a/sys/contrib/openzfs/man/man8/zstreamdump.8 +++ b/sys/contrib/openzfs/man/man8/zstreamdump.8 diff --cc sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c index 0491b2ff3e28,6a59c0eae766..3eb5cd490d03 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c @@@ -1247,12 -1269,16 +1269,21 @@@ zfs_znode_free(znode_t *zp list_remove(&zfsvfs->z_all_znodes, zp); zfsvfs->z_nr_znodes--; mutex_exit(&zfsvfs->z_znodes_lock); + symlink = atomic_load_ptr(&zp->z_cached_symlink); + if (symlink != NULL) { + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); + cache_symlink_free(symlink, strlen(symlink) + 1); + } + #if __FreeBSD_version >= 1300139 + symlink = atomic_load_ptr(&zp->z_cached_symlink); + if (symlink != NULL) { + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, + (uintptr_t)NULL); + cache_symlink_free(symlink, strlen(symlink) + 1); + } + #endif + if (zp->z_acl_cached) { zfs_acl_free(zp->z_acl_cached); zp->z_acl_cached = NULL; diff --cc sys/contrib/openzfs/scripts/mancheck.sh index 000000000000,6ae1fc5becff..6ae1fc5becff mode 000000,100755..100755 --- a/sys/contrib/openzfs/scripts/mancheck.sh +++ b/sys/contrib/openzfs/scripts/mancheck.sh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_clone_livelist_dedup.ksh index 000000000000,5f356967a457..5f356967a457 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_clone_livelist_dedup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_destroy/zfs_clone_livelist_dedup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/HEXKEY index 000000000000,95ed1c051a21..95ed1c051a21 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/HEXKEY +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/HEXKEY diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/PASSPHRASE index 000000000000,f3097ab13082..f3097ab13082 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/PASSPHRASE +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/PASSPHRASE diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/RAWKEY index 000000000000,f2d4cbf581ce..f2d4cbf581ce mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/RAWKEY +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/RAWKEY diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_https.ksh index 000000000000,cac9c4140322..cac9c4140322 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_https.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_load-key/zfs_load-key_https.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh index 000000000000,b367cef9c4a4..b367cef9c4a4 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh index 000000000000,469117a56cc0..469117a56cc0 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore index 000000000000,ed5af03a1095..ed5af03a1095 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c index 000000000000,c072f906d23e..c072f906d23e mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh index 000000000000,8736a7fdf7e6..8736a7fdf7e6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh index 000000000000,8015e682c892..8015e682c892 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh index 000000000000,6796cc78a1bd..6796cc78a1bd mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh diff --cc sys/modules/zfs/zfs_config.h index ebc9bbe9059b,000000000000..1400d9fe92c0 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,774 -1,0 +1,774 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ *** 646 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Jun 8 15:01:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6F2E638BE2; Tue, 8 Jun 2021 15:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FztjR5nSRz3HVD; Tue, 8 Jun 2021 15:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF31E3198; Tue, 8 Jun 2021 15:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158F1Fdv035967; Tue, 8 Jun 2021 15:01:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158F1F72035966; Tue, 8 Jun 2021 15:01:15 GMT (envelope-from git) Date: Tue, 8 Jun 2021 15:01:15 GMT Message-Id: <202106081501.158F1F72035966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b38239433258 - main - updating: add note about vendor/openzfs branch rename MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b38239433258683bdd45a5627815a56ea6e79b64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 15:01:15 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b38239433258683bdd45a5627815a56ea6e79b64 commit b38239433258683bdd45a5627815a56ea6e79b64 Author: Warner Losh AuthorDate: 2021-06-08 14:57:42 +0000 Commit: Warner Losh CommitDate: 2021-06-08 15:00:57 +0000 updating: add note about vendor/openzfs branch rename Add a pointer to https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html to explain how to pull a new tree due to the vendor/openzfs branch being renamed. Reviewed by: lwhsu@ Sponsored by: Netflix --- UPDATING | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UPDATING b/UPDATING index f1ff8a8b64b1..c9e081563e6c 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20210608: + The vendor/openzfs branch was renamed to vnedor/openzfs/legacy to + start tracking OpenZFS upstream more closely. Please see +https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html + for details on how to correct any errors that might result. The + short version is that you need to remove the old branch locally: + git update-ref -d refs/remotes/freebsd/vendor/openzfs + (assuming your upstream origin is named 'freebsd'). + 20210525: Commits 17accc08ae15 and de102f870501 add new files to LinuxKPI which break drm-kmod. In addition various other additions where From owner-dev-commits-src-all@freebsd.org Tue Jun 8 15:03:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8B8C6393A6; Tue, 8 Jun 2021 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fztmb5BZzz3HvP; Tue, 8 Jun 2021 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A84D3091; Tue, 8 Jun 2021 15:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158F3xnl039341; Tue, 8 Jun 2021 15:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158F3xpo039340; Tue, 8 Jun 2021 15:03:59 GMT (envelope-from git) Date: Tue, 8 Jun 2021 15:03:59 GMT Message-Id: <202106081503.158F3xpo039340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 04c4bd7f7b52 - stable/13 - zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04c4bd7f7b525b1627304894e3413693e945bc0d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 15:03:59 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=04c4bd7f7b525b1627304894e3413693e945bc0d commit 04c4bd7f7b525b1627304894e3413693e945bc0d Merge: 84b8d2bc9ba8 7d9f3ef0ef5c Author: Martin Matuska AuthorDate: 2021-06-08 15:01:18 +0000 Commit: Martin Matuska CommitDate: 2021-06-08 15:01:18 +0000 zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13 Notable upstream pull request merges: #11710 Allow zfs to send replication streams with missing snapshots #11786 Ratelimit deadman zevents as with delay zevents #11813 Allow pool names that look like Solaris disk names #11822 Atomically check and set dropped zevent count #11822 Don't scale zfs_zevent_len_max by CPU count #11837 zfs get -p only outputs 3 columns if "clones" property is empty #11849 Use dsl_scan_setup_check() to setup a scrub #11861 Improvements to the 'compatibility' property #11862 cmd/zfs receive: allow dry-run (-n) to check property args #11864 receive: don't fail inheriting (-x) properties on wrong dataset type #11877 Combine zio caches if possible #11881 FreeBSD: use vnlru_free_vfsops if available #11883 FreeBSD: add support for lockless symlink lookup #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr #11896 Fix crash in zio_done error reporting #11905 zfs-send(8): Restore sorting of flags #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines #11966 Scale worker threads and taskqs with number of CPUs #11997 FreeBSD: Don't force xattr mount option #11997 FreeBSD: Use SET_ERROR to trace xattr name errors #11998 Simplify/fix dnode_move() for dn_zfetch #12003 FreeBSD: Initialize/destroy zp->z_lock #12010 Fix dRAID self-healing short columns #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots" #12040 Reinstate the old zpool read label logic as a fallback #12049 FreeBSD: avoid memory allocation in arc_prune_async #12061 Fix dRAID sequential resilver silent damage handling #12077 FreeBSD: Retry OCF ENOMEM errors. #12088 Propagate vdev state due to invalid label corruption #12097 FreeBSD: Update dataset_kstats for zvols in dev mode Obtained from: OpenZFS OpenZFS commit: 7d9f3ef0ef5c26424d6f1eab2c7d4dfa3e7f9950 OpenZFS tag: 2.1.0-rc6 cddl/share/zfs/compatibility.d/Makefile | 4 + .../.github/workflows/zfs-tests-functional.yml | 6 + .../openzfs/.github/workflows/zfs-tests-sanity.yml | 6 + sys/contrib/openzfs/.gitmodules | 2 +- sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/Makefile.am | 12 +- sys/contrib/openzfs/RELEASES.md | 37 + sys/contrib/openzfs/cmd/arc_summary/arc_summary2 | 97 +- sys/contrib/openzfs/cmd/arc_summary/arc_summary3 | 44 +- sys/contrib/openzfs/cmd/fsck_zfs/.gitignore | 1 + sys/contrib/openzfs/cmd/fsck_zfs/Makefile.am | 4 + sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs | 9 - sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in | 44 + sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c | 7 +- sys/contrib/openzfs/cmd/vdev_id/vdev_id | 7 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 5 +- sys/contrib/openzfs/cmd/zed/agents/zfs_agents.c | 1 + sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c | 1 + sys/contrib/openzfs/cmd/zed/zed.c | 48 +- sys/contrib/openzfs/cmd/zed/zed.d/data-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/generic-notify.sh | 2 +- .../zed/zed.d/history_event-zfs-list-cacher.sh.in | 4 +- .../openzfs/cmd/zed/zed.d/scrub_finish-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/statechange-led.sh | 90 +- .../openzfs/cmd/zed/zed.d/statechange-notify.sh | 2 +- .../openzfs/cmd/zed/zed.d/trim_finish-notify.sh | 2 +- sys/contrib/openzfs/cmd/zed/zed.d/zed-functions.sh | 8 +- sys/contrib/openzfs/cmd/zed/zed.h | 17 +- sys/contrib/openzfs/cmd/zed/zed_conf.c | 218 +- sys/contrib/openzfs/cmd/zed/zed_conf.h | 38 +- sys/contrib/openzfs/cmd/zed/zed_disk_event.c | 1 + sys/contrib/openzfs/cmd/zed/zed_event.c | 82 +- sys/contrib/openzfs/cmd/zed/zed_event.h | 2 +- sys/contrib/openzfs/cmd/zed/zed_exec.c | 255 ++- sys/contrib/openzfs/cmd/zed/zed_exec.h | 8 +- sys/contrib/openzfs/cmd/zed/zed_file.c | 120 +- sys/contrib/openzfs/cmd/zed/zed_file.h | 8 +- sys/contrib/openzfs/cmd/zed/zed_log.c | 2 +- sys/contrib/openzfs/cmd/zed/zed_log.h | 2 +- sys/contrib/openzfs/cmd/zed/zed_strings.c | 2 +- sys/contrib/openzfs/cmd/zed/zed_strings.h | 2 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 13 +- .../openzfs/cmd/zfs_ids_to_path/zfs_ids_to_path.c | 8 +- sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c | 2 +- sys/contrib/openzfs/cmd/zpool/Makefile.am | 4 + .../cmd/zpool/compatibility.d/openzfs-2.1-freebsd | 34 + .../cmd/zpool/compatibility.d/openzfs-2.1-linux | 35 + .../openzfs/cmd/zpool/compatibility.d/zol-0.6.1 | 4 + .../openzfs/cmd/zpool/compatibility.d/zol-0.6.4 | 10 + sys/contrib/openzfs/cmd/zpool/zpool_iter.c | 15 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 184 +- sys/contrib/openzfs/cmd/zpool/zpool_vdev.c | 2 +- sys/contrib/openzfs/cmd/zstreamdump/zstreamdump | 2 +- sys/contrib/openzfs/cmd/ztest/ztest.c | 2 +- sys/contrib/openzfs/cmd/zvol_wait/zvol_wait | 42 +- sys/contrib/openzfs/config/CppCheck.am | 2 +- sys/contrib/openzfs/config/deb.am | 22 +- sys/contrib/openzfs/config/kernel-acl.m4 | 25 +- sys/contrib/openzfs/config/kernel-bdi.m4 | 4 +- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 8 +- .../config/kernel-block-device-operations.m4 | 32 + .../openzfs/config/kernel-generic_fillattr.m4 | 2 +- .../openzfs/config/kernel-is_owner_or_cap.m4 | 4 + sys/contrib/openzfs/config/kernel-rename.m4 | 1 + sys/contrib/openzfs/config/kernel-siginfo.m4 | 21 + sys/contrib/openzfs/config/kernel-signal-stop.m4 | 21 + sys/contrib/openzfs/config/kernel-special-state.m4 | 21 + sys/contrib/openzfs/config/kernel-tmpfile.m4 | 28 +- sys/contrib/openzfs/config/kernel.m4 | 6 + sys/contrib/openzfs/config/zfs-build.m4 | 6 + .../openzfs/contrib/bash_completion.d/.gitignore | 1 + .../openzfs/contrib/bash_completion.d/Makefile.am | 5 +- .../contrib/bash_completion.d/{zfs => zfs.in} | 11 +- sys/contrib/openzfs/contrib/bpftrace/zfs-trace.sh | 4 +- .../dracut/02zfsexpandknowledge/module-setup.sh.in | 4 +- .../contrib/dracut/90zfs/zfs-generator.sh.in | 78 +- .../openzfs/contrib/dracut/90zfs/zfs-lib.sh.in | 49 +- .../dracut/90zfs/zfs-rollback-bootfs.service.in | 2 +- .../dracut/90zfs/zfs-snapshot-bootfs.service.in | 2 +- sys/contrib/openzfs/contrib/initramfs/hooks/zfs.in | 4 +- sys/contrib/openzfs/contrib/initramfs/scripts/zfs | 48 +- .../pyzfs/libzfs_core/test/test_libzfs_core.py | 4 +- sys/contrib/openzfs/copy-builtin | 45 +- .../system-generators/zfs-mount-generator.in | 1 + sys/contrib/openzfs/etc/zfs/zfs-functions.in | 4 +- sys/contrib/openzfs/include/libzfs.h | 10 +- .../openzfs/include/os/freebsd/spl/sys/Makefile.am | 1 - .../openzfs/include/os/freebsd/spl/sys/console.h | 35 - .../openzfs/include/os/freebsd/spl/sys/vnode.h | 5 - .../include/os/freebsd/spl/sys/vnode_impl.h | 2 +- .../include/os/freebsd/zfs/sys/zfs_znode_impl.h | 2 +- .../include/os/linux/kernel/linux/blkdev_compat.h | 22 +- .../include/os/linux/kernel/linux/mod_compat.h | 2 +- .../openzfs/include/os/linux/spl/sys/Makefile.am | 1 - .../openzfs/include/os/linux/spl/sys/console.h | 30 - .../openzfs/include/os/linux/spl/sys/signal.h | 18 +- .../openzfs/include/os/linux/spl/sys/thread.h | 13 + sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 5 + sys/contrib/openzfs/include/sys/dsl_scan.h | 1 + sys/contrib/openzfs/include/sys/fm/util.h | 1 - sys/contrib/openzfs/include/sys/vdev_draid.h | 2 +- sys/contrib/openzfs/include/sys/vdev_impl.h | 5 +- sys/contrib/openzfs/include/sys/vdev_raidz_impl.h | 3 +- sys/contrib/openzfs/include/sys/vdev_rebuild.h | 2 +- sys/contrib/openzfs/include/sys/zfs_context.h | 4 +- sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c | 29 +- sys/contrib/openzfs/lib/libshare/os/linux/nfs.c | 23 +- sys/contrib/openzfs/lib/libshare/os/linux/smb.c | 2 +- .../openzfs/lib/libspl/os/linux/gethostid.c | 41 +- .../openzfs/lib/libspl/os/linux/getmntany.c | 5 +- sys/contrib/openzfs/lib/libuutil/uu_open.c | 8 +- sys/contrib/openzfs/lib/libzfs/Makefile.am | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 2084 ++++++++++---------- sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 14 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 10 +- sys/contrib/openzfs/lib/libzfs/libzfs_diff.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_iter.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 27 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 258 +-- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 124 +- sys/contrib/openzfs/lib/libzfs/libzfs_status.c | 28 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 20 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_zmount.c | 5 - .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c | 10 +- .../lib/libzfs/os/linux/libzfs_sendrecv_os.c | 2 +- .../openzfs/lib/libzfs/os/linux/libzfs_util_os.c | 4 +- sys/contrib/openzfs/lib/libzfs_core/libzfs_core.c | 2 +- .../openzfs/lib/libzfsbootenv/lzbe_device.c | 9 +- sys/contrib/openzfs/lib/libzpool/Makefile.am | 2 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 8 +- sys/contrib/openzfs/lib/libzpool/util.c | 2 +- .../lib/libzutil/os/freebsd/zutil_import_os.c | 2 +- .../lib/libzutil/os/linux/zutil_device_path_os.c | 30 +- .../lib/libzutil/os/linux/zutil_import_os.c | 4 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 111 +- sys/contrib/openzfs/lib/libzutil/zutil_nicenum.c | 3 + .../openzfs/man/man5/zfs-module-parameters.5 | 95 +- sys/contrib/openzfs/man/man5/zpool-features.5 | 23 +- sys/contrib/openzfs/man/man8/fsck.zfs.8 | 26 +- sys/contrib/openzfs/man/man8/mount.zfs.8 | 182 +- sys/contrib/openzfs/man/man8/zed.8.in | 40 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 1 + sys/contrib/openzfs/man/man8/zfs-jail.8 | 4 +- .../openzfs/man/man8/zfs-mount-generator.8.in | 1 - sys/contrib/openzfs/man/man8/zfs-program.8 | 1 + sys/contrib/openzfs/man/man8/zfs-send.8 | 12 +- sys/contrib/openzfs/man/man8/zfs-wait.8 | 3 +- sys/contrib/openzfs/man/man8/zfs.8 | 2 +- sys/contrib/openzfs/man/man8/zfs_ids_to_path.8 | 2 +- sys/contrib/openzfs/man/man8/zfsprops.8 | 20 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-get.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-replace.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-split.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 16 +- sys/contrib/openzfs/man/man8/zstream.8 | 3 +- sys/contrib/openzfs/module/avl/avl.c | 2 +- sys/contrib/openzfs/module/icp/Makefile.in | 7 +- sys/contrib/openzfs/module/icp/algs/edonr/edonr.c | 2 +- sys/contrib/openzfs/module/icp/algs/modes/gcm.c | 4 +- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 16 +- .../openzfs/module/os/freebsd/zfs/crypto_os.c | 8 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 36 +- .../openzfs/module/os/freebsd/zfs/zfs_debug.c | 5 +- .../openzfs/module/os/freebsd/zfs/zfs_dir.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 36 +- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 15 + .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 17 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 8 +- .../openzfs/module/os/linux/spl/spl-generic.c | 4 +- sys/contrib/openzfs/module/os/linux/spl/spl-proc.c | 105 +- .../openzfs/module/os/linux/spl/spl-thread.c | 51 + sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_file_os.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 8 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 9 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 2 +- .../openzfs/module/os/linux/zfs/zio_crypt.c | 17 +- .../openzfs/module/os/linux/zfs/zpl_export.c | 12 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 2 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 41 +- .../openzfs/module/os/linux/zfs/zpl_xattr.c | 35 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 2 + sys/contrib/openzfs/module/unicode/u8_textprep.c | 2 +- sys/contrib/openzfs/module/zcommon/zfs_comutil.c | 2 +- .../openzfs/module/zcommon/zfs_fletcher_avx512.c | 8 +- sys/contrib/openzfs/module/zcommon/zfs_namecheck.c | 6 - sys/contrib/openzfs/module/zfs/abd.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 2 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 4 +- sys/contrib/openzfs/module/zfs/dmu_traverse.c | 67 +- sys/contrib/openzfs/module/zfs/dnode.c | 8 +- sys/contrib/openzfs/module/zfs/dsl_bookmark.c | 6 +- sys/contrib/openzfs/module/zfs/dsl_crypt.c | 11 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 2 +- sys/contrib/openzfs/module/zfs/fm.c | 321 +-- sys/contrib/openzfs/module/zfs/spa.c | 92 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 2 +- sys/contrib/openzfs/module/zfs/vdev.c | 14 +- sys/contrib/openzfs/module/zfs/vdev_draid.c | 49 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 7 +- sys/contrib/openzfs/module/zfs/vdev_mirror.c | 9 + sys/contrib/openzfs/module/zfs/vdev_raidz.c | 11 +- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 6 +- sys/contrib/openzfs/module/zfs/zfs_fm.c | 8 +- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 2 +- sys/contrib/openzfs/module/zfs/zio.c | 32 +- sys/contrib/openzfs/module/zstd/README.md | 2 +- .../module/zstd/include/zstd_compat_wrapper.h | 2 +- sys/contrib/openzfs/module/zstd/zfs_zstd.c | 4 +- sys/contrib/openzfs/rpm/generic/zfs-dkms.spec.in | 2 +- sys/contrib/openzfs/rpm/generic/zfs.spec.in | 64 +- sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 5 +- sys/contrib/openzfs/scripts/kmodtool | 16 +- sys/contrib/openzfs/scripts/zimport.sh | 6 +- sys/contrib/openzfs/tests/runfiles/common.run | 22 +- sys/contrib/openzfs/tests/runfiles/linux.run | 8 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 2 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 25 +- .../openzfs/tests/zfs-tests/cmd/draid/draid.c | 8 +- .../tests/zfs-tests/cmd/file_write/file_write.c | 2 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 26 +- .../openzfs/tests/zfs-tests/include/tunables.cfg | 1 + .../tests/functional/atime/root_atime_off.ksh | 2 +- .../tests/functional/atime/root_atime_on.ksh | 2 +- .../tests/functional/atime/root_relatime_on.ksh | 2 +- .../cli_root/zfs_destroy/zfs_destroy_015_pos.ksh | 2 +- .../cli_root/zfs_get/zfs_get_001_pos.ksh | 12 +- .../cli_root/zfs_get/zfs_get_common.kshlib | 10 +- .../cli_root/zfs_mount/zfs_mount_test_race.ksh | 9 +- .../zfs_receive/receive-o-x_props_override.ksh | 15 +- .../tests/functional/cli_root/zfs_send/Makefile.am | 3 +- .../cli_root/zfs_send/zfs_send_skip_missing.ksh | 77 + .../cli_root/zpool_add/zpool_add_dryrun_output.ksh | 4 +- .../cli_user/misc/arc_summary_001_pos.ksh | 3 + .../cli_user/zfs_list/zfs_list_002_pos.ksh | 2 +- .../zpool_iostat/zpool_iostat_-c_homedir.ksh | 2 +- .../zpool_iostat/zpool_iostat_-c_searchpath.ksh | 2 +- .../zpool_status/zpool_status_-c_homedir.ksh | 2 +- .../zpool_status/zpool_status_-c_searchpath.ksh | 2 +- .../zfs-tests/tests/functional/deadman/Makefile.am | 1 + .../tests/functional/deadman/deadman_ratelimit.ksh | 78 + .../tests/functional/deadman/deadman_sync.ksh | 6 +- .../zfs-tests/tests/functional/events/.gitignore | 1 + .../zfs-tests/tests/functional/events/Makefile.am | 9 +- .../zfs-tests/tests/functional/events/cleanup.ksh | 2 +- .../tests/functional/events/events_002_pos.ksh | 4 +- .../tests/functional/events/zed_fd_spill-zedlet.c | 36 + .../tests/functional/events/zed_fd_spill.ksh | 77 + .../tests/functional/events/zed_rc_filter.ksh | 1 + .../functional/fault/auto_offline_001_pos.ksh | 4 +- .../pool_checkpoint/checkpoint_big_rewind.ksh | 3 +- .../pool_checkpoint/checkpoint_capacity.ksh | 7 +- .../pool_checkpoint/checkpoint_discard_busy.ksh | 3 +- .../pool_checkpoint/pool_checkpoint.kshlib | 9 +- .../functional/pool_names/pool_names_002_neg.ksh | 2 +- .../tests/functional/redundancy/Makefile.am | 2 + .../tests/functional/redundancy/redundancy.kshlib | 24 +- .../functional/redundancy/redundancy_draid.ksh | 248 +++ .../functional/redundancy/redundancy_draid3.ksh | 2 +- .../redundancy/redundancy_draid_damaged.ksh | 153 ++ .../redundancy/redundancy_draid_spare1.ksh | 31 +- .../redundancy/redundancy_draid_spare3.ksh | 46 +- .../functional/redundancy/redundancy_raidz.ksh | 52 +- .../functional/redundancy/redundancy_stripe.ksh | 4 +- .../functional/removal/removal_condense_export.ksh | 2 + .../functional/removal/removal_with_export.ksh | 2 +- .../functional/replacement/attach_multiple.ksh | 6 +- .../functional/replacement/replace_import.ksh | 2 +- .../replacement/resilver_restart_001.ksh | 2 +- .../functional/reservation/reservation_006_pos.ksh | 2 +- .../functional/rsend/send_encrypted_files.ksh | 2 +- .../tests/functional/userquota/Makefile.am | 3 +- .../userquota/userspace_send_encrypted.ksh | 108 - .../tests/functional/xattr/xattr_002_neg.ksh | 4 +- sys/modules/zfs/zfs_config.h | 6 +- 282 files changed, 4580 insertions(+), 3367 deletions(-) diff --cc cddl/share/zfs/compatibility.d/Makefile index 8bc18bcd6391,000000000000..255f4a3542b3 mode 100644,000000..100644 --- a/cddl/share/zfs/compatibility.d/Makefile +++ b/cddl/share/zfs/compatibility.d/Makefile @@@ -1,49 -1,0 +1,53 @@@ +# $FreeBSD$ + +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs + +.PATH: ${ZFSTOP}/cmd/zpool/compatibility.d + +FILES= \ + compat-2018 \ + compat-2019 \ + compat-2020 \ + compat-2021 \ + freebsd-11.0 \ + freebsd-11.2 \ + freebsd-11.3 \ + freenas-9.10.2 \ + grub2 \ + openzfsonosx-1.7.0 \ + openzfsonosx-1.8.1 \ + openzfsonosx-1.9.3 \ + openzfs-2.0-freebsd \ + openzfs-2.0-linux \ ++ openzfs-2.1-freebsd \ ++ openzfs-2.1-linux \ ++ zol-0.6.1 \ ++ zol-0.6.4 \ + zol-0.6.5 \ + zol-0.7 \ + zol-0.8 + +FILESDIR= ${SHAREDIR}/zfs/compatibility.d + +LINKS= \ + ${FILESDIR}/compat-2018 ${FILESDIR}/2018 \ + ${FILESDIR}/compat-2019 ${FILESDIR}/2019 \ + ${FILESDIR}/compat-2020 ${FILESDIR}/2020 \ + ${FILESDIR}/compat-2021 ${FILESDIR}/2021 \ + ${FILESDIR}/freebsd-11.0 ${FILESDIR}/freebsd-11.1 \ + ${FILESDIR}/freebsd-11.0 ${FILESDIR}/freenas-11.0 \ + ${FILESDIR}/freebsd-11.2 ${FILESDIR}/freenas-11.2 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-11.4 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.0 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.1 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freebsd-12.2 \ + ${FILESDIR}/freebsd-11.3 ${FILESDIR}/freenas-11.3 \ + ${FILESDIR}/freenas-11.0 ${FILESDIR}/freenas-11.1 \ + ${FILESDIR}/openzfsonosx-1.9.3 ${FILESDIR}/openzfsonosx-1.9.4 \ + ${FILESDIR}/openzfs-2.0-freebsd ${FILESDIR}/truenas-12.0 \ + ${FILESDIR}/zol-0.7 ${FILESDIR}/ubuntu-18.04 \ + ${FILESDIR}/zol-0.8 ${FILESDIR}/ubuntu-20.04 + +LINKMODE= ${NOBINMODE} + +.include diff --cc sys/contrib/openzfs/RELEASES.md index 000000000000,55bfdb80ef6e..55bfdb80ef6e mode 000000,100644..100644 --- a/sys/contrib/openzfs/RELEASES.md +++ b/sys/contrib/openzfs/RELEASES.md diff --cc sys/contrib/openzfs/cmd/fsck_zfs/.gitignore index 000000000000,0edf0309e94a..0edf0309e94a mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/fsck_zfs/.gitignore +++ b/sys/contrib/openzfs/cmd/fsck_zfs/.gitignore diff --cc sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in index 000000000000,32c8043e68fb..32c8043e68fb mode 000000,100755..100755 --- a/sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in +++ b/sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd index 000000000000,9fde997e8c60..9fde997e8c60 mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-freebsd diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux index 000000000000,c3ff176bf8f2..c3ff176bf8f2 mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.1-linux diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 index 000000000000,9bc963ddccab..9bc963ddccab mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.1 diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 index 000000000000,82a2698c8c5c..82a2698c8c5c mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/zol-0.6.4 diff --cc sys/contrib/openzfs/config/kernel-siginfo.m4 index 000000000000,6ddb0dcc37d2..6ddb0dcc37d2 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-siginfo.m4 +++ b/sys/contrib/openzfs/config/kernel-siginfo.m4 diff --cc sys/contrib/openzfs/config/kernel-signal-stop.m4 index 000000000000,6cb86e7c4cde..6cb86e7c4cde mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-signal-stop.m4 +++ b/sys/contrib/openzfs/config/kernel-signal-stop.m4 diff --cc sys/contrib/openzfs/config/kernel-special-state.m4 index 000000000000,aa60aabebc43..aa60aabebc43 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-special-state.m4 +++ b/sys/contrib/openzfs/config/kernel-special-state.m4 diff --cc sys/contrib/openzfs/contrib/bash_completion.d/.gitignore index 000000000000,0fd9cc63af2a..0fd9cc63af2a mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/bash_completion.d/.gitignore +++ b/sys/contrib/openzfs/contrib/bash_completion.d/.gitignore diff --cc sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c index 0491b2ff3e28,fd1da03712f1..dace3ec345fa --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c @@@ -1247,12 -1253,16 +1253,21 @@@ zfs_znode_free(znode_t *zp list_remove(&zfsvfs->z_all_znodes, zp); zfsvfs->z_nr_znodes--; mutex_exit(&zfsvfs->z_znodes_lock); + symlink = atomic_load_ptr(&zp->z_cached_symlink); + if (symlink != NULL) { + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); + cache_symlink_free(symlink, strlen(symlink) + 1); + } + #if __FreeBSD_version >= 1300139 + symlink = atomic_load_ptr(&zp->z_cached_symlink); + if (symlink != NULL) { + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, + (uintptr_t)NULL); + cache_symlink_free(symlink, strlen(symlink) + 1); + } + #endif + if (zp->z_acl_cached) { zfs_acl_free(zp->z_acl_cached); zp->z_acl_cached = NULL; diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh index 000000000000,b367cef9c4a4..b367cef9c4a4 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh index 000000000000,469117a56cc0..469117a56cc0 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/deadman/deadman_ratelimit.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore index 000000000000,ed5af03a1095..ed5af03a1095 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/.gitignore diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c index 000000000000,c072f906d23e..c072f906d23e mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh index 000000000000,8736a7fdf7e6..8736a7fdf7e6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh index 000000000000,8015e682c892..8015e682c892 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh index 000000000000,6796cc78a1bd..6796cc78a1bd mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redundancy/redundancy_draid_damaged.ksh diff --cc sys/modules/zfs/zfs_config.h index ebc9bbe9059b,000000000000..7e910ef6ec43 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,774 -1,0 +1,774 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT_LEGACY */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* kernel has large stacks */ +/* #undef HAVE_LARGE_STACKS */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->create()/mkdir()/mknod() take umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + *** 305 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Jun 8 15:52:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96525639EC2; Tue, 8 Jun 2021 15:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzvrr3rX6z3QJy; Tue, 8 Jun 2021 15:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C33D3B68; Tue, 8 Jun 2021 15:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158FqiO4005296; Tue, 8 Jun 2021 15:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158FqiXP005295; Tue, 8 Jun 2021 15:52:44 GMT (envelope-from git) Date: Tue, 8 Jun 2021 15:52:44 GMT Message-Id: <202106081552.158FqiXP005295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: f0f7b0868a94 - main - Remove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0f7b0868a94d33ca3362702832b772bc01c65d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 15:52:44 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=f0f7b0868a94d33ca3362702832b772bc01c65d6 commit f0f7b0868a94d33ca3362702832b772bc01c65d6 Author: Marcin Wojtas AuthorDate: 2021-05-27 08:05:35 +0000 Commit: Marcin Wojtas CommitDate: 2021-06-08 15:51:11 +0000 Remove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c ThunderX is the only board known to use them. Move them to the ThunderX PCIe driver. Submitted by: Kornel Duleba Reviewed by: andrew Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30179 --- sys/arm64/cavium/thunder_pcie_fdt.c | 164 +++++++++++++++++++++++++++++++-- sys/dev/pci/pci_host_generic_fdt.c | 178 +----------------------------------- 2 files changed, 158 insertions(+), 184 deletions(-) diff --git a/sys/arm64/cavium/thunder_pcie_fdt.c b/sys/arm64/cavium/thunder_pcie_fdt.c index 115b89b67b88..b89b4e345d31 100644 --- a/sys/arm64/cavium/thunder_pcie_fdt.c +++ b/sys/arm64/cavium/thunder_pcie_fdt.c @@ -59,23 +59,43 @@ __FBSDID("$FreeBSD$"); #ifdef THUNDERX_PASS_1_1_ERRATA static struct resource * thunder_pcie_fdt_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int thunder_pcie_fdt_release_resource(device_t, device_t, + int, int, struct resource*); #endif static int thunder_pcie_fdt_attach(device_t); static int thunder_pcie_fdt_probe(device_t); static int thunder_pcie_fdt_get_id(device_t, device_t, enum pci_id_type, uintptr_t *); +static const struct ofw_bus_devinfo *thunder_pcie_ofw_get_devinfo(device_t, + device_t); + +/* OFW bus interface */ +struct thunder_pcie_ofw_devinfo { + struct ofw_bus_devinfo di_dinfo; + struct resource_list di_rl; +}; + static device_method_t thunder_pcie_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, thunder_pcie_fdt_probe), DEVMETHOD(device_attach, thunder_pcie_fdt_attach), #ifdef THUNDERX_PASS_1_1_ERRATA DEVMETHOD(bus_alloc_resource, thunder_pcie_fdt_alloc_resource), + DEVMETHOD(bus_release_resource, thunder_pcie_fdt_release_resource), #endif /* pcib interface */ DEVMETHOD(pcib_get_id, thunder_pcie_fdt_get_id), + /* ofw interface */ + DEVMETHOD(ofw_bus_get_devinfo, thunder_pcie_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + /* End */ DEVMETHOD_END }; @@ -90,6 +110,70 @@ DRIVER_MODULE(thunder_pcib, simplebus, thunder_pcie_fdt_driver, DRIVER_MODULE(thunder_pcib, ofwbus, thunder_pcie_fdt_driver, thunder_pcie_fdt_devclass, 0, 0); +static const struct ofw_bus_devinfo * +thunder_pcie_ofw_get_devinfo(device_t bus __unused, device_t child) +{ + struct thunder_pcie_ofw_devinfo *di; + + di = device_get_ivars(child); + return (&di->di_dinfo); +} + +static void +get_addr_size_cells(phandle_t node, pcell_t *addr_cells, pcell_t *size_cells) +{ + + *addr_cells = 2; + /* Find address cells if present */ + OF_getencprop(node, "#address-cells", addr_cells, sizeof(*addr_cells)); + + *size_cells = 2; + /* Find size cells if present */ + OF_getencprop(node, "#size-cells", size_cells, sizeof(*size_cells)); +} + +static int +thunder_pcie_ofw_bus_attach(device_t dev) +{ + struct thunder_pcie_ofw_devinfo *di; + device_t child; + phandle_t parent, node; + pcell_t addr_cells, size_cells; + + parent = ofw_bus_get_node(dev); + if (parent > 0) { + get_addr_size_cells(parent, &addr_cells, &size_cells); + /* Iterate through all bus subordinates */ + for (node = OF_child(parent); node > 0; node = OF_peer(node)) { + /* Allocate and populate devinfo. */ + di = malloc(sizeof(*di), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { + free(di, M_DEVBUF); + continue; + } + + /* Initialize and populate resource list. */ + resource_list_init(&di->di_rl); + ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, + &di->di_rl); + ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); + + /* Add newbus device for this FDT node */ + child = device_add_child(dev, NULL, -1); + if (child == NULL) { + resource_list_free(&di->di_rl); + ofw_bus_gen_destroy_devinfo(&di->di_dinfo); + free(di, M_DEVBUF); + continue; + } + + device_set_ivars(child, di); + } + } + + return (0); +} + static int thunder_pcie_fdt_probe(device_t dev) { @@ -121,6 +205,10 @@ thunder_pcie_fdt_attach(device_t dev) thunder_pcie_identify_ecam(dev, &sc->base.ecam); sc->base.coherent = 1; + /* Attach OFW bus */ + if (thunder_pcie_ofw_bus_attach(dev) != 0) + return (ENXIO); + return (pci_host_generic_attach(dev)); } @@ -145,16 +233,76 @@ thunder_pcie_fdt_get_id(device_t pci, device_t child, enum pci_id_type type, } #ifdef THUNDERX_PASS_1_1_ERRATA -static struct resource * -thunder_pcie_fdt_alloc_resource(device_t dev, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +struct resource * +thunder_pcie_fdt_alloc_resource(device_t dev, device_t child, int type, + int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct generic_pcie_fdt_softc *sc; + struct thunder_pcie_ofw_devinfo *di; + struct resource_list_entry *rle; + int i; + + /* + * For PCIe devices that do not have FDT nodes pass + * the request to the core driver. + */ + if ((int)ofw_bus_get_node(child) <= 0) + return (thunder_pcie_alloc_resource(dev, child, type, + rid, start, end, count, flags)); + + /* For other devices use OFW method */ + sc = device_get_softc(dev); + + if (RMAN_IS_DEFAULT_RANGE(start, end)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + /* Find defaults for this rid */ + rle = resource_list_find(&di->di_rl, type, *rid); + if (rle == NULL) + return (NULL); + + start = rle->start; + end = rle->end; + count = rle->count; + } + + if (type == SYS_RES_MEMORY) { + /* Remap through ranges property */ + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + if (start >= sc->base.ranges[i].phys_base && + end < (sc->base.ranges[i].pci_base + + sc->base.ranges[i].size)) { + start -= sc->base.ranges[i].phys_base; + start += sc->base.ranges[i].pci_base; + end -= sc->base.ranges[i].phys_base; + end += sc->base.ranges[i].pci_base; + break; + } + } + + if (i == MAX_RANGES_TUPLES) { + device_printf(dev, "Could not map resource " + "%#jx-%#jx\n", start, end); + return (NULL); + } + } + + return (bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags)); +} + +static int +thunder_pcie_fdt_release_resource(device_t dev, device_t child, int type, + int rid, struct resource *res) { - if ((int)ofw_bus_get_node(child) > 0) - return (pci_host_generic_alloc_resource(dev, child, - type, rid, start, end, count, flags)); + if ((int)ofw_bus_get_node(child) <= 0) + return (pci_host_generic_core_release_resource(dev, child, type, + rid, res)); - return (thunder_pcie_alloc_resource(dev, child, - type, rid, start, end, count, flags)); + return (bus_generic_release_resource(dev, child, type, rid, res)); } #endif diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c index 48e032ad4389..26047135164c 100644 --- a/sys/dev/pci/pci_host_generic_fdt.c +++ b/sys/dev/pci/pci_host_generic_fdt.c @@ -71,34 +71,10 @@ __FBSDID("$FreeBSD$"); #define PROPS_CELL_SIZE 1 #define PCI_ADDR_CELL_SIZE 2 -/* OFW bus interface */ -struct generic_pcie_ofw_devinfo { - struct ofw_bus_devinfo di_dinfo; - struct resource_list di_rl; -}; - /* Forward prototypes */ static int generic_pcie_fdt_probe(device_t dev); static int parse_pci_mem_ranges(device_t, struct generic_pcie_core_softc *); -static int generic_pcie_fdt_release_resource(device_t dev, device_t child, - int type, int rid, struct resource *res); -static int generic_pcie_ofw_bus_attach(device_t); -static const struct ofw_bus_devinfo *generic_pcie_ofw_get_devinfo(device_t, - device_t); - -static __inline void -get_addr_size_cells(phandle_t node, pcell_t *addr_cells, pcell_t *size_cells) -{ - - *addr_cells = 2; - /* Find address cells if present */ - OF_getencprop(node, "#address-cells", addr_cells, sizeof(*addr_cells)); - - *size_cells = 2; - /* Find size cells if present */ - OF_getencprop(node, "#size-cells", size_cells, sizeof(*size_cells)); -} static int generic_pcie_fdt_probe(device_t dev) @@ -134,10 +110,6 @@ pci_host_generic_setup_fdt(device_t dev) if (parse_pci_mem_ranges(dev, &sc->base)) return (ENXIO); - /* Attach OFW bus */ - if (generic_pcie_ofw_bus_attach(dev) != 0) - return (ENXIO); - node = ofw_bus_get_node(dev); if (sc->base.coherent == 0) { sc->base.coherent = OF_hasprop(node, "dma-coherent"); @@ -284,93 +256,6 @@ generic_pcie_fdt_route_interrupt(device_t bus, device_t dev, int pin) return (PCI_INVALID_IRQ); } -static int -generic_pcie_fdt_release_resource(device_t dev, device_t child, int type, - int rid, struct resource *res) -{ - -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { - return (pci_host_generic_core_release_resource(dev, child, type, - rid, res)); - } -#endif - - /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if ((int)ofw_bus_get_node(child) <= 0) { - return (pci_host_generic_core_release_resource(dev, child, type, - rid, res)); - } - - /* For other devices use OFW method */ - return (bus_generic_release_resource(dev, child, type, rid, res)); -} - -struct resource * -pci_host_generic_alloc_resource(device_t dev, device_t child, int type, - int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct generic_pcie_fdt_softc *sc; - struct generic_pcie_ofw_devinfo *di; - struct resource_list_entry *rle; - int i; - -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { - return (pci_host_generic_core_alloc_resource(dev, child, type, rid, - start, end, count, flags)); - } -#endif - - /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if ((int)ofw_bus_get_node(child) <= 0) - return (pci_host_generic_core_alloc_resource(dev, child, type, - rid, start, end, count, flags)); - - /* For other devices use OFW method */ - sc = device_get_softc(dev); - - if (RMAN_IS_DEFAULT_RANGE(start, end)) { - if ((di = device_get_ivars(child)) == NULL) - return (NULL); - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - - /* Find defaults for this rid */ - rle = resource_list_find(&di->di_rl, type, *rid); - if (rle == NULL) - return (NULL); - - start = rle->start; - end = rle->end; - count = rle->count; - } - - if (type == SYS_RES_MEMORY) { - /* Remap through ranges property */ - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - if (start >= sc->base.ranges[i].phys_base && - end < (sc->base.ranges[i].pci_base + - sc->base.ranges[i].size)) { - start -= sc->base.ranges[i].phys_base; - start += sc->base.ranges[i].pci_base; - end -= sc->base.ranges[i].phys_base; - end += sc->base.ranges[i].pci_base; - break; - } - } - - if (i == MAX_RANGES_TUPLES) { - device_printf(dev, "Could not map resource " - "%#jx-%#jx\n", start, end); - return (NULL); - } - } - - return (bus_generic_alloc_resource(dev, child, type, rid, start, - end, count, flags)); -} - static int generic_pcie_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) @@ -482,64 +367,13 @@ generic_pcie_get_id(device_t pci, device_t child, enum pci_id_type type, return (0); } -static const struct ofw_bus_devinfo * -generic_pcie_ofw_get_devinfo(device_t bus __unused, device_t child) -{ - struct generic_pcie_ofw_devinfo *di; - - di = device_get_ivars(child); - return (&di->di_dinfo); -} - /* Helper functions */ -static int -generic_pcie_ofw_bus_attach(device_t dev) -{ - struct generic_pcie_ofw_devinfo *di; - device_t child; - phandle_t parent, node; - pcell_t addr_cells, size_cells; - - parent = ofw_bus_get_node(dev); - if (parent > 0) { - get_addr_size_cells(parent, &addr_cells, &size_cells); - /* Iterate through all bus subordinates */ - for (node = OF_child(parent); node > 0; node = OF_peer(node)) { - /* Allocate and populate devinfo. */ - di = malloc(sizeof(*di), M_DEVBUF, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { - free(di, M_DEVBUF); - continue; - } - - /* Initialize and populate resource list. */ - resource_list_init(&di->di_rl); - ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, - &di->di_rl); - ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); - - /* Add newbus device for this FDT node */ - child = device_add_child(dev, NULL, -1); - if (child == NULL) { - resource_list_free(&di->di_rl); - ofw_bus_gen_destroy_devinfo(&di->di_dinfo); - free(di, M_DEVBUF); - continue; - } - - device_set_ivars(child, di); - } - } - - return (0); -} - static device_method_t generic_pcie_fdt_methods[] = { DEVMETHOD(device_probe, generic_pcie_fdt_probe), DEVMETHOD(device_attach, pci_host_generic_attach), - DEVMETHOD(bus_alloc_resource, pci_host_generic_alloc_resource), - DEVMETHOD(bus_release_resource, generic_pcie_fdt_release_resource), + DEVMETHOD(bus_alloc_resource, pci_host_generic_core_alloc_resource), + DEVMETHOD(bus_release_resource, pci_host_generic_core_release_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_fdt_route_interrupt), @@ -551,14 +385,6 @@ static device_method_t generic_pcie_fdt_methods[] = { DEVMETHOD(pcib_get_id, generic_pcie_get_id), DEVMETHOD(pcib_request_feature, pcib_request_feature_allow), - /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, generic_pcie_ofw_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - DEVMETHOD_END }; From owner-dev-commits-src-all@freebsd.org Tue Jun 8 15:52:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD950639E4A; Tue, 8 Jun 2021 15:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzvrs4md1z3Qcx; Tue, 8 Jun 2021 15:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D47A3BB9; Tue, 8 Jun 2021 15:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Fqjmp005320; Tue, 8 Jun 2021 15:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Fqj2L005319; Tue, 8 Jun 2021 15:52:45 GMT (envelope-from git) Date: Tue, 8 Jun 2021 15:52:45 GMT Message-Id: <202106081552.158Fqj2L005319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: ea52e815887b - main - pci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea52e815887b48f7eb10219777dc89ee0d99e8b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 15:52:46 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=ea52e815887b48f7eb10219777dc89ee0d99e8b6 commit ea52e815887b48f7eb10219777dc89ee0d99e8b6 Author: Marcin Wojtas AuthorDate: 2021-05-27 08:07:19 +0000 Commit: Marcin Wojtas CommitDate: 2021-06-08 15:51:40 +0000 pci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices Some arm64 SoCs have nodes in their fdts that describe devices connected to the internal PCI bus. One such SoC is Freescale LS1028A. It expects the nodes to be mapped to devices enumerated using the standard PCI method. Mapping is done by reading device and function ids from "reg" property. Information is dts is used to describe MDIO/PHY connected to a given interface. Submitted by: Kornel Duleba Reviewed by: andrew Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30180 --- sys/dev/pci/pci_host_generic_fdt.c | 78 ++++++++++++++++++++++++++++++++++++++ sys/dev/pci/pci_host_generic_fdt.h | 4 ++ 2 files changed, 82 insertions(+) diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c index 26047135164c..cb77c0c674a9 100644 --- a/sys/dev/pci/pci_host_generic_fdt.c +++ b/sys/dev/pci/pci_host_generic_fdt.c @@ -71,10 +71,21 @@ __FBSDID("$FreeBSD$"); #define PROPS_CELL_SIZE 1 #define PCI_ADDR_CELL_SIZE 2 +struct pci_ofw_devinfo { + STAILQ_ENTRY(pci_ofw_devinfo) pci_ofw_link; + struct ofw_bus_devinfo di_dinfo; + uint8_t slot; + uint8_t func; + uint8_t bus; +}; + /* Forward prototypes */ static int generic_pcie_fdt_probe(device_t dev); static int parse_pci_mem_ranges(device_t, struct generic_pcie_core_softc *); +static int generic_pcie_ofw_bus_attach(device_t); +static const struct ofw_bus_devinfo *generic_pcie_ofw_get_devinfo(device_t, + device_t); static int generic_pcie_fdt_probe(device_t dev) @@ -104,12 +115,18 @@ pci_host_generic_setup_fdt(device_t dev) sc = device_get_softc(dev); + STAILQ_INIT(&sc->pci_ofw_devlist); + /* Retrieve 'ranges' property from FDT */ if (bootverbose) device_printf(dev, "parsing FDT for ECAM%d:\n", sc->base.ecam); if (parse_pci_mem_ranges(dev, &sc->base)) return (ENXIO); + /* Attach OFW bus */ + if (generic_pcie_ofw_bus_attach(dev) != 0) + return (ENXIO); + node = ofw_bus_get_node(dev); if (sc->base.coherent == 0) { sc->base.coherent = OF_hasprop(node, "dma-coherent"); @@ -367,8 +384,62 @@ generic_pcie_get_id(device_t pci, device_t child, enum pci_id_type type, return (0); } +static const struct ofw_bus_devinfo * +generic_pcie_ofw_get_devinfo(device_t bus, device_t child) +{ + struct generic_pcie_fdt_softc *sc; + struct pci_ofw_devinfo *di; + uint8_t slot, func, busno; + + sc = device_get_softc(bus); + slot = pci_get_slot(child); + func = pci_get_function(child); + busno = pci_get_bus(child); + + STAILQ_FOREACH(di, &sc->pci_ofw_devlist, pci_ofw_link) + if (slot == di->slot && func == di->func && busno == di->bus) + return (&di->di_dinfo); + + return (NULL); +} + /* Helper functions */ +static int +generic_pcie_ofw_bus_attach(device_t dev) +{ + struct generic_pcie_fdt_softc *sc; + struct pci_ofw_devinfo *di; + phandle_t parent, node; + pcell_t reg[5]; + ssize_t len; + + sc = device_get_softc(dev); + parent = ofw_bus_get_node(dev); + if (parent == 0) + return (0); + + /* Iterate through all bus subordinates */ + for (node = OF_child(parent); node > 0; node = OF_peer(node)) { + len = OF_getencprop(node, "reg", reg, sizeof(reg)); + if (len != 5 * sizeof(pcell_t)) + continue; + + /* Allocate and populate devinfo. */ + di = malloc(sizeof(*di), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node) != 0) { + free(di, M_DEVBUF); + continue; + } + di->func = OFW_PCI_PHYS_HI_FUNCTION(reg[0]); + di->slot = OFW_PCI_PHYS_HI_DEVICE(reg[0]); + di->bus = OFW_PCI_PHYS_HI_BUS(reg[0]); + STAILQ_INSERT_TAIL(&sc->pci_ofw_devlist, di, pci_ofw_link); + } + + return (0); +} + static device_method_t generic_pcie_fdt_methods[] = { DEVMETHOD(device_probe, generic_pcie_fdt_probe), DEVMETHOD(device_attach, pci_host_generic_attach), @@ -385,6 +456,13 @@ static device_method_t generic_pcie_fdt_methods[] = { DEVMETHOD(pcib_get_id, generic_pcie_get_id), DEVMETHOD(pcib_request_feature, pcib_request_feature_allow), + DEVMETHOD(ofw_bus_get_devinfo, generic_pcie_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + DEVMETHOD_END }; diff --git a/sys/dev/pci/pci_host_generic_fdt.h b/sys/dev/pci/pci_host_generic_fdt.h index 5c3e18e9ad35..a5d75eddc84d 100644 --- a/sys/dev/pci/pci_host_generic_fdt.h +++ b/sys/dev/pci/pci_host_generic_fdt.h @@ -34,9 +34,13 @@ #ifndef __PCI_HOST_GENERIC_FDT_H_ #define __PCI_HOST_GENERIC_FDT_H_ +struct pci_ofw_devinfo; + struct generic_pcie_fdt_softc { struct generic_pcie_core_softc base; struct ofw_bus_iinfo pci_iinfo; + + STAILQ_HEAD(, pci_ofw_devinfo) pci_ofw_devlist; }; DECLARE_CLASS(generic_pcie_fdt_driver); From owner-dev-commits-src-all@freebsd.org Tue Jun 8 15:52:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 341FB63A122; Tue, 8 Jun 2021 15:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzvrv0lSJz3QMZ; Tue, 8 Jun 2021 15:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFFDE3D91; Tue, 8 Jun 2021 15:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158FqkUM005344; Tue, 8 Jun 2021 15:52:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158FqkLO005343; Tue, 8 Jun 2021 15:52:46 GMT (envelope-from git) Date: Tue, 8 Jun 2021 15:52:46 GMT Message-Id: <202106081552.158FqkLO005343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 28c4e511c23f - main - Add ofw interface support to PCI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28c4e511c23f8b7fd131a13cc2a027aefcb520b7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 15:52:47 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=28c4e511c23f8b7fd131a13cc2a027aefcb520b7 commit 28c4e511c23f8b7fd131a13cc2a027aefcb520b7 Author: Marcin Wojtas AuthorDate: 2021-05-27 08:09:04 +0000 Commit: Marcin Wojtas CommitDate: 2021-06-08 15:52:02 +0000 Add ofw interface support to PCI Some arm64 SoCs have nodes in their fdts that describe devices connected to the internal PCI bus. One such SoC is Freescale LS1028A. In order to access information stored in them we need to add ofw bus support to pci. Pass devinfo request up to our parent, which is responsible for parsing all the information. It allows to use ofw interface on PCI devices that support it. This method is similar to sys/dev/acpica/acpi_pci.c. Submitted by: Kornel Duleba Reviewed by: andrew Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30181 --- sys/conf/files.arm64 | 1 + sys/dev/ofw/ofw_pci.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index fed33562b834..7b9b2583aaa1 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -245,6 +245,7 @@ dev/neta/if_mvneta_fdt.c optional neta fdt dev/neta/if_mvneta.c optional neta mdio mii dev/ofw/ofw_cpu.c optional fdt +dev/ofw/ofw_pci.c optional fdt pci dev/ofw/ofw_pcib.c optional fdt pci dev/pci/controller/pci_n1sdp.c optional pci_n1sdp acpi diff --git a/sys/dev/ofw/ofw_pci.c b/sys/dev/ofw/ofw_pci.c new file mode 100644 index 000000000000..c7ed7c5c8fe9 --- /dev/null +++ b/sys/dev/ofw/ofw_pci.c @@ -0,0 +1,93 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Alstom Group. + * Copyright (c) 2021 Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "pcib_if.h" +#include "pci_if.h" + +static int ofw_pci_probe(device_t); +static const struct ofw_bus_devinfo* pci_ofw_get_devinfo(device_t, device_t); + +static device_method_t ofw_pci_methods[] = { + DEVMETHOD(device_probe, ofw_pci_probe), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, pci_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static devclass_t pci_devclass; + +DEFINE_CLASS_1(pci, ofw_pci_driver, ofw_pci_methods, sizeof(struct pci_softc), + pci_driver); +DRIVER_MODULE(ofw_pci, pcib, ofw_pci_driver, pci_devclass, 0, 0); +MODULE_DEPEND(ofw_pci, simplebus, 1, 1, 1); +MODULE_DEPEND(ofw_pci, pci, 1, 1, 1); +MODULE_VERSION(ofw_pci, 1); + +static int +ofw_pci_probe(device_t dev) +{ + device_t parent; + + parent = device_get_parent(dev); + if (ofw_bus_get_node(parent) <= 0) + return (ENXIO); + + device_set_desc(dev, "OFW PCI bus"); + return (BUS_PROBE_DEFAULT); +} + +/* Pass the request up to our parent. */ +static const struct ofw_bus_devinfo* +pci_ofw_get_devinfo(device_t bus, device_t dev) +{ + + return OFW_BUS_GET_DEVINFO(device_get_parent(bus), dev); +} From owner-dev-commits-src-all@freebsd.org Tue Jun 8 16:37:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9097D63AC1B; Tue, 8 Jun 2021 16:37:50 +0000 (UTC) (envelope-from nwhitehorn@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzwrt3pZHz3nCt; Tue, 8 Jun 2021 16:37:50 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:64aa:ae5e:5615:3d60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 3E1FD9F5D; Tue, 8 Jun 2021 16:37:50 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 28c4e511c23f - main - Add ofw interface support to PCI To: Marcin Wojtas , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202106081552.158FqkLO005343@gitrepo.freebsd.org> From: Nathan Whitehorn Message-ID: <0d50b80a-dbbc-9db9-0a31-1baaedc9978e@freebsd.org> Date: Tue, 8 Jun 2021 12:37:49 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <202106081552.158FqkLO005343@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 16:37:50 -0000 Did you look at moving sys/powerpc/ofw/ofw_pcibus.c to MI code? It does a bit more than this (NUMA etc.) and isn't actually PowerPC-specific. -Nathan On 6/8/21 11:52 AM, Marcin Wojtas wrote: > The branch main has been updated by mw: > > URL: https://cgit.FreeBSD.org/src/commit/?id=28c4e511c23f8b7fd131a13cc2a027aefcb520b7 > > commit 28c4e511c23f8b7fd131a13cc2a027aefcb520b7 > Author: Marcin Wojtas > AuthorDate: 2021-05-27 08:09:04 +0000 > Commit: Marcin Wojtas > CommitDate: 2021-06-08 15:52:02 +0000 > > Add ofw interface support to PCI > > Some arm64 SoCs have nodes in their fdts that describe devices > connected to the internal PCI bus. One such SoC is Freescale LS1028A. > In order to access information stored in them we need to add ofw bus > support to pci. Pass devinfo request up to our parent, which > is responsible for parsing all the information. > It allows to use ofw interface on PCI devices that support it. > This method is similar to sys/dev/acpica/acpi_pci.c. > > Submitted by: Kornel Duleba > Reviewed by: andrew > Obtained from: Semihalf > Sponsored by: Alstom Group > Differential Revision: https://reviews.freebsd.org/D30181 > --- > sys/conf/files.arm64 | 1 + > sys/dev/ofw/ofw_pci.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 94 insertions(+) > > diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 > index fed33562b834..7b9b2583aaa1 100644 > --- a/sys/conf/files.arm64 > +++ b/sys/conf/files.arm64 > @@ -245,6 +245,7 @@ dev/neta/if_mvneta_fdt.c optional neta fdt > dev/neta/if_mvneta.c optional neta mdio mii > > dev/ofw/ofw_cpu.c optional fdt > +dev/ofw/ofw_pci.c optional fdt pci > dev/ofw/ofw_pcib.c optional fdt pci > > dev/pci/controller/pci_n1sdp.c optional pci_n1sdp acpi > diff --git a/sys/dev/ofw/ofw_pci.c b/sys/dev/ofw/ofw_pci.c > new file mode 100644 > index 000000000000..c7ed7c5c8fe9 > --- /dev/null > +++ b/sys/dev/ofw/ofw_pci.c > @@ -0,0 +1,93 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2021 Alstom Group. > + * Copyright (c) 2021 Semihalf. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include "pcib_if.h" > +#include "pci_if.h" > + > +static int ofw_pci_probe(device_t); > +static const struct ofw_bus_devinfo* pci_ofw_get_devinfo(device_t, device_t); > + > +static device_method_t ofw_pci_methods[] = { > + DEVMETHOD(device_probe, ofw_pci_probe), > + > + /* ofw_bus interface */ > + DEVMETHOD(ofw_bus_get_devinfo, pci_ofw_get_devinfo), > + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), > + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), > + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), > + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), > + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), > + > + DEVMETHOD_END > +}; > + > +static devclass_t pci_devclass; > + > +DEFINE_CLASS_1(pci, ofw_pci_driver, ofw_pci_methods, sizeof(struct pci_softc), > + pci_driver); > +DRIVER_MODULE(ofw_pci, pcib, ofw_pci_driver, pci_devclass, 0, 0); > +MODULE_DEPEND(ofw_pci, simplebus, 1, 1, 1); > +MODULE_DEPEND(ofw_pci, pci, 1, 1, 1); > +MODULE_VERSION(ofw_pci, 1); > + > +static int > +ofw_pci_probe(device_t dev) > +{ > + device_t parent; > + > + parent = device_get_parent(dev); > + if (ofw_bus_get_node(parent) <= 0) > + return (ENXIO); > + > + device_set_desc(dev, "OFW PCI bus"); > + return (BUS_PROBE_DEFAULT); > +} > + > +/* Pass the request up to our parent. */ > +static const struct ofw_bus_devinfo* > +pci_ofw_get_devinfo(device_t bus, device_t dev) > +{ > + > + return OFW_BUS_GET_DEVINFO(device_get_parent(bus), dev); > +} > From owner-dev-commits-src-all@freebsd.org Tue Jun 8 16:52:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9955763AD1E for ; Tue, 8 Jun 2021 16:52:07 +0000 (UTC) (envelope-from mw@semihalf.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 4Fzx9M2Plmz3nx3 for ; Tue, 8 Jun 2021 16:52:07 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-qk1-x729.google.com with SMTP id c138so7956482qkg.5 for ; Tue, 08 Jun 2021 09:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dNHm3eIrsRNYTeTWg6JppI0OqF49f/oq2wgx43+cEGE=; b=oWKPpB106NhxfN5xcX/t0kEfuDdtU27xiU8WpNR3ZNogQyPfcfxpGOlklUnWMRNRDv jSU9z+jXIOKVfpFJdQgMRGQUc3pjYMcJ4ekqMTkMOaWJFsWKr52cUOFCTThYkNyACKdH NMo5dWcwe9aCj2hCJ2RFOfOVJ1/RRQDohIPyBS6AnAaoNSmiDv7HfP/bdXu8AkciSaR2 NuYumWYpblx879odFI9CdORseGf+1BNuTzL7TejymlKe4M7WC1gLxqKooMlB38zy8BXJ 1/4cz+CNjr5eBWAYfSUs82E501sF9sP8ERGNVNL7YYz0FUOeBxrjF3g8UHO+IIQWS3Ip 2hpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dNHm3eIrsRNYTeTWg6JppI0OqF49f/oq2wgx43+cEGE=; b=mZBzdbL1zeeqbsZmOuzHepOu4d9kWV40TSzBQ5bFJaqPvtvyRogUz6Eee70q/incSO VIIiW89JF9TlXuxnlCiEotEZM3XIZluBzoLn4DP+KFkAjqHpWq5firauHbmTXiJsVEKH Q+TPoLa8u/kLDBJjAOI1+R6RRVOC5AVC+m3H9RmmEgKEE38Sze2ZNYCMVc6l6vE4doV2 QOVspuh6bcOx0vDAqEc/m8hRq4cpfLlRyZqTkH/fg1WvwSADKdJlT9HiJkZf12Kbscv5 Clz6B9oSp/DrrCJUwm6FTXde5gy02yw4Z5vEQXVFRfOkflOKwBlXXY0SkiKIrnHPRcpi uMtw== X-Gm-Message-State: AOAM532amBPQL+pt9DdfWxmEXdru+qT2QF3jL0AK2ZAtH3Zs878PnFpg +QxUmsn/uJu4c6aGnrTapfs6zivvtuoNzLxk6aLL9A== X-Google-Smtp-Source: ABdhPJwSSbuUfdeCRxu1II0cOblB4MjnVruva6QPGreEVDpN9HP7xA5JNxeh/XgFOOv55EK0pR46/RhEemtvpk3aufs= X-Received: by 2002:a05:620a:1267:: with SMTP id b7mr7724621qkl.385.1623171126168; Tue, 08 Jun 2021 09:52:06 -0700 (PDT) MIME-Version: 1.0 References: <202106081552.158FqkLO005343@gitrepo.freebsd.org> <0d50b80a-dbbc-9db9-0a31-1baaedc9978e@freebsd.org> In-Reply-To: <0d50b80a-dbbc-9db9-0a31-1baaedc9978e@freebsd.org> From: Marcin Wojtas Date: Tue, 8 Jun 2021 18:51:54 +0200 Message-ID: Subject: Re: git: 28c4e511c23f - main - Add ofw interface support to PCI To: Nathan Whitehorn Cc: Marcin Wojtas , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, =?UTF-8?Q?Kornel_Dul=C4=99ba?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Fzx9M2Plmz3nx3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 16:52:07 -0000 Hi Nathan, wt., 8 cze 2021 o 18:37 Nathan Whitehorn napisa=C5= =82(a): > > Did you look at moving sys/powerpc/ofw/ofw_pcibus.c to MI code? It does > a bit more than this (NUMA etc.) and isn't actually PowerPC-specific. > -Nathan > Thanks for the pointer - we will take a look. Best regards, Marcin > On 6/8/21 11:52 AM, Marcin Wojtas wrote: > > The branch main has been updated by mw: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D28c4e511c23f8b7fd131a13c= c2a027aefcb520b7 > > > > commit 28c4e511c23f8b7fd131a13cc2a027aefcb520b7 > > Author: Marcin Wojtas > > AuthorDate: 2021-05-27 08:09:04 +0000 > > Commit: Marcin Wojtas > > CommitDate: 2021-06-08 15:52:02 +0000 > > > > Add ofw interface support to PCI > > > > Some arm64 SoCs have nodes in their fdts that describe devices > > connected to the internal PCI bus. One such SoC is Freescale LS102= 8A. > > In order to access information stored in them we need to add ofw b= us > > support to pci. Pass devinfo request up to our parent, which > > is responsible for parsing all the information. > > It allows to use ofw interface on PCI devices that support it. > > This method is similar to sys/dev/acpica/acpi_pci.c. > > > > Submitted by: Kornel Duleba > > Reviewed by: andrew > > Obtained from: Semihalf > > Sponsored by: Alstom Group > > Differential Revision: https://reviews.freebsd.org/D30181 > > --- > > sys/conf/files.arm64 | 1 + > > sys/dev/ofw/ofw_pci.c | 93 ++++++++++++++++++++++++++++++++++++++++++= +++++++++ > > 2 files changed, 94 insertions(+) > > > > diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 > > index fed33562b834..7b9b2583aaa1 100644 > > --- a/sys/conf/files.arm64 > > +++ b/sys/conf/files.arm64 > > @@ -245,6 +245,7 @@ dev/neta/if_mvneta_fdt.c optional = neta fdt > > dev/neta/if_mvneta.c optional neta mdi= o mii > > > > dev/ofw/ofw_cpu.c optional fdt > > +dev/ofw/ofw_pci.c optional fdt pci > > dev/ofw/ofw_pcib.c optional fdt pci > > > > dev/pci/controller/pci_n1sdp.c optional pci_n1sd= p acpi > > diff --git a/sys/dev/ofw/ofw_pci.c b/sys/dev/ofw/ofw_pci.c > > new file mode 100644 > > index 000000000000..c7ed7c5c8fe9 > > --- /dev/null > > +++ b/sys/dev/ofw/ofw_pci.c > > @@ -0,0 +1,93 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2021 Alstom Group. > > + * Copyright (c) 2021 Semihalf. > > + * > > + * 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 copyrigh= t > > + * notice, this list of conditions and the following disclaimer in = the > > + * documentation and/or other materials provided with the distribut= ion. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS O= R > > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARR= ANTIES > > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAI= MED. > > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING= , BUT > > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS O= F USE, > > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A= NY > > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE U= SE OF > > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > + */ > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > + > > +#include "pcib_if.h" > > +#include "pci_if.h" > > + > > +static int ofw_pci_probe(device_t); > > +static const struct ofw_bus_devinfo* pci_ofw_get_devinfo(device_t, dev= ice_t); > > + > > +static device_method_t ofw_pci_methods[] =3D { > > + DEVMETHOD(device_probe, ofw_pci_probe), > > + > > + /* ofw_bus interface */ > > + DEVMETHOD(ofw_bus_get_devinfo, pci_ofw_get_devinfo), > > + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), > > + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), > > + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), > > + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), > > + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), > > + > > + DEVMETHOD_END > > +}; > > + > > +static devclass_t pci_devclass; > > + > > +DEFINE_CLASS_1(pci, ofw_pci_driver, ofw_pci_methods, sizeof(struct pci= _softc), > > + pci_driver); > > +DRIVER_MODULE(ofw_pci, pcib, ofw_pci_driver, pci_devclass, 0, 0); > > +MODULE_DEPEND(ofw_pci, simplebus, 1, 1, 1); > > +MODULE_DEPEND(ofw_pci, pci, 1, 1, 1); > > +MODULE_VERSION(ofw_pci, 1); > > + > > +static int > > +ofw_pci_probe(device_t dev) > > +{ > > + device_t parent; > > + > > + parent =3D device_get_parent(dev); > > + if (ofw_bus_get_node(parent) <=3D 0) > > + return (ENXIO); > > + > > + device_set_desc(dev, "OFW PCI bus"); > > + return (BUS_PROBE_DEFAULT); > > +} > > + > > +/* Pass the request up to our parent. */ > > +static const struct ofw_bus_devinfo* > > +pci_ofw_get_devinfo(device_t bus, device_t dev) > > +{ > > + > > + return OFW_BUS_GET_DEVINFO(device_get_parent(bus), dev); > > +} > > > From owner-dev-commits-src-all@freebsd.org Tue Jun 8 17:05:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FEA563B486 for ; Tue, 8 Jun 2021 17:05:59 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 4FzxTM1wRRz3q7b for ; Tue, 8 Jun 2021 17:05:59 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x72f.google.com with SMTP id d196so15753519qkg.12 for ; Tue, 08 Jun 2021 10:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dD/Dkl1l31G6Ggfg6fRq8btR47ppYP1NBdRhno70+yw=; b=GqDgLMCCfmKRKuCa2tEhlO1Uyo4kS8nyFM4XRDiYeiTvc02TrJBaprRrut+7emqsDq X+b7ot4+U/Q1gOABg4wBQCFA9dAKppLkNc0xEfBUH4b6qMV6iNywR5azID2q4npHe/Sz naizjVRbcquqGMneMdYgyZOU4nBT/EwcZFdDGwigGTmWGE3BDqBDiSfWTNMNDdBn7ls6 U2/nLKvWdYXauDjjSVwf16WvF+08qQUC0OtBYdjBJlnr4uGJtvP4AA+QL7Uxi8OiNBRg JQ7gTxK+6o9TiuGEBOxXObYO5N/tBscjMEvw1D7lNt74b6rXpMvmk2Ae2IZIncf3pBwF X/JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dD/Dkl1l31G6Ggfg6fRq8btR47ppYP1NBdRhno70+yw=; b=FzsYcXWQoMbN9GzzdORlahmWloImyhu8QUwsqG1d4nSPhN/ZRFiFUqI72QEGE5o+mO gIWrwdC4Xmlu1zT7gZ0HiOAfLf6AIY80ZjlT6Yp2+g9cEVU/e1eL3JD+u8DWgYoOFtRW GGS+qQ1dOuNIagWLA/FgKhaJQco+34NTXbCncCSVpgVECoiG7JBsOc0TUYOAzKbUB1J2 jyghmJCQrwjxfVsyJqOpvFiz7W9QX4kltBZm4lE0hdDnApoQ/+oaO4zH6D1a3yrSV4K+ 1zeNu3FRW2ewaNWaodqqzgN+T+g+13bwQZ2AB6mkWs3Ui5SURTPE0d0mEm3F+XshyJXP 2AEw== X-Gm-Message-State: AOAM533/R4rHMD294KFhx0BbvmlcU7C+7f/xg9xTszZFbd7Qn6bpxX0R E0vmxil8H00iiKAA6w8Uutie7U9u92xmXQ== X-Google-Smtp-Source: ABdhPJyXxO+tCrYE0wALLXaS62byqvyGnvEd/4QZ8UxKkv+fQyGpTfwFnkyy4zVlnMZqJg0m/VvkdA== X-Received: by 2002:ae9:e84b:: with SMTP id a72mr19570839qkg.226.1623171955752; Tue, 08 Jun 2021 10:05:55 -0700 (PDT) Received: from mutt-hbsd ([38.140.209.220]) by smtp.gmail.com with ESMTPSA id p7sm1437599qkk.104.2021.06.08.10.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 10:05:54 -0700 (PDT) Date: Tue, 8 Jun 2021 13:05:54 -0400 From: Shawn Webb To: Martin Matuska Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 160388166736 - main - zfs: merge openzfs/zfs@75b4cbf62 (master) into main Message-ID: <20210608170554.7ge67t5aiwry54lt@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202106081453.158Eri7k025234@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hrzeujzawo3dwmmv" Content-Disposition: inline In-Reply-To: <202106081453.158Eri7k025234@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4FzxTM1wRRz3q7b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 17:05:59 -0000 --hrzeujzawo3dwmmv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Martin, On Tue, Jun 08, 2021 at 02:53:44PM +0000, Martin Matuska wrote: > The branch main has been updated by mm: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1603881667360c015f6685131f= 2f25474fa67a72 >=20 > commit 1603881667360c015f6685131f2f25474fa67a72 > Merge: ed9215c8e05f 75b4cbf62590 > Author: Martin Matuska > AuthorDate: 2021-06-08 14:48:37 +0000 > Commit: Martin Matuska > CommitDate: 2021-06-08 14:52:44 +0000 This commit broke buildworld (at least on HardenedBSD). Log of the build posted below. building shared library libavl.so.2 cc -target x86_64-unknown-freebsd14.0 --sysroot=3D/usr/obj/usr/src/amd64.am= d64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -flto -fstack-protect= or-strong -shared -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel -o= libavl.so.2.full -Wl,-soname,libavl.so.2 avl.pico=20 objcopy --only-keep-debug libavl.so.2.full libavl.so.2.debug objcopy --strip-debug --add-gnu-debuglink=3Dlibavl.so.2.debug libavl.so.2.= full libavl.so.2 install -U -C -o root -g wheel -m 444 libavl.a /usr/obj/usr/src/amd64.am= d64/tmp/usr/lib/ install -U -s -o root -g wheel -m 444 -S libavl.so.2 /usr/obj/usr/src/a= md64.amd64/tmp/lib/ install -U -o root -g wheel -m 444 libavl.so.2.debug /usr/obj/usr/src/a= md64.amd64/tmp/usr/lib/debug/lib/ install -U -l rs -o root -g wheel -m 755 -S /usr/obj/usr/src/amd64.amd64/= tmp/lib/libavl.so.2 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libavl.so =3D=3D=3D> cddl/lib/libspl (obj,all,install) make[4]: don't know how to make atomic.S. Stop make[4]: stopped in /usr/src/cddl/lib/libspl Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --hrzeujzawo3dwmmv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmC/o3AACgkQ/y5nonf4 4fpewQ/+MxlqQyjud7NWtPHt2WzrP0lNegE6IvMZYqXNfAafN6lfhEEmIhiGUb9H m49E09SzhXiy8puBm6ErscmFMn7zPcRNurQlQAaoi1XE5F8P4UiA9d2jLWUNWnmL KuFIZaAq0hH7mO+sNIJBKgljQvVAJYKBw0ZEWBhlNyWhKN+tAiflZn8nDnJwREOC drivm2XEN/Lt7sYR5wUf2WkJkaBtbTbRUFSPuIhXV6p1V9oqd5ERnOL9qrjA57sc fArfpFDMTiy6nzUqG7Mx/50iFa62an4vK+J232U1qkUgb814llAMjDjSf7nKNKxu pfxohraZt2/zx252Qi20LBbmCjFucAn7lsanSj9GQC2Vquc7PG+eT+vk0TGIfLPP EtUoyK9M7rfqWc1T+UY8fzVn8YnkaWo6lIdOFaUn3sSBaEVbeIXtpkGF2q1nHdAD 2XR1zbSiZ8kM5R+tjoH3KWtJHzzhEAHJlUZquk6BZWz8MuztFyZdImM5a5slwfiB x1+qYRwAZA2mhEeaTNWZySOEmzuLcUbJrI1j4jGB58DU8pPSDX5ZFY7JlkdPuc36 5FoWDNLnmHMtjW2NZjW7e2hTnXQ3hAUTbsHK05g6kyY9aX1UZngqbrCd0m5UOByD RMYzVTYRIk8+pwYx0HKYEv/PsSY1giVlOf9qdFeWkZw05qZy3HM= =0Xrn -----END PGP SIGNATURE----- --hrzeujzawo3dwmmv-- From owner-dev-commits-src-all@freebsd.org Tue Jun 8 17:25:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC13A63B808; Tue, 8 Jun 2021 17:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FzxvM5Sf1z3sjD; Tue, 8 Jun 2021 17:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EBBA4ED9; Tue, 8 Jun 2021 17:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158HP3rF025820; Tue, 8 Jun 2021 17:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158HP33p025819; Tue, 8 Jun 2021 17:25:03 GMT (envelope-from git) Date: Tue, 8 Jun 2021 17:25:03 GMT Message-Id: <202106081725.158HP33p025819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 9021c46603bf - main - tests/netgraph: Attribute errors to the caller MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9021c46603bf29b9700f24b8dce8796b434d7c8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 17:25:03 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=9021c46603bf29b9700f24b8dce8796b434d7c8f commit 9021c46603bf29b9700f24b8dce8796b434d7c8f Author: Lutz Donnerhacke AuthorDate: 2021-06-08 17:19:35 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-08 17:23:50 +0000 tests/netgraph: Attribute errors to the caller Errors raised in the common util functions should raise the location of their caller to be useful and include the errno description. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30671 --- tests/sys/netgraph/util.c | 43 +++++++++++++++++++++++++----------------- tests/sys/netgraph/util.h | 48 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 64 insertions(+), 27 deletions(-) diff --git a/tests/sys/netgraph/util.c b/tests/sys/netgraph/util.c index 450a176971a7..dbf62599aa04 100644 --- a/tests/sys/netgraph/util.c +++ b/tests/sys/netgraph/util.c @@ -45,11 +45,13 @@ static int cs = -1, ds = -1; static ng_error_t error_handling = FAIL; -#define CHECK(r, x) do { \ - if (error_handling == FAIL) \ - ATF_REQUIRE(x); \ - else if(!(x)) \ - return r; \ +#define CHECK(r, x) do { \ + if (!(x)) { \ + if (error_handling == PASS) \ + return r; \ + atf_tc_fail_requirement(file, line, "%s (%s)", \ + #x " not met", strerror(errno));\ + } \ } while(0) struct data_handler { @@ -64,8 +66,9 @@ static void handle_data(void *ctx); static void handle_msg(void *ctx); void -ng_connect(char const *path1, char const *hook1, - char const *path2, char const *hook2) +_ng_connect(char const *path1, char const *hook1, + char const *path2, char const *hook2, + char const *file, size_t line) { struct ngm_connect c; @@ -79,8 +82,9 @@ ng_connect(char const *path1, char const *hook1, } void -ng_mkpeer(char const *path1, char const *hook1, - char const *type, char const *hook2) +_ng_mkpeer(char const *path1, char const *hook1, + char const *type, char const *hook2, + char const *file, size_t line) { struct ngm_mkpeer p; @@ -94,7 +98,8 @@ ng_mkpeer(char const *path1, char const *hook1, } void -ng_rmhook(char const *path, char const *hook) +_ng_rmhook(char const *path, char const *hook, + char const *file, size_t line) { struct ngm_rmhook h; @@ -106,7 +111,8 @@ ng_rmhook(char const *path, char const *hook) } void -ng_name(char const *path, char const *name) +_ng_name(char const *path, char const *name, + char const *file, size_t line) { struct ngm_name n; @@ -118,7 +124,8 @@ ng_name(char const *path, char const *name) } void -ng_shutdown(char const *path) +_ng_shutdown(char const *path, + char const *file, size_t line) { CHECK(, -1 != NgSendMsg(cs, path, NGM_GENERIC_COOKIE, NGM_SHUTDOWN, @@ -137,8 +144,9 @@ ng_register_data(char const *hook, ng_data_handler_t proc) } void -ng_send_data(char const *hook, - void const *data, size_t len) +_ng_send_data(char const *hook, + void const *data, size_t len, + char const *file, size_t line) { CHECK(, -1 != NgSendData(ds, hook, data, len)); } @@ -213,7 +221,8 @@ ng_handle_events(unsigned int ms, void *context) } int -ng_send_msg(char const *path, char const *msg) +_ng_send_msg(char const *path, char const *msg, + char const *file, size_t line) { int res; @@ -231,10 +240,10 @@ ng_errors(ng_error_t n) } void -ng_init(void) { +_ng_init(char const *file, size_t line) { if (cs >= 0) /* prevent reinit */ return; - ATF_REQUIRE(0 == NgMkSockNode(NULL, &cs, &ds)); + CHECK(, 0 == NgMkSockNode(NULL, &cs, &ds)); NgSetDebug(3); } diff --git a/tests/sys/netgraph/util.h b/tests/sys/netgraph/util.h index 93ddc91f79bc..41243e15fb10 100644 --- a/tests/sys/netgraph/util.h +++ b/tests/sys/netgraph/util.h @@ -34,21 +34,47 @@ #include -void ng_connect (char const *path1, char const *hook1, - char const *path2, char const *hook2); -void ng_mkpeer (char const *path1, char const *hook1, - char const *type, char const *hook2); -void ng_shutdown(char const *path); -void ng_rmhook (char const *path, char const *hook); -void ng_name (char const *path, char const *name); +void _ng_connect (char const *path1, char const *hook1, + char const *path2, char const *hook2, + char const *file, size_t line); +#define ng_connect(p1,h1,p2,h2) \ + _ng_connect(p1,h1,p2,h2,__FILE__,__LINE__) + +void _ng_mkpeer (char const *path1, char const *hook1, + char const *type, char const *hook2, + char const *file, size_t line); +#define ng_mkpeer(p1,h1,t,h2) \ + _ng_mkpeer(p1,h1,t,h2,__FILE__,__LINE__) + +void _ng_shutdown(char const *path, + char const *file, size_t line); +#define ng_shutdown(p) \ + _ng_shutdown(p,__FILE__,__LINE__) + +void _ng_rmhook (char const *path, char const *hook, + char const *file, size_t line); +#define ng_rmhook(p,h) \ + _ng_rmhook(p,h,__FILE__,__LINE__) + +void _ng_name (char const *path, char const *name, + char const *file, size_t line); +#define ng_name(p,n) \ + _ng_name(p,n,__FILE__,__LINE__) + typedef void (*ng_data_handler_t)(void *, size_t, void *ctx); void ng_register_data(char const *hook, ng_data_handler_t proc); -void ng_send_data(char const *hook, void const *, size_t); +void _ng_send_data(char const *hook, void const *, size_t, + char const *file, size_t line); +#define ng_send_data(h,d,l) \ + _ng_send_data(h,d,l,__FILE__,__LINE__) typedef void (*ng_msg_handler_t)(char const *, struct ng_mesg *, void *); void ng_register_msg(ng_msg_handler_t proc); -int ng_send_msg(char const *path, char const *msg); +int _ng_send_msg(char const *path, char const *msg, + char const *file, size_t line); +#define ng_send_msg(p,m) \ + _ng_send_msg(p,m,__FILE__,__LINE__) int ng_handle_event (unsigned int ms, void *ctx); void ng_handle_events(unsigned int ms, void *ctx); @@ -56,4 +82,6 @@ void ng_handle_events(unsigned int ms, void *ctx); typedef enum { FAIL, PASS } ng_error_t; ng_error_t ng_errors(ng_error_t); -void ng_init(void); +void _ng_init(char const *file, size_t line); +#define ng_init() \ + _ng_init(__FILE__,__LINE__) From owner-dev-commits-src-all@freebsd.org Tue Jun 8 17:31:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20A3D63BA82; Tue, 8 Jun 2021 17:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzy2j0TK9z3tFY; Tue, 8 Jun 2021 17:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDA4A4E78; Tue, 8 Jun 2021 17:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158HVOMS035999; Tue, 8 Jun 2021 17:31:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158HVO7d035986; Tue, 8 Jun 2021 17:31:24 GMT (envelope-from git) Date: Tue, 8 Jun 2021 17:31:24 GMT Message-Id: <202106081731.158HVO7d035986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: de295884c4ef - main - tip: Cast via intptr_t not long when casting between pointer and int MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de295884c4efd9a126dfdd8d98247de345d1f468 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 17:31:25 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=de295884c4efd9a126dfdd8d98247de345d1f468 commit de295884c4efd9a126dfdd8d98247de345d1f468 Author: Jessica Clarke AuthorDate: 2021-06-08 17:30:59 +0000 Commit: Jessica Clarke CommitDate: 2021-06-08 17:30:59 +0000 tip: Cast via intptr_t not long when casting between pointer and int Whilst all FreeBSD architectures have the same representation for intptr_t and long (even if the former is int on ILP32 architectures), this is more general and correct, and on CHERI they are not the same so warnings are generated by default for integer-to-pointer casts that aren't via (u)intptr_t. Reviewed by: imp, kib Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D30696 --- usr.bin/tip/tip/tip.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.bin/tip/tip/tip.h b/usr.bin/tip/tip/tip.h index ab6b2c4cd9a0..6bf94521cdfd 100644 --- a/usr.bin/tip/tip/tip.h +++ b/usr.bin/tip/tip/tip.h @@ -153,16 +153,16 @@ typedef */ #define value(v) vtable[v].v_value -#define lvalue(v) (long)vtable[v].v_value +#define lvalue(v) (long)(intptr_t)vtable[v].v_value -#define number(v) ((long)(v)) -#define boolean(v) ((short)(long)(v)) -#define character(v) ((char)(long)(v)) -#define address(v) ((long *)(v)) +#define number(v) ((long)(intptr_t)(v)) +#define boolean(v) ((short)(intptr_t)(v)) +#define character(v) ((char)(intptr_t)(v)) +#define address(v) ((long *)(v)) -#define setnumber(v,n) do { (v) = (char *)(long)(n); } while (0) -#define setboolean(v,n) do { (v) = (char *)(long)(n); } while (0) -#define setcharacter(v,n) do { (v) = (char *)(long)(n); } while (0) +#define setnumber(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) +#define setboolean(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) +#define setcharacter(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) #define setaddress(v,n) do { (v) = (char *)(n); } while (0) /* From owner-dev-commits-src-all@freebsd.org Tue Jun 8 17:31:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BF5463B899; Tue, 8 Jun 2021 17:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzy2k2Kgwz3t7j; Tue, 8 Jun 2021 17:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2595C5480; Tue, 8 Jun 2021 17:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158HVQ42037299; Tue, 8 Jun 2021 17:31:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158HVQx5037285; Tue, 8 Jun 2021 17:31:26 GMT (envelope-from git) Date: Tue, 8 Jun 2021 17:31:26 GMT Message-Id: <202106081731.158HVQx5037285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 6d2648bcaba9 - main - tip: Fix pointer-vs-integer confusion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d2648bcaba9b14e2f5c76680f3e7608e1f125f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 17:31:26 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=6d2648bcaba9b14e2f5c76680f3e7608e1f125f4 commit 6d2648bcaba9b14e2f5c76680f3e7608e1f125f4 Author: Jessica Clarke AuthorDate: 2021-06-08 17:30:59 +0000 Commit: Jessica Clarke CommitDate: 2021-06-08 17:30:59 +0000 tip: Fix pointer-vs-integer confusion Currently IREMOTE assumes that every value is (initially) a pointer to a long. This is true for NUMBERs, but false for STRINGs, which are instead pointers to pointers, though on ILP32 and LP64 systems these happen to have the same representation, but this is still a strict aliasing violation, and of course breaks on systems where the representations are not the same, such as CHERI. We do not currently have any BOOLs (short, curiously) or CHARs used with IREMOTE, though the code should not be relying on that. This removes the unused setaddress macro, and the now-unused address macro due to the above issue. Reviewed by: imp, kib Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D30697 --- usr.bin/tip/tip/tip.h | 2 -- usr.bin/tip/tip/value.c | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/usr.bin/tip/tip/tip.h b/usr.bin/tip/tip/tip.h index 6bf94521cdfd..298b08cb6692 100644 --- a/usr.bin/tip/tip/tip.h +++ b/usr.bin/tip/tip/tip.h @@ -158,12 +158,10 @@ typedef #define number(v) ((long)(intptr_t)(v)) #define boolean(v) ((short)(intptr_t)(v)) #define character(v) ((char)(intptr_t)(v)) -#define address(v) ((long *)(v)) #define setnumber(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) #define setboolean(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) #define setcharacter(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) -#define setaddress(v,n) do { (v) = (char *)(n); } while (0) /* * Escape command table definitions -- diff --git a/usr.bin/tip/tip/value.c b/usr.bin/tip/tip/value.c index a4776b80d35d..9cf1052d3ea2 100644 --- a/usr.bin/tip/tip/value.c +++ b/usr.bin/tip/tip/value.c @@ -69,8 +69,22 @@ vinit(void) if (p->v_type&ENVIRON) if ((cp = getenv(p->v_name))) p->v_value = cp; - if (p->v_type&IREMOTE) - setnumber(p->v_value, *address(p->v_value)); + if (p->v_type&IREMOTE) { + switch (p->v_type&TMASK) { + case STRING: + p->v_value = *(char **)p->v_value; + break; + case NUMBER: + setnumber(p->v_value, *(long *)p->v_value); + break; + case BOOL: + setboolean(p->v_value, *(short *)p->v_value); + break; + case CHAR: + setcharacter(p->v_value, *(char *)p->v_value); + break; + } + } } /* * Read the .tiprc file in the HOME directory From owner-dev-commits-src-all@freebsd.org Tue Jun 8 17:33:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3C9663BA4B; Tue, 8 Jun 2021 17:33:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fzy4y3Bxsz3tJp; Tue, 8 Jun 2021 17:33:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id qfbKlBmF2ycp5qfbMl7ARq; Tue, 08 Jun 2021 11:33:20 -0600 X-Authority-Analysis: v=2.4 cv=H864f8Ui c=1 sm=1 tr=0 ts=60bfa9e0 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=r6YtysWOX24A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=FiNJkoHMrfPae4rBkvEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id BAA8B29A; Tue, 8 Jun 2021 10:33:17 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 158HX4UN005996; Tue, 8 Jun 2021 10:33:05 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202106081733.158HX4UN005996@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Shawn Webb cc: Martin Matuska , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 160388166736 - main - zfs: merge openzfs/zfs@75b4cbf62 (master) into main In-reply-to: <20210608170554.7ge67t5aiwry54lt@mutt-hbsd> References: <202106081453.158Eri7k025234@gitrepo.freebsd.org> <20210608170554.7ge67t5aiwry54lt@mutt-hbsd> Comments: In-reply-to Shawn Webb message dated "Tue, 08 Jun 2021 13:05:54 -0400." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 08 Jun 2021 10:33:04 -0700 X-CMAE-Envelope: MS4xfIQiPbMjGuxsBYJ+9ip0N8xe0spyZUalvoBq+TmuC83kZb71A+r/pg/SBox37gPw3rXRAepRqukdMxBHGBcZfCyYTbCwF5e2OuEgbISVjceJn9nusy4B xsFZz2x0Vn8MmpDfVzZ9EUTDHkL3AFqFm8V2DjKEEziLNMzGurssNg8bkEowMwUYtWGrCeVqiw7bT3lYzdy7iaqUTn2HR2VDGwND2NEBchDwKDqbxfLHTkWl nYmcbDMCDZ1KuPkRzO4T9ke9IhjU7yHAfG0CdTXkRsgoaw0tHNiw8Y1Hvc2vJtmKjV0qGppnucYvDJVsi61No0KH3JCKGfQOGJ9tXdc9nXlpi15NzBEd6DEs vUiyro7Ah3quU6Tck13rzrfFqfPPVA== X-Rspamd-Queue-Id: 4Fzy4y3Bxsz3tJp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 17:33:22 -0000 In message <20210608170554.7ge67t5aiwry54lt@mutt-hbsd>, Shawn Webb writes: > > Hey Martin, > > On Tue, Jun 08, 2021 at 02:53:44PM +0000, Martin Matuska wrote: > > The branch main has been updated by mm: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1603881667360c015f6685131f= > 2f25474fa67a72 > >=20 > > commit 1603881667360c015f6685131f2f25474fa67a72 > > Merge: ed9215c8e05f 75b4cbf62590 > > Author: Martin Matuska > > AuthorDate: 2021-06-08 14:48:37 +0000 > > Commit: Martin Matuska > > CommitDate: 2021-06-08 14:52:44 +0000 > > This commit broke buildworld (at least on HardenedBSD). Log of the Not just HardendBSD. > build posted below. > > building shared library libavl.so.2 > cc -target x86_64-unknown-freebsd14.0 --sysroot=3D/usr/obj/usr/src/amd64.am= > d64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -flto -fstack-protect= > or-strong -shared -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel -o= > libavl.so.2.full -Wl,-soname,libavl.so.2 avl.pico=20 > objcopy --only-keep-debug libavl.so.2.full libavl.so.2.debug > objcopy --strip-debug --add-gnu-debuglink=3Dlibavl.so.2.debug libavl.so.2.= > full libavl.so.2 > install -U -C -o root -g wheel -m 444 libavl.a /usr/obj/usr/src/amd64.am= > d64/tmp/usr/lib/ > install -U -s -o root -g wheel -m 444 -S libavl.so.2 /usr/obj/usr/src/a= > md64.amd64/tmp/lib/ > install -U -o root -g wheel -m 444 libavl.so.2.debug /usr/obj/usr/src/a= > md64.amd64/tmp/usr/lib/debug/lib/ > install -U -l rs -o root -g wheel -m 755 -S /usr/obj/usr/src/amd64.amd64/= > tmp/lib/libavl.so.2 /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libavl.so > =3D=3D=3D> cddl/lib/libspl (obj,all,install) > make[4]: don't know how to make atomic.S. Stop > > make[4]: stopped in /usr/src/cddl/lib/libspl > > Thanks, > > --=20 > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Tue Jun 8 17:34:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2F9163B37C for ; Tue, 8 Jun 2021 17:34:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (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 4Fzy625SnBz3tKB for ; Tue, 8 Jun 2021 17:34:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2a.google.com with SMTP id e18so11219251qvm.10 for ; Tue, 08 Jun 2021 10:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xJzANi91ABOCEuejcFCBnMaceS3K+1JC5+T1mhkjTEo=; b=QnXUcmo3sikQtE+ViW8ZNyI08yZ1mgWZ69Vi28dzlJf8gfkcyBqexCoDAeSq2dWQ7v fUUi1e8GgpTsNMxfgfqlgJqi9iLUvrADDlfIc6l8OC+0IjgdTe4GiKM4Kp0wgcXP5UDl nw3cmVLiU/2vBxDWIN+ldojeocK7PR9aOeS+lwCsQ7aDGFLxTsOrqEUuLnFox/oCMZlj kev04TNplQ+641fvaVy7P95BndDsj6otQ/xyG5/h6EkIA2mwjoCHQ6nYjYnOsJw1NUBu BfuOqDTFF46HLlIJM1G4ili+quJwyMcUBcKExFoCRvxv4fR4TW2CE+5vE0l2e8hPUNi0 eyZg== 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=xJzANi91ABOCEuejcFCBnMaceS3K+1JC5+T1mhkjTEo=; b=DsNn4HQUZVjVuBLWRsUsDepUxNXAuUP4ogLt/hVUtaCx3qufeAY78YMXCVBFEGakuJ 4Tl1UjIAXNtBK/6lTy6w+UiNX5GEROHWa44jQfgWLZqQBgDyVG/WN1ca2b4Qmd2+iQlA wmAB3l7mD5tnvS1JHbE0UWbG4tx1CtiVOE/29Kc0g24NYL7na7s7iSa6Z6od2g7fwFrk vyaacyFWO2QpsIu93pbGsj3e34XhYWs/L4jXb/0yMchwM3tW+CH8IT/BKCDWgs/F/Rt/ L0RQp+or+T/YvblVElREZwPiwkBBhEJnqMUzJNuRUICWr0k9n2Qh/ZgA5pSVy1zrljye GjhA== X-Gm-Message-State: AOAM531aiXRp2XIGRIPxOs6ntGicP2tbSDYW3JRL+z++7GM3rV1xSA05 ajKHHMAefjZrC9PWoWcppjKfmPGGcKJAdtWOm9cM6g== X-Google-Smtp-Source: ABdhPJxAda7Wb5LG5KaVaFbPogohlFL9AFg5CF6UKMOlYOiGJx0V6soXd+4cAZmvMn7sn9uFh3M5fzAZcGf6vfC5ZfI= X-Received: by 2002:ad4:576c:: with SMTP id r12mr970692qvx.28.1623173657791; Tue, 08 Jun 2021 10:34:17 -0700 (PDT) MIME-Version: 1.0 References: <202106081453.158Eri7k025234@gitrepo.freebsd.org> <20210608170554.7ge67t5aiwry54lt@mutt-hbsd> In-Reply-To: <20210608170554.7ge67t5aiwry54lt@mutt-hbsd> From: Warner Losh Date: Tue, 8 Jun 2021 11:34:06 -0600 Message-ID: Subject: Re: git: 160388166736 - main - zfs: merge openzfs/zfs@75b4cbf62 (master) into main To: Shawn Webb Cc: Martin Matuska , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Fzy625SnBz3tKB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 17:34:18 -0000 On Tue, Jun 8, 2021 at 11:06 AM Shawn Webb wrote: > Hey Martin, > > On Tue, Jun 08, 2021 at 02:53:44PM +0000, Martin Matuska wrote: > > The branch main has been updated by mm: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=1603881667360c015f6685131f2f25474fa67a72 > > > > commit 1603881667360c015f6685131f2f25474fa67a72 > > Merge: ed9215c8e05f 75b4cbf62590 > > Author: Martin Matuska > > AuthorDate: 2021-06-08 14:48:37 +0000 > > Commit: Martin Matuska > > CommitDate: 2021-06-08 14:52:44 +0000 > > This commit broke buildworld (at least on HardenedBSD). Log of the > build posted below. > > building shared library libavl.so.2 > cc -target x86_64-unknown-freebsd14.0 > --sysroot=/usr/obj/usr/src/amd64.amd64/tmp > -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -flto > -fstack-protector-strong -shared -Wl,-x -Wl,--fatal-warnings > -Wl,--warn-shared-textrel -o libavl.so.2.full -Wl,-soname,libavl.so.2 > avl.pico > objcopy --only-keep-debug libavl.so.2.full libavl.so.2.debug > objcopy --strip-debug --add-gnu-debuglink=libavl.so.2.debug > libavl.so.2.full libavl.so.2 > install -U -C -o root -g wheel -m 444 libavl.a > /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/ > install -U -s -o root -g wheel -m 444 -S libavl.so.2 > /usr/obj/usr/src/amd64.amd64/tmp/lib/ > install -U -o root -g wheel -m 444 libavl.so.2.debug > /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/debug/lib/ > install -U -l rs -o root -g wheel -m 755 -S > /usr/obj/usr/src/amd64.amd64/tmp/lib/libavl.so.2 > /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libavl.so > ===> cddl/lib/libspl (obj,all,install) > make[4]: don't know how to make atomic.S. Stop > > make[4]: stopped in /usr/src/cddl/lib/libspl > A fix is in progress... Warner From owner-dev-commits-src-all@freebsd.org Tue Jun 8 20:21:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB87A63DA6E; Tue, 8 Jun 2021 20:21:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G01qQ69CKz4k6j; Tue, 8 Jun 2021 20:21:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC4D772EA; Tue, 8 Jun 2021 20:21:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158KLsPF065729; Tue, 8 Jun 2021 20:21:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158KLscZ065728; Tue, 8 Jun 2021 20:21:54 GMT (envelope-from git) Date: Tue, 8 Jun 2021 20:21:54 GMT Message-Id: <202106082021.158KLscZ065728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: f20893853e8e - main - zfs: unbreak build broken in 160388166 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f20893853e8e6909d422f6646b706b4b6e299682 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 20:21:55 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=f20893853e8e6909d422f6646b706b4b6e299682 commit f20893853e8e6909d422f6646b706b4b6e299682 Author: Martin Matuska AuthorDate: 2021-06-08 17:02:21 +0000 Commit: Martin Matuska CommitDate: 2021-06-08 20:21:11 +0000 zfs: unbreak build broken in 160388166 --- cddl/lib/libspl/Makefile | 28 ++++++++-------------------- cddl/lib/libuutil/Makefile | 2 -- cddl/lib/libzfs/Makefile | 5 ++--- cddl/usr.bin/Makefile | 2 -- cddl/usr.bin/zstream/Makefile | 3 +++ cddl/usr.bin/zstreamdump/Makefile | 11 ----------- cddl/usr.bin/zstreamdump/Makefile.depend | 25 ------------------------- lib/libbe/Makefile | 1 + 8 files changed, 14 insertions(+), 63 deletions(-) diff --git a/cddl/lib/libspl/Makefile b/cddl/lib/libspl/Makefile index 8088ef497d46..f565683fba4e 100644 --- a/cddl/lib/libspl/Makefile +++ b/cddl/lib/libspl/Makefile @@ -1,7 +1,6 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl -.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/os/freebsd .PATH: ${SRCTOP}/sys/contrib/openzfs/include @@ -11,11 +10,13 @@ PACKAGE= runtime SRCS = \ assert.c \ + getexecname.c \ list.c \ mkdirp.c \ + os/freebsd/getexecname.c \ + os/freebsd/zone.c \ page.c \ timestamp.c \ - zone.c \ include/sys/list.h \ include/sys/list_impl.h @@ -23,25 +24,12 @@ SRCS = \ # will not compile when building on macOS. .if !defined(BOOTSTRAPPING) SRCS += \ - getexecname.c \ - gethostid.c \ - getmntany.c \ - mnttab.c - - -.if ${MACHINE_ARCH} == "amd64" -.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-x86_64 -SRCS += atomic.S -.elif ${MACHINE_ARCH} == "i386" -.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-i386 -SRCS += atomic.S -.else -.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-generic -SRCS += atomic.c -.endif + atomic.c \ + os/freebsd/gethostid.c \ + os/freebsd/getmntany.c \ + os/freebsd/mnttab.c .endif - WARNS?= 2 CSTD= c99 CFLAGS+= -DIN_BASE @@ -53,6 +41,6 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h -CFLAGS.atomic.S+= -DLOCORE +CFLAGS.atomic.c+= -Wno-error-atomic-alignment .include diff --git a/cddl/lib/libuutil/Makefile b/cddl/lib/libuutil/Makefile index 76567b50c610..169b8d8afe01 100644 --- a/cddl/lib/libuutil/Makefile +++ b/cddl/lib/libuutil/Makefile @@ -7,11 +7,9 @@ LIB= uutil SRCS=\ uu_alloc.c \ uu_avl.c \ - uu_dprintf.c \ uu_ident.c \ uu_list.c \ uu_misc.c \ - uu_open.c \ uu_pname.c \ uu_string.c diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile index b159955c0212..6de09d1b7333 100644 --- a/cddl/lib/libzfs/Makefile +++ b/cddl/lib/libzfs/Makefile @@ -5,7 +5,6 @@ .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs/os/freebsd .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libshare -.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libshare/os/freebsd .PATH: ${SRCTOP}/sys/contrib/openzfs/include .PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd .PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd/lib @@ -53,8 +52,8 @@ USER_C += \ USER_C += \ libshare.c \ nfs.c \ - smb.c - + os/freebsd/nfs.c \ + os/freebsd/smb.c KERNEL_C = \ algs/sha2/sha2.c \ diff --git a/cddl/usr.bin/Makefile b/cddl/usr.bin/Makefile index 5c2595df1c9f..10d55215c0b3 100644 --- a/cddl/usr.bin/Makefile +++ b/cddl/usr.bin/Makefile @@ -8,7 +8,6 @@ SUBDIR= \ ctfmerge \ ${_zinject} \ ${_zstream} \ - ${_zstreamdump} \ ${_ztest} SUBDIR.${MK_TESTS}+= tests @@ -17,7 +16,6 @@ SUBDIR.${MK_TESTS}+= tests _zinject= zinject _ztest= ztest _zstream = zstream -_zstreamdump = zstreamdump .endif SUBDIR_PARALLEL= diff --git a/cddl/usr.bin/zstream/Makefile b/cddl/usr.bin/zstream/Makefile index d6ac8c5f3b16..ac3bfeb68cf4 100644 --- a/cddl/usr.bin/zstream/Makefile +++ b/cddl/usr.bin/zstream/Makefile @@ -7,6 +7,7 @@ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs PROG= zstream MAN= zstream.8 +MLINKS= zstream.8 zstreamdump.8 INCS= zstream.h SRCS= \ zstream.c \ @@ -14,6 +15,8 @@ SRCS= \ zstream_redup.c \ zstream_token.c +LINKS= ${BINDIR}/zstream ${BINDIR}/zstreamdump + WARNS?= 2 CFLAGS+= \ -DIN_BASE \ diff --git a/cddl/usr.bin/zstreamdump/Makefile b/cddl/usr.bin/zstreamdump/Makefile deleted file mode 100644 index 63f365d0445a..000000000000 --- a/cddl/usr.bin/zstreamdump/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $FreeBSD$ - -ZFSTOP= ${SRCTOP}/sys/contrib/openzfs - -.PATH: ${ZFSTOP}/cmd/zstreamdump -.PATH: ${ZFSTOP}/man/man8 - -SCRIPTS= zstreamdump -MAN= zstreamdump.8 - -.include diff --git a/cddl/usr.bin/zstreamdump/Makefile.depend b/cddl/usr.bin/zstreamdump/Makefile.depend deleted file mode 100644 index 3089536f9717..000000000000 --- a/cddl/usr.bin/zstreamdump/Makefile.depend +++ /dev/null @@ -1,25 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - cddl/lib/libavl \ - cddl/lib/libnvpair \ - cddl/lib/libumem \ - cddl/lib/libzpool \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libmd \ - lib/libthr \ - lib/libz \ - lib/msun \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/lib/libbe/Makefile b/lib/libbe/Makefile index d1fab41578bf..50a8f8f56fb2 100644 --- a/lib/libbe/Makefile +++ b/lib/libbe/Makefile @@ -58,6 +58,7 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzfs CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h From owner-dev-commits-src-all@freebsd.org Tue Jun 8 23:39:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FB6A6402D2; Tue, 8 Jun 2021 23:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06C946bSz3kXG; Tue, 8 Jun 2021 23:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7183E1204B; Tue, 8 Jun 2021 23:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158NdHXi017387; Tue, 8 Jun 2021 23:39:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158NdH0R017386; Tue, 8 Jun 2021 23:39:17 GMT (envelope-from git) Date: Tue, 8 Jun 2021 23:39:17 GMT Message-Id: <202106082339.158NdH0R017386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 39b87f051506 - stable/13 - Fix LINT kernel builds after 1a714ff20419 . MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 39b87f051506f5d77ab5fa5ece948a73d4e91809 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 23:39:17 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=39b87f051506f5d77ab5fa5ece948a73d4e91809 commit 39b87f051506f5d77ab5fa5ece948a73d4e91809 Author: Hans Petter Selasky AuthorDate: 2021-02-01 12:23:21 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:32:14 +0000 Fix LINT kernel builds after 1a714ff20419 . Discussed with: rrs@ Differential Revision: https://reviews.freebsd.org/D28357 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit db46c0d0cb3da2813727e56df1f2db292065867a) --- sys/netinet/tcp_ratelimit.c | 36 ++++++++---------------------------- sys/netinet/tcp_ratelimit.h | 2 -- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index aeb1ed6906b5..8f2cf3d8d061 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -372,17 +372,6 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "using", CTLFLAG_RD, - &rs->rs_rlt[i].using, 0, - "Number of flows using"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "enobufs", CTLFLAG_RD, - &rs->rs_rlt[i].rs_num_enobufs, 0, - "Number of enobufs logged on this rate"); - } } #endif @@ -678,8 +667,6 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; - rs->rs_rlt[i].using = 0; - rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1076,28 +1063,16 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* @@ -1214,9 +1189,11 @@ use_real_interface: rte = NULL; } else { KASSERT((inp->inp_snd_tag != NULL) , - ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", - inp, rte, rte->rate, rs)); + ("Setup rate has no snd_tag inp:%p rte:%p rate:%llu rs:%p", + inp, rte, (unsigned long long)rte->rate, rs)); +#ifdef INET counter_u64_add(rate_limit_new, 1); +#endif } } if (rte) { @@ -1462,8 +1439,11 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if (error) *error = err; return (NULL); - } else + } else { +#ifdef INET counter_u64_add(rate_limit_chg, 1); +#endif + } if (error) *error = 0; tp->t_pacing_rate = nrte->rate; diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index d3f82fab3ee1..b69f0e634b60 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -44,8 +44,6 @@ struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ uint64_t rate; /* Rate we get in Bytes per second (Bps) */ - uint64_t using; /* Temporary -- rrs remove */ - uint64_t rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; From owner-dev-commits-src-all@freebsd.org Tue Jun 8 23:57:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0D7C640576; Tue, 8 Jun 2021 23:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06bw4rvdz3lMv; Tue, 8 Jun 2021 23:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AA791261E; Tue, 8 Jun 2021 23:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158NvGob043886; Tue, 8 Jun 2021 23:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158NvG09043885; Tue, 8 Jun 2021 23:57:16 GMT (envelope-from git) Date: Tue, 8 Jun 2021 23:57:16 GMT Message-Id: <202106082357.158NvG09043885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a7619988ebc2 - stable/13 - This brings into sync FreeBSD with the netflix versions of rack and bbr. This fixes several breakages (panics) since the tcp_lro code was committed that have been reported. Quite a few new features are now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the largest). There is also support for ack-war prevention. Documents comming soon on rack.. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7619988ebc23fc4db80cddec7c13627f4bb80fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 23:57:16 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a7619988ebc23fc4db80cddec7c13627f4bb80fe commit a7619988ebc23fc4db80cddec7c13627f4bb80fe Author: Randall Stewart AuthorDate: 2021-05-06 15:22:26 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:56:18 +0000 This brings into sync FreeBSD with the netflix versions of rack and bbr. This fixes several breakages (panics) since the tcp_lro code was committed that have been reported. Quite a few new features are now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the largest). There is also support for ack-war prevention. Documents comming soon on rack.. Sponsored by: Netflix Reviewed by: rscheff, mtuexen Differential Revision: https://reviews.freebsd.org/D30036 (cherry picked from commit 5d8fd932e418f03e98b3469c4088a36f0ef34ffe) --- sys/netinet/cc/cc.h | 7 +- sys/netinet/cc/cc_newreno.c | 34 +- sys/netinet/cc/cc_newreno.h | 13 +- sys/netinet/tcp.h | 24 +- sys/netinet/tcp_accounting.h | 39 + sys/netinet/tcp_input.c | 10 +- sys/netinet/tcp_log_buf.h | 8 +- sys/netinet/tcp_ratelimit.c | 29 +- sys/netinet/tcp_ratelimit.h | 4 +- sys/netinet/tcp_sack.c | 11 + sys/netinet/tcp_stacks/bbr.c | 92 +- sys/netinet/tcp_stacks/rack.c | 9876 ++++++++++++++++++++++-------- sys/netinet/tcp_stacks/rack_bbr_common.c | 473 +- sys/netinet/tcp_stacks/rack_bbr_common.h | 21 +- sys/netinet/tcp_stacks/tcp_bbr.h | 6 +- sys/netinet/tcp_stacks/tcp_rack.h | 201 +- sys/netinet/tcp_subr.c | 105 + sys/netinet/tcp_var.h | 12 + 18 files changed, 8181 insertions(+), 2784 deletions(-) diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index a52cfca9579b..be84a6841d15 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -91,15 +91,20 @@ struct cc_var { struct sctp_nets *sctp; } ccvc; uint16_t nsegs; /* # segments coalesced into current chain. */ + uint8_t labc; /* Dont use system abc use passed in */ }; /* cc_var flags. */ #define CCF_ABC_SENTAWND 0x0001 /* ABC counted cwnd worth of bytes? */ #define CCF_CWND_LIMITED 0x0002 /* Are we currently cwnd limited? */ -#define CCF_UNUSED1 0x0004 /* unused */ +#define CCF_USE_LOCAL_ABC 0x0004 /* Dont use the system l_abc val */ #define CCF_ACKNOW 0x0008 /* Will this ack be sent now? */ #define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ #define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ +#define CCF_MAX_CWND 0x0040 /* Have we reached maximum cwnd? */ +#define CCF_CHG_MAX_CWND 0x0080 /* Cubic max_cwnd changed, for K */ +#define CCF_USR_IWND 0x0100 /* User specified initial window */ +#define CCF_USR_IWND_INIT_NSEG 0x0200 /* Convert segs to bytes on conn init */ /* ACK types passed to the ack_received() hook. */ #define CC_ACK 0x0001 /* Regular in sequence ACK. */ diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index a924acb0b8d6..55cab36e149a 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -86,8 +86,8 @@ static void newreno_cong_signal(struct cc_var *ccv, uint32_t type); static void newreno_post_recovery(struct cc_var *ccv); static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf); -VNET_DEFINE_STATIC(uint32_t, newreno_beta) = 50; -VNET_DEFINE_STATIC(uint32_t, newreno_beta_ecn) = 80; +VNET_DEFINE(uint32_t, newreno_beta) = 50; +VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80; #define V_newreno_beta VNET(newreno_beta) #define V_newreno_beta_ecn VNET(newreno_beta_ecn) @@ -101,11 +101,6 @@ struct cc_algo newreno_cc_algo = { .ctl_output = newreno_ctl_output, }; -struct newreno { - uint32_t beta; - uint32_t beta_ecn; -}; - static inline struct newreno * newreno_malloc(struct cc_var *ccv) { @@ -182,9 +177,15 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type) * XXXLAS: Find a way to signal SS after RTO that * doesn't rely on tcpcb vars. */ + uint16_t abc_val; + + if (ccv->flags & CCF_USE_LOCAL_ABC) + abc_val = ccv->labc; + else + abc_val = V_tcp_abc_l_var; if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) incr = min(ccv->bytes_this_ack, - ccv->nsegs * V_tcp_abc_l_var * + ccv->nsegs * abc_val * CCV(ccv, t_maxseg)); else incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); @@ -237,7 +238,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) u_int mss; cwin = CCV(ccv, snd_cwnd); - mss = tcp_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->ccvc.tcp); /* * Other TCP congestion controls use newreno_cong_signal(), but * with their own private cc_data. Make sure the cc_data is used @@ -246,7 +247,15 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) nreno = (CC_ALGO(ccv->ccvc.tcp) == &newreno_cc_algo) ? ccv->cc_data : NULL; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; - if (V_cc_do_abe && type == CC_ECN) + + /* + * Note that we only change the backoff for ECN if the + * global sysctl V_cc_do_abe is set the stack itself + * has set a flag in our newreno_flags (due to pacing) telling + * us to use the lower valued back-off. + */ + if (V_cc_do_abe || + (nreno && (nreno->newreno_flags & CC_NEWRENO_BETA_ECN) && (type == CC_ECN))) factor = beta_ecn; else factor = beta; @@ -265,8 +274,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) V_cc_do_abe && V_cc_abe_frlossreduce)) { CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_ssthresh) * - (uint64_t)beta) / - (100ULL * (uint64_t)beta_ecn); + (uint64_t)beta) / (uint64_t)beta_ecn; } if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) CCV(ccv, snd_ssthresh) = cwin; @@ -352,7 +360,7 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) nreno->beta = opt->val; break; case CC_NEWRENO_BETA_ECN: - if (!V_cc_do_abe) + if ((!V_cc_do_abe) && ((nreno->newreno_flags & CC_NEWRENO_BETA_ECN) == 0)) return (EACCES); nreno->beta_ecn = opt->val; break; diff --git a/sys/netinet/cc/cc_newreno.h b/sys/netinet/cc/cc_newreno.h index 9e2a3cff5fe9..16cf1757e830 100644 --- a/sys/netinet/cc/cc_newreno.h +++ b/sys/netinet/cc/cc_newreno.h @@ -31,12 +31,17 @@ #define CCALGONAME_NEWRENO "newreno" +struct newreno { + uint32_t beta; + uint32_t beta_ecn; + uint32_t newreno_flags; +}; + struct cc_newreno_opts { - int name; + int name; uint32_t val; }; -#define CC_NEWRENO_BETA 1 -#define CC_NEWRENO_BETA_ECN 2 - +#define CC_NEWRENO_BETA 1 /* Beta for normal DUP-ACK/Sack recovery */ +#define CC_NEWRENO_BETA_ECN 2 /* ECN Beta for Abe */ #endif /* _CC_NEWRENO_H */ diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index d2bf1f8431fd..50f0811a6517 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -181,13 +181,24 @@ struct tcphdr { #define TCP_TXTLS_MODE 40 /* Transmit TLS mode */ #define TCP_RXTLS_ENABLE 41 /* TLS framing and encryption for receive */ #define TCP_RXTLS_MODE 42 /* Receive TLS mode */ +#define TCP_IWND_NB 43 /* Override initial window (units: bytes) */ +#define TCP_IWND_NSEG 44 /* Override initial window (units: MSS segs) */ +#define TCP_LOGID_CNT 46 /* get number of connections with the same ID */ +#define TCP_LOG_TAG 47 /* configure tag for grouping logs */ +#define TCP_USER_LOG 48 /* userspace log event */ #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ +#define TCP_MAXUNACKTIME 68 /* maximum time without making progress (sec) */ +#define TCP_MAXPEAKRATE 69 /* maximum peak rate allowed (kbps) */ +#define TCP_IDLE_REDUCE 70 /* Reduce cwnd on idle input */ #define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP tunneling via the specified port */ #define TCP_DELACK 72 /* socket option for delayed ack */ #define TCP_FIN_IS_RST 73 /* A fin from the peer is treated has a RST */ #define TCP_LOG_LIMIT 74 /* Limit to number of records in tcp-log */ #define TCP_SHARED_CWND_ALLOWED 75 /* Use of a shared cwnd is allowed */ +#define TCP_PROC_ACCOUNTING 76 /* Do accounting on tcp cpu usage and counts */ +#define TCP_USE_CMP_ACKS 77 /* The transport can handle the Compressed mbuf acks */ +#define TCP_PERF_INFO 78 /* retrieve accounting counters */ #define TCP_KEEPINIT 128 /* N, time to establish connection */ #define TCP_KEEPIDLE 256 /* L,N,X start keeplives after this period */ #define TCP_KEEPINTVL 512 /* L,N interval between keepalives */ @@ -201,7 +212,7 @@ struct tcphdr { #define TCP_RACK_MBUF_QUEUE 1050 /* Do we allow mbuf queuing if supported */ #define TCP_RACK_PROP 1051 /* RACK proportional rate reduction (bool) */ #define TCP_RACK_TLP_REDUCE 1052 /* RACK TLP cwnd reduction (bool) */ -#define TCP_RACK_PACE_REDUCE 1053 /* RACK Pacing reduction factor (divisor) */ +#define TCP_RACK_PACE_REDUCE 1053 /* RACK Pacingv reduction factor (divisor) */ #define TCP_RACK_PACE_MAX_SEG 1054 /* Max TSO size we will send */ #define TCP_RACK_PACE_ALWAYS 1055 /* Use the always pace method */ #define TCP_RACK_PROP_RATE 1056 /* The proportional reduction rate */ @@ -284,6 +295,16 @@ struct tcphdr { #define TCP_RACK_PACE_TO_FILL 1127 /* If we are not in recovery, always pace to fill the cwnd in 1 RTT */ #define TCP_SHARED_CWND_TIME_LIMIT 1128 /* we should limit to low time values the scwnd life */ #define TCP_RACK_PROFILE 1129 /* Select a profile that sets multiple options */ +#define TCP_HDWR_RATE_CAP 1130 /* Allow hardware rates to cap pacing rate */ +#define TCP_PACING_RATE_CAP 1131 /* Highest rate allowed in pacing in bytes per second (uint64_t) */ +#define TCP_HDWR_UP_ONLY 1132 /* Allow the pacing rate to climb but not descend (with the exception of fill-cw */ +#define TCP_RACK_ABC_VAL 1133 /* Set a local ABC value different then the system default */ +#define TCP_REC_ABC_VAL 1134 /* Do we use the ABC value for recovery or the override one from sysctl */ +#define TCP_RACK_MEASURE_CNT 1135 /* How many measurements are required in GP pacing */ +#define TCP_DEFER_OPTIONS 1136 /* Defer options until the proper number of measurements occur, does not defer TCP_RACK_MEASURE_CNT */ +#define TCP_FAST_RSM_HACK 1137 /* Do we do the broken thing where we don't twiddle the TLP bits properly in fast_rsm_output? */ +#define TCP_RACK_PACING_BETA 1138 /* Changing the beta for pacing */ +#define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR @@ -295,6 +316,7 @@ struct tcphdr { #define TCPI_OPT_WSCALE 0x04 #define TCPI_OPT_ECN 0x08 #define TCPI_OPT_TOE 0x10 +#define TCPI_OPT_TFO 0x20 /* Maximum length of log ID. */ #define TCP_LOG_ID_LEN 64 diff --git a/sys/netinet/tcp_accounting.h b/sys/netinet/tcp_accounting.h new file mode 100644 index 000000000000..a2e2d4edd46d --- /dev/null +++ b/sys/netinet/tcp_accounting.h @@ -0,0 +1,39 @@ +#ifndef __tcp_accounting_h__ +#define __tcp_accounting_h__ +/* + * Return values from tcp_do_ack_accounting + * and indexs to the into the tcp_proc_time[] + * array. + */ +#define ACK_BEHIND 0 +#define ACK_SACK 1 +#define ACK_CUMACK 2 +#define ACK_CUMACK_SACK 3 +#define ACK_DUPACK 4 +#define ACK_RWND 5 +/* Added values for tracking output too */ +#define SND_BLOCKED 6 +#define SND_LIMITED 7 +#define SND_OUT_DATA 8 +#define SND_OUT_ACK 9 +#define SND_OUT_FAIL 10 +/* We also count in the counts array two added (MSS sent and ACKS In) */ +#define CNT_OF_MSS_OUT 11 +#define CNT_OF_ACKS_IN 12 + +/* for the tcpcb we add two more cycle counters */ +#define CYC_HANDLE_MAP 11 +#define CYC_HANDLE_ACK 12 + +/* Should the tp->xxx array's be alloc'ed? */ +/* #define TCP_NUM_PROC_COUNTERS 11 defined in tcp_var.h */ +/* #define TCP_NUM_CNT_COUNTERS 13 defined in tcp_var.h */ + +#ifdef _KERNEL +#ifdef TCP_ACCOUNTING +extern counter_u64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; +extern counter_u64_t tcp_proc_time[TCP_NUM_PROC_COUNTERS]; +#endif +#endif + +#endif diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index d36f9566ffba..916a7186770c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -531,7 +531,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) void inline -cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) +cc_ecnpkt_handler_flags(struct tcpcb *tp, uint16_t flags, uint8_t iptos) { INP_WLOCK_ASSERT(tp->t_inpcb); @@ -549,7 +549,7 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) break; } - if (th->th_flags & TH_CWR) + if (flags & TH_CWR) tp->ccv->flags |= CCF_TCPHDR_CWR; else tp->ccv->flags &= ~CCF_TCPHDR_CWR; @@ -563,6 +563,12 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) } } +void inline +cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) +{ + cc_ecnpkt_handler_flags(tp, th->th_flags, iptos); +} + /* * TCP input handling is split into multiple parts: * tcp6_input is a thin wrapper around tcp_input for the extended diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 436383124dce..4e8b79babfe8 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -174,7 +174,7 @@ enum tcp_log_events { TCP_LOG_IN = 1, /* Incoming packet 1 */ TCP_LOG_OUT, /* Transmit (without other event) 2 */ TCP_LOG_RTO, /* Retransmit timeout 3 */ - TCP_LOG_TF_ACK, /* Transmit due to TF_ACK 4 */ + TCP_LOG_SB_WAKE, /* Awaken socket buffer 4 */ TCP_LOG_BAD_RETRAN, /* Detected bad retransmission 5 */ TCP_LOG_PRR, /* Doing PRR 6 */ TCP_LOG_REORDER, /* Detected reorder 7 */ @@ -200,7 +200,7 @@ enum tcp_log_events { BBR_LOG_DOSEG_DONE, /* hpts do_segment completes 27 */ BBR_LOG_EXIT_GAIN, /* hpts do_segment completes 28 */ BBR_LOG_THRESH_CALC, /* Doing threshold calculation 29 */ - BBR_LOG_EXTRACWNDGAIN, /* Removed 30 */ + TCP_LOG_MAPCHG, /* Map Changes to the sendmap 30 */ TCP_LOG_USERSEND, /* User level sends data 31 */ BBR_RSM_CLEARED, /* RSM cleared of ACK flags 32 */ BBR_LOG_STATE_TARGET, /* Log of target at state 33 */ @@ -232,7 +232,9 @@ enum tcp_log_events { TCP_LOG_USER_EVENT, /* User space event data 59 */ TCP_LOG_SENDFILE, /* sendfile() logging for TCP connections 60 */ TCP_LOG_HTTP_T, /* logging of http request tracking 61 */ - TCP_LOG_END /* End (keep at end) 62 */ + TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */ + TCP_LOG_FSB, /* FSB information 63 */ + TCP_LOG_END /* End (keep at end) 64 */ }; enum tcp_log_states { diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index 8f2cf3d8d061..c33b2872e91f 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -367,11 +367,22 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "pacetime", CTLFLAG_RD, &rs->rs_rlt[i].time_between, 0, "Time hardware inserts between 1500 byte sends"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, + SYSCTL_ADD_LONG(&rs->sysctl_ctx, SYSCTL_CHILDREN(rl_rate_num), OID_AUTO, "rate", CTLFLAG_RD, - &rs->rs_rlt[i].rate, 0, + &rs->rs_rlt[i].rate, "Rate in bytes per second"); + SYSCTL_ADD_LONG(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "using", CTLFLAG_RD, + &rs->rs_rlt[i].using, + "Number of flows using"); + SYSCTL_ADD_LONG(&rs->sysctl_ctx, + SYSCTL_CHILDREN(rl_rate_num), + OID_AUTO, "enobufs", CTLFLAG_RD, + &rs->rs_rlt[i].rs_num_enobufs, + "Number of enobufs logged on this rate"); + } } #endif @@ -667,6 +678,8 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; + rs->rs_rlt[i].using = 0; + rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1063,16 +1076,28 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { + struct tcp_hwrate_limit_table *decon_rte; + + decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); + atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index b69f0e634b60..8747708e8b5e 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -43,7 +43,9 @@ struct m_snd_tag; struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ - uint64_t rate; /* Rate we get in Bytes per second (Bps) */ + long rate; /* Rate we get in Bytes per second (Bps) */ + long using; /* How many flows are using this hdwr rate. */ + long rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 9187a9fc66d8..7d1e4077c79c 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -150,6 +150,17 @@ SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalholes, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_sack_globalholes), 0, "Global number of TCP SACK holes currently allocated"); +int +tcp_dsack_block_exists(struct tcpcb *tp) +{ + /* Return true if a DSACK block exists */ + if (tp->rcv_numsacks == 0) + return (0); + if (SEQ_LEQ(tp->sackblks[0].end, tp->rcv_nxt)) + return(1); + return (0); +} + /* * This function will find overlaps with the currently stored sackblocks * and add any overlap as a dsack block upfront diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index fbd5ac231496..f19872245e55 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -3930,6 +3930,9 @@ bbr_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type, struct bbr_s struct tcp_bbr *bbr; INP_WLOCK_ASSERT(tp->t_inpcb); +#ifdef STATS + stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_CSIG, type); +#endif bbr = (struct tcp_bbr *)tp->t_fb_ptr; switch (type) { case CC_NDUPACK: @@ -4403,6 +4406,7 @@ bbr_clone_rsm(struct tcp_bbr *bbr, struct bbr_sendmap *nrsm, struct bbr_sendmap nrsm->r_start = start; nrsm->r_end = rsm->r_end; nrsm->r_rtr_cnt = rsm->r_rtr_cnt; + nrsm-> r_rtt_not_allowed = rsm->r_rtt_not_allowed; nrsm->r_flags = rsm->r_flags; /* We don't transfer forward the SYN flag */ nrsm->r_flags &= ~BBR_HAS_SYN; @@ -6429,65 +6433,6 @@ tcp_bbr_xmit_timer_commit(struct tcp_bbr *bbr, struct tcpcb *tp, uint32_t cts) bbr->r_ctl.bbr_smallest_srtt_this_state = rtt; } -static void -bbr_earlier_retran(struct tcpcb *tp, struct tcp_bbr *bbr, struct bbr_sendmap *rsm, - uint32_t t, uint32_t cts, int ack_type) -{ - /* - * For this RSM, we acknowledged the data from a previous - * transmission, not the last one we made. This means we did a false - * retransmit. - */ - if (rsm->r_flags & BBR_HAS_FIN) { - /* - * The sending of the FIN often is multiple sent when we - * have everything outstanding ack'd. We ignore this case - * since its over now. - */ - return; - } - if (rsm->r_flags & BBR_TLP) { - /* - * We expect TLP's to have this occur often - */ - bbr->rc_tlp_rtx_out = 0; - return; - } - if (ack_type != BBR_CUM_ACKED) { - /* - * If it was not a cum-ack we - * don't really know for sure since - * the timestamp could be from some - * other transmission. - */ - return; - } - - if (rsm->r_flags & BBR_WAS_SACKPASS) { - /* - * We retransmitted based on a sack and the earlier - * retransmission ack'd it - re-ordering is occuring. - */ - BBR_STAT_INC(bbr_reorder_seen); - bbr->r_ctl.rc_reorder_ts = cts; - } - /* Back down the loss count */ - if (rsm->r_flags & BBR_MARKED_LOST) { - bbr->r_ctl.rc_lost -= rsm->r_end - rsm->r_start; - bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start; - rsm->r_flags &= ~BBR_MARKED_LOST; - if (SEQ_GT(bbr->r_ctl.rc_lt_lost, bbr->r_ctl.rc_lost)) - /* LT sampling also needs adjustment */ - bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; - } - /***** RRS HERE ************************/ - /* Do we need to do this??? */ - /* bbr_reset_lt_bw_sampling(bbr, cts); */ - /***** RRS HERE ************************/ - BBR_STAT_INC(bbr_badfr); - BBR_STAT_ADD(bbr_badfr_bytes, (rsm->r_end - rsm->r_start)); -} - static void bbr_set_reduced_rtt(struct tcp_bbr *bbr, uint32_t cts, uint32_t line) { @@ -6869,6 +6814,10 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, /* Already done */ return (0); } + if (rsm->r_rtt_not_allowed) { + /* Not allowed */ + return (0); + } if (rsm->r_rtr_cnt == 1) { /* * Only one transmit. Hopefully the normal case. @@ -6926,7 +6875,7 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, rsm->r_tim_lastsent[i], ack_type, to); if ((i + 1) < rsm->r_rtr_cnt) { /* Likely */ - bbr_earlier_retran(tp, bbr, rsm, t, cts, ack_type); + return (0); } else if (rsm->r_flags & BBR_TLP) { bbr->rc_tlp_rtx_out = 0; } @@ -6974,7 +6923,7 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, t = 1; bbr_update_bbr_info(bbr, rsm, t, cts, to->to_tsecr, uts, BBR_RTT_BY_EARLIER_RET, rsm->r_tim_lastsent[i], ack_type, to); - bbr_earlier_retran(tp, bbr, rsm, t, cts, ack_type); + return (0); } else { /* * Too many prior transmissions, just @@ -10207,7 +10156,7 @@ bbr_init(struct tcpcb *tp) tp->t_fb_ptr = NULL; return (ENOMEM); } - rsm->r_flags = BBR_OVERMAX; + rsm->r_rtt_not_allowed = 1; rsm->r_tim_lastsent[0] = cts; rsm->r_rtr_cnt = 1; rsm->r_rtr_bytes = 0; @@ -10320,6 +10269,10 @@ bbr_fini(struct tcpcb *tp, int32_t tcb_is_purged) counter_u64_add(bbr_flows_whdwr_pacing, -1); else counter_u64_add(bbr_flows_nohdwr_pacing, -1); + if (bbr->r_ctl.crte != NULL) { + tcp_rel_pacing_rate(bbr->r_ctl.crte, tp); + bbr->r_ctl.crte = NULL; + } rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); while (rsm) { TAILQ_REMOVE(&bbr->r_ctl.rc_map, rsm, r_next); @@ -13463,15 +13416,6 @@ send: th->th_seq = htonl(tp->snd_max); bbr_seq = tp->snd_max; } - } else if (flags & TH_RST) { - /* - * For a Reset send the last cum ack in sequence - * (this like any other choice may still generate a - * challenge ack, if a ack-update packet is in - * flight). - */ - th->th_seq = htonl(tp->snd_una); - bbr_seq = tp->snd_una; } else { /* * len == 0 and not persist we use snd_max, sending @@ -14536,9 +14480,9 @@ bbr_set_sockopt(struct socket *so, struct sockopt *sopt, } else { bbr->bbr_hdw_pace_ena = 0; #ifdef RATELIMIT - if (bbr->bbr_hdrw_pacing) { - bbr->bbr_hdrw_pacing = 0; - in_pcbdetach_txrtlmt(bbr->rc_inp); + if (bbr->r_ctl.crte != NULL) { + tcp_rel_pacing_rate(bbr->r_ctl.crte, tp); + bbr->r_ctl.crte = NULL; } #endif } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index a6b439e38ad7..dd60091bbbc0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -63,7 +63,10 @@ __FBSDID("$FreeBSD$"); #include #include #include - +#ifdef TCP_ACCOUNTING +#include +#include +#endif #include #include @@ -91,8 +94,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #ifdef NETFLIX_SHARED_CWND @@ -133,6 +138,15 @@ uma_zone_t rack_pcb_zone; #define TICKS2SBT(__t) (tick_sbt * ((sbintime_t)(__t))) #endif +VNET_DECLARE(uint32_t, newreno_beta); +VNET_DECLARE(uint32_t, newreno_beta_ecn); +#define V_newreno_beta VNET(newreno_beta) +#define V_newreno_beta_ecn VNET(newreno_beta_ecn) + + +MALLOC_DEFINE(M_TCPFSB, "tcp_fsb", "TCP fast send block"); +MALLOC_DEFINE(M_TCPDO, "tcp_do", "TCP deferred options"); + struct sysctl_ctx_list rack_sysctl_ctx; struct sysctl_oid *rack_sysctl_root; @@ -175,30 +189,51 @@ static int32_t rack_tlp_thresh = 1; static int32_t rack_tlp_limit = 2; /* No more than 2 TLPs w-out new data */ static int32_t rack_tlp_use_greater = 1; static int32_t rack_reorder_thresh = 2; -static int32_t rack_reorder_fade = 60000; /* 0 - never fade, def 60,000 +static int32_t rack_reorder_fade = 60000000; /* 0 - never fade, def 60,000,000 * - 60 seconds */ +static uint8_t rack_req_measurements = 1; /* Attack threshold detections */ static uint32_t rack_highest_sack_thresh_seen = 0; static uint32_t rack_highest_move_thresh_seen = 0; - -static int32_t rack_pkt_delay = 1; -static int32_t rack_early_recovery = 1; +static int32_t rack_enable_hw_pacing = 0; /* Due to CCSP keep it off by default */ +static int32_t rack_hw_pace_extra_slots = 2; /* 2 extra MSS time betweens */ +static int32_t rack_hw_rate_caps = 1; /* 1; */ +static int32_t rack_hw_rate_min = 0; /* 1500000;*/ +static int32_t rack_hw_rate_to_low = 0; /* 1200000; */ +static int32_t rack_hw_up_only = 1; +static int32_t rack_stats_gets_ms_rtt = 1; +static int32_t rack_prr_addbackmax = 2; + +static int32_t rack_pkt_delay = 1000; static int32_t rack_send_a_lot_in_prr = 1; -static int32_t rack_min_to = 1; /* Number of ms minimum timeout */ +static int32_t rack_min_to = 1000; /* Number of microsecond min timeout */ static int32_t rack_verbose_logging = 0; static int32_t rack_ignore_data_after_close = 1; -static int32_t rack_enable_shared_cwnd = 0; +static int32_t rack_enable_shared_cwnd = 1; +static int32_t rack_use_cmp_acks = 1; +static int32_t rack_use_fsb = 1; +static int32_t rack_use_rfo = 1; +static int32_t rack_use_rsm_rfo = 1; +static int32_t rack_max_abc_post_recovery = 2; +static int32_t rack_client_low_buf = 0; +#ifdef TCP_ACCOUNTING +static int32_t rack_tcp_accounting = 0; +#endif static int32_t rack_limits_scwnd = 1; static int32_t rack_enable_mqueue_for_nonpaced = 0; static int32_t rack_disable_prr = 0; static int32_t use_rack_rr = 1; static int32_t rack_non_rxt_use_cr = 0; /* does a non-rxt in recovery use the configured rate (ss/ca)? */ -static int32_t rack_persist_min = 250; /* 250ms */ -static int32_t rack_persist_max = 2000; /* 2 Second */ -static int32_t rack_sack_not_required = 0; /* set to one to allow non-sack to use rack */ -static int32_t rack_default_init_window = 0; /* Use system default */ +static int32_t rack_persist_min = 250000; /* 250usec */ +static int32_t rack_persist_max = 2000000; /* 2 Second in usec's */ +static int32_t rack_sack_not_required = 1; /* set to one to allow non-sack to use rack */ +static int32_t rack_default_init_window = 0; /* Use system default */ static int32_t rack_limit_time_with_srtt = 0; -static int32_t rack_hw_pace_adjust = 0; +static int32_t rack_autosndbuf_inc = 20; /* In percentage form */ +static int32_t rack_enobuf_hw_boost_mult = 2; /* How many times the hw rate we boost slot using time_between */ +static int32_t rack_enobuf_hw_max = 12000; /* 12 ms in usecs */ +static int32_t rack_enobuf_hw_min = 10000; /* 10 ms in usecs */ +static int32_t rack_hw_rwnd_factor = 2; /* How many max_segs the rwnd must be before we hold off sending */ /* * Currently regular tcp has a rto_min of 30ms * the backoff goes 12 times so that ends up @@ -209,23 +244,21 @@ static uint32_t rack_def_data_window = 20; static uint32_t rack_goal_bdp = 2; static uint32_t rack_min_srtts = 1; static uint32_t rack_min_measure_usec = 0; -static int32_t rack_tlp_min = 10; -static int32_t rack_rto_min = 30; /* 30ms same as main freebsd */ -static int32_t rack_rto_max = 4000; /* 4 seconds */ +static int32_t rack_tlp_min = 10000; /* 10ms */ +static int32_t rack_rto_min = 30000; /* 30,000 usec same as main freebsd */ +static int32_t rack_rto_max = 4000000; /* 4 seconds in usec's */ static const int32_t rack_free_cache = 2; static int32_t rack_hptsi_segments = 40; static int32_t rack_rate_sample_method = USE_RTT_LOW; static int32_t rack_pace_every_seg = 0; -static int32_t rack_delayed_ack_time = 200; /* 200ms */ +static int32_t rack_delayed_ack_time = 40000; /* 40ms in usecs */ static int32_t rack_slot_reduction = 4; static int32_t rack_wma_divisor = 8; /* For WMA calculation */ static int32_t rack_cwnd_block_ends_measure = 0; static int32_t rack_rwnd_block_ends_measure = 0; +static int32_t rack_def_profile = 0; static int32_t rack_lower_cwnd_at_tlp = 0; -static int32_t rack_use_proportional_reduce = 0; -static int32_t rack_proportional_rate = 10; -static int32_t rack_tlp_max_resend = 2; static int32_t rack_limited_retran = 0; static int32_t rack_always_send_oldest = 0; static int32_t rack_tlp_threshold_use = TLP_USE_TWO_ONE; @@ -247,13 +280,13 @@ static uint32_t rack_probertt_use_min_rtt_entry = 1; /* Use the min to calculate static uint32_t rack_probertt_use_min_rtt_exit = 0; static uint32_t rack_probe_rtt_sets_cwnd = 0; static uint32_t rack_probe_rtt_safety_val = 2000000; /* No more than 2 sec in probe-rtt */ -static uint32_t rack_time_between_probertt = 9600000; /* 9.6 sec in us */ +static uint32_t rack_time_between_probertt = 9600000; /* 9.6 sec in usecs */ static uint32_t rack_probertt_gpsrtt_cnt_mul = 0; /* How many srtt periods does probe-rtt last top fraction */ -static uint32_t rack_probertt_gpsrtt_cnt_div = 0; /* How many srtt periods does probe-rtt last bottom fraction */ -static uint32_t rack_min_probertt_hold = 200000; /* Equal to delayed ack time */ +static uint32_t rack_probertt_gpsrtt_cnt_div = 0; /* How many srtt periods does probe-rtt last bottom fraction */ +static uint32_t rack_min_probertt_hold = 40000; /* Equal to delayed ack time */ static uint32_t rack_probertt_filter_life = 10000000; static uint32_t rack_probertt_lower_within = 10; -static uint32_t rack_min_rtt_movement = 250; /* Must move at least 250 useconds to count as a lowering */ +static uint32_t rack_min_rtt_movement = 250000; /* Must move at least 250ms (in microseconds) to count as a lowering */ static int32_t rack_pace_one_seg = 0; /* Shall we pace for less than 1.4Meg 1MSS at a time */ static int32_t rack_probertt_clear_is = 1; static int32_t rack_max_drain_hbp = 1; /* Extra drain times gpsrtt for highly buffered paths */ @@ -264,7 +297,7 @@ static int32_t rack_max_per_above = 30; /* When we go to increment stop if abov /* Timely information */ /* Combine these two gives the range of 'no change' to bw */ -/* ie the up/down provide the upper and lower bound */ +/* ie the up/down provide the upper and lower bound */ static int32_t rack_gp_per_bw_mul_up = 2; /* 2% */ static int32_t rack_gp_per_bw_mul_down = 4; /* 4% */ static int32_t rack_gp_rtt_maxmul = 3; /* 3 x maxmin */ @@ -286,6 +319,7 @@ static int32_t rack_timely_int_timely_only = 0; /* do interim timely's only use static int32_t rack_timely_no_stopping = 0; static int32_t rack_down_raise_thresh = 100; static int32_t rack_req_segs = 1; +static uint64_t rack_bw_rate_cap = 0; /* Weird delayed ack mode */ static int32_t rack_use_imac_dack = 0; @@ -301,9 +335,14 @@ counter_u64_t rack_unpaced_segments; counter_u64_t rack_calc_zero; counter_u64_t rack_calc_nonzero; counter_u64_t rack_saw_enobuf; +counter_u64_t rack_saw_enobuf_hw; counter_u64_t rack_saw_enetunreach; counter_u64_t rack_per_timer_hole; - +counter_u64_t rack_large_ackcmp; +counter_u64_t rack_small_ackcmp; +#ifdef INVARIANTS +counter_u64_t rack_adjust_map_bw; +#endif /* Tail loss probe counters */ counter_u64_t rack_tlp_tot; counter_u64_t rack_tlp_newdata; @@ -313,6 +352,7 @@ counter_u64_t rack_tlp_retran_fail; counter_u64_t rack_to_tot; counter_u64_t rack_to_arm_rack; counter_u64_t rack_to_arm_tlp; +counter_u64_t rack_hot_alloc; counter_u64_t rack_to_alloc; counter_u64_t rack_to_alloc_hard; counter_u64_t rack_to_alloc_emerg; @@ -320,6 +360,17 @@ counter_u64_t rack_to_alloc_limited; counter_u64_t rack_alloc_limited_conns; counter_u64_t rack_split_limited; +#define MAX_NUM_OF_CNTS 13 +counter_u64_t rack_proc_comp_ack[MAX_NUM_OF_CNTS]; +counter_u64_t rack_multi_single_eq; +counter_u64_t rack_proc_non_comp_ack; + +counter_u64_t rack_fto_send; +counter_u64_t rack_fto_rsm_send; +counter_u64_t rack_nfto_resend; +counter_u64_t rack_non_fto_send; +counter_u64_t rack_extended_rfo; + counter_u64_t rack_sack_proc_all; counter_u64_t rack_sack_proc_short; counter_u64_t rack_sack_proc_restart; @@ -342,6 +393,10 @@ counter_u64_t rack_input_idle_reduces; counter_u64_t rack_collapsed_win; counter_u64_t rack_tlp_does_nada; counter_u64_t rack_try_scwnd; +counter_u64_t rack_hw_pace_init_fail; +counter_u64_t rack_hw_pace_lost; +counter_u64_t rack_sbsndptr_right; +counter_u64_t rack_sbsndptr_wrong; /* Temp CPU counters */ counter_u64_t rack_find_high; @@ -350,6 +405,17 @@ counter_u64_t rack_progress_drops; counter_u64_t rack_out_size[TCP_MSS_ACCT_SIZE]; counter_u64_t rack_opts_arry[RACK_OPTS_SIZE]; + +#define RACK_REXMTVAL(tp) max(rack_rto_min, ((tp)->t_srtt + ((tp)->t_rttvar << 2))) + +#define RACK_TCPT_RANGESET(tv, value, tvmin, tvmax) do { \ + (tv) = (value) + TICKS_2_USEC(tcp_rexmit_slop); \ + if ((u_long)(tv) < (u_long)(tvmin)) \ + (tv) = (tvmin); \ + if ((u_long)(tv) > (u_long)(tvmax)) \ + (tv) = (tvmax); \ +} while (0) + static void rack_log_progress_event(struct tcp_rack *rack, struct tcpcb *tp, uint32_t tick, int event, int line); @@ -363,7 +429,7 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt); static void rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, - struct tcphdr *th, uint16_t nsegs, uint16_t type, int32_t recovery); + uint32_t th_ack, uint16_t nsegs, uint16_t type, int32_t recovery); static struct rack_sendmap *rack_alloc(struct tcp_rack *rack); static struct rack_sendmap *rack_alloc_limit(struct tcp_rack *rack, uint8_t limit_type); @@ -371,24 +437,21 @@ static struct rack_sendmap * rack_check_recovery_mode(struct tcpcb *tp, uint32_t tsused); static void -rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, - uint32_t type); +rack_cong_signal(struct tcpcb *tp, + uint32_t type, uint32_t ack); static void rack_counter_destroy(void); static int rack_ctloutput(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp); static int32_t rack_ctor(void *mem, int32_t size, void *arg, int32_t how); static void -rack_set_pace_segments(struct tcpcb *tp, struct tcp_rack *rack, uint32_t line); +rack_set_pace_segments(struct tcpcb *tp, struct tcp_rack *rack, uint32_t line, uint64_t *fill_override); static void rack_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int32_t drop_hdrlen, int32_t tlen, uint8_t iptos); static void rack_dtor(void *mem, int32_t size, void *arg); static void -rack_earlier_retran(struct tcpcb *tp, struct rack_sendmap *rsm, - uint32_t t, uint32_t cts); -static void rack_log_alt_to_to_cancel(struct tcp_rack *rack, uint32_t flex1, uint32_t flex2, uint32_t flex3, uint32_t flex4, @@ -416,11 +479,12 @@ static int32_t rack_init(struct tcpcb *tp); static void rack_init_sysctls(void); static void rack_log_ack(struct tcpcb *tp, struct tcpopt *to, - struct tcphdr *th); + struct tcphdr *th, int entered_rec, int dup_ack_struck); static void rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, - uint32_t seq_out, uint8_t th_flags, int32_t err, uint32_t ts, - uint8_t pass, struct rack_sendmap *hintrsm, uint32_t us_cts); + uint32_t seq_out, uint8_t th_flags, int32_t err, uint64_t ts, + struct rack_sendmap *hintrsm, uint16_t add_flags, struct mbuf *s_mb, uint32_t s_moff); + static void rack_log_sack_passed(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendmap *rsm); @@ -431,7 +495,7 @@ static uint32_t rack_proc_sack_blk(struct tcpcb *tp, struct tcp_rack *rack, struct sackblk *sack, struct tcpopt *to, struct rack_sendmap **prsm, uint32_t cts, int *moved_two); -static void rack_post_recovery(struct tcpcb *tp, struct tcphdr *th); +static void rack_post_recovery(struct tcpcb *tp, uint32_t th_seq); static void rack_remxt_tmr(struct tcpcb *tp); static int rack_set_sockopt(struct socket *so, struct sockopt *sopt, @@ -446,10 +510,10 @@ static void rack_timer_cancel(struct tcpcb *tp, struct tcp_rack *rack, uint32_t static void rack_timer_stop(struct tcpcb *tp, uint32_t timer_type); static uint32_t rack_update_entry(struct tcpcb *tp, struct tcp_rack *rack, - struct rack_sendmap *rsm, uint32_t ts, int32_t * lenp); + struct rack_sendmap *rsm, uint64_t ts, int32_t * lenp, uint16_t add_flag); static void rack_update_rsm(struct tcpcb *tp, struct tcp_rack *rack, - struct rack_sendmap *rsm, uint32_t ts); + struct rack_sendmap *rsm, uint64_t ts, uint16_t add_flag); static int rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendmap *rsm, struct tcpopt *to, uint32_t cts, int32_t ack_type, tcp_seq th_ack); @@ -496,15 +560,182 @@ tcp_rack_output(struct tcpcb *tp, struct tcp_rack *rack, static void tcp_rack_xmit_timer(struct tcp_rack *rack, int32_t rtt, uint32_t len, uint32_t us_tim, int confidence, struct rack_sendmap *rsm, uint16_t rtrcnt); static void - tcp_rack_partialack(struct tcpcb *tp, struct tcphdr *th); + tcp_rack_partialack(struct tcpcb *tp); +static int +rack_set_profile(struct tcp_rack *rack, int prof); +static void +rack_apply_deferred_options(struct tcp_rack *rack); int32_t rack_clear_counter=0; +static void +rack_set_cc_pacing(struct tcp_rack *rack) +{ + struct sockopt sopt; + struct cc_newreno_opts opt; + struct newreno old, *ptr; + struct tcpcb *tp; + int error; + + if (rack->rc_pacing_cc_set) + return; + + tp = rack->rc_tp; + if (tp->cc_algo == NULL) { + /* Tcb is leaving */ + printf("No cc algorithm?\n"); + return; + } + rack->rc_pacing_cc_set = 1; + if (strcmp(tp->cc_algo->name, CCALGONAME_NEWRENO) != 0) { + /* Not new-reno we can't play games with beta! */ + printf("cc_algo:%s is not NEWRENO:%s\n", + tp->cc_algo->name, CCALGONAME_NEWRENO); + goto out; + } + ptr = ((struct newreno *)tp->ccv->cc_data); + if (CC_ALGO(tp)->ctl_output == NULL) { + /* Huh, why does new_reno no longer have a set function? */ *** 14150 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Jun 8 23:59:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EF8B640E14; Tue, 8 Jun 2021 23:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06dw43pzz3l7q; Tue, 8 Jun 2021 23:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 742B712354; Tue, 8 Jun 2021 23:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 158Nx0iW044102; Tue, 8 Jun 2021 23:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 158Nx0JI044101; Tue, 8 Jun 2021 23:59:00 GMT (envelope-from git) Date: Tue, 8 Jun 2021 23:59:00 GMT Message-Id: <202106082359.158Nx0JI044101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f5d0badc7007 - stable/13 - Fix a UDP tunneling issue with rack. Basically there are two issues. A) Not enough hdrlen was being calculated when a UDP tunnel is in place. and B) Not enough memory is allocated in racks fsb. We need to overbook the fsb to include a udphdr just in case. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f5d0badc7007b32d1ed42c9a2d7aa0de29ab0ea0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 23:59:00 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f5d0badc7007b32d1ed42c9a2d7aa0de29ab0ea0 commit f5d0badc7007b32d1ed42c9a2d7aa0de29ab0ea0 Author: Randall Stewart AuthorDate: 2021-05-07 18:06:43 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:58:06 +0000 Fix a UDP tunneling issue with rack. Basically there are two issues. A) Not enough hdrlen was being calculated when a UDP tunnel is in place. and B) Not enough memory is allocated in racks fsb. We need to overbook the fsb to include a udphdr just in case. Submitted by: Peter Lei Reviewed by: Michael Tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30157 (cherry picked from commit a16cee0218652230d94a73690201e76baab0bba1) --- sys/netinet/tcp_stacks/rack.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index dd60091bbbc0..110304d29cc0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -11875,6 +11875,7 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); ip6 = (struct ip6_hdr *)rack->r_ctl.fsb.tcp_ip_hdr; if (tp->t_port) { + rack->r_ctl.fsb.tcp_ip_hdr_len += sizeof(struct udphdr); udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; @@ -11894,6 +11895,7 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr); ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; if (tp->t_port) { + rack->r_ctl.fsb.tcp_ip_hdr_len += sizeof(struct udphdr); udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; @@ -11914,10 +11916,14 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) static int rack_init_fsb(struct tcpcb *tp, struct tcp_rack *rack) { - /* Allocate the larger of spaces V6 if available else just V4 */ - rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr); + /* + * Allocate the larger of spaces V6 if available else just + * V4 and include udphdr (overbook) + */ #ifdef INET6 - rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr) + sizeof(struct udphdr); +#else + rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr) + sizeof(struct udphdr); #endif rack->r_ctl.fsb.tcp_ip_hdr = malloc(rack->r_ctl.fsb.tcp_ip_hdr_len, M_TCPFSB, M_NOWAIT|M_ZERO); @@ -15078,6 +15084,8 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma optlen = tcp_addoptions(&to, opt); hdrlen += optlen; udp = rack->r_ctl.fsb.udp; + if (udp) + hdrlen += sizeof(struct udphdr); if (rack->r_ctl.rc_pace_max_segs) max_val = rack->r_ctl.rc_pace_max_segs; else if (rack->rc_user_set_max_segs) @@ -15530,6 +15538,8 @@ rack_fast_output(struct tcpcb *tp, struct tcp_rack *rack, uint64_t ts_val, optlen = tcp_addoptions(&to, opt); hdrlen += optlen; udp = rack->r_ctl.fsb.udp; + if (udp) + hdrlen += sizeof(struct udphdr); if (rack->r_ctl.rc_pace_max_segs) max_val = rack->r_ctl.rc_pace_max_segs; else if (rack->rc_user_set_max_segs) From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:00:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B878C640C9A; Wed, 9 Jun 2021 00:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06gD4Vvtz3l84; Wed, 9 Jun 2021 00:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 827F812355; Wed, 9 Jun 2021 00:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159008pr048101; Wed, 9 Jun 2021 00:00:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159008lG048098; Wed, 9 Jun 2021 00:00:08 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:00:08 GMT Message-Id: <202106090000.159008lG048098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4651125ac6df - stable/13 - This takes Warners suggested approach to making it so that platforms that for whatever reason cannot include the RATELIMIT option can still work with rack. It adds two dummy functions that rack will call and find out that the highest hw supported b/w is 0 (which kinda makes sense and rack is already prepared to handle). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4651125ac6df34e24251463a37e4c1c652c2ff80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:00:08 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4651125ac6df34e24251463a37e4c1c652c2ff80 commit 4651125ac6df34e24251463a37e4c1c652c2ff80 Author: Randall Stewart AuthorDate: 2021-05-07 21:32:32 +0000 Commit: Michael Tuexen CommitDate: 2021-06-08 23:59:21 +0000 This takes Warners suggested approach to making it so that platforms that for whatever reason cannot include the RATELIMIT option can still work with rack. It adds two dummy functions that rack will call and find out that the highest hw supported b/w is 0 (which kinda makes sense and rack is already prepared to handle). Reviewed by: Michael Tuexen, Warner Losh Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30163 (cherry picked from commit 5a4333a5378f7afe4f8cab293a987865ae0c32c4) --- sys/netinet/tcp_ratelimit.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index 8747708e8b5e..b689c9127493 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -147,6 +147,20 @@ tcp_rel_pacing_rate(const struct tcp_hwrate_limit_table *crte, { return; } + +static uint64_t inline +tcp_hw_highest_rate(const struct tcp_hwrate_limit_table *rle) +{ + return (0); +} + +static uint64_t inline +tcp_hw_highest_rate_ifp(struct ifnet *ifp, struct inpcb *inp) +{ + return (0); +} + + #endif /* * Given a b/w and a segsiz, and optional hardware From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:01:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B6F9640CB4; Wed, 9 Jun 2021 00:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06hY35wNz3lWs; Wed, 9 Jun 2021 00:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 510C112361; Wed, 9 Jun 2021 00:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15901Hgh053521; Wed, 9 Jun 2021 00:01:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15901HgD053520; Wed, 9 Jun 2021 00:01:17 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:01:17 GMT Message-Id: <202106090001.15901HgD053520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 87cf5dcc3335 - stable/13 - tcp:Host cache and rack ending up with incorrect values. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 87cf5dcc3335de32661ae75471f29bc387de194e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:01:17 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=87cf5dcc3335de32661ae75471f29bc387de194e commit 87cf5dcc3335de32661ae75471f29bc387de194e Author: Randall Stewart AuthorDate: 2021-05-10 15:25:51 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:00:27 +0000 tcp:Host cache and rack ending up with incorrect values. The hostcache up to now as been updated in the discard callback but without checking if we are all done (the race where there are more than one calls and the counter has not yet reached zero). This means that when the race occurs, we end up calling the hc_upate more than once. Also alternate stacks can keep there srtt/rttvar in different formats (example rack keeps its values in microseconds). Since we call the hc_update *before* the stack fini() then the values will be in the wrong format. Rack on the other hand, needs to convert items pulled from the hostcache into its internal format else it may end up with very much incorrect values from the hostcache. In the process lets commonize the update mechanism for srtt/rttvar since we now have more than one place that needs to call it. Reviewed by: Michael Tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30172 (cherry picked from commit 9867224bab3f247ac875d89c2472aa4bc855fe3b) --- sys/netinet/tcp_stacks/rack.c | 102 ++++++++++++++++++++---------------- sys/netinet/tcp_subr.c | 118 ++++++++++++++++++++++-------------------- 2 files changed, 119 insertions(+), 101 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 110304d29cc0..7bb77d8158af 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6563,13 +6563,65 @@ rack_remxt_tmr(struct tcpcb *tp) rack->r_ctl.rc_snd_max_at_rto = tp->snd_max; } +static void +rack_convert_rtts(struct tcpcb *tp) +{ + if (tp->t_srtt > 1) { + uint32_t val, frac; + + val = tp->t_srtt >> TCP_RTT_SHIFT; + frac = tp->t_srtt & 0x1f; + tp->t_srtt = TICKS_2_USEC(val); + /* + * frac is the fractional part of the srtt (if any) + * but its in ticks and every bit represents + * 1/32nd of a hz. + */ + if (frac) { + if (hz == 1000) { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); + } else { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); + } + tp->t_srtt += frac; + } + } + if (tp->t_rttvar) { + uint32_t val, frac; + + val = tp->t_rttvar >> TCP_RTTVAR_SHIFT; + frac = tp->t_rttvar & 0x1f; + tp->t_rttvar = TICKS_2_USEC(val); + /* + * frac is the fractional part of the srtt (if any) + * but its in ticks and every bit represents + * 1/32nd of a hz. + */ + if (frac) { + if (hz == 1000) { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); + } else { + frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); + } + tp->t_rttvar += frac; + } + } + RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), + rack_rto_min, rack_rto_max); +} + static void rack_cc_conn_init(struct tcpcb *tp) { struct tcp_rack *rack; rack = (struct tcp_rack *)tp->t_fb_ptr; + cc_conn_init(tp); + /* + * Now convert to rack's internal format. + */ + rack_convert_rtts(tp); /* * We want a chance to stay in slowstart as * we create a connection. TCP spec says that @@ -11916,9 +11968,9 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) static int rack_init_fsb(struct tcpcb *tp, struct tcp_rack *rack) { - /* - * Allocate the larger of spaces V6 if available else just - * V4 and include udphdr (overbook) + /* + * Allocate the larger of spaces V6 if available else just + * V4 and include udphdr (overbook) */ #ifdef INET6 rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr) + sizeof(struct udphdr); @@ -12147,47 +12199,7 @@ rack_init(struct tcpcb *tp) * bit decimal so we have to carefully convert * these to get the full precision. */ - if (tp->t_srtt > 1) { - uint32_t val, frac; - - val = tp->t_srtt >> TCP_RTT_SHIFT; - frac = tp->t_srtt & 0x1f; - tp->t_srtt = TICKS_2_USEC(val); - /* - * frac is the fractional part of the srtt (if any) - * but its in ticks and every bit represents - * 1/32nd of a hz. - */ - if (frac) { - if (hz == 1000) { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); - } else { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); - } - tp->t_srtt += frac; - } - } - if (tp->t_rttvar) { - uint32_t val, frac; - - val = tp->t_rttvar >> TCP_RTTVAR_SHIFT; - frac = tp->t_rttvar & 0x1f; - tp->t_rttvar = TICKS_2_USEC(val); - /* - * frac is the fractional part of the srtt (if any) - * but its in ticks and every bit represents - * 1/32nd of a hz. - */ - if (frac) { - if (hz == 1000) { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_MSEC) / (uint64_t)TCP_RTT_SCALE); - } else { - frac = (((uint64_t)frac * (uint64_t)HPTS_USEC_IN_SEC) / ((uint64_t)(hz) * (uint64_t)TCP_RTT_SCALE)); - } - tp->t_rttvar += frac; - } - } - tp->t_rxtcur = TICKS_2_USEC(tp->t_rxtcur); + rack_convert_rtts(tp); tp->t_rttlow = TICKS_2_USEC(tp->t_rttlow); if (rack_def_profile) rack_set_profile(rack, rack_def_profile); @@ -12230,7 +12242,7 @@ rack_init(struct tcpcb *tp) rack_stop_all_timers(tp); /* Lets setup the fsb block */ rack_start_hpts_timer(rack, tp, tcp_get_usecs(NULL), 0, 0, 0); - rack_log_rtt_shrinks(rack, us_cts, 0, + rack_log_rtt_shrinks(rack, us_cts, tp->t_rxtcur, __LINE__, RACK_RTTS_INIT); return (0); } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 93445c636d41..b9da908d2a15 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2305,62 +2305,6 @@ tcp_discardcb(struct tcpcb *tp) tp->t_fb->tfb_tcp_timer_stop_all(tp); } - /* - * If we got enough samples through the srtt filter, - * save the rtt and rttvar in the routing entry. - * 'Enough' is arbitrarily defined as 4 rtt samples. - * 4 samples is enough for the srtt filter to converge - * to within enough % of the correct value; fewer samples - * and we could save a bogus rtt. The danger is not high - * as tcp quickly recovers from everything. - * XXX: Works very well but needs some more statistics! - */ - if (tp->t_rttupdated >= 4) { - struct hc_metrics_lite metrics; - uint32_t ssthresh; - - bzero(&metrics, sizeof(metrics)); - /* - * Update the ssthresh always when the conditions below - * are satisfied. This gives us better new start value - * for the congestion avoidance for new connections. - * ssthresh is only set if packet loss occurred on a session. - * - * XXXRW: 'so' may be NULL here, and/or socket buffer may be - * being torn down. Ideally this code would not use 'so'. - */ - ssthresh = tp->snd_ssthresh; - if (ssthresh != 0 && ssthresh < so->so_snd.sb_hiwat / 2) { - /* - * convert the limit from user data bytes to - * packets then to packet data bytes. - */ - ssthresh = (ssthresh + tp->t_maxseg / 2) / tp->t_maxseg; - if (ssthresh < 2) - ssthresh = 2; - ssthresh *= (tp->t_maxseg + -#ifdef INET6 - (isipv6 ? sizeof (struct ip6_hdr) + - sizeof (struct tcphdr) : -#endif - sizeof (struct tcpiphdr) -#ifdef INET6 - ) -#endif - ); - } else - ssthresh = 0; - metrics.rmx_ssthresh = ssthresh; - - metrics.rmx_rtt = tp->t_srtt; - metrics.rmx_rttvar = tp->t_rttvar; - metrics.rmx_cwnd = tp->snd_cwnd; - metrics.rmx_sendpipe = 0; - metrics.rmx_recvpipe = 0; - - tcp_hc_update(&inp->inp_inc, &metrics); - } - /* free the reassembly queue, if any */ tcp_reass_flush(tp); @@ -2400,6 +2344,68 @@ tcp_discardcb(struct tcpcb *tp) TCPSTATES_DEC(tp->t_state); if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); + + /* + * If we got enough samples through the srtt filter, + * save the rtt and rttvar in the routing entry. + * 'Enough' is arbitrarily defined as 4 rtt samples. + * 4 samples is enough for the srtt filter to converge + * to within enough % of the correct value; fewer samples + * and we could save a bogus rtt. The danger is not high + * as tcp quickly recovers from everything. + * XXX: Works very well but needs some more statistics! + * + * XXXRRS: Updating must be after the stack fini() since + * that may be converting some internal representation of + * say srtt etc into the general one used by other stacks. + * Lets also at least protect against the so being NULL + * as RW stated below. + */ + if ((tp->t_rttupdated >= 4) && (so != NULL)) { + struct hc_metrics_lite metrics; + uint32_t ssthresh; + + bzero(&metrics, sizeof(metrics)); + /* + * Update the ssthresh always when the conditions below + * are satisfied. This gives us better new start value + * for the congestion avoidance for new connections. + * ssthresh is only set if packet loss occurred on a session. + * + * XXXRW: 'so' may be NULL here, and/or socket buffer may be + * being torn down. Ideally this code would not use 'so'. + */ + ssthresh = tp->snd_ssthresh; + if (ssthresh != 0 && ssthresh < so->so_snd.sb_hiwat / 2) { + /* + * convert the limit from user data bytes to + * packets then to packet data bytes. + */ + ssthresh = (ssthresh + tp->t_maxseg / 2) / tp->t_maxseg; + if (ssthresh < 2) + ssthresh = 2; + ssthresh *= (tp->t_maxseg + +#ifdef INET6 + (isipv6 ? sizeof (struct ip6_hdr) + + sizeof (struct tcphdr) : +#endif + sizeof (struct tcpiphdr) +#ifdef INET6 + ) +#endif + ); + } else + ssthresh = 0; + metrics.rmx_ssthresh = ssthresh; + + metrics.rmx_rtt = tp->t_srtt; + metrics.rmx_rttvar = tp->t_rttvar; + metrics.rmx_cwnd = tp->snd_cwnd; + metrics.rmx_sendpipe = 0; + metrics.rmx_recvpipe = 0; + + tcp_hc_update(&inp->inp_inc, &metrics); + } refcount_release(&tp->t_fb->tfb_refcnt); tp->t_inpcb = NULL; uma_zfree(V_tcpcb_zone, tp); From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:02:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD703641056; Wed, 9 Jun 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06jk5vYcz3ljp; Wed, 9 Jun 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1B5C128A5; Wed, 9 Jun 2021 00:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15902IQQ056775; Wed, 9 Jun 2021 00:02:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15902Ii4056774; Wed, 9 Jun 2021 00:02:18 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:02:18 GMT Message-Id: <202106090002.15902Ii4056774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: ecfc25f05bf4 - stable/13 - tcp: In rack, we must only convert restored rtt when the hostcache does restore them. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ecfc25f05bf4bea6ce35a34b746d50fe57d84130 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:02:18 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ecfc25f05bf4bea6ce35a34b746d50fe57d84130 commit ecfc25f05bf4bea6ce35a34b746d50fe57d84130 Author: Randall Stewart AuthorDate: 2021-05-11 12:15:05 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:01:32 +0000 tcp: In rack, we must only convert restored rtt when the hostcache does restore them. Rack now after the previous commit is very careful to translate any value in the hostcache for srtt/rttvar into its proper format. However there is a snafu here in that if tp->srtt is 0 is the only time that the HC will actually restore the srtt. We need to then only convert the srtt restored when it is actually restored. We do this by making sure it was zero before the call to cc_conn_init and it is non-zero afterwards. Reviewed by: Michael Tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30213 (cherry picked from commit 4b86a24a76a4d58c1d870fcb2252b321f61cb3cc) --- sys/netinet/tcp_stacks/rack.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 7bb77d8158af..e9d3c6b95d91 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6614,14 +6614,17 @@ static void rack_cc_conn_init(struct tcpcb *tp) { struct tcp_rack *rack; + uint32_t srtt; rack = (struct tcp_rack *)tp->t_fb_ptr; - + srtt = tp->t_srtt; cc_conn_init(tp); /* - * Now convert to rack's internal format. + * Now convert to rack's internal format, + * if required. */ - rack_convert_rtts(tp); + if ((srtt == 0) && (tp->t_srtt != 0)) + rack_convert_rtts(tp); /* * We want a chance to stay in slowstart as * we create a connection. TCP spec says that From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:03:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 806EA640F49; Wed, 9 Jun 2021 00:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06l03Dm4z3m2y; Wed, 9 Jun 2021 00:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57C60126B2; Wed, 9 Jun 2021 00:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15903O8v057815; Wed, 9 Jun 2021 00:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15903ODa057814; Wed, 9 Jun 2021 00:03:24 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:03:24 GMT Message-Id: <202106090003.15903ODa057814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6170c93c03fa - stable/13 - tcp rack: improve initialisation of retransmit timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6170c93c03fa394eae81ce20f969b6a53bc68415 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:03:24 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6170c93c03fa394eae81ce20f969b6a53bc68415 commit 6170c93c03fa394eae81ce20f969b6a53bc68415 Author: Michael Tuexen AuthorDate: 2021-05-12 15:58:56 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:02:39 +0000 tcp rack: improve initialisation of retransmit timeout When the TCP is in the front states, don't take the slop variable into account. This improves consistency with the base stack. Reviewed by: rrs@ Differential Revision: https://reviews.freebsd.org/D30230 Sponsored by: Netflix, Inc. (cherry picked from commit 251842c63927fc4af63bdc61989bbfbf3823c679) --- sys/netinet/tcp_stacks/rack.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index e9d3c6b95d91..48b278806410 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6606,8 +6606,13 @@ rack_convert_rtts(struct tcpcb *tp) tp->t_rttvar += frac; } } - RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + tp->t_rxtcur = RACK_REXMTVAL(tp); + if (TCPS_HAVEESTABLISHED(tp->t_state)) { + tp->t_rxtcur += TICKS_2_USEC(tcp_rexmit_slop); + } + if (tp->t_rxtcur > rack_rto_max) { + tp->t_rxtcur = rack_rto_max; + } } static void From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:04:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0D6A640CE6; Wed, 9 Jun 2021 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06mC61HZz3lmm; Wed, 9 Jun 2021 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6B05127D6; Wed, 9 Jun 2021 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15904RTE057995; Wed, 9 Jun 2021 00:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15904RS5057994; Wed, 9 Jun 2021 00:04:27 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:04:27 GMT Message-Id: <202106090004.15904RS5057994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 821543e7834b - stable/13 - mod_cc: cross reference CC modules consistently MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 821543e7834b0c050bfc33d9f7c70f3cc288b736 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:04:27 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=821543e7834b0c050bfc33d9f7c70f3cc288b736 commit 821543e7834b0c050bfc33d9f7c70f3cc288b736 Author: Michael Tuexen AuthorDate: 2021-05-13 08:47:45 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:04:12 +0000 mod_cc: cross reference CC modules consistently Reviewed by: bcr, gbe Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30240 (cherry picked from commit 8ea5eeb913b94aa45aa7773d14b31222d509ec34) --- share/man/man4/cc_cdg.4 | 3 ++- share/man/man4/cc_chd.4 | 4 +++- share/man/man4/cc_cubic.4 | 4 +++- share/man/man4/cc_dctcp.4 | 3 ++- share/man/man4/cc_hd.4 | 4 +++- share/man/man4/cc_htcp.4 | 4 +++- share/man/man4/cc_newreno.4 | 4 +++- share/man/man4/cc_vegas.4 | 4 +++- share/man/man9/mod_cc.9 | 3 ++- 9 files changed, 24 insertions(+), 9 deletions(-) diff --git a/share/man/man4/cc_cdg.4 b/share/man/man4/cc_cdg.4 index 38f8ed397def..1b14e094ff84 100644 --- a/share/man/man4/cc_cdg.4 +++ b/share/man/man4/cc_cdg.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 2, 2013 +.Dd May 13, 2021 .Dt CC_CDG 4 .Os .Sh NAME @@ -99,6 +99,7 @@ Default is 0. .Sh SEE ALSO .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man4/cc_chd.4 b/share/man/man4/cc_chd.4 index 963d89247fde..32b0444f89d7 100644 --- a/share/man/man4/cc_chd.4 +++ b/share/man/man4/cc_chd.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_CHD 4 .Os .Sh NAME @@ -86,7 +86,9 @@ is used. Default is 1. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man4/cc_cubic.4 b/share/man/man4/cc_cubic.4 index 75df183fa16f..92ac8971e867 100644 --- a/share/man/man4/cc_cubic.4 +++ b/share/man/man4/cc_cubic.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_CUBIC 4 .Os .Sh NAME @@ -62,7 +62,9 @@ section below. .Sh MIB Variables There are currently no tunable MIB variables. .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man4/cc_dctcp.4 b/share/man/man4/cc_dctcp.4 index 5c5be4fed96e..8c23f2eaa134 100644 --- a/share/man/man4/cc_dctcp.4 +++ b/share/man/man4/cc_dctcp.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2019 +.Dd May 13, 2021 .Dt CC_DCTCP 4 .Os .Sh NAME @@ -93,6 +93,7 @@ A flag if the congestion window should be reduced by one half after slow start. Valid settings 0 and 1, default 0. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , .Xr cc_hd 4 , diff --git a/share/man/man4/cc_hd.4 b/share/man/man4/cc_hd.4 index 497e61616a0a..d56d9b77b4d9 100644 --- a/share/man/man4/cc_hd.4 +++ b/share/man/man4/cc_hd.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_HD 4 .Os .Sh NAME @@ -69,8 +69,10 @@ Minimum queuing delay threshold (qmin) in ticks. Default is 5. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , diff --git a/share/man/man4/cc_htcp.4 b/share/man/man4/cc_htcp.4 index 0e141bb79a7d..46d94a12114a 100644 --- a/share/man/man4/cc_htcp.4 +++ b/share/man/man4/cc_htcp.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_HTCP 4 .Os .Sh NAME @@ -69,8 +69,10 @@ window increase during congestion avoidance mode invariant with respect to RTT. Default is 0 (disabled). .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , diff --git a/share/man/man4/cc_newreno.4 b/share/man/man4/cc_newreno.4 index 8169c04c3eaa..0ac59beeec48 100644 --- a/share/man/man4/cc_newreno.4 +++ b/share/man/man4/cc_newreno.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 6, 2019 +.Dd May 13, 2021 .Dt CC_NEWRENO 4 .Os .Sh NAME @@ -96,8 +96,10 @@ per: cwnd = (cwnd * beta_ecn) / 100. Default is 80. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_vegas 4 , diff --git a/share/man/man4/cc_vegas.4 b/share/man/man4/cc_vegas.4 index 45b4b6244017..ad043b218a4d 100644 --- a/share/man/man4/cc_vegas.4 +++ b/share/man/man4/cc_vegas.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_VEGAS 4 .Os .Sh NAME @@ -92,8 +92,10 @@ When setting beta, the value must satisfy: 0 < alpha < beta. Default is 3. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , diff --git a/share/man/man9/mod_cc.9 b/share/man/man9/mod_cc.9 index 7e9ab2488437..8be6fb2381bd 100644 --- a/share/man/man9/mod_cc.9 +++ b/share/man/man9/mod_cc.9 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2016 +.Dd May 13, 2021 .Dt MOD_CC 9 .Os .Sh NAME @@ -309,6 +309,7 @@ a large difference between the congestion window and send window. .Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:05:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D74B464132F; Wed, 9 Jun 2021 00:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06nz5ktfz3lxc; Wed, 9 Jun 2021 00:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC83D128AA; Wed, 9 Jun 2021 00:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15905xMD058211; Wed, 9 Jun 2021 00:05:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15905xj2058210; Wed, 9 Jun 2021 00:05:59 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:05:59 GMT Message-Id: <202106090005.15905xj2058210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3a3bba7df566 - stable/13 - tcp: Incorrect KASSERT causes a panic in rack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a3bba7df566e421c385444912ce603ee845c171 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:05:59 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3a3bba7df566e421c385444912ce603ee845c171 commit 3a3bba7df566e421c385444912ce603ee845c171 Author: Randall Stewart AuthorDate: 2021-05-13 11:36:04 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:05:15 +0000 tcp: Incorrect KASSERT causes a panic in rack Skyzall found an interesting panic in rack. When a SYN and FIN are both sent together a KASSERT gets tripped where it is validating that a mbuf pointer is in the sendmap. But a SYN and FIN often will not have a mbuf pointer. So the fix is two fold a) make sure that the SYN and FIN split the right way when cloning an RSM SYN on left edge and FIN on right. And also make sure the KASSERT properly accounts for the case that we have a SYN or FIN so we don't panic. Reviewed by: mtuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D30241 (cherry picked from commit 02cffbc2507e83944b0c29d69d6ddf26c9386d54) --- sys/netinet/tcp_stacks/rack.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 48b278806410..6b0eadd89004 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6054,6 +6054,12 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, for (idx = 0; idx < nrsm->r_rtr_cnt; idx++) { nrsm->r_tim_lastsent[idx] = rsm->r_tim_lastsent[idx]; } + /* Now if we have SYN flag we keep it on the left edge */ + if (nrsm->r_flags & RACK_HAS_SYN) + nrsm->r_flags &= ~RACK_HAS_SYN; + /* Now if we have a FIN flag we keep it on the right edge */ + if (nrsm->r_flags & RACK_HAS_FIN) + nrsm->r_flags &= ~RACK_HAS_FIN; /* * Now we need to find nrsm's new location in the mbuf chain * we basically calculate a new offset, which is soff + @@ -6061,9 +6067,11 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, * chain to find the righ postion, it may be the same mbuf * or maybe not. */ - KASSERT((rsm->m != NULL), + KASSERT(((rsm->m != NULL) || + (rsm->r_flags & (RACK_HAS_SYN|RACK_HAS_FIN))), ("rsm:%p nrsm:%p rack:%p -- rsm->m is NULL?", rsm, nrsm, rack)); - rack_setup_offset_for_rsm(rsm, nrsm); + if (rsm->m) + rack_setup_offset_for_rsm(rsm, nrsm); } static struct rack_sendmap * From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:06:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5408640CFA; Wed, 9 Jun 2021 00:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06pD6BYGz3lxq; Wed, 9 Jun 2021 00:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD0EE127D7; Wed, 9 Jun 2021 00:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15906Coo058338; Wed, 9 Jun 2021 00:06:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15906C99058337; Wed, 9 Jun 2021 00:06:12 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:06:12 GMT Message-Id: <202106090006.15906C99058337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: dbbf7cb21ce3 - main - libspl: fix NO_CLEAN build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbbf7cb21ce3e40c9f96a24601fdc536b6e32aca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:06:13 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dbbf7cb21ce3e40c9f96a24601fdc536b6e32aca commit dbbf7cb21ce3e40c9f96a24601fdc536b6e32aca Author: Warner Losh AuthorDate: 2021-06-08 23:56:15 +0000 Commit: Warner Losh CommitDate: 2021-06-08 23:56:15 +0000 libspl: fix NO_CLEAN build atomic.S moved to atomic.c, update the cleaup script to remove stale dependencies for this. Sponsored by: Netflix --- tools/build/depend-cleanup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 23bedee1ea26..ae393c2451f0 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -70,3 +70,6 @@ if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then echo "Removing stale ncurses objects" rm -rf "$OBJTOP"/lib/ncurses "$OBJTOP"/obj-lib32/lib/ncurses fi + +# 20210608 f20893853e8e move from atomic.S to atomic.c +clean_dep cddl/lib/libspl atomic S From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:08:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46F9A6414B9; Wed, 9 Jun 2021 00:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06sD1Y0Jz3mBp; Wed, 9 Jun 2021 00:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E1C312376; Wed, 9 Jun 2021 00:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15908mPL058616; Wed, 9 Jun 2021 00:08:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15908lod058615; Wed, 9 Jun 2021 00:08:47 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:08:47 GMT Message-Id: <202106090008.15908lod058615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 56aeedd2fda4 - stable/13 - tcp: Fix sending of TCP segments with IP level options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 56aeedd2fda4e1a714812a1fbdc9e8a784283d94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:08:48 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=56aeedd2fda4e1a714812a1fbdc9e8a784283d94 commit 56aeedd2fda4e1a714812a1fbdc9e8a784283d94 Author: Michael Tuexen AuthorDate: 2021-05-21 07:45:00 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:06:26 +0000 tcp: Fix sending of TCP segments with IP level options When bringing in TCP over UDP support in https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605, the length of IP level options was considered when locating the transport header. This was incorrect and is fixed by this patch. X-MFC with: https://cgit.FreeBSD.org/src/commit/?id=9e644c23000c2f5028b235f6263d17ffb24d3605 Reviewed by: markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30358 (cherry picked from commit 500eb6dd80404ea512e31a8f795c73cb802c9c64) --- sys/netinet/tcp_output.c | 4 ++-- sys/netinet/tcp_stacks/bbr.c | 4 ++-- sys/netinet/tcp_stacks/rack.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 5bda2be14df0..2a91570acdad 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1154,7 +1154,7 @@ send: if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip6_hdr); @@ -1172,7 +1172,7 @@ send: ipov = (struct ipovly *)ip; #endif if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip); diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index f19872245e55..abc0536d47c7 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -13354,7 +13354,7 @@ send: if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip6_hdr); @@ -13372,7 +13372,7 @@ send: ipov = (struct ipovly *)ip; #endif if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip); diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 6b0eadd89004..d7a01bab6bd0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -17658,7 +17658,7 @@ send: if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip6 + ipoptlen + sizeof(struct ip6_hdr)); + udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip6_hdr); @@ -17675,7 +17675,7 @@ send: ipov = (struct ipovly *)ip; #endif if (tp->t_port) { - udp = (struct udphdr *)((caddr_t)ip + ipoptlen + sizeof(struct ip)); + udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(V_tcp_udp_tunneling_port); udp->uh_dport = tp->t_port; ulen = hdrlen + len - sizeof(struct ip); From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:10:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B5CA641467; Wed, 9 Jun 2021 00:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06v81gKQz3m6x; Wed, 9 Jun 2021 00:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2185D125DA; Wed, 9 Jun 2021 00:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590ASO4067016; Wed, 9 Jun 2021 00:10:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590AS1M067015; Wed, 9 Jun 2021 00:10:28 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:10:28 GMT Message-Id: <202106090010.1590AS1M067015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6264ff9bd9f0 - stable/13 - tcp: Handle stack switch while processing socket options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6264ff9bd9f0f01f052b9b100af12e53613a825c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:10:28 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6264ff9bd9f0f01f052b9b100af12e53613a825c commit 6264ff9bd9f0f01f052b9b100af12e53613a825c Author: Michael Tuexen AuthorDate: 2021-05-22 12:35:09 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:09:37 +0000 tcp: Handle stack switch while processing socket options Handle the case where during socket option processing, the user switches a stack such that processing the stack specific socket option does not make sense anymore. Return an error in this case. Reviewed by: markj Reported by: syzbot+a6e1d91f240ad5d72cd1@syzkaller.appspotmail.com Sponsored by: Netflix, Inc. Differential revision: https://reviews.freebsd.org/D30395 (cherry picked from commit 8923ce630492d21ec57c2637757bcc44da9970f8) --- sys/netinet/tcp_stacks/bbr.c | 62 ++++++++++++++++++++++++------------------- sys/netinet/tcp_stacks/rack.c | 60 ++++++++++++++++++++++------------------- 2 files changed, 67 insertions(+), 55 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index abc0536d47c7..2a98f5cb43ef 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -518,6 +518,10 @@ static void bbr_log_pacing_delay_calc(struct tcp_bbr *bbr, uint16_t gain, uint32_t len, uint32_t cts, uint32_t usecs, uint64_t bw, uint32_t override, int mod); +static int +bbr_ctloutput(struct socket *so, struct sockopt *sopt, struct inpcb *inp, + struct tcpcb *tp); + static inline uint8_t bbr_state_val(struct tcp_bbr *bbr) { @@ -14197,6 +14201,33 @@ bbr_mtu_chg(struct tcpcb *tp) } } +static int +bbr_pru_options(struct tcpcb *tp, int flags) +{ + if (flags & PRUS_OOB) + return (EOPNOTSUPP); + return (0); +} + +struct tcp_function_block __tcp_bbr = { + .tfb_tcp_block_name = __XSTRING(STACKNAME), + .tfb_tcp_output = bbr_output, + .tfb_do_queued_segments = ctf_do_queued_segments, + .tfb_do_segment_nounlock = bbr_do_segment_nounlock, + .tfb_tcp_do_segment = bbr_do_segment, + .tfb_tcp_ctloutput = bbr_ctloutput, + .tfb_tcp_fb_init = bbr_init, + .tfb_tcp_fb_fini = bbr_fini, + .tfb_tcp_timer_stop_all = bbr_stopall, + .tfb_tcp_timer_activate = bbr_timer_activate, + .tfb_tcp_timer_active = bbr_timer_active, + .tfb_tcp_timer_stop = bbr_timer_stop, + .tfb_tcp_rexmit_tmr = bbr_remxt_tmr, + .tfb_tcp_handoff_ok = bbr_handoff_ok, + .tfb_tcp_mtu_chg = bbr_mtu_chg, + .tfb_pru_options = bbr_pru_options, +}; + /* * bbr_ctloutput() must drop the inpcb lock before performing copyin on * socket option arguments. When it re-acquires the lock after the copy, it @@ -14269,6 +14300,10 @@ bbr_set_sockopt(struct socket *so, struct sockopt *sopt, return (ECONNRESET); } tp = intotcpcb(inp); + if (tp->t_fb != &__tcp_bbr) { + INP_WUNLOCK(inp); + return (ENOPROTOOPT); + } bbr = (struct tcp_bbr *)tp->t_fb_ptr; switch (sopt->sopt_name) { case TCP_BBR_PACE_PER_SEC: @@ -14772,33 +14807,6 @@ out: return (error); } -static int -bbr_pru_options(struct tcpcb *tp, int flags) -{ - if (flags & PRUS_OOB) - return (EOPNOTSUPP); - return (0); -} - -struct tcp_function_block __tcp_bbr = { - .tfb_tcp_block_name = __XSTRING(STACKNAME), - .tfb_tcp_output = bbr_output, - .tfb_do_queued_segments = ctf_do_queued_segments, - .tfb_do_segment_nounlock = bbr_do_segment_nounlock, - .tfb_tcp_do_segment = bbr_do_segment, - .tfb_tcp_ctloutput = bbr_ctloutput, - .tfb_tcp_fb_init = bbr_init, - .tfb_tcp_fb_fini = bbr_fini, - .tfb_tcp_timer_stop_all = bbr_stopall, - .tfb_tcp_timer_activate = bbr_timer_activate, - .tfb_tcp_timer_active = bbr_timer_active, - .tfb_tcp_timer_stop = bbr_timer_stop, - .tfb_tcp_rexmit_tmr = bbr_remxt_tmr, - .tfb_tcp_handoff_ok = bbr_handoff_ok, - .tfb_tcp_mtu_chg = bbr_mtu_chg, - .tfb_pru_options = bbr_pru_options, -}; - static const char *bbr_stack_names[] = { __XSTRING(STACKNAME), #ifdef STACKALIAS diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index d7a01bab6bd0..c870b286a847 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -19409,6 +19409,34 @@ rack_apply_deferred_options(struct tcp_rack *rack) } } +static int +rack_pru_options(struct tcpcb *tp, int flags) +{ + if (flags & PRUS_OOB) + return (EOPNOTSUPP); + return (0); +} + +static struct tcp_function_block __tcp_rack = { + .tfb_tcp_block_name = __XSTRING(STACKNAME), + .tfb_tcp_output = rack_output, + .tfb_do_queued_segments = ctf_do_queued_segments, + .tfb_do_segment_nounlock = rack_do_segment_nounlock, + .tfb_tcp_do_segment = rack_do_segment, + .tfb_tcp_ctloutput = rack_ctloutput, + .tfb_tcp_fb_init = rack_init, + .tfb_tcp_fb_fini = rack_fini, + .tfb_tcp_timer_stop_all = rack_stopall, + .tfb_tcp_timer_activate = rack_timer_activate, + .tfb_tcp_timer_active = rack_timer_active, + .tfb_tcp_timer_stop = rack_timer_stop, + .tfb_tcp_rexmit_tmr = rack_remxt_tmr, + .tfb_tcp_handoff_ok = rack_handoff_ok, + .tfb_tcp_mtu_chg = rack_mtu_change, + .tfb_pru_options = rack_pru_options, + +}; + /* * rack_ctloutput() must drop the inpcb lock before performing copyin on * socket option arguments. When it re-acquires the lock after the copy, it @@ -19498,6 +19526,10 @@ rack_set_sockopt(struct socket *so, struct sockopt *sopt, INP_WUNLOCK(inp); return (ECONNRESET); } + if (tp->t_fb != &__tcp_rack) { + INP_WUNLOCK(inp); + return (ENOPROTOOPT); + } if (rack->defer_options && (rack->gp_ready == 0) && (sopt->sopt_name != TCP_DEFER_OPTIONS) && (sopt->sopt_name != TCP_RACK_PACING_BETA) && @@ -19834,34 +19866,6 @@ out: return (error); } -static int -rack_pru_options(struct tcpcb *tp, int flags) -{ - if (flags & PRUS_OOB) - return (EOPNOTSUPP); - return (0); -} - -static struct tcp_function_block __tcp_rack = { - .tfb_tcp_block_name = __XSTRING(STACKNAME), - .tfb_tcp_output = rack_output, - .tfb_do_queued_segments = ctf_do_queued_segments, - .tfb_do_segment_nounlock = rack_do_segment_nounlock, - .tfb_tcp_do_segment = rack_do_segment, - .tfb_tcp_ctloutput = rack_ctloutput, - .tfb_tcp_fb_init = rack_init, - .tfb_tcp_fb_fini = rack_fini, - .tfb_tcp_timer_stop_all = rack_stopall, - .tfb_tcp_timer_activate = rack_timer_activate, - .tfb_tcp_timer_active = rack_timer_active, - .tfb_tcp_timer_stop = rack_timer_stop, - .tfb_tcp_rexmit_tmr = rack_remxt_tmr, - .tfb_tcp_handoff_ok = rack_handoff_ok, - .tfb_tcp_mtu_chg = rack_mtu_change, - .tfb_pru_options = rack_pru_options, - -}; - static const char *rack_stack_names[] = { __XSTRING(STACKNAME), #ifdef STACKALIAS From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:13:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A15B7641699; Wed, 9 Jun 2021 00:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06yH46x0z3mZf; Wed, 9 Jun 2021 00:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7566112BCA; Wed, 9 Jun 2021 00:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590DB2n071255; Wed, 9 Jun 2021 00:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590DBhr071254; Wed, 9 Jun 2021 00:13:11 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:13:11 GMT Message-Id: <202106090013.1590DBhr071254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e99fa57b981e - stable/13 - tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e99fa57b981eaeac287a1d0d8c0b351740f7a30b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:13:11 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e99fa57b981eaeac287a1d0d8c0b351740f7a30b commit e99fa57b981eaeac287a1d0d8c0b351740f7a30b Author: Randall Stewart AuthorDate: 2021-05-24 18:42:15 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:12:21 +0000 tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's The push bit itself was also not actually being properly moved to the right edge. The FIN bit was incorrectly on the left edge. We fix these two issues as well as plumb in the mtu_change for alternate stacks. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30413 (cherry picked from commit 631449d5d03506295eaa6947c1b0e8a168a2f6b7) --- sys/netinet/tcp_stacks/rack.c | 8 ++++++-- sys/netinet/tcp_subr.c | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index c870b286a847..0bdcc20d2b7c 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6058,8 +6058,12 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, if (nrsm->r_flags & RACK_HAS_SYN) nrsm->r_flags &= ~RACK_HAS_SYN; /* Now if we have a FIN flag we keep it on the right edge */ - if (nrsm->r_flags & RACK_HAS_FIN) - nrsm->r_flags &= ~RACK_HAS_FIN; + if (rsm->r_flags & RACK_HAS_FIN) + rsm->r_flags &= ~RACK_HAS_FIN; + /* Push bit must go to the right edge as well */ + if (rsm->r_flags & RACK_HAD_PUSH) + rsm->r_flags &= ~RACK_HAD_PUSH; + /* * Now we need to find nrsm's new location in the mbuf chain * we basically calculate a new offset, which is soff + diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index b9da908d2a15..bb2c35c76fde 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -3373,6 +3373,15 @@ tcp_mtudisc(struct inpcb *inp, int mtuoffer) tp->snd_recover = tp->snd_max; if (tp->t_flags & TF_SACK_PERMIT) EXIT_FASTRECOVERY(tp->t_flags); + if (tp->t_fb->tfb_tcp_mtu_chg != NULL) { + /* + * Conceptually the snd_nxt setting + * and freeing sack holes should + * be done by the default stacks + * own tfb_tcp_mtu_chg(). + */ + tp->t_fb->tfb_tcp_mtu_chg(tp); + } tp->t_fb->tfb_tcp_output(tp); } From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:14:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0111A64188C; Wed, 9 Jun 2021 00:14:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G06zl6Zrqz3mdK; Wed, 9 Jun 2021 00:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA2FB12C07; Wed, 9 Jun 2021 00:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590ERMM071463; Wed, 9 Jun 2021 00:14:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590ERSB071462; Wed, 9 Jun 2021 00:14:27 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:14:27 GMT Message-Id: <202106090014.1590ERSB071462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 12e181b67273 - stable/13 - tcp: Fix bugs related to the PUSH bit and rack and an ack war MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12e181b6727326f79173182d04eb799eab3bdec7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:14:28 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=12e181b6727326f79173182d04eb799eab3bdec7 commit 12e181b6727326f79173182d04eb799eab3bdec7 Author: Randall Stewart AuthorDate: 2021-05-25 17:23:31 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:13:32 +0000 tcp: Fix bugs related to the PUSH bit and rack and an ack war Michaels testing with UDP tunneling found an issue with the push bit, which was only partly fixed in the last commit. The problem is the left edge gets transmitted before the adjustments are done to the send_map, this means that right edge bits must be considered to be added only if the entire RSM is being retransmitted. Now syzkaller also continued to find a crash, which Michael sent me the reproducer for. Turns out that the reproducer on default (freebsd) stack made the stack get into an ack-war with itself. After fixing the reference issues in rack the same ack-war was found in rack (and bbr). Basically what happens is we go into the reassembly code and lose the FIN bit. The trick here is we should not be going into the reassembly code if tlen == 0 i.e. the peer never sent you anything. That then gets the proper action on the FIN bit but then you end up in LAST_ACK with no timers running. This is because the usrclosed function gets called and the FIN's and such have already been exchanged. So when we should be entering FIN_WAIT2 (or even FIN_WAIT1) we get stuck in LAST_ACK. Fixing this means tweaking the usrclosed function so that we properly recognize the condition and drop into FIN_WAIT2 where a timer will allow at least TP_MAXIDLE before closing (to allow time for the peer to retransmit its FIN if the ack is lost). Setting the fast_finwait2 timer can speed this up in testing. Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30451 (cherry picked from commit 13c0e198ca275447f9a60a03f730c38c98f19009) --- sys/netinet/tcp_input.c | 6 +++-- sys/netinet/tcp_stacks/bbr.c | 6 +++-- sys/netinet/tcp_stacks/rack.c | 58 +++++++++++++++++++++++++++++-------------- sys/netinet/tcp_usrreq.c | 16 ++++++++++++ 4 files changed, 64 insertions(+), 22 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 916a7186770c..4ea0f7c5231c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3184,8 +3184,10 @@ dodata: /* XXX */ * when trimming from the head. */ tcp_seq temp = save_start; - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; + if (tlen) { + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 2a98f5cb43ef..78957bdfb27d 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8321,8 +8321,10 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; + if (tlen) { + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 0bdcc20d2b7c..a500c2a18004 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6017,7 +6017,7 @@ rack_setup_offset_for_rsm(struct rack_sendmap *src_rsm, struct rack_sendmap *rsm struct mbuf *m; uint32_t soff; - if (src_rsm->orig_m_len != src_rsm->m->m_len) { + if (src_rsm->m && (src_rsm->orig_m_len != src_rsm->m->m_len)) { /* Fix up the orig_m_len and possibly the mbuf offset */ rack_adjust_orig_mlen(src_rsm); } @@ -8818,21 +8818,23 @@ more: rack->r_ctl.rc_gp_cumack_ts = rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)]; rack_log_map_chg(tp, rack, NULL, rsm, NULL, MAP_TRIM_HEAD, th_ack, __LINE__); /* Now we need to move our offset forward too */ - if (rsm->orig_m_len != rsm->m->m_len) { + if (rsm->m && (rsm->orig_m_len != rsm->m->m_len)) { /* Fix up the orig_m_len and possibly the mbuf offset */ rack_adjust_orig_mlen(rsm); } rsm->soff += (th_ack - rsm->r_start); rsm->r_start = th_ack; /* Now do we need to move the mbuf fwd too? */ - while (rsm->soff >= rsm->m->m_len) { - rsm->soff -= rsm->m->m_len; - rsm->m = rsm->m->m_next; - KASSERT((rsm->m != NULL), - (" nrsm:%p hit at soff:%u null m", - rsm, rsm->soff)); - } - rsm->orig_m_len = rsm->m->m_len; + if (rsm->m) { + while (rsm->soff >= rsm->m->m_len) { + rsm->soff -= rsm->m->m_len; + rsm->m = rsm->m->m_next; + KASSERT((rsm->m != NULL), + (" nrsm:%p hit at soff:%u null m", + rsm, rsm->soff)); + } + rsm->orig_m_len = rsm->m->m_len; + } if (rack->app_limited_needs_set) rack_need_set_test(tp, rack, rsm, tp->snd_una, __LINE__, RACK_USE_BEG); } @@ -9655,7 +9657,7 @@ rack_adjust_sendmap(struct tcp_rack *rack, struct sockbuf *sb, tcp_seq snd_una) /* Nothing outstanding */ return; } - while (rsm->m == m) { + while (rsm->m && (rsm->m == m)) { /* one to adjust */ #ifdef INVARIANTS struct mbuf *tm; @@ -9676,10 +9678,16 @@ rack_adjust_sendmap(struct tcp_rack *rack, struct sockbuf *sb, tcp_seq snd_una) } rsm->m = tm; rsm->soff = soff; - rsm->orig_m_len = rsm->m->m_len; + if (tm) + rsm->orig_m_len = rsm->m->m_len; + else + rsm->orig_m_len = 0; #else rsm->m = sbsndmbuf(sb, (rsm->r_start - snd_una), &rsm->soff); - rsm->orig_m_len = rsm->m->m_len; + if (rsm->m) + rsm->orig_m_len = rsm->m->m_len; + else + rsm->orig_m_len = 0; #endif rsm = RB_NEXT(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); @@ -10058,6 +10066,7 @@ rack_validate_fo_sendwin_up(struct tcpcb *tp, struct tcp_rack *rack) } } + /* * Return value of 1, the TCB is unlocked and most * likely gone, return value of 0, the TCP is still @@ -10227,9 +10236,10 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; + if (tlen) { + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && @@ -12190,7 +12200,10 @@ rack_init(struct tcpcb *tp) rsm->r_dupack = 0; if (rack->rc_inp->inp_socket->so_snd.sb_mb != NULL) { rsm->m = sbsndmbuf(&rack->rc_inp->inp_socket->so_snd, 0, &rsm->soff); - rsm->orig_m_len = rsm->m->m_len; + if (rsm->m) + rsm->orig_m_len = rsm->m->m_len; + else + rsm->orig_m_len = 0; } else { /* * This can happen if we have a stand-alone FIN or @@ -15075,6 +15088,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma uint32_t us_cts; uint32_t if_hw_tsomaxsegcount = 0, startseq; uint32_t if_hw_tsomaxsegsize; + #ifdef INET6 struct ip6_hdr *ip6 = NULL; @@ -15184,7 +15198,15 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma } th->th_seq = htonl(rsm->r_start); th->th_ack = htonl(tp->rcv_nxt); - if(rsm->r_flags & RACK_HAD_PUSH) + /* + * The PUSH bit should only be applied + * if the full retransmission is made. If + * we are sending less than this is the + * left hand edge and should not have + * the PUSH bit. + */ + if ((rsm->r_flags & RACK_HAD_PUSH) && + (len == (rsm->r_end - rsm->r_start))) flags |= TH_PUSH; th->th_flags = flags; th->th_win = htons((u_short)(rack->r_ctl.fsb.recwin >> tp->rcv_scale)); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index bd847426681e..55aa609fd084 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2635,6 +2635,22 @@ tcp_usrclosed(struct tcpcb *tp) tcp_state_change(tp, TCPS_LAST_ACK); break; } + if ((tp->t_state == TCPS_LAST_ACK) && + (tp->t_flags & TF_SENTFIN)) { + /* + * If we have reached LAST_ACK, and + * we sent a FIN (e.g. via MSG_EOR), then + * we really should move to either FIN_WAIT_1 + * or FIN_WAIT_2 depending on snd_max/snd_una. + */ + if (tp->snd_una == tp->snd_max) { + /* The FIN is acked */ + tcp_state_change(tp, TCPS_FIN_WAIT_2); + } else { + /* The FIN is still outstanding */ + tcp_state_change(tp, TCPS_FIN_WAIT_1); + } + } if (tp->t_state >= TCPS_FIN_WAIT_2) { soisdisconnected(tp->t_inpcb->inp_socket); /* Prevent the connection hanging in FIN_WAIT_2 forever. */ From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:18:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C27FB6418AA; Wed, 9 Jun 2021 00:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G074D52z2z3mXf; Wed, 9 Jun 2021 00:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 954B012BCE; Wed, 9 Jun 2021 00:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590IKJT071823; Wed, 9 Jun 2021 00:18:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590IKo4071822; Wed, 9 Jun 2021 00:18:20 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:18:20 GMT Message-Id: <202106090018.1590IKo4071822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 362f95f52897 - stable/13 - tcp: Add a socket option to rack so we can test various changes to the slop value in timers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 362f95f5289706dfcdf46dac3619a6aa8ee25186 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:18:20 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=362f95f5289706dfcdf46dac3619a6aa8ee25186 commit 362f95f5289706dfcdf46dac3619a6aa8ee25186 Author: Randall Stewart AuthorDate: 2021-05-26 10:43:30 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:16:00 +0000 tcp: Add a socket option to rack so we can test various changes to the slop value in timers. Timer_slop, in TCP, has been 200ms for a long time. This value dates back a long time when delayed ack timers were longer and links were slower. A 200ms timer slop allows 1 MSS to be sent over a 60kbps link. Its possible that lowering this value to something more in line with todays delayed ack values (40ms) might improve TCP. This bit of code makes it so rack can, via a socket option, adjust the timer slop. Reviewed by: mtuexen Sponsered by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30249 (cherry picked from commit 4f3addd94be5e02e6e425f6119f5409972ab5d14) --- sys/netinet/tcp.h | 1 + sys/netinet/tcp_stacks/rack.c | 44 +++++++++++++++++++++++++++------------ sys/netinet/tcp_stacks/tcp_rack.h | 2 ++ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 50f0811a6517..7273cb5104ea 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -305,6 +305,7 @@ struct tcphdr { #define TCP_FAST_RSM_HACK 1137 /* Do we do the broken thing where we don't twiddle the TLP bits properly in fast_rsm_output? */ #define TCP_RACK_PACING_BETA 1138 /* Changing the beta for pacing */ #define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ +#define TCP_RACK_TIMER_SLOP 1140 /* Set or get the timer slop used */ /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index a500c2a18004..5556e562c0eb 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -408,8 +408,8 @@ counter_u64_t rack_opts_arry[RACK_OPTS_SIZE]; #define RACK_REXMTVAL(tp) max(rack_rto_min, ((tp)->t_srtt + ((tp)->t_rttvar << 2))) -#define RACK_TCPT_RANGESET(tv, value, tvmin, tvmax) do { \ - (tv) = (value) + TICKS_2_USEC(tcp_rexmit_slop); \ +#define RACK_TCPT_RANGESET(tv, value, tvmin, tvmax, slop) do { \ + (tv) = (value) + slop; \ if ((u_long)(tv) < (u_long)(tvmin)) \ (tv) = (tvmin); \ if ((u_long)(tv) > (u_long)(tvmax)) \ @@ -2448,7 +2448,7 @@ rack_log_rtt_sample(struct tcp_rack *rack, uint32_t rtt) /* Lets capture all the things that make up t_rtxcur */ log.u_bbr.applimited = rack_rto_min; log.u_bbr.epoch = rack_rto_max; - log.u_bbr.lt_epoch = rtt; + log.u_bbr.lt_epoch = rack->r_ctl.timer_slop; log.u_bbr.lost = rack_rto_min; log.u_bbr.pkt_epoch = TICKS_2_USEC(tcp_rexmit_slop); log.u_bbr.rttProp = RACK_REXMTVAL(rack->rc_tp); @@ -5260,7 +5260,7 @@ rack_get_persists_timer_val(struct tcpcb *tp, struct tcp_rack *rack) t = (tp->t_srtt + (tp->t_rttvar << 2)); RACK_TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], - rack_persist_min, rack_persist_max); + rack_persist_min, rack_persist_max, rack->r_ctl.timer_slop); if (tp->t_rxtshift < TCP_MAXRXTSHIFT) tp->t_rxtshift++; rack->r_ctl.rc_hpts_flags |= PACE_TMR_PERSIT; @@ -5526,7 +5526,7 @@ rack_enter_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) rack_timer_cancel(tp, rack, cts, __LINE__); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_in_persist = 1; } } @@ -5581,7 +5581,7 @@ rack_exit_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) rack->r_ctl.rc_went_idle_time = 0; tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->r_ctl.rc_agg_delayed = 0; rack->r_early = 0; rack->r_late = 0; @@ -6777,7 +6777,7 @@ drop_it: rexmt = max(rack_rto_min, (tp->t_srtt + (tp->t_rttvar << 2))) * tcp_backoff[tp->t_rxtshift]; RACK_TCPT_RANGESET(tp->t_rxtcur, rexmt, - max(rack_rto_min, rexmt), rack_rto_max); + max(rack_rto_min, rexmt), rack_rto_max, rack->r_ctl.timer_slop); /* * We enter the path for PLMTUD if connection is established or, if * connection is FIN_WAIT_1 status, reason for the last is that if @@ -7702,7 +7702,7 @@ tcp_rack_xmit_timer_commit(struct tcp_rack *rack, struct tcpcb *tp) */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - max(rack_rto_min, rtt + 2), rack_rto_max); + max(rack_rto_min, rtt + 2), rack_rto_max, rack->r_ctl.timer_slop); rack_log_rtt_sample(rack, rtt); tp->t_softerror = 0; } @@ -7877,7 +7877,7 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); tp->t_softerror = 0; if (to && (to->to_flags & TOF_TS) && (ack_type == CUM_ACKED) && @@ -9735,7 +9735,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, if (rack->rc_in_persist) { tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); } if ((th->th_ack == tp->snd_una) && (tiwin == tp->snd_wnd)) { rack_strike_dupack(rack); @@ -9798,7 +9798,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, /* assure we are not backed off */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_tlp_in_progress = 0; rack->r_ctl.rc_tlp_cnt_out = 0; /* @@ -10650,7 +10650,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, m_freem(mfree); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_tlp_in_progress = 0; rack->r_ctl.rc_tlp_cnt_out = 0; /* @@ -12089,6 +12089,7 @@ rack_init(struct tcpcb *tp) rack->r_ctl.rc_lowest_us_rtt = 0xffffffff; rack->r_ctl.rc_highest_us_rtt = 0; rack->r_ctl.bw_rate_cap = rack_bw_rate_cap; + rack->r_ctl.timer_slop = TICKS_2_USEC(tcp_rexmit_slop); if (rack_use_cmp_acks) rack->r_use_cmp_ack = 1; if (rack_disable_prr) @@ -13183,7 +13184,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb /* Clear out shifts and such */ tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), - rack_rto_min, rack_rto_max); + rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); rack->rc_tlp_in_progress = 0; rack->r_ctl.rc_tlp_cnt_out = 0; /* Send recover and snd_nxt must be dragged along */ @@ -18880,6 +18881,19 @@ rack_process_option(struct tcpcb *tp, struct tcp_rack *rack, int sopt_name, rack->r_ctl.rc_saved_beta.beta = optval; } break; + case TCP_RACK_TIMER_SLOP: + RACK_OPTS_INC(tcp_rack_timer_slop); + rack->r_ctl.timer_slop = optval; + if (rack->rc_tp->t_srtt) { + /* + * If we have an SRTT lets update t_rxtcur + * to have the new slop. + */ + RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), + rack_rto_min, rack_rto_max, + rack->r_ctl.timer_slop); + } + break; case TCP_RACK_PACING_BETA_ECN: RACK_OPTS_INC(tcp_rack_beta_ecn); if (strcmp(tp->cc_algo->name, CCALGONAME_NEWRENO) != 0) { @@ -19526,6 +19540,7 @@ rack_set_sockopt(struct socket *so, struct sockopt *sopt, case TCP_DEFER_OPTIONS: /* URL:defer */ case TCP_RACK_PACING_BETA: /* URL:pacing_beta */ case TCP_RACK_PACING_BETA_ECN: /* URL:pacing_beta_ecn */ + case TCP_RACK_TIMER_SLOP: /* URL:timer_slop */ break; default: /* Filter off all unknown options to the base stack */ @@ -19857,6 +19872,9 @@ rack_get_sockopt(struct socket *so, struct sockopt *sopt, case TCP_SHARED_CWND_TIME_LIMIT: optval = rack->r_limit_scw; break; + case TCP_RACK_TIMER_SLOP: + optval = rack->r_ctl.timer_slop; + break; default: return (tcp_default_ctloutput(so, sopt, inp, tp)); break; diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index 7f2b2ce4786a..349f6daec2f4 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -245,6 +245,7 @@ struct rack_opts_stats { uint64_t tcp_rack_fastrsm_hack; uint64_t tcp_rack_beta; uint64_t tcp_rack_beta_ecn; + uint64_t tcp_rack_timer_slop; }; /* RTT shrink reasons */ @@ -341,6 +342,7 @@ struct rack_control { struct rack_sendmap *rc_resend; /* something we have been asked to * resend */ struct rack_fast_send_blk fsb; /* The fast-send block */ + uint32_t timer_slop; uint32_t input_pkt; uint32_t saved_input_pkt; uint32_t rc_hpts_flags; From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:19:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64A7C641353; Wed, 9 Jun 2021 00:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G075V2PBnz3mh6; Wed, 9 Jun 2021 00:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AA31127F3; Wed, 9 Jun 2021 00:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590JQEr072005; Wed, 9 Jun 2021 00:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590JQ81072004; Wed, 9 Jun 2021 00:19:26 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:19:26 GMT Message-Id: <202106090019.1590JQ81072004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: eb91abb4ba3d - stable/13 - tcp: When we have an out-of-order FIN we do want to strip off the FIN bit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eb91abb4ba3dbdafedfea125129b2f0115e81137 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:19:26 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eb91abb4ba3dbdafedfea125129b2f0115e81137 commit eb91abb4ba3dbdafedfea125129b2f0115e81137 Author: Randall Stewart AuthorDate: 2021-05-27 14:50:32 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:18:36 +0000 tcp: When we have an out-of-order FIN we do want to strip off the FIN bit. The last set of commits fixed both a panic (in rack) and an ACK-war (in freebsd and bbr). However there was a missing case, i.e. where we get an out-of-order FIN by itself. In such a case we don't want to leave the FIN bit set, otherwise we will do the wrong thing and ack the FIN incorrectly. Instead we need to go through the tcp_reasm() code and that way the FIN will be stripped and all will be well. Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30497 (cherry picked from commit 8c69d988a8d32e53310c7b73ec8721b04b7249e6) --- sys/netinet/tcp_input.c | 7 ++++++- sys/netinet/tcp_stacks/bbr.c | 7 ++++++- sys/netinet/tcp_stacks/rack.c | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 4ea0f7c5231c..b6a198b49eef 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3184,7 +3184,12 @@ dodata: /* XXX */ * when trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 78957bdfb27d..a10235f94c89 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8321,7 +8321,12 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 5556e562c0eb..63574691112c 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10236,7 +10236,12 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen) { + if (tlen || (th->th_seq != tp->rcv_nxt)) { + /* + * We add the th_seq != rcv_nxt to + * catch the case of a stand alone out + * of order FIN. + */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:20:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB80E6418C7; Wed, 9 Jun 2021 00:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G07733XwPz3mfF; Wed, 9 Jun 2021 00:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 620C51294B; Wed, 9 Jun 2021 00:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590KloW082585; Wed, 9 Jun 2021 00:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590KlIb082545; Wed, 9 Jun 2021 00:20:47 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:20:47 GMT Message-Id: <202106090020.1590KlIb082545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: fc53b7269fed - stable/13 - tcp: A better fix for the previously attempted fix of the ack-war issue with tcp. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc53b7269fedf53b5fb13e4587d017d6bd833cf3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:20:47 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fc53b7269fedf53b5fb13e4587d017d6bd833cf3 commit fc53b7269fedf53b5fb13e4587d017d6bd833cf3 Author: Randall Stewart AuthorDate: 2021-06-04 09:26:43 +0000 Commit: Michael Tuexen CommitDate: 2021-06-09 00:19:47 +0000 tcp: A better fix for the previously attempted fix of the ack-war issue with tcp. So it turns out that my fix before was not correct. It ended with us failing some of the "improved" SYN tests, since we are not in the correct states. With more digging I have figured out the root of the problem is that when we receive a SYN|FIN the reassembly code made it so we create a segq entry to hold the FIN. In the established state where we were not in order this would be correct i.e. a 0 len with a FIN would need to be accepted. But if you are in a front state we need to strip the FIN so we correctly handle the ACK but ignore the FIN. This gets us into the proper states and avoids the previous ack war. I back out some of the previous changes but then add a new change here in tcp_reass() that fixes the root cause of the issue. We still leave the rack panic fixes in place however. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30627 (cherry picked from commit 4747500deaaa7765ba1c0413197c23ddba4faf49) --- sys/netinet/tcp_input.c | 12 +++--------- sys/netinet/tcp_reass.c | 14 ++++++++++++++ sys/netinet/tcp_stacks/bbr.c | 12 +++--------- sys/netinet/tcp_stacks/rack.c | 13 ++++--------- sys/netinet/tcp_usrreq.c | 16 ---------------- 5 files changed, 24 insertions(+), 43 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index b6a198b49eef..5e25b38c45e2 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3184,15 +3184,9 @@ dodata: /* XXX */ * when trimming from the head. */ tcp_seq temp = save_start; - if (tlen || (th->th_seq != tp->rcv_nxt)) { - /* - * We add the th_seq != rcv_nxt to - * catch the case of a stand alone out - * of order FIN. - */ - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; - } + + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 310d7d540507..e708b6db14c0 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -571,6 +571,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq *seq_start, * the rcv_nxt <-> rcv_wnd but thats * already done for us by the caller. */ +strip_fin: #ifdef TCP_REASS_COUNTERS counter_u64_add(tcp_zero_input, 1); #endif @@ -579,6 +580,19 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq *seq_start, tcp_reass_log_dump(tp); #endif return (0); + } else if ((*tlenp == 0) && + (th->th_flags & TH_FIN) && + !TCPS_HAVEESTABLISHED(tp->t_state)) { + /* + * We have not established, and we + * have a FIN and no data. Lets treat + * this as the same as if the FIN were + * not present. We don't want to save + * the FIN bit in a reassembly buffer + * we want to get established first before + * we do that (the peer will retransmit). + */ + goto strip_fin; } /* * Will it fit? diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index a10235f94c89..a3f7961af345 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8321,15 +8321,9 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen || (th->th_seq != tp->rcv_nxt)) { - /* - * We add the th_seq != rcv_nxt to - * catch the case of a stand alone out - * of order FIN. - */ - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; - } + + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 63574691112c..4a547e900c4f 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10236,15 +10236,10 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, * trimming from the head. */ tcp_seq temp = save_start; - if (tlen || (th->th_seq != tp->rcv_nxt)) { - /* - * We add the th_seq != rcv_nxt to - * catch the case of a stand alone out - * of order FIN. - */ - thflags = tcp_reass(tp, th, &temp, &tlen, m); - tp->t_flags |= TF_ACKNOW; - } + + thflags = tcp_reass(tp, th, &temp, &tlen, m); + tp->t_flags |= TF_ACKNOW; + } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 55aa609fd084..bd847426681e 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2635,22 +2635,6 @@ tcp_usrclosed(struct tcpcb *tp) tcp_state_change(tp, TCPS_LAST_ACK); break; } - if ((tp->t_state == TCPS_LAST_ACK) && - (tp->t_flags & TF_SENTFIN)) { - /* - * If we have reached LAST_ACK, and - * we sent a FIN (e.g. via MSG_EOR), then - * we really should move to either FIN_WAIT_1 - * or FIN_WAIT_2 depending on snd_max/snd_una. - */ - if (tp->snd_una == tp->snd_max) { - /* The FIN is acked */ - tcp_state_change(tp, TCPS_FIN_WAIT_2); - } else { - /* The FIN is still outstanding */ - tcp_state_change(tp, TCPS_FIN_WAIT_1); - } - } if (tp->t_state >= TCPS_FIN_WAIT_2) { soisdisconnected(tp->t_inpcb->inp_socket); /* Prevent the connection hanging in FIN_WAIT_2 forever. */ From owner-dev-commits-src-all@freebsd.org Wed Jun 9 00:47:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 517C6641DB4; Wed, 9 Jun 2021 00:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G07k31sfbz3pMg; Wed, 9 Jun 2021 00:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 286211301A; Wed, 9 Jun 2021 00:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1590ld4B011733; Wed, 9 Jun 2021 00:47:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1590ldKf011732; Wed, 9 Jun 2021 00:47:39 GMT (envelope-from git) Date: Wed, 9 Jun 2021 00:47:39 GMT Message-Id: <202106090047.1590ldKf011732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f530cce55c4f - main - UPDATING: correct typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f530cce55c4ffd33f677bde5e3a2b082abec3875 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 00:47:39 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f530cce55c4ffd33f677bde5e3a2b082abec3875 commit f530cce55c4ffd33f677bde5e3a2b082abec3875 Author: Ed Maste AuthorDate: 2021-06-09 00:46:16 +0000 Commit: Ed Maste CommitDate: 2021-06-09 00:47:05 +0000 UPDATING: correct typo Sponsored by: The FreeBSD Foundation --- UPDATING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index c9e081563e6c..ed27ec0fb9c1 100644 --- a/UPDATING +++ b/UPDATING @@ -28,7 +28,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20210608: - The vendor/openzfs branch was renamed to vnedor/openzfs/legacy to + The vendor/openzfs branch was renamed to vendor/openzfs/legacy to start tracking OpenZFS upstream more closely. Please see https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html for details on how to correct any errors that might result. The From owner-dev-commits-src-all@freebsd.org Wed Jun 9 01:42:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13356642860; Wed, 9 Jun 2021 01:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G08xW04LYz4TLy; Wed, 9 Jun 2021 01:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEEB813DBD; Wed, 9 Jun 2021 01:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1591gcjA090738; Wed, 9 Jun 2021 01:42:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1591gcmo090737; Wed, 9 Jun 2021 01:42:38 GMT (envelope-from git) Date: Wed, 9 Jun 2021 01:42:38 GMT Message-Id: <202106090142.1591gcmo090737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 20c918af7a3d - stable/12 - Cirrus-CI: Add descriptive task name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 20c918af7a3de84a6fc7d840a712fc4aa4dcdb69 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 01:42:39 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=20c918af7a3de84a6fc7d840a712fc4aa4dcdb69 commit 20c918af7a3de84a6fc7d840a712fc4aa4dcdb69 Author: Ed Maste AuthorDate: 2021-06-02 15:31:48 +0000 Commit: Ed Maste CommitDate: 2021-06-09 01:41:45 +0000 Cirrus-CI: Add descriptive task name Previously it appeared only as "main" in places like GitHub's list of checks run as part of a pull request. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 903526542ac2309c08c769e517ea173a9f67cdb2) "boot smoke test" dropped from task name for the MFC, because Cirrus runs a build test only on stable/12 (see 05b9673637fe for details). --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index ed89c0061973..356125f7d7b1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -9,6 +9,7 @@ env: CIRRUS_CLONE_DEPTH: 1 task: + name: World and kernel amd64 build test timeout_in: 90m install_script: - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 05:22:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FFFB64672C; Wed, 9 Jun 2021 05:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0Fpk1q0jz4mNs; Wed, 9 Jun 2021 05:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2706A164E9; Wed, 9 Jun 2021 05:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1595M6JC078879; Wed, 9 Jun 2021 05:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1595M64K078878; Wed, 9 Jun 2021 05:22:06 GMT (envelope-from git) Date: Wed, 9 Jun 2021 05:22:06 GMT Message-Id: <202106090522.1595M64K078878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Takanori Watanabe Subject: git: 26c3e7a1ecb3 - stable/13 - Fix a use-after-free in an error case. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: takawata X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 26c3e7a1ecb375de071786a07bdd68f867acdb3c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 05:22:06 -0000 The branch stable/13 has been updated by takawata: URL: https://cgit.FreeBSD.org/src/commit/?id=26c3e7a1ecb375de071786a07bdd68f867acdb3c commit 26c3e7a1ecb375de071786a07bdd68f867acdb3c Author: Takanori Watanabe AuthorDate: 2021-05-26 09:23:33 +0000 Commit: Takanori Watanabe CommitDate: 2021-06-09 05:20:57 +0000 Fix a use-after-free in an error case. PR: 255872 Submitted by: lylgood Differential Revision: https://reviews.freebsd.org/D30454 (cherry picked from commit 14803ec8d193d8d46f4137a7dba61b277c6a2fed) --- sys/netgraph/bluetooth/hci/ng_hci_evnt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c index 9e299d12fd1e..64ab4f0b36b9 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c @@ -528,6 +528,7 @@ static int le_connection_complete(ng_hci_unit_p unit, struct mbuf *event) if (error != 0) { ng_hci_con_untimeout(con); ng_hci_free_con(con); + goto out; } } else if ((error = ng_hci_con_untimeout(con)) != 0) From owner-dev-commits-src-all@freebsd.org Wed Jun 9 06:36:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84F416476D8; Wed, 9 Jun 2021 06:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HS3354tz4sxg; Wed, 9 Jun 2021 06:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51E3517878; Wed, 9 Jun 2021 06:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596a35l074046; Wed, 9 Jun 2021 06:36:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596a3ot074045; Wed, 9 Jun 2021 06:36:03 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:36:03 GMT Message-Id: <202106090636.1596a3ot074045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: a7a46c77f1b4 - stable/12 - rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a7a46c77f1b4a425ca2aa5deb28d61168e87ccd5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:36:03 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=a7a46c77f1b4a425ca2aa5deb28d61168e87ccd5 commit a7a46c77f1b4a425ca2aa5deb28d61168e87ccd5 Author: Dmitry Chagin AuthorDate: 2021-05-26 07:13:08 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:32:54 +0000 rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. (cherry picked from commit 399bad7b9a105930b8203ad0a1fd154681bc16b8) --- share/man/man4/rtwn_usb.4 | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 3019827fd5e4..60ec680d6ddd 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -92,6 +92,7 @@ based USB wireless network adapters, including: .It "NEC AtermWL900U PA-WL900U" Ta RTL8812AU Ta USB 3.0 .It "Netgear A6100" Ta RTL8821AU Ta USB 2.0 .It "Netgear WNA1000M" Ta RTL8188CUS Ta USB 2.0 +.It "Mercusys MW150US" Ta RTL8188EU Ta USB 2.0 .It "Planex GW-900D" Ta RTL8812AU Ta USB 3.0 .It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 06:36:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A867647B2C; Wed, 9 Jun 2021 06:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HS4412Pz4sct; Wed, 9 Jun 2021 06:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 737B0179D3; Wed, 9 Jun 2021 06:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596a4LF074074; Wed, 9 Jun 2021 06:36:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596a4cp074073; Wed, 9 Jun 2021 06:36:04 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:36:04 GMT Message-Id: <202106090636.1596a4cp074073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 6cc8a2f4bbc1 - stable/12 - rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6cc8a2f4bbc1a2f76e617e8031f57d8a0728cf89 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:36:04 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=6cc8a2f4bbc1a2f76e617e8031f57d8a0728cf89 commit 6cc8a2f4bbc1a2f76e617e8031f57d8a0728cf89 Author: Dmitry Chagin AuthorDate: 2021-05-26 05:01:04 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:33:46 +0000 rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list (cherry picked from commit 962b3a092616c95c68c0b0a844f4660675aa40f6) --- share/man/man4/rtwn_usb.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 60ec680d6ddd..1cbc280dfdcb 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd June 27, 2020 +.Dd May 26, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -70,6 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 +.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 06:36:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F368D647C17; Wed, 9 Jun 2021 06:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HS566BFz4syw; Wed, 9 Jun 2021 06:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B078917879; Wed, 9 Jun 2021 06:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596a5Zg074101; Wed, 9 Jun 2021 06:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596a58x074100; Wed, 9 Jun 2021 06:36:05 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:36:05 GMT Message-Id: <202106090636.1596a58x074100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: f29323c94f58 - stable/12 - rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f29323c94f5874f10d440dc43380ff17fb39d44f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:36:06 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f29323c94f5874f10d440dc43380ff17fb39d44f commit f29323c94f5874f10d440dc43380ff17fb39d44f Author: Dmitry Chagin AuthorDate: 2021-05-26 06:47:30 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:34:39 +0000 rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). (cherry picked from commit 17dafdc0de7e8ab0c750d1339e4debc78262e19b) --- share/man/man4/rtwn_usb.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 1cbc280dfdcb..b146cfe4fe09 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -70,7 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 -.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-121 rev C1A (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 06:38:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81250647C53; Wed, 9 Jun 2021 06:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HVM3HQ4z4t39; Wed, 9 Jun 2021 06:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59BD41787B; Wed, 9 Jun 2021 06:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596c3Rf074353; Wed, 9 Jun 2021 06:38:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596c3gn074352; Wed, 9 Jun 2021 06:38:03 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:38:03 GMT Message-Id: <202106090638.1596c3gn074352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 13bdb7d59456 - stable/13 - rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13bdb7d59456e435b6b95f115aa1e75aa65e978c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:38:03 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=13bdb7d59456e435b6b95f115aa1e75aa65e978c commit 13bdb7d59456e435b6b95f115aa1e75aa65e978c Author: Dmitry Chagin AuthorDate: 2021-05-26 07:13:08 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:37:19 +0000 rtwn_usb(4): add Mercusys MW150US (N150 Nano) to the rtwn_usb hardware list. (cherry picked from commit 399bad7b9a105930b8203ad0a1fd154681bc16b8) --- share/man/man4/rtwn_usb.4 | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 3019827fd5e4..60ec680d6ddd 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -92,6 +92,7 @@ based USB wireless network adapters, including: .It "NEC AtermWL900U PA-WL900U" Ta RTL8812AU Ta USB 3.0 .It "Netgear A6100" Ta RTL8821AU Ta USB 2.0 .It "Netgear WNA1000M" Ta RTL8188CUS Ta USB 2.0 +.It "Mercusys MW150US" Ta RTL8188EU Ta USB 2.0 .It "Planex GW-900D" Ta RTL8812AU Ta USB 3.0 .It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 06:38:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B12FA647AFC; Wed, 9 Jun 2021 06:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HVN4Yc1z4ssC; Wed, 9 Jun 2021 06:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 846E2178B9; Wed, 9 Jun 2021 06:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596c4NG074377; Wed, 9 Jun 2021 06:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596c4NZ074376; Wed, 9 Jun 2021 06:38:04 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:38:04 GMT Message-Id: <202106090638.1596c4NZ074376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: f38af5d76c87 - stable/13 - rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f38af5d76c87bf0b6438afb98cda831a8ac13f86 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:38:04 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f38af5d76c87bf0b6438afb98cda831a8ac13f86 commit f38af5d76c87bf0b6438afb98cda831a8ac13f86 Author: Dmitry Chagin AuthorDate: 2021-05-26 05:01:04 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:37:36 +0000 rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list (cherry picked from commit 962b3a092616c95c68c0b0a844f4660675aa40f6) --- share/man/man4/rtwn_usb.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 60ec680d6ddd..1cbc280dfdcb 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd June 27, 2020 +.Dd May 26, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -70,6 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 +.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 06:38:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75891647C62; Wed, 9 Jun 2021 06:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0HVP6yGTz4t3J; Wed, 9 Jun 2021 06:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB5F91787C; Wed, 9 Jun 2021 06:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1596c5WD074401; Wed, 9 Jun 2021 06:38:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1596c50R074400; Wed, 9 Jun 2021 06:38:05 GMT (envelope-from git) Date: Wed, 9 Jun 2021 06:38:05 GMT Message-Id: <202106090638.1596c50R074400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 7cddc353b63c - stable/13 - rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7cddc353b63cc1496fd714593133b706512c4788 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 06:38:06 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7cddc353b63cc1496fd714593133b706512c4788 commit 7cddc353b63cc1496fd714593133b706512c4788 Author: Dmitry Chagin AuthorDate: 2021-05-26 06:47:30 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-09 06:37:50 +0000 rtwn_usb(4): add revision number for D-Link DWA-121 (N150 Nano). (cherry picked from commit 17dafdc0de7e8ab0c750d1339e4debc78262e19b) --- share/man/man4/rtwn_usb.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index 1cbc280dfdcb..b146cfe4fe09 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -70,7 +70,7 @@ based USB wireless network adapters, including: .It "Buffalo WI-U2-433DHP" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 -.It "D-Link DWA-121 (N150 Nano)" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-121 rev C1A (N150 Nano)" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 .It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 07:04:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7D0F648413 for ; Wed, 9 Jun 2021 07:04:29 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0J4q1sqxz3DHT; Wed, 9 Jun 2021 07:04:26 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1623222258; 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=D31FgwAsx0XuF3iZjzd23ZTUw/xEHwhscAxnsjKpARE=; b=JslZoSrdeV6d46bXXhO15Ey1/H206fdnuiDCE5qPqygUhZuoXhyUIh8w7tBZvbGOTh8EWN Yz7CApDN9NUrJyNzAzvQuDGEdLMuT2HzKTSP8kfdhQrqAvbIkDxKbt7isL4J44q2p/Gywp m+pnI7vj31egE4J0AeMrUq0xrnZjZxo= Received: from amy (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 8b00521c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 9 Jun 2021 07:04:18 +0000 (UTC) Date: Wed, 9 Jun 2021 09:04:15 +0200 From: Emmanuel Vadot To: Cy Schubert Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org Subject: Re: git: 40c7ff83e74e - vendor/wpa - wpa: Import wpa_supplicant/hostapd commit e8662e9d4 Message-Id: <20210609090415.507c477968bce2efce9e9ff8@bidouilliste.com> In-Reply-To: <202106031638.153GcGhh069766@gitrepo.freebsd.org> References: <202106031638.153GcGhh069766@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4G0J4q1sqxz3DHT X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=JslZoSrd; 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 [-1.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SPAMHAUS_ZRD(0.00)[212.83.155.74:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.83.155.74:from]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 07:04:30 -0000 On Thu, 3 Jun 2021 16:38:16 GMT Cy Schubert wrote: > The branch vendor/wpa has been updated by cy: > > URL: https://cgit.FreeBSD.org/src/commit/?id=40c7ff83e74eabba5a7e2caefeea12372b2d3f9a > > commit 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a > Author: Cy Schubert > AuthorDate: 2021-06-03 16:15:01 +0000 > Commit: Cy Schubert > CommitDate: 2021-06-03 16:15:01 +0000 > > wpa: Import wpa_supplicant/hostapd commit e8662e9d4 > > This is the June update to vendor/wpa committed upstream 2021/06/03. Hi cy@ Don't know if it is this commit or something else yet but I'm seeing weird behavior from a recent head. wpa_supplicant abort with SIGBUS just after connecting to my wireless network. I'm still connected but this stopped working after a while (I guess when the supplicant would need to do some stuff with the AP or something). From dmesg just after running service netif restart: lo0: link state changed to DOWN wlan0: link state changed to DOWN wlan0: Ethernet address: bc:54:2f:4b:d1:dd lo0: link state changed to UP wlan0: link state changed to UP pid 69593 (wpa_supplicant), jid 0, uid 0: exited on signal 10 (core dumped) Reading symbols from /usr/sbin/wpa_supplicant... Reading symbols from /usr/lib/debug//usr/sbin/wpa_supplicant.debug... [New LWP 112604] Core was generated by `/usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_supplicant.conf -D bsd -P /v'. Program terminated with signal SIGBUS, Bus error. #0 0x00000000010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304 304 /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h: No such file or directory. (gdb) bt #0 0x00000000010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304 #1 wpa_supplicant_process_3_of_4 (sm=0x801e12700, key=, ver=, key_data=, key_data_len=) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa.c:1572 #2 wpa_sm_rx_eapol (sm=, src_addr=, buf=, len=) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa.c:2434 #3 0x00000000010e372e in l2_packet_receive (sock=, eloop_ctx=0x801e286e0, sock_ctx=) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/l2_packet/l2_packet_freebsd.c:98 #4 0x0000000001112b23 in eloop_sock_table_dispatch (table=, fds=0x801e44080) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/utils/eloop.c:600 #5 eloop_run () at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/utils/eloop.c:1223 #6 0x00000000010af228 in wpa_supplicant_run (global=, global@entry=0x801e2d000) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/wpa_supplicant.c:6526 #7 0x000000000109ab6c in main (argc=, argv=) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/main.c:397 I'll try to revert the update later this week but if you have any idea in the mean time. Thanks, -- Emmanuel Vadot From owner-dev-commits-src-all@freebsd.org Wed Jun 9 09:41:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA08464A57B; Wed, 9 Jun 2021 09:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0MZ657zqz3nPv; Wed, 9 Jun 2021 09:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9907319B6B; Wed, 9 Jun 2021 09:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1599fYQu023264; Wed, 9 Jun 2021 09:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1599fYAD023263; Wed, 9 Jun 2021 09:41:34 GMT (envelope-from git) Date: Wed, 9 Jun 2021 09:41:34 GMT Message-Id: <202106090941.1599fYAD023263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 20eb6bd8c598 - main - rc.d: liberate powerd from ACPI dependency MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20eb6bd8c598fdbf4e96ed4ca64a609be255ccba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 09:41:34 -0000 The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=20eb6bd8c598fdbf4e96ed4ca64a609be255ccba commit 20eb6bd8c598fdbf4e96ed4ca64a609be255ccba Author: Andriy Gapon AuthorDate: 2021-06-08 17:08:10 +0000 Commit: Andriy Gapon CommitDate: 2021-06-09 09:40:53 +0000 rc.d: liberate powerd from ACPI dependency For instance, many non-ACPI ARM systems have CPU power / frequency levels. Discussed with: manu MFC after: 1 week --- libexec/rc/rc.d/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 0834d8c4c2a0..24a4e7edb9d9 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -78,6 +78,7 @@ CONFS= DAEMON \ pf \ pflog \ pfsync \ + powerd \ ppp \ pppoed \ pwcheck \ @@ -135,10 +136,6 @@ ACPI= power_profile ACPIPACKAGE= acpi .endif -.if ${MK_ACPI} != "no" || ${MK_APM} != "no" -CONFS+= powerd -.endif - .if ${MK_APM} != "no" CONFGROUPS+= APM APM+= apm From owner-dev-commits-src-all@freebsd.org Wed Jun 9 09:43:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1B3F64A395; Wed, 9 Jun 2021 09:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0Mbm65yrz3p6v; Wed, 9 Jun 2021 09:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA29519E56; Wed, 9 Jun 2021 09:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1599h0fL027222; Wed, 9 Jun 2021 09:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1599h0v6027221; Wed, 9 Jun 2021 09:43:00 GMT (envelope-from git) Date: Wed, 9 Jun 2021 09:43:00 GMT Message-Id: <202106090943.1599h0v6027221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: ffc5dc788f05 - main - rk3328_cru: fix a typo in the SCLK_I2S2 gate definition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffc5dc788f05dec5fd11aff8f216c37cd56fcd7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 09:43:00 -0000 The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ffc5dc788f05dec5fd11aff8f216c37cd56fcd7f commit ffc5dc788f05dec5fd11aff8f216c37cd56fcd7f Author: Andriy Gapon AuthorDate: 2021-06-09 07:44:41 +0000 Commit: Andriy Gapon CommitDate: 2021-06-09 09:41:52 +0000 rk3328_cru: fix a typo in the SCLK_I2S2 gate definition MFC after: 4 days --- sys/arm64/rockchip/clk/rk3328_cru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/rockchip/clk/rk3328_cru.c b/sys/arm64/rockchip/clk/rk3328_cru.c index e110564f773d..95a87cfd0e00 100644 --- a/sys/arm64/rockchip/clk/rk3328_cru.c +++ b/sys/arm64/rockchip/clk/rk3328_cru.c @@ -114,7 +114,7 @@ static struct rk_cru_gate rk3328_gates[] = { /* CRU_CLKGATE_CON1 */ CRU_GATE(SCLK_I2S0, "clk_i2s0", "clk_i2s0_mux", 0x204, 3) CRU_GATE(SCLK_I2S1, "clk_i2s1", "clk_i2s1_mux", 0x204, 6) - CRU_GATE(SCLK_I2S1, "clk_i2s2", "clk_i2s2_mux", 0x204, 10) + CRU_GATE(SCLK_I2S2, "clk_i2s2", "clk_i2s2_mux", 0x204, 10) /* CRU_CLKGATE_CON4 */ CRU_GATE(0, "gpll_peri", "gpll", 0x210, 0) From owner-dev-commits-src-all@freebsd.org Wed Jun 9 10:31:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3849F64B5CD; Wed, 9 Jun 2021 10:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0NgG0vppz3rC7; Wed, 9 Jun 2021 10:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 082001A9B4; Wed, 9 Jun 2021 10:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159AV5U3092742; Wed, 9 Jun 2021 10:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159AV5fb092741; Wed, 9 Jun 2021 10:31:05 GMT (envelope-from git) Date: Wed, 9 Jun 2021 10:31:05 GMT Message-Id: <202106091031.159AV5fb092741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando Apestegu=C3=ADa=?= Subject: git: dc318a4ffabc - main - Fix syscall kld example MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc318a4ffabcbfa23bb56a33403aad36e6de30af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 10:31:06 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=dc318a4ffabcbfa23bb56a33403aad36e6de30af commit dc318a4ffabcbfa23bb56a33403aad36e6de30af Author: Fernando Apesteguía AuthorDate: 2021-05-27 12:09:39 +0000 Commit: Fernando Apesteguía CommitDate: 2021-06-09 10:24:26 +0000 Fix syscall kld example PR: 255936 Reported by: splitface@mailfence.com Approved by: gbe (mentor), imp@, jilles@ Differential Revision: https://reviews.freebsd.org/D30498 --- share/examples/kld/syscall/module/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/examples/kld/syscall/module/syscall.c b/share/examples/kld/syscall/module/syscall.c index 701e2492884c..1ee533005b85 100644 --- a/share/examples/kld/syscall/module/syscall.c +++ b/share/examples/kld/syscall/module/syscall.c @@ -51,8 +51,8 @@ hello(struct thread *td, void *arg) * The `sysent' for the new syscall */ static struct sysent hello_sysent = { - 0, /* sy_narg */ - hello /* sy_call */ + .sy_narg = 0, + .sy_call = hello }; /* From owner-dev-commits-src-all@freebsd.org Wed Jun 9 10:36:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D33B64B35B; Wed, 9 Jun 2021 10:36:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 4G0Nnv35hyz3s2c; Wed, 9 Jun 2021 10:36:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x130.google.com with SMTP id r198so33917263lff.11; Wed, 09 Jun 2021 03:36:51 -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=YoJ0Ee7506uVcXCsJjQy4zLgFV81bGIrjGXT42uh2ZE=; b=rtLTzbwitocVXByYkfazIJue+BjPgbqOi11ssGkZHrM2yP3Fyh2U9FPwvyQfXr4d+V CTUyka30QosApjWK98I2be70Z1DvZczKo9JF98j5KrJF3XQhAqOCFeHkje43aCBE/cub m51zeT1u7zeID2le8E5qGTjlTQ+NaVRVwpfHkGNOZ0beomdSdTnsMkC6PQY3LKGgfX9C Aieiz0K48RqVmWeEaWt1I3/BgEewsCar0r0WFTdcpIbThuNusVKShghpZe4Ha6sOP06g zRVS9y6VDgThPtvWsTcviBuWKueUTmJoY04wiceY4bLSwen373ee+afyPmBVcW30IMHI +CYA== 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=YoJ0Ee7506uVcXCsJjQy4zLgFV81bGIrjGXT42uh2ZE=; b=DHCQWA6tBz1hLGqMQtHZ6/VLlLcLj85tm+Nm+5xYRGcbAcLw5A4icEmlsS9RTRFEnt Pfq2Ce85EManFB3e8HnArQzg+baKW9wQdMYLIegD4WcZaVl0EpkhVZ6iTGwMaNHlBPYY CjmtKBkOAqSrFpIcoZcYYTh2l86n1b7/7URujKd/h3NMsHk+iR+J7diW1nzbHCTds1oi QQlpdaPlWlLUjw9qZ4kwp4a4dAYo5E5RVmC5uE7yQ20ol0qoHRsRqLLeXvqjljb59AkV Cq/HOTQFq5ekHjOwQGkIEdUtfm7ROCUmgKp7Hgxo5eAHaqkR4wQqXt34zx8I9T6R4FuK 5UZg== X-Gm-Message-State: AOAM531K2g29Q5QxOI41sevYsAR/oLjF6U9YyCJUA50Z7wzgqwm7nhsC InP1gkOe0g3rYgHCHekkwKhwUFRLlaL5ImqRcSNPy8py X-Google-Smtp-Source: ABdhPJzFCscB4qJvLS/Hi4tV7RoKJbErQF00n6zpuGLDvG55VznskVn34B6UTL7D0DzK+PUrLMO7p+vx7bvvkmjljuE= X-Received: by 2002:a05:6512:b0f:: with SMTP id w15mr18605416lfu.118.1623235009753; Wed, 09 Jun 2021 03:36:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:651c:2006:0:0:0:0 with HTTP; Wed, 9 Jun 2021 03:36:49 -0700 (PDT) In-Reply-To: <202106081350.158DoTmi096312@gitrepo.freebsd.org> References: <202106081350.158DoTmi096312@gitrepo.freebsd.org> From: Mateusz Guzik Date: Wed, 9 Jun 2021 12:36:49 +0200 Message-ID: Subject: Re: git: 97993d1ebf59 - main - hyperv: Fix vmbus after the i386 4/4 split To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4G0Nnv35hyz3s2c X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 10:36:51 -0000 This breaks i386 LINT kernels: ld: error: undefined symbol: Xvmbus_isr >>> referenced by vmbus.c >>> vmbus.o:(vmbus_intrhook) ld: error: undefined symbol: Xvmbus_isr_pti >>> referenced by vmbus.c >>> vmbus.o:(vmbus_intrhook) On 6/8/21, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=97993d1ebf592ac6689a498d5d0d2afb46758680 > > commit 97993d1ebf592ac6689a498d5d0d2afb46758680 > Author: Mark Johnston > AuthorDate: 2021-06-08 13:40:30 +0000 > Commit: Mark Johnston > CommitDate: 2021-06-08 13:40:30 +0000 > > hyperv: Fix vmbus after the i386 4/4 split > > The vmbus ISR needs to live in a trampoline. Dynamically allocating a > trampoline at driver initialization time poses some difficulties due to > the fact that the KENTER macro assumes that the offset relative to > tramp_idleptd is fixed at static link time. Another problem is that > native_lapic_ipi_alloc() uses setidt(), which assumes a fixed > trampoline > offset. > > Rather than fight this, move the Hyper-V ISR to i386/exception.s. Add > a > new HYPERV kernel option to make this optional, and configure it by > default on i386. This is sufficient to make use of vmbus(4) after the > 4/4 split. Note that vmbus cannot be loaded dynamically and both the > HYPERV option and device must be configured together. I think this is > not too onerous a requirement, since vmbus(4) was previously > non-functional. > > Reported by: Harry Schmalzbauer > Tested by: Harry Schmalzbauer > Reviewed by: whu, kib > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D30577 > --- > sys/conf/files.i386 | 1 - > sys/conf/options.i386 | 3 +++ > sys/dev/hyperv/vmbus/i386/vmbus_vector.S | 6 +++++- > sys/i386/conf/GENERIC | 4 +++- > sys/i386/i386/exception.s | 9 +++++++++ > sys/modules/hyperv/vmbus/Makefile | 5 ++++- > 6 files changed, 24 insertions(+), 4 deletions(-) > > diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 > index 331ad5fec79a..10e286dae271 100644 > --- a/sys/conf/files.i386 > +++ b/sys/conf/files.i386 > @@ -102,7 +102,6 @@ dev/glxiic/glxiic.c optional glxiic > dev/glxsb/glxsb.c optional glxsb > dev/glxsb/glxsb_hash.c optional glxsb > dev/hyperv/vmbus/i386/hyperv_machdep.c optional hyperv > -dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv > dev/le/if_le_isa.c optional le isa > dev/nctgpio/nctgpio.c optional nctgpio > dev/nfe/if_nfe.c optional nfe pci > diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 > index 4249fa1dfd0a..5e7ea446089b 100644 > --- a/sys/conf/options.i386 > +++ b/sys/conf/options.i386 > @@ -101,6 +101,9 @@ NPX_DEBUG opt_npx.h > # BPF just-in-time compiler > BPF_JITTER opt_bpf.h > > +# Hyper-V support > +HYPERV opt_hyperv.h > + > XENHVM opt_global.h > > # options for the Intel C600 SAS driver (isci) > diff --git a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S > b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S > index 0570c6b49e1c..d119cfdc5b12 100644 > --- a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S > +++ b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S > @@ -35,6 +35,9 @@ > /* > * This is the Hyper-V vmbus channel direct callback interrupt. > * Only used when it is running on Hyper-V. > + * > + * Note that this file is not compiled directly, it is included into > + * i386/exception.s. > */ > .text > SUPERALIGN_TEXT > @@ -45,6 +48,7 @@ IDTVEC(vmbus_isr) > cld > KENTER > pushl %esp > - call vmbus_handle_intr > + mov $vmbus_handle_intr, %eax > + call *%eax > add $4, %esp > jmp doreti > diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC > index 1b4d853fe1d4..288968d84af1 100644 > --- a/sys/i386/conf/GENERIC > +++ b/sys/i386/conf/GENERIC > @@ -339,7 +339,9 @@ device virtio_scsi # VirtIO SCSI device > device virtio_balloon # VirtIO Memory Balloon device > > # HyperV drivers and enhancement support > -device hyperv # HyperV drivers > +# NOTE: HYPERV depends on hyperv. They must be added or removed together. > +options HYPERV # Kernel support for HyperV drivers > +device hyperv # HyperV drivers > > # Xen HVM Guest Optimizations > # NOTE: XENHVM depends on xenpci. They must be added or removed together. > diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s > index 6989d3e2828a..f47ab92f1987 100644 > --- a/sys/i386/i386/exception.s > +++ b/sys/i386/i386/exception.s > @@ -39,6 +39,7 @@ > #include "opt_apic.h" > #include "opt_atpic.h" > #include "opt_hwpmc_hooks.h" > +#include "opt_hyperv.h" > > #include "assym.inc" > > @@ -404,6 +405,14 @@ ENTRY(fork_trampoline) > > #ifdef DEV_APIC > #include > +#endif > + > +#ifdef HYPERV > + .data > + .p2align 4 > + .text > + SUPERALIGN_TEXT > +#include > #endif > > .data > diff --git a/sys/modules/hyperv/vmbus/Makefile > b/sys/modules/hyperv/vmbus/Makefile > index 435106c7e9bd..47a83e76204a 100644 > --- a/sys/modules/hyperv/vmbus/Makefile > +++ b/sys/modules/hyperv/vmbus/Makefile > @@ -13,8 +13,11 @@ SRCS= hyperv.c \ > vmbus_et.c \ > vmbus_if.c \ > vmbus_res.c \ > - vmbus_vector.S \ > vmbus_xact.c > + > +.if ${MACHINE_CPUARCH} != "i386" > +SRCS+= vmbus_vector.S > +.endif > SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h pci_if.h pcib_if.h > vmbus_if.h > > # XXX: for assym.inc > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Wed Jun 9 11:14:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA32E64BE4B; Wed, 9 Jun 2021 11:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0PdB4qCQz3ttb; Wed, 9 Jun 2021 11:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DAA11B489; Wed, 9 Jun 2021 11:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BEMkl047416; Wed, 9 Jun 2021 11:14:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BEMl8047415; Wed, 9 Jun 2021 11:14:22 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:14:22 GMT Message-Id: <202106091114.159BEMl8047415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 55cc0a478506 - stable/13 - [tcp] Keep socket buffer locked until upcall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 55cc0a478506ee1c2db7b2f9aadb9855e5490af3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:14:22 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=55cc0a478506ee1c2db7b2f9aadb9855e5490af3 commit 55cc0a478506ee1c2db7b2f9aadb9855e5490af3 Author: Richard Scheffenegger AuthorDate: 2021-05-21 09:00:53 +0000 Commit: Richard Scheffenegger CommitDate: 2021-06-09 10:51:19 +0000 [tcp] Keep socket buffer locked until upcall r367492 would unlock the socket buffer before eventually calling the upcall. This leads to problematic interaction with NFS kernel server/client components (MP threads) accessing the socket buffer with potentially not correctly updated state. Reported by: rmacklem Reviewed By: tuexen, #transport Tested by: rmacklem, otis MFC after: 2 weeks Sponsored By: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29690 (cherry picked from commit 032bf749fd44ac5ff20aab2c3d8e3c05491778ea) --- sys/netinet/tcp_input.c | 38 ++++++++++++++------------------ sys/netinet/tcp_reass.c | 2 -- sys/netinet/tcp_stacks/bbr.c | 20 ++++++++--------- sys/netinet/tcp_stacks/rack.c | 20 ++++++++--------- sys/netinet/tcp_stacks/rack_bbr_common.c | 1 - sys/netinet/tcp_var.h | 2 +- 6 files changed, 37 insertions(+), 46 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 5e25b38c45e2..19232218170b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1505,18 +1505,17 @@ tcp_handle_wakeup(struct tcpcb *tp, struct socket *so) * the TIME_WAIT state before coming here, we need * to check if the socket is still connected. */ - if ((so->so_state & SS_ISCONNECTED) == 0) + if (tp == NULL) { return; + } + if (so == NULL) { + return; + } INP_LOCK_ASSERT(tp->t_inpcb); if (tp->t_flags & TF_WAKESOR) { tp->t_flags &= ~TF_WAKESOR; - SOCKBUF_UNLOCK_ASSERT(&so->so_rcv); - sorwakeup(so); - } - if (tp->t_flags & TF_WAKESOW) { - tp->t_flags &= ~TF_WAKESOW; - SOCKBUF_UNLOCK_ASSERT(&so->so_snd); - sowwakeup(so); + SOCKBUF_LOCK_ASSERT(&so->so_rcv); + sorwakeup_locked(so); } } @@ -1894,7 +1893,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, else if (!tcp_timer_active(tp, TT_PERSIST)) tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); if (sbavail(&so->so_snd)) (void) tp->t_fb->tfb_tcp_output(tp); goto check_delack; @@ -1959,8 +1958,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, m_adj(m, drop_hdrlen); /* delayed header drop */ sbappendstream_locked(&so->so_rcv, m, 0); } - SOCKBUF_UNLOCK(&so->so_rcv); - tp->t_flags |= TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); if (DELAY_ACK(tp, tlen)) { tp->t_flags |= TF_DELACK; } else { @@ -2498,9 +2497,11 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, * If segment contains data or ACK, will call tcp_reass() * later; if not, do so now to pass queued data to user. */ - if (tlen == 0 && (thflags & TH_FIN) == 0) + if (tlen == 0 && (thflags & TH_FIN) == 0) { (void) tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); + tcp_handle_wakeup(tp, so); + } tp->snd_wl1 = th->th_seq - 1; /* FALLTHROUGH */ @@ -2952,8 +2953,8 @@ process_ACK: tp->snd_wnd = 0; ourfinisacked = 0; } - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + /* NB: sowwakeup_locked() does an implicit unlock. */ + sowwakeup_locked(so); m_freem(mfree); /* Detect una wraparound. */ if (!IN_RECOVERY(tp->t_flags) && @@ -3174,7 +3175,6 @@ dodata: /* XXX */ m_freem(m); else sbappendstream_locked(&so->so_rcv, m, 0); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; } else { /* @@ -3221,6 +3221,7 @@ dodata: /* XXX */ save_start + tlen); } } + tcp_handle_wakeup(tp, so); #if 0 /* * Note the amount of data that peer has sent into @@ -3244,9 +3245,8 @@ dodata: /* XXX */ */ if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { - socantrcvmore(so); /* The socket upcall is handled by socantrcvmore. */ - tp->t_flags &= ~TF_WAKESOR; + socantrcvmore(so); /* * If connection is half-synchronized * (ie NEEDSYN flag on) then delay ACK, @@ -3310,7 +3310,6 @@ check_delack: tp->t_flags &= ~TF_DELACK; tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); } - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); return; @@ -3344,7 +3343,6 @@ dropafterack: TCP_PROBE3(debug__input, tp, th, m); tp->t_flags |= TF_ACKNOW; (void) tp->t_fb->tfb_tcp_output(tp); - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); m_freem(m); return; @@ -3352,7 +3350,6 @@ dropafterack: dropwithreset: if (tp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } else tcp_dropwithreset(m, th, NULL, tlen, rstreason); @@ -3369,7 +3366,6 @@ drop: #endif TCP_PROBE3(debug__input, tp, th, m); if (tp != NULL) { - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } m_freem(m); diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index e708b6db14c0..5b9255da3acf 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -973,7 +973,6 @@ new_entry: } else { sbappendstream_locked(&so->so_rcv, m, 0); } - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; return (flags); } @@ -1122,7 +1121,6 @@ present: #ifdef TCP_REASS_LOGGING tcp_reass_log_dump(tp); #endif - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; return (flags); } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index a3f7961af345..7d709e33f0d7 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -7829,8 +7829,8 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, acked_amount = min(acked, (int)sbavail(&so->so_snd)); tp->snd_wnd -= acked_amount; mfree = sbcut_locked(&so->so_snd, acked_amount); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + /* NB: sowwakeup_locked() does an implicit unlock. */ + sowwakeup_locked(so); m_freem(mfree); if (SEQ_GT(th->th_ack, tp->snd_una)) { bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp)); @@ -8306,7 +8306,6 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, appended = #endif sbappendstream_locked(&so->so_rcv, m, 0); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) @@ -8358,6 +8357,7 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, save_start + tlen); } } + tcp_handle_wakeup(tp, so); } else { m_freem(m); thflags &= ~TH_FIN; @@ -8369,9 +8369,8 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, */ if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { - socantrcvmore(so); /* The socket upcall is handled by socantrcvmore. */ - tp->t_flags &= ~TF_WAKESOR; + socantrcvmore(so); /* * If connection is half-synchronized (ie NEEDSYN * flag on) then delay ACK, so it may be piggybacked @@ -8562,8 +8561,8 @@ bbr_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, sbappendstream_locked(&so->so_rcv, m, 0); ctf_calc_rwin(so, tp); } - SOCKBUF_UNLOCK(&so->so_rcv); - tp->t_flags |= TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && mcnt != appended) counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); @@ -8754,7 +8753,7 @@ bbr_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, &tcp_savetcp, 0); #endif /* Wake up the socket if we have room to write more */ - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); if (tp->snd_una == tp->snd_max) { /* Nothing left outstanding */ bbr_log_progress_event(bbr, tp, ticks, PROGRESS_CLEAR, __LINE__); @@ -9162,9 +9161,11 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, * If segment contains data or ACK, will call tcp_reass() later; if * not, do so now to pass queued data to user. */ - if (tlen == 0 && (thflags & TH_FIN) == 0) + if (tlen == 0 && (thflags & TH_FIN) == 0) { (void)tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); + tcp_handle_wakeup(tp, so); + } tp->snd_wl1 = th->th_seq - 1; if (bbr_process_ack(m, th, so, tp, to, tiwin, tlen, &ourfinisacked, thflags, &ret_val)) { return (ret_val); @@ -11716,7 +11717,6 @@ bbr_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, retval = bbr_do_segment_nounlock(m, th, so, tp, drop_hdrlen, tlen, iptos, 0, &tv); if (retval == 0) { - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 4a547e900c4f..9203eb8e252d 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -9869,8 +9869,8 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, if (acked_amount && sbavail(&so->so_snd)) rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + /* NB: sowwakeup_locked() does an implicit unlock. */ + sowwakeup_locked(so); m_freem(mfree); if (SEQ_GT(tp->snd_una, tp->snd_recover)) tp->snd_recover = tp->snd_una; @@ -10221,7 +10221,6 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, sbappendstream_locked(&so->so_rcv, m, 0); rack_log_wakeup(tp,rack, &so->so_rcv, tlen, 1); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) @@ -10279,6 +10278,7 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, save_start + tlen); } } + tcp_handle_wakeup(tp, so); } else { m_freem(m); thflags &= ~TH_FIN; @@ -10290,9 +10290,8 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, */ if (thflags & TH_FIN) { if (TCPS_HAVERCVDFIN(tp->t_state) == 0) { - socantrcvmore(so); /* The socket upcall is handled by socantrcvmore. */ - tp->t_flags &= ~TF_WAKESOR; + socantrcvmore(so); /* * If connection is half-synchronized (ie NEEDSYN * flag on) then delay ACK, so it may be piggybacked @@ -10485,7 +10484,6 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, ctf_calc_rwin(so, tp); } rack_log_wakeup(tp,rack, &so->so_rcv, tlen, 1); - SOCKBUF_UNLOCK(&so->so_rcv); tp->t_flags |= TF_WAKESOR; #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && mcnt != appended) @@ -10645,8 +10643,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); m_freem(mfree); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), @@ -11084,9 +11081,11 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, * If segment contains data or ACK, will call tcp_reass() later; if * not, do so now to pass queued data to user. */ - if (tlen == 0 && (thflags & TH_FIN) == 0) + if (tlen == 0 && (thflags & TH_FIN) == 0) { (void) tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); + tcp_handle_wakeup(tp, so); + } tp->snd_wl1 = th->th_seq - 1; /* For syn-recv we need to possibly update the rtt */ if ((to->to_flags & TOF_TS) != 0 && to->to_tsecr) { @@ -13173,8 +13172,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - SOCKBUF_UNLOCK(&so->so_snd); - tp->t_flags |= TF_WAKESOW; + sowwakeup(so); m_freem(mfree); } /* update progress */ diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index 6475a1a01c26..501d29ac48da 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -533,7 +533,6 @@ ctf_do_queued_segments(struct socket *so, struct tcpcb *tp, int have_pkt) /* We lost the tcpcb (maybe a RST came in)? */ return(1); } - tcp_handle_wakeup(tp, so); } return (0); } diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 917e993d79e0..7b51afbb42b6 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -408,7 +408,7 @@ TAILQ_HEAD(tcp_funchead, tcp_function); #define TF_FORCEDATA 0x00800000 /* force out a byte */ #define TF_TSO 0x01000000 /* TSO enabled on this connection */ #define TF_TOE 0x02000000 /* this connection is offloaded */ -#define TF_WAKESOW 0x04000000 /* wake up send socket */ +#define TF_UNUSED0 0x04000000 /* unused */ #define TF_UNUSED1 0x08000000 /* unused */ #define TF_UNUSED2 0x10000000 /* unused */ #define TF_CONGRECOVERY 0x20000000 /* congestion recovery mode */ From owner-dev-commits-src-all@freebsd.org Wed Jun 9 11:14:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3EE664BD44; Wed, 9 Jun 2021 11:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0PdC5WWkz3v2Y; Wed, 9 Jun 2021 11:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3C141B434; Wed, 9 Jun 2021 11:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BENhi047440; Wed, 9 Jun 2021 11:14:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BENSj047439; Wed, 9 Jun 2021 11:14:23 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:14:23 GMT Message-Id: <202106091114.159BENSj047439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 0230e6cf56eb - stable/13 - rack: honor prior socket buffer lock when doing the upcall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0230e6cf56eb6be41b075537a4752b898d27cc1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:14:23 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=0230e6cf56eb6be41b075537a4752b898d27cc1d commit 0230e6cf56eb6be41b075537a4752b898d27cc1d Author: Richard Scheffenegger AuthorDate: 2021-05-21 22:08:56 +0000 Commit: Richard Scheffenegger CommitDate: 2021-06-09 10:51:36 +0000 rack: honor prior socket buffer lock when doing the upcall While partially reverting D24237 with D29690, due to introducing some unintended effects for in-kernel TCP consumers, the preexisting lock on the socket send buffer was not considered properly. Found by: markj MFC after: 2 weeks Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D30390 (cherry picked from commit 39756885633fd9d9649b4cb0f0abf594bfeb8dbb) --- sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 9203eb8e252d..bd17749bbd0e 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10643,7 +10643,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - sowwakeup(so); + sowwakeup_locked(so); m_freem(mfree); tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), @@ -13172,7 +13172,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una); /* Wake up the socket if we have room to write more */ rack_log_wakeup(tp,rack, &so->so_snd, acked, 2); - sowwakeup(so); + sowwakeup_locked(so); m_freem(mfree); } /* update progress */ From owner-dev-commits-src-all@freebsd.org Wed Jun 9 11:14:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3462E64BD4A; Wed, 9 Jun 2021 11:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0PdF0p1Bz3tth; Wed, 9 Jun 2021 11:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD0971B502; Wed, 9 Jun 2021 11:14:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BEObb047471; Wed, 9 Jun 2021 11:14:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BEOTA047470; Wed, 9 Jun 2021 11:14:24 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:14:24 GMT Message-Id: <202106091114.159BEOTA047470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 71b88ee39fc6 - stable/13 - tcp: fix a RACK socket buffer lock issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71b88ee39fc6427b6353e9210710a947a27f383f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:14:25 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=71b88ee39fc6427b6353e9210710a947a27f383f commit 71b88ee39fc6427b6353e9210710a947a27f383f Author: Michael Tuexen AuthorDate: 2021-05-24 18:31:23 +0000 Commit: Richard Scheffenegger CommitDate: 2021-06-09 10:51:50 +0000 tcp: fix a RACK socket buffer lock issue Fix a missing socket buffer unlocking of the socket receive buffer. Reviewed by: gallatin, rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D30402 (cherry picked from commit 9bbd1a8fcb13928cd4b6cfddf0a8359d5dc97451) --- sys/netinet/tcp_stacks/rack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index bd17749bbd0e..f010c958951c 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6063,7 +6063,7 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, /* Push bit must go to the right edge as well */ if (rsm->r_flags & RACK_HAD_PUSH) rsm->r_flags &= ~RACK_HAD_PUSH; - + /* * Now we need to find nrsm's new location in the mbuf chain * we basically calculate a new offset, which is soff + @@ -10492,6 +10492,7 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_handle_delayed_ack(tp, rack, tlen, 0); if (tp->snd_una == tp->snd_max) sack_filter_clear(&rack->r_ctl.rack_sf, tp->snd_una); + tcp_handle_wakeup(tp, so); return (1); } From owner-dev-commits-src-all@freebsd.org Wed Jun 9 11:31:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 999DE64BC76; Wed, 9 Jun 2021 11:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0Q163wG9z3vcm; Wed, 9 Jun 2021 11:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E70B1B475; Wed, 9 Jun 2021 11:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BVcXn073780; Wed, 9 Jun 2021 11:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BVcae073779; Wed, 9 Jun 2021 11:31:38 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:31:38 GMT Message-Id: <202106091131.159BVcae073779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: a664ade93972 - main - tests/netgraph: Fix style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a664ade93972ce617f0888ff79e715dff9cf0f87 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:31:38 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=a664ade93972ce617f0888ff79e715dff9cf0f87 commit a664ade93972ce617f0888ff79e715dff9cf0f87 Author: Lutz Donnerhacke AuthorDate: 2021-06-08 08:46:18 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-09 11:31:16 +0000 tests/netgraph: Fix style Indent all files correctly MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30692 --- tests/sys/netgraph/basic.c | 28 ++++++++----- tests/sys/netgraph/util.c | 100 ++++++++++++++++++++++++--------------------- tests/sys/netgraph/util.h | 58 +++++++++++++++----------- 3 files changed, 105 insertions(+), 81 deletions(-) diff --git a/tests/sys/netgraph/basic.c b/tests/sys/netgraph/basic.c index 6f2e085e4a83..614208ba42a8 100644 --- a/tests/sys/netgraph/basic.c +++ b/tests/sys/netgraph/basic.c @@ -1,4 +1,4 @@ -/* +/*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright 2021 Lutz Donnerhacke @@ -37,17 +37,18 @@ #include "util.h" -static void get_data(void *data, size_t len, void *ctx); +static void get_data(void *data, size_t len, void *ctx); ATF_TC(send_recv); ATF_TC_HEAD(send_recv, conf) { atf_tc_set_md_var(conf, "require.user", "root"); } + ATF_TC_BODY(send_recv, dummy) { - char msg[] = "test"; - int received; + char msg[] = "test"; + int received; ng_init(); ng_connect(".", "a", ".", "b"); @@ -64,10 +65,11 @@ ATF_TC_HEAD(node, conf) { atf_tc_set_md_var(conf, "require.user", "root"); } + ATF_TC_BODY(node, dummy) { - char msg[] = "test"; - int received; + char msg[] = "test"; + int received; ng_init(); ng_mkpeer(".", "a", "hub", "a"); @@ -99,6 +101,7 @@ ATF_TC_HEAD(message, conf) { atf_tc_set_md_var(conf, "require.user", "root"); } + ATF_TC_BODY(message, dummy) { ng_init(); @@ -116,6 +119,7 @@ ATF_TC_HEAD(same_name, conf) { atf_tc_set_md_var(conf, "require.user", "root"); } + ATF_TC_BODY(same_name, dummy) { ng_init(); @@ -139,18 +143,20 @@ ATF_TC_HEAD(queuelimit, conf) { atf_tc_set_md_var(conf, "require.user", "root"); } + ATF_TC_BODY(queuelimit, dummy) { - int received, i; - char msg[] = "test"; - const int MAX = 1000; + int received, i; + char msg[] = "test"; + const int MAX = 1000; ng_init(); ng_connect(".", "a", ".", "b"); ng_register_data("b", get_data); ng_errors(PASS); - for (i = 0; i < MAX; i++) { + for (i = 0; i < MAX; i++) + { ng_send_data("a", msg, sizeof(msg)); if (errno != 0) break; @@ -183,7 +189,7 @@ ATF_TP_ADD_TCS(basic) static void get_data(void *data, size_t len, void *ctx) { - int *cnt = ctx; + int *cnt = ctx; (void)data; printf("Got %zu bytes of data.\n", len); diff --git a/tests/sys/netgraph/util.c b/tests/sys/netgraph/util.c index dbf62599aa04..307bacfa8cc6 100644 --- a/tests/sys/netgraph/util.c +++ b/tests/sys/netgraph/util.c @@ -1,4 +1,4 @@ -/* +/*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright 2021 Lutz Donnerhacke @@ -42,7 +42,7 @@ #include "util.h" -static int cs = -1, ds = -1; +static int cs = -1, ds = -1; static ng_error_t error_handling = FAIL; #define CHECK(r, x) do { \ @@ -54,16 +54,17 @@ static ng_error_t error_handling = FAIL; } \ } while(0) -struct data_handler { - char const *hook; +struct data_handler +{ + char const *hook; ng_data_handler_t handler; - SLIST_ENTRY(data_handler) next; + SLIST_ENTRY(data_handler) next; }; static SLIST_HEAD(, data_handler) data_head = SLIST_HEAD_INITIALIZER(data_head); static ng_msg_handler_t msg_handler = NULL; -static void handle_data(void *ctx); -static void handle_msg(void *ctx); +static void handle_data(void *ctx); +static void handle_msg(void *ctx); void _ng_connect(char const *path1, char const *hook1, @@ -72,29 +73,29 @@ _ng_connect(char const *path1, char const *hook1, { struct ngm_connect c; - strncpy(c.ourhook, hook1, sizeof(c.ourhook)); + strncpy(c.ourhook, hook1, sizeof(c.ourhook)); strncpy(c.peerhook, hook2, sizeof(c.peerhook)); - strncpy(c.path, path2, sizeof(c.path)); + strncpy(c.path, path2, sizeof(c.path)); CHECK(, -1 != NgSendMsg(cs, path1, - NGM_GENERIC_COOKIE, NGM_CONNECT, - &c, sizeof(c))); + NGM_GENERIC_COOKIE, NGM_CONNECT, + &c, sizeof(c))); } void _ng_mkpeer(char const *path1, char const *hook1, - char const *type, char const *hook2, + char const *type, char const *hook2, char const *file, size_t line) { struct ngm_mkpeer p; - strncpy(p.ourhook, hook1, sizeof(p.ourhook)); + strncpy(p.ourhook, hook1, sizeof(p.ourhook)); strncpy(p.peerhook, hook2, sizeof(p.peerhook)); - strncpy(p.type, type, sizeof(p.type)); + strncpy(p.type, type, sizeof(p.type)); CHECK(, -1 != NgSendMsg(cs, path1, - NGM_GENERIC_COOKIE, NGM_MKPEER, - &p, sizeof(p))); + NGM_GENERIC_COOKIE, NGM_MKPEER, + &p, sizeof(p))); } void @@ -106,21 +107,21 @@ _ng_rmhook(char const *path, char const *hook, strncpy(h.ourhook, hook, sizeof(h.ourhook)); CHECK(, -1 != NgSendMsg(cs, path, - NGM_GENERIC_COOKIE, NGM_RMHOOK, - &h, sizeof(h))); + NGM_GENERIC_COOKIE, NGM_RMHOOK, + &h, sizeof(h))); } void _ng_name(char const *path, char const *name, char const *file, size_t line) { - struct ngm_name n; + struct ngm_name n; strncpy(n.name, name, sizeof(n.name)); CHECK(, -1 != NgSendMsg(cs, path, - NGM_GENERIC_COOKIE, NGM_NAME, - &n, sizeof(n))); + NGM_GENERIC_COOKIE, NGM_NAME, + &n, sizeof(n))); } void @@ -128,8 +129,8 @@ _ng_shutdown(char const *path, char const *file, size_t line) { CHECK(, -1 != NgSendMsg(cs, path, - NGM_GENERIC_COOKIE, NGM_SHUTDOWN, - NULL, 0)); + NGM_GENERIC_COOKIE, NGM_SHUTDOWN, + NULL, 0)); } void @@ -152,37 +153,42 @@ _ng_send_data(char const *hook, } void -ng_register_msg(ng_msg_handler_t proc) { +ng_register_msg(ng_msg_handler_t proc) +{ msg_handler = proc; } static void -handle_msg(void *ctx) { +handle_msg(void *ctx) +{ struct ng_mesg *m; - char path[NG_PATHSIZ]; + char path[NG_PATHSIZ]; ATF_REQUIRE(-1 != NgAllocRecvMsg(cs, &m, path)); - if(msg_handler != NULL) - (*msg_handler)(path, m, ctx); + if (msg_handler != NULL) + (*msg_handler) (path, m, ctx); free(m); } static void -handle_data(void *ctx) { - char hook[NG_HOOKSIZ]; +handle_data(void *ctx) +{ + char hook[NG_HOOKSIZ]; struct data_handler *hnd; - u_char *data; - int len; + u_char *data; + int len; ATF_REQUIRE(0 < (len = NgAllocRecvData(ds, &data, hook))); SLIST_FOREACH(hnd, &data_head, next) + { if (0 == strcmp(hnd->hook, hook)) break; + } if (hnd != NULL) - (*(hnd->handler))(data, len, ctx); + (*(hnd->handler)) (data, len, ctx); free(data); } @@ -190,25 +196,26 @@ handle_data(void *ctx) { int ng_handle_event(unsigned int ms, void *context) { - fd_set fds; - int maxfd = (ds < cs) ? cs : ds; - struct timeval timeout = { 0, ms * 1000lu }; + fd_set fds; + int maxfd = (ds < cs) ? cs : ds; + struct timeval timeout = {0, ms * 1000lu}; FD_ZERO(&fds); FD_SET(cs, &fds); FD_SET(ds, &fds); retry: - switch (select(maxfd+1, &fds, NULL, NULL, &timeout)) { + switch (select(maxfd + 1, &fds, NULL, NULL, &timeout)) + { case -1: ATF_REQUIRE_ERRNO(EINTR, 1); goto retry; - case 0: /* timeout */ + case 0: /* timeout */ return 0; - default: /* something to do */ + default: /* something to do */ if (FD_ISSET(cs, &fds)) - handle_msg(context); + handle_msg(context); if (FD_ISSET(ds, &fds)) - handle_data(context); + handle_data(context); return 1; } } @@ -216,7 +223,7 @@ retry: void ng_handle_events(unsigned int ms, void *context) { - while(ng_handle_event(ms, context)) + while (ng_handle_event(ms, context)) ; } @@ -224,7 +231,7 @@ int _ng_send_msg(char const *path, char const *msg, char const *file, size_t line) { - int res; + int res; CHECK(-1, -1 != (res = NgSendAsciiMsg(cs, path, "%s", msg))); return (res); @@ -233,15 +240,16 @@ _ng_send_msg(char const *path, char const *msg, ng_error_t ng_errors(ng_error_t n) { - ng_error_t o = error_handling; + ng_error_t o = error_handling; error_handling = n; return (o); } void -_ng_init(char const *file, size_t line) { - if (cs >= 0) /* prevent reinit */ +_ng_init(char const *file, size_t line) +{ + if (cs >= 0) /* prevent reinit */ return; CHECK(, 0 == NgMkSockNode(NULL, &cs, &ds)); diff --git a/tests/sys/netgraph/util.h b/tests/sys/netgraph/util.h index 41243e15fb10..21ecc68459ea 100644 --- a/tests/sys/netgraph/util.h +++ b/tests/sys/netgraph/util.h @@ -1,4 +1,4 @@ -/* +/*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright 2021 Lutz Donnerhacke @@ -34,54 +34,64 @@ #include -void _ng_connect (char const *path1, char const *hook1, - char const *path2, char const *hook2, - char const *file, size_t line); +void +_ng_connect(char const *path1, char const *hook1, + char const *path2, char const *hook2, + char const *file, size_t line); #define ng_connect(p1,h1,p2,h2) \ _ng_connect(p1,h1,p2,h2,__FILE__,__LINE__) -void _ng_mkpeer (char const *path1, char const *hook1, - char const *type, char const *hook2, - char const *file, size_t line); +void +_ng_mkpeer(char const *path1, char const *hook1, + char const *type, char const *hook2, + char const *file, size_t line); #define ng_mkpeer(p1,h1,t,h2) \ _ng_mkpeer(p1,h1,t,h2,__FILE__,__LINE__) -void _ng_shutdown(char const *path, - char const *file, size_t line); +void +_ng_shutdown(char const *path, + char const *file, size_t line); #define ng_shutdown(p) \ _ng_shutdown(p,__FILE__,__LINE__) -void _ng_rmhook (char const *path, char const *hook, - char const *file, size_t line); +void +_ng_rmhook(char const *path, char const *hook, + char const *file, size_t line); #define ng_rmhook(p,h) \ _ng_rmhook(p,h,__FILE__,__LINE__) -void _ng_name (char const *path, char const *name, - char const *file, size_t line); +void +_ng_name(char const *path, char const *name, + char const *file, size_t line); #define ng_name(p,n) \ _ng_name(p,n,__FILE__,__LINE__) typedef void (*ng_data_handler_t)(void *, size_t, void *ctx); -void ng_register_data(char const *hook, ng_data_handler_t proc); -void _ng_send_data(char const *hook, void const *, size_t, - char const *file, size_t line); +void ng_register_data(char const *hook, ng_data_handler_t proc); +void +_ng_send_data(char const *hook, void const *, size_t, + char const *file, size_t line); #define ng_send_data(h,d,l) \ _ng_send_data(h,d,l,__FILE__,__LINE__) typedef void (*ng_msg_handler_t)(char const *, struct ng_mesg *, void *); -void ng_register_msg(ng_msg_handler_t proc); -int _ng_send_msg(char const *path, char const *msg, - char const *file, size_t line); +void ng_register_msg(ng_msg_handler_t proc); +int +_ng_send_msg(char const *path, char const *msg, + char const *file, size_t line); #define ng_send_msg(p,m) \ _ng_send_msg(p,m,__FILE__,__LINE__) -int ng_handle_event (unsigned int ms, void *ctx); -void ng_handle_events(unsigned int ms, void *ctx); +int ng_handle_event(unsigned int ms, void *ctx); +void ng_handle_events(unsigned int ms, void *ctx); -typedef enum { FAIL, PASS } ng_error_t; -ng_error_t ng_errors(ng_error_t); +typedef enum +{ + FAIL, PASS +} ng_error_t; +ng_error_t ng_errors(ng_error_t); -void _ng_init(char const *file, size_t line); +void _ng_init(char const *file, size_t line); #define ng_init() \ _ng_init(__FILE__,__LINE__) From owner-dev-commits-src-all@freebsd.org Wed Jun 9 11:34:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB9C564C5C7; Wed, 9 Jun 2021 11:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0Q3w4Sbnz3vbm; Wed, 9 Jun 2021 11:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8153E1B726; Wed, 9 Jun 2021 11:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BY4Cg074093; Wed, 9 Jun 2021 11:34:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BY4e4074092; Wed, 9 Jun 2021 11:34:04 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:34:04 GMT Message-Id: <202106091134.159BY4e4074092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 5554abd9cc97 - main - tests/netgraph: Factor out univeral data counter functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5554abd9cc9702af30af90925b33c5efff4e7d88 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:34:04 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=5554abd9cc9702af30af90925b33c5efff4e7d88 commit 5554abd9cc9702af30af90925b33c5efff4e7d88 Author: Lutz Donnerhacke AuthorDate: 2021-06-08 19:45:20 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-09 11:32:22 +0000 tests/netgraph: Factor out univeral data counter functions Factor out the data counter helpers for other tests to use. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30699 --- tests/sys/netgraph/bridge.c | 104 +++++++++++++++++--------------------------- tests/sys/netgraph/util.c | 20 +++++++++ tests/sys/netgraph/util.h | 17 ++++++++ 3 files changed, 78 insertions(+), 63 deletions(-) diff --git a/tests/sys/netgraph/bridge.c b/tests/sys/netgraph/bridge.c index 41d2346b527b..3e3c0f804278 100644 --- a/tests/sys/netgraph/bridge.c +++ b/tests/sys/netgraph/bridge.c @@ -43,11 +43,6 @@ #include "util.h" #include -static void get_data0(void *data, size_t len, void *ctx); -static void get_data1(void *data, size_t len, void *ctx); -static void get_data2(void *data, size_t len, void *ctx); -static void get_data3(void *data, size_t len, void *ctx); - static void get_tablesize(char const *source, struct ng_mesg *msg, void *ctx); struct gettable { @@ -90,7 +85,7 @@ ATF_TC_HEAD(basic, conf) ATF_TC_BODY(basic, dummy) { - int r[4]; + ng_counter_t r; struct gettable rm; ng_init(); @@ -105,7 +100,7 @@ ATF_TC_BODY(basic, dummy) /* do not bounce back */ ng_register_data("a", get_data0); - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; ng_send_data("a", &msg4, sizeof(msg4)); ng_handle_events(50, &r); @@ -114,26 +109,26 @@ ATF_TC_BODY(basic, dummy) /* send to others */ ng_register_data("b", get_data1); ng_register_data("c", get_data2); - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; ng_send_data("a", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1); - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 2; ng_send_data("b", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1); - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 3; ng_send_data("c", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 1 && r[1] == 1 && r[2] == 0); /* send to learned unicast */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; msg4.eh.ether_dhost[5] = 3; ng_send_data("a", &msg4, sizeof(msg4)); @@ -149,7 +144,7 @@ ATF_TC_BODY(basic, dummy) /* remove a link */ ng_rmhook(".", "b"); - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; msg4.eh.ether_dhost[5] = 0; ng_send_data("a", &msg4, sizeof(msg4)); @@ -196,7 +191,8 @@ ATF_TC_HEAD(loop, conf) ATF_TC_BODY(loop, dummy) { - int r[4], i; + ng_counter_t r; + int i; ng_init(); ng_errors(PASS); @@ -221,7 +217,7 @@ ATF_TC_BODY(loop, dummy) */ ng_connect("bridge1:", "link11", "bridge2:", "link11"); - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; ng_send_data("a", &msg4, sizeof(msg4)); ng_handle_events(50, &r); @@ -236,7 +232,7 @@ ATF_TC_BODY(loop, dummy) */ ng_connect("bridge1:", "link12", "bridge2:", "link12"); - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; ng_errors(PASS); ng_send_data("a", &msg4, sizeof(msg4)); @@ -259,7 +255,8 @@ ATF_TC_HEAD(many_unicasts, conf) ATF_TC_BODY(many_unicasts, dummy) { - int r[4], i; + ng_counter_t r; + int i; const int HOOKS = 1000; struct gettable rm; @@ -273,7 +270,7 @@ ATF_TC_BODY(many_unicasts, dummy) ng_register_data("a", get_data0); /* learn MAC */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[3] = 0xff; ng_send_data("a", &msg4, sizeof(msg4)); ng_handle_events(50, &r); @@ -284,7 +281,7 @@ ATF_TC_BODY(many_unicasts, dummy) msg4.eh.ether_dhost[3] = 0xff; /* now send */ - bzero(r, sizeof(r)); + ng_counter_clear(r); for (i = 1; i <= HOOKS; i++) { char hook[20]; @@ -330,7 +327,8 @@ ATF_TC_HEAD(many_broadcasts, conf) ATF_TC_BODY(many_broadcasts, dummy) { - int r[4], i; + ng_counter_t r; + int i; const int HOOKS = 1000; ng_init(); @@ -343,7 +341,7 @@ ATF_TC_BODY(many_broadcasts, dummy) ng_register_data("a", get_data0); /* learn MAC */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[3] = 0xff; ng_send_data("a", &msg4, sizeof(msg4)); ng_handle_events(50, &r); @@ -354,7 +352,7 @@ ATF_TC_BODY(many_broadcasts, dummy) memset(msg4.eh.ether_dhost, 0xff, sizeof(msg4.eh.ether_dhost)); /* now send */ - bzero(r, sizeof(r)); + ng_counter_clear(r); for (i = 1; i <= HOOKS; i++) { char hook[20]; @@ -389,7 +387,7 @@ ATF_TC_HEAD(uplink_private, conf) ATF_TC_BODY(uplink_private, dummy) { - int r[4]; + ng_counter_t r; struct gettable rm; ng_init(); @@ -410,14 +408,14 @@ ATF_TC_BODY(uplink_private, dummy) ng_register_data("l3", get_data3); /* unknown unicast 0 from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; ng_send_data("u1", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1 && r[3] == 0); /* unknown unicast 2 from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; msg4.eh.ether_dhost[5] = 2; ng_send_data("l0", &msg4, sizeof(msg4)); @@ -425,7 +423,7 @@ ATF_TC_BODY(uplink_private, dummy) ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 0); /* known unicast 0 from uplink2 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 2; msg4.eh.ether_dhost[5] = 0; ng_send_data("u2", &msg4, sizeof(msg4)); @@ -433,7 +431,7 @@ ATF_TC_BODY(uplink_private, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); /* known unicast 0 from link3 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 3; msg4.eh.ether_dhost[5] = 0; ng_send_data("l3", &msg4, sizeof(msg4)); @@ -441,7 +439,7 @@ ATF_TC_BODY(uplink_private, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); /* (un)known unicast 2 from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; msg4.eh.ether_dhost[5] = 2; ng_send_data("u1", &msg4, sizeof(msg4)); @@ -449,14 +447,14 @@ ATF_TC_BODY(uplink_private, dummy) ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1 && r[3] == 0); /* (un)known unicast 2 from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; ng_send_data("l0", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 0); /* unknown multicast 2 from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; msg4.eh.ether_dhost[0] = 0xff; ng_send_data("u1", &msg4, sizeof(msg4)); @@ -464,14 +462,14 @@ ATF_TC_BODY(uplink_private, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); /* unknown multicast 2 from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; ng_send_data("l0", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); /* broadcast from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; memset(msg4.eh.ether_dhost, 0xff, sizeof(msg4.eh.ether_dhost)); ng_send_data("u1", &msg4, sizeof(msg4)); @@ -479,7 +477,7 @@ ATF_TC_BODY(uplink_private, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); /* broadcast from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; ng_send_data("l0", &msg4, sizeof(msg4)); ng_handle_events(50, &r); @@ -503,7 +501,7 @@ ATF_TC_HEAD(uplink_classic, conf) ATF_TC_BODY(uplink_classic, dummy) { - int r[4]; + ng_counter_t r; struct gettable rm; ng_init(); @@ -524,14 +522,14 @@ ATF_TC_BODY(uplink_classic, dummy) ng_register_data("l3", get_data3); /* unknown unicast 0 from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; ng_send_data("u1", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); /* unknown unicast 2 from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; msg4.eh.ether_dhost[5] = 2; ng_send_data("l0", &msg4, sizeof(msg4)); @@ -539,7 +537,7 @@ ATF_TC_BODY(uplink_classic, dummy) ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); /* known unicast 0 from uplink2 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 2; msg4.eh.ether_dhost[5] = 0; ng_send_data("u2", &msg4, sizeof(msg4)); @@ -547,7 +545,7 @@ ATF_TC_BODY(uplink_classic, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); /* known unicast 0 from link3 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 3; msg4.eh.ether_dhost[5] = 0; ng_send_data("l3", &msg4, sizeof(msg4)); @@ -555,7 +553,7 @@ ATF_TC_BODY(uplink_classic, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); /* (un)known unicast 2 from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; msg4.eh.ether_dhost[5] = 2; ng_send_data("u1", &msg4, sizeof(msg4)); @@ -563,14 +561,14 @@ ATF_TC_BODY(uplink_classic, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); /* (un)known unicast 2 from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; ng_send_data("l0", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); /* unknown multicast 2 from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; msg4.eh.ether_dhost[0] = 0xff; ng_send_data("u1", &msg4, sizeof(msg4)); @@ -578,14 +576,14 @@ ATF_TC_BODY(uplink_classic, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); /* unknown multicast 2 from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; ng_send_data("l0", &msg4, sizeof(msg4)); ng_handle_events(50, &r); ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1 && r[3] == 1); /* broadcast from uplink1 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 1; memset(msg4.eh.ether_dhost, 0xff, sizeof(msg4.eh.ether_dhost)); ng_send_data("u1", &msg4, sizeof(msg4)); @@ -593,7 +591,7 @@ ATF_TC_BODY(uplink_classic, dummy) ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1 && r[3] == 1); /* broadcast from link0 */ - bzero(r, sizeof(r)); + ng_counter_clear(r); msg4.eh.ether_shost[5] = 0; ng_send_data("l0", &msg4, sizeof(msg4)); ng_handle_events(50, &r); @@ -622,26 +620,6 @@ ATF_TP_ADD_TCS(bridge) return atf_no_error(); } -static inline void -_get_data(void *data, size_t len, void *ctx, int i) -{ - int *cnt = ctx; - - (void)data; - fprintf(stderr, "[%d] Got %zu bytes of data.\n", i, len); - cnt[i]++; -} - -#define GD(x) static void \ -get_data##x(void *data, size_t len, void *ctx) {\ - _get_data(data, len, ctx, x); \ -} - -GD(0) -GD(1) -GD(2) -GD(3) - static void get_tablesize(char const *source, struct ng_mesg *msg, void *ctx) { diff --git a/tests/sys/netgraph/util.c b/tests/sys/netgraph/util.c index 307bacfa8cc6..b25e63dfa76d 100644 --- a/tests/sys/netgraph/util.c +++ b/tests/sys/netgraph/util.c @@ -255,3 +255,23 @@ _ng_init(char const *file, size_t line) CHECK(, 0 == NgMkSockNode(NULL, &cs, &ds)); NgSetDebug(3); } + +#define GD(x) void \ +get_data##x(void *data, size_t len, void *ctx) {\ + int *cnt = ctx; \ + \ + (void)data; \ + (void)len; \ + cnt[x]++; \ +} + +GD(0) +GD(1) +GD(2) +GD(3) +GD(4) +GD(5) +GD(6) +GD(7) +GD(8) +GD(9) diff --git a/tests/sys/netgraph/util.h b/tests/sys/netgraph/util.h index 21ecc68459ea..44c9f3a360a7 100644 --- a/tests/sys/netgraph/util.h +++ b/tests/sys/netgraph/util.h @@ -95,3 +95,20 @@ ng_error_t ng_errors(ng_error_t); void _ng_init(char const *file, size_t line); #define ng_init() \ _ng_init(__FILE__,__LINE__) + +/* Helper function to count received data */ + +typedef int ng_counter_t[10]; +#define ng_counter_clear(x)\ + bzero((x), sizeof(x)) + +void get_data0(void *data, size_t len, void *ctx); +void get_data1(void *data, size_t len, void *ctx); +void get_data2(void *data, size_t len, void *ctx); +void get_data3(void *data, size_t len, void *ctx); +void get_data4(void *data, size_t len, void *ctx); +void get_data5(void *data, size_t len, void *ctx); +void get_data6(void *data, size_t len, void *ctx); +void get_data7(void *data, size_t len, void *ctx); +void get_data8(void *data, size_t len, void *ctx); +void get_data9(void *data, size_t len, void *ctx); From owner-dev-commits-src-all@freebsd.org Wed Jun 9 11:39:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B08E064C322; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0QBG4cVLz3vr7; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 826C21BA01; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159BdY1I074558; Wed, 9 Jun 2021 11:39:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BdYta074557; Wed, 9 Jun 2021 11:39:34 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:39:34 GMT Message-Id: <202106091139.159BdYta074557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 7863faa78ae2 - main - tests/netgraph: Tests for ng_hub MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7863faa78ae271017c404c635b2a9d07379d4316 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:39:34 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=7863faa78ae271017c404c635b2a9d07379d4316 commit 7863faa78ae271017c404c635b2a9d07379d4316 Author: Lutz Donnerhacke AuthorDate: 2021-06-03 22:22:29 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-09 11:36:23 +0000 tests/netgraph: Tests for ng_hub Test functionality of ng_hub(4): - replicting traffic to anything but the sending hook - persistence - an unrestricted loop - implementation limits with many hooks. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30633 --- tests/sys/netgraph/Makefile | 2 + tests/sys/netgraph/hub.c | 231 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 233 insertions(+) diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile index 7376cb5c1227..2ae9882b2bc3 100644 --- a/tests/sys/netgraph/Makefile +++ b/tests/sys/netgraph/Makefile @@ -12,9 +12,11 @@ TEST_METADATA.ng_macfilter_test+= required_programs="perl" ATF_TESTS_C+= basic \ bridge \ + hub \ SRCS.basic= basic.c util.c SRCS.bridge= bridge.c util.c +SRCS.hub= hub.c util.c LIBADD+= netgraph diff --git a/tests/sys/netgraph/hub.c b/tests/sys/netgraph/hub.c new file mode 100644 index 000000000000..08d083ad9605 --- /dev/null +++ b/tests/sys/netgraph/hub.c @@ -0,0 +1,231 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2021 Lutz Donnerhacke + * + * 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. + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 +#include +#include + +#include "util.h" + +ATF_TC(basic); +ATF_TC_HEAD(basic, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(basic, dummy) +{ + char msg[] = "test"; + ng_counter_t r; + + ng_errors(PASS); + ng_shutdown("hub:"); + ng_errors(FAIL); + + ng_init(); + ng_mkpeer(".", "a", "hub", "a"); + ng_name("a", "hub"); + ng_connect(".", "b", "hub:", "b"); + ng_connect(".", "c", "hub:", "c"); + + /* do not bounce back */ + ng_register_data("a", get_data0); + ng_counter_clear(r); + ng_send_data("a", msg, sizeof(msg)); + ng_handle_events(50, r); + ATF_CHECK(r[0] == 0); + + /* send to others */ + ng_register_data("b", get_data0); + ng_register_data("c", get_data0); + ng_counter_clear(r); + ng_send_data("a", msg, sizeof(msg)); + ng_handle_events(50, r); + ATF_CHECK(r[0] == 2); + + ng_counter_clear(r); + ng_send_data("b", msg, sizeof(msg)); + ng_handle_events(50, r); + ATF_CHECK(r[0] == 2); + + ng_counter_clear(r); + ng_send_data("c", msg, sizeof(msg)); + ng_handle_events(50, r); + ATF_CHECK(r[0] == 2); + + /* remove a link */ + ng_rmhook(".", "b"); + ng_counter_clear(r); + ng_send_data("a", msg, sizeof(msg)); + ng_handle_events(50, r); + ATF_CHECK(r[0] == 1); + + ng_shutdown("hub:"); +} + +ATF_TC(persistence); +ATF_TC_HEAD(persistence, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(persistence, dummy) +{ + ng_errors(PASS); + ng_shutdown("hub:"); + ng_errors(FAIL); + + ng_init(); + ng_mkpeer(".", "a", "hub", "a"); + ng_name("a", "hub"); + + ng_send_msg("hub:", "setpersistent"); + ng_rmhook(".", "a"); + + ng_shutdown("hub:"); +} + +ATF_TC(loop); +ATF_TC_HEAD(loop, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(loop, dummy) +{ + ng_counter_t r; + int i; + char msg[] = "LOOP Alert!"; + + ng_errors(PASS); + ng_shutdown("hub1:"); + ng_shutdown("hub2:"); + ng_errors(FAIL); + + ng_init(); + ng_mkpeer(".", "a", "hub", "a"); + ng_name("a", "hub1"); + ng_mkpeer(".", "b", "hub", "b"); + ng_name("b", "hub2"); + + ng_register_data("a", get_data0); + ng_register_data("b", get_data0); + + /*- + * Open loop + * + * /-- hub1 + * . < | + * \-- hub2 + */ + ng_connect("hub1:", "xc1", "hub2:", "xc1"); + + ng_counter_clear(r); + ng_send_data("a", msg, sizeof(msg)); + ng_handle_events(50, r); + ATF_CHECK(r[0] == 1); + + /*- + * Closed loop, DANGEROUS! + * + * /-- hub1 -\ + * . < | | + * \-- hub2 -/ + */ + ng_connect("hub1:", "xc2", "hub2:", "xc2"); + + ng_counter_clear(r); + ng_send_data("a", msg, sizeof(msg)); + for (i = 0; i < 10; i++) /* don't run forever */ + if (!ng_handle_event(50, r)) + break; + ATF_CHECK(r[0] > 7); + + ng_shutdown("hub1:"); + ng_shutdown("hub2:"); +} + +ATF_TC(many_hooks); +ATF_TC_HEAD(many_hooks, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(many_hooks, dummy) +{ + ng_counter_t r; + int i; + char msg[] = "test"; + const int HOOKS = 1000; + + ng_errors(PASS); + ng_shutdown("hub:"); + ng_errors(FAIL); + + ng_init(); + ng_mkpeer(".", "a", "hub", "a"); + ng_name("a", "hub"); + + ng_register_data("a", get_data0); + ng_counter_clear(r); + for (i = 0; i < HOOKS; i++) + { + char hook[20]; + + snprintf(hook, sizeof(hook), "hook%d", i); + ng_connect(".", hook, "hub:", hook); + ng_errors(PASS); + ng_send_data(hook, msg, sizeof(msg)); + ng_errors(FAIL); + if (errno != 0) + break; + ng_handle_events(50, r); + } + ATF_CHECK(r[0] > 100); + atf_tc_expect_fail("Implementation limitation (%d)", i); + ATF_CHECK(r[0] == HOOKS); + atf_tc_expect_pass(); + + ng_shutdown("hub:"); +} + + +ATF_TP_ADD_TCS(hub) +{ + ATF_TP_ADD_TC(hub, basic); + ATF_TP_ADD_TC(hub, loop); + ATF_TP_ADD_TC(hub, persistence); + ATF_TP_ADD_TC(hub, many_hooks); + + return atf_no_error(); +} From owner-dev-commits-src-all@freebsd.org Wed Jun 9 11:46:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EF1E64C726; Wed, 9 Jun 2021 11:46:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0QLc0s9dz3wJF; Wed, 9 Jun 2021 11:46:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01C5D1BA19; Wed, 9 Jun 2021 11:46:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159Bkldd087259; Wed, 9 Jun 2021 11:46:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159BklZV087258; Wed, 9 Jun 2021 11:46:47 GMT (envelope-from git) Date: Wed, 9 Jun 2021 11:46:47 GMT Message-Id: <202106091146.159BklZV087258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 6b08e68be111 - main - tests/netgraph: Tests for ng_vlan_rotate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b08e68be111d50931b0d30145f8b7e3402decaf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 11:46:48 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=6b08e68be111d50931b0d30145f8b7e3402decaf commit 6b08e68be111d50931b0d30145f8b7e3402decaf Author: Lutz Donnerhacke AuthorDate: 2021-06-06 23:56:12 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-09 11:45:37 +0000 tests/netgraph: Tests for ng_vlan_rotate Test functionality of ng_vlan_rotate(4): - Rotate 1 to 9 stagged vlans in any possible direction and length - Rotate random combinations of ethertypes (8100, 88a8, 9100) - Automatic reverse rotating for backward data flow - Test too many and to few vlans Reviewed by: kp (earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30670 --- tests/sys/netgraph/Makefile | 8 +- tests/sys/netgraph/vlan_rotate.c | 335 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 340 insertions(+), 3 deletions(-) diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile index 2ae9882b2bc3..f397e66a22bc 100644 --- a/tests/sys/netgraph/Makefile +++ b/tests/sys/netgraph/Makefile @@ -10,13 +10,15 @@ TAP_TESTS_SH+= ng_macfilter_test TEST_METADATA.ng_macfilter_test+= required_user="root" TEST_METADATA.ng_macfilter_test+= required_programs="perl" -ATF_TESTS_C+= basic \ - bridge \ - hub \ +ATF_TESTS_C+= basic \ + bridge \ + hub \ + vlan_rotate \ SRCS.basic= basic.c util.c SRCS.bridge= bridge.c util.c SRCS.hub= hub.c util.c +SRCS.vlan_rotate=vlan_rotate.c util.c LIBADD+= netgraph diff --git a/tests/sys/netgraph/vlan_rotate.c b/tests/sys/netgraph/vlan_rotate.c new file mode 100644 index 000000000000..8df3ab981a7c --- /dev/null +++ b/tests/sys/netgraph/vlan_rotate.c @@ -0,0 +1,335 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2021 Lutz Donnerhacke + * + * 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. + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 +#include +#include +#include + +#include +#include + +#include "util.h" +#include + +struct vlan +{ + uint16_t proto; + uint16_t tag; +} __packed; + +struct frame +{ + u_char dst[ETHER_ADDR_LEN]; + u_char src[ETHER_ADDR_LEN]; + struct vlan vlan[10]; +} __packed; + +static struct frame msg = { + .src = {2, 4, 6, 1, 3, 5}, + .dst = {2, 4, 6, 1, 3, 7}, + .vlan[0] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(1, 0, 0))}, + .vlan[1] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(2, 0, 0))}, + .vlan[2] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(3, 0, 0))}, + .vlan[3] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(4, 0, 0))}, + .vlan[4] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(5, 0, 0))}, + .vlan[5] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(6, 0, 0))}, + .vlan[6] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(7, 0, 0))}, + .vlan[7] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(8, 0, 0))}, + .vlan[8] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(9, 0, 0))}, + .vlan[9] = {0} +}; + +static void _basic(int); +static void get_vlan(void *data, size_t len, void *ctx); + +static void +get_vlan(void *data, size_t len, void *ctx) +{ + int *v = ctx, i; + struct frame *f = data; + + (void)len; + for (i = 0; i < 10; i++) + v[i] = EVL_VLANOFTAG(ntohs(f->vlan[i].tag)); +} + +static void +_basic(int direction) +{ + int r[10]; + int i, rot, len; + + ng_init(); + ng_errors(PASS); + ng_shutdown("vr:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "vlan_rotate", direction > 0 ? "original" : "ordered"); + ng_name("a", "vr"); + ng_connect(".", "b", "vr:", direction > 0 ? "ordered" : "original"); + ng_register_data("b", get_vlan); + + for (len = 9; len > 0; len--) + { + /* reduce the number of vlans */ + msg.vlan[len].proto = htons(ETHERTYPE_IP); + + for (rot = -len + 1; rot < len; rot++) + { + char cmd[40]; + + /* set rotation offset */ + snprintf(cmd, sizeof(cmd), "setconf { min=0 max=9 rot=%d }", rot); + ng_send_msg("vr:", cmd); + + ng_send_data("a", &msg, sizeof(msg)); + ng_handle_events(50, &r); + + /* check rotation */ + for (i = 0; i < len; i++) + { + int expect = (2 * len + i - direction * rot) % len + 1; + int vlan = r[i]; + + ATF_CHECK_MSG(vlan == expect, + "len=%d rot=%d i=%d -> vlan=%d, expect=%d", + len, rot, i, r[i], expect); + } + } + } + + ng_shutdown("vr:"); +} + +ATF_TC(basic); +ATF_TC_HEAD(basic, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(basic, dummy) +{ + _basic(1); +} + +ATF_TC(reverse); +ATF_TC_HEAD(reverse, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(reverse, dummy) +{ + _basic(-1); +} + +static void _ethertype(int); +static void get_ethertype(void *data, size_t len, void *ctx); + +static void +get_ethertype(void *data, size_t len, void *ctx) +{ + int *v = ctx, i; + struct frame *f = data; + + (void)len; + for (i = 0; i < 10; i++) + v[i] = ntohs(f->vlan[i].proto); +} + +static void +_ethertype(int direction) +{ + int r[10]; + int i, rounds = 20; + + ng_init(); + ng_errors(PASS); + ng_shutdown("vr:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "vlan_rotate", direction > 0 ? "original" : "ordered"); + ng_name("a", "vr"); + ng_connect(".", "b", "vr:", direction > 0 ? "ordered" : "original"); + ng_register_data("b", get_ethertype); + + while (rounds-- > 0) + { + char cmd[40]; + int len = 9; + int rot = rand() % (2 * len - 1) - len + 1; + int vlan[10]; + + for (i = 0; i < len; i++) + { + switch (rand() % 3) + { + default: + msg.vlan[i].proto = htons(ETHERTYPE_VLAN); + break; + case 1: + msg.vlan[i].proto = htons(ETHERTYPE_QINQ); + break; + case 2: + msg.vlan[i].proto = htons(ETHERTYPE_8021Q9100); + break; + } + } + msg.vlan[i].proto = htons(ETHERTYPE_IP); + + for (i = 0; i < len; i++) + vlan[i] = msg.vlan[i].proto; + + snprintf(cmd, sizeof(cmd), "setconf { min=0 max=9 rot=%d }", rot); + ng_send_msg("vr:", cmd); + + bzero(r, sizeof(r)); + ng_send_data("a", &msg, sizeof(msg)); + ng_handle_events(50, &r); + + /* check rotation */ + for (i = 0; i < len; i++) + { + int expect = (2 * len + i - direction * rot) % len; + + ATF_CHECK_MSG(r[i] == ntohs(vlan[expect]), + "len=%d rot=%d i=%d -> vlan=%04x, expect(%d)=%04x", + len, rot, i, ntohs(r[i]), expect, vlan[expect]); + } + } + + ng_shutdown("vr:"); +} + +ATF_TC(ethertype); +ATF_TC_HEAD(ethertype, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(ethertype, dummy) +{ + _ethertype(1); +} + +ATF_TC(typeether); +ATF_TC_HEAD(typeether, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(typeether, dummy) +{ + _ethertype(-1); +} + +ATF_TC(minmax); +ATF_TC_HEAD(minmax, conf) +{ + atf_tc_set_md_var(conf, "require.user", "root"); +} + +ATF_TC_BODY(minmax, dummy) +{ + ng_counter_t r; + int len; + + ng_init(); + ng_errors(PASS); + ng_shutdown("vr:"); + ng_errors(FAIL); + + ng_mkpeer(".", "a", "vlan_rotate", "original"); + ng_name("a", "vr"); + ng_connect(".", "b", "vr:", "ordered"); + ng_connect(".", "c", "vr:", "excessive"); + ng_connect(".", "d", "vr:", "incomplete"); + ng_register_data("a", get_data0); + ng_register_data("b", get_data1); + ng_register_data("c", get_data2); + ng_register_data("d", get_data3); + + ng_send_msg("vr:", "setconf { min=3 max=7 rot=0 }"); + for (len = 9; len > 0; len--) + { + /* reduce the number of vlans */ + msg.vlan[len].proto = htons(ETHERTYPE_IP); + + ng_counter_clear(r); + ng_send_data("a", &msg, sizeof(msg)); + ng_handle_events(50, &r); + if (len < 3) + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 0 && r[3] == 1); + else if (len > 7) + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1 && r[3] == 0); + else + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 0 && r[3] == 0); + + ng_counter_clear(r); + ng_send_data("b", &msg, sizeof(msg)); + ng_handle_events(50, &r); + if (len < 3) + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 0 && r[3] == 1); + else if (len > 7) + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1 && r[3] == 0); + else + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); + + ng_counter_clear(r); + ng_send_data("c", &msg, sizeof(msg)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); + + ng_counter_clear(r); + ng_send_data("d", &msg, sizeof(msg)); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 0 && r[3] == 0); + } + + ng_shutdown("vr:"); +} + +ATF_TP_ADD_TCS(vlan_rotate) +{ + /* Use "dd if=/dev/random bs=2 count=1 | od -x" to reproduce */ + srand(0xb93b); + + ATF_TP_ADD_TC(vlan_rotate, basic); + ATF_TP_ADD_TC(vlan_rotate, ethertype); + ATF_TP_ADD_TC(vlan_rotate, reverse); + ATF_TP_ADD_TC(vlan_rotate, typeether); + ATF_TP_ADD_TC(vlan_rotate, minmax); + + return atf_no_error(); +} From owner-dev-commits-src-all@freebsd.org Wed Jun 9 13:01:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A43A64DC85; Wed, 9 Jun 2021 13:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0S0z2y5Dz4Wvt; Wed, 9 Jun 2021 13:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DCF01CCFE; Wed, 9 Jun 2021 13:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159D1d2P092789; Wed, 9 Jun 2021 13:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159D1d97092788; Wed, 9 Jun 2021 13:01:39 GMT (envelope-from git) Date: Wed, 9 Jun 2021 13:01:39 GMT Message-Id: <202106091301.159D1d97092788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 334335cb14d4 - main - i386: Add "options HYPERV" to NOTES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 334335cb14d4754d45265d19cd3c6e7708cca0c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 13:01:39 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=334335cb14d4754d45265d19cd3c6e7708cca0c1 commit 334335cb14d4754d45265d19cd3c6e7708cca0c1 Author: Mark Johnston AuthorDate: 2021-06-09 12:58:45 +0000 Commit: Mark Johnston CommitDate: 2021-06-09 13:01:22 +0000 i386: Add "options HYPERV" to NOTES This unbreaks the LINT build. Fixes: 97993d1ebf Reported by: mjg MFC after: 13 days --- sys/i386/conf/NOTES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 81d2140ebfa5..e02426df2df2 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -719,7 +719,8 @@ device virtio_balloon # VirtIO Memory Balloon device device virtio_random # VirtIO Entropy device device virtio_console # VirtIO Console device -device hyperv # HyperV drivers +options HYPERV +device hyperv # HyperV drivers ##################################################################### From owner-dev-commits-src-all@freebsd.org Wed Jun 9 13:17:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE78164DF81 for ; Wed, 9 Jun 2021 13:17:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0SM13wv0z4Y9d; Wed, 9 Jun 2021 13:17:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id qy52lIB3bycp5qy53l9oTR; Wed, 09 Jun 2021 07:17:15 -0600 X-Authority-Analysis: v=2.4 cv=H864f8Ui c=1 sm=1 tr=0 ts=60c0bf5b a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=r6YtysWOX24A:10 a=7ASnObcnAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=SfLyrcBf43hk1FulhhkA:9 a=CjuIK1q_8ugA:10 a=pj5rz7AvTRnaHDIeLm0D:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 41E20588; Wed, 9 Jun 2021 06:17:11 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 159DH9U5013332; Wed, 9 Jun 2021 06:17:11 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202106091317.159DH9U5013332@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Emmanuel Vadot cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org Subject: Re: git: 40c7ff83e74e - vendor/wpa - wpa: Import wpa_supplicant/hostapd commit e8662e9d4 In-reply-to: <20210609090415.507c477968bce2efce9e9ff8@bidouilliste.com> References: <202106031638.153GcGhh069766@gitrepo.freebsd.org> <20210609090415.507c477968bce2efce9e9ff8@bidouilliste.com> Comments: In-reply-to Emmanuel Vadot message dated "Wed, 09 Jun 2021 09:04:15 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 09 Jun 2021 06:17:09 -0700 X-CMAE-Envelope: MS4xfHwRpL8FXlimkt8ggxTex8uJ/uX1oD5VcaxXkZkdh2Gn+57t9LYoXomnJaAzlP4KPlI7lwOFEwfqs497qUZUyzM1nXZsP6kNsNX639TWRtw1VfLEQBhm nnj0RBmf84yrTMUPnAsfoJrmNqwxOP87NAh9RorUVN6A3cOrI2K9LZBop1lx3um/9AYTjlFKlUEFNe4+pfcpAg5usFrCK3tDKxJolJDlY+kWR5jSet5CkXVt p+3M19zO0Cbb9p7B4Cesn+05JHJYlw0dX2gZxhZ8yQtDmm7tUqV5KAI0V67HrX2w0cUv0aCPw/ZcqGLZF6d9wA== X-Rspamd-Queue-Id: 4G0SM13wv0z4Y9d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 13:17:18 -0000 In message <20210609090415.507c477968bce2efce9e9ff8@bidouilliste.com>, Emmanuel Vadot writes: > On Thu, 3 Jun 2021 16:38:16 GMT > Cy Schubert wrote: > > > The branch vendor/wpa has been updated by cy: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=40c7ff83e74eabba5a7e2caefeea12 > 372b2d3f9a > > > > commit 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a > > Author: Cy Schubert > > AuthorDate: 2021-06-03 16:15:01 +0000 > > Commit: Cy Schubert > > CommitDate: 2021-06-03 16:15:01 +0000 > > > > wpa: Import wpa_supplicant/hostapd commit e8662e9d4 > > > > This is the June update to vendor/wpa committed upstream 2021/06/03. > > Hi cy@ > > Don't know if it is this commit or something else yet but I'm seeing > weird behavior from a recent head. > wpa_supplicant abort with SIGBUS just after connecting to my wireless > network. I'm still connected but this stopped working after a while (I > guess when the supplicant would need to do some stuff with the AP or > something). > From dmesg just after running service netif restart: > lo0: link state changed to DOWN > wlan0: link state changed to DOWN > wlan0: Ethernet address: bc:54:2f:4b:d1:dd > lo0: link state changed to UP > wlan0: link state changed to UP > pid 69593 (wpa_supplicant), jid 0, uid 0: exited on signal 10 (core > dumped) > > Reading symbols from /usr/sbin/wpa_supplicant... > Reading symbols from /usr/lib/debug//usr/sbin/wpa_supplicant.debug... > [New LWP 112604] > Core was generated by `/usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_su > pplicant.conf -D bsd -P /v'. > Program terminated with signal SIGBUS, Bus error. > #0 0x00000000010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/l > ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304 > 304 /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wp > a_i.h: No such file or directory. > (gdb) bt > #0 0x00000000010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/l > ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304 > #1 wpa_supplicant_process_3_of_4 (sm=0x801e12700, key=, ver=< > optimized out>, key_data=, key_data_len=) > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa > .c:1572 > #2 wpa_sm_rx_eapol (sm=, src_addr=, buf= ized out>, len=) > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa > .c:2434 > #3 0x00000000010e372e in l2_packet_receive (sock=, eloop_ctx= > 0x801e286e0, sock_ctx=) > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/l2_packet/l2 > _packet_freebsd.c:98 > #4 0x0000000001112b23 in eloop_sock_table_dispatch (table=, f > ds=0x801e44080) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/ > utils/eloop.c:600 > #5 eloop_run () at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src > /utils/eloop.c:1223 > #6 0x00000000010af228 in wpa_supplicant_run (global=, global@ > entry=0x801e2d000) > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/w > pa_supplicant.c:6526 > #7 0x000000000109ab6c in main (argc=, argv=) a > t /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/main.c > :397 > > I'll try to revert the update later this week but if you have any idea in th > e mean time. Hi Emmanuel, The commit you quote was only to the vendor branch which has not landed in main yet. However the SIGBUS you have been experiencing, a SIBGUS at line 304 of wpa_i.h, caused by 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 and fixed by the following commit: commit 9a0f82285322a338548d13fcda07e1d574301190 Author: Cy Schubert Date: Wed Jun 2 12:46:02 2021 -0700 wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload Incorrectly linked built-in wpa functions resulted in overwriting sm->ctx->set_rekey_offload with garbage. It was initialized correctly however it changed after wpa_supplicant became a daemon. No SIGBUS violations reported by dhw@ were experienced during testing of the original commit by msyelf or philip@. Reported by: dhw Tested by: dhw MFC after: 2 months X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 If you already have 9a0f82285322a338548d13fcda07e1d574301190 applied and do -DWITHOUT_CLEAN builds and still have the SIGBUS, rm -r /usr/obj/${ARCH}/usr.sbin/wpa will remove incorrectly built .a files and rebuild. They will rebuild correctly and the SIBGUS will resolve. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Wed Jun 9 13:45:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B497064E4D8 for ; Wed, 9 Jun 2021 13:45:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0Szl0L4Zz4bLZ; Wed, 9 Jun 2021 13:45:38 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1623246336; 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=TOzZGthM6zy+V/ppuUNSiAvtlMkRYBBN35ZBp9O1rSA=; b=nxYTVsWiU6B+gvWt6qExDpG4cSUKtWfG2FP8QgoZqB799k02zj+vi/bVhABhiVySGnflyf 6VGCNqNPVddieBt5S5Lwa3zhiGtFvyjyfDF/leQrYjQSdcJ2z3H2OXhWDDGRN6HvI1Y4iv ENSpl2/tRt+vWgcEpfQAyiFGxep0JSI= Received: from skull.home.blih.net (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 6d667015 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 9 Jun 2021 13:45:36 +0000 (UTC) Date: Wed, 9 Jun 2021 15:45:33 +0200 From: Emmanuel Vadot To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org Subject: Re: git: 40c7ff83e74e - vendor/wpa - wpa: Import wpa_supplicant/hostapd commit e8662e9d4 Message-Id: <20210609154533.4931d8af823b95384b097650@bidouilliste.com> In-Reply-To: <202106091317.159DH9U5013332@slippy.cwsent.com> References: <202106031638.153GcGhh069766@gitrepo.freebsd.org> <20210609090415.507c477968bce2efce9e9ff8@bidouilliste.com> <202106091317.159DH9U5013332@slippy.cwsent.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4G0Szl0L4Zz4bLZ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=nxYTVsWi; 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 [0.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; FREEFALL_USER(0.00)[manu]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[212.83.155.74:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(1.00)[0.999]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.83.155.74:from]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 13:45:40 -0000 On Wed, 09 Jun 2021 06:17:09 -0700 Cy Schubert wrote: > In message <20210609090415.507c477968bce2efce9e9ff8@bidouilliste.com>, > Emmanuel > Vadot writes: > > On Thu, 3 Jun 2021 16:38:16 GMT > > Cy Schubert wrote: > > > > > The branch vendor/wpa has been updated by cy: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=40c7ff83e74eabba5a7e2caefeea12 > > 372b2d3f9a > > > > > > commit 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a > > > Author: Cy Schubert > > > AuthorDate: 2021-06-03 16:15:01 +0000 > > > Commit: Cy Schubert > > > CommitDate: 2021-06-03 16:15:01 +0000 > > > > > > wpa: Import wpa_supplicant/hostapd commit e8662e9d4 > > > > > > This is the June update to vendor/wpa committed upstream 2021/06/03. > > > > Hi cy@ > > > > Don't know if it is this commit or something else yet but I'm seeing > > weird behavior from a recent head. > > wpa_supplicant abort with SIGBUS just after connecting to my wireless > > network. I'm still connected but this stopped working after a while (I > > guess when the supplicant would need to do some stuff with the AP or > > something). > > From dmesg just after running service netif restart: > > lo0: link state changed to DOWN > > wlan0: link state changed to DOWN > > wlan0: Ethernet address: bc:54:2f:4b:d1:dd > > lo0: link state changed to UP > > wlan0: link state changed to UP > > pid 69593 (wpa_supplicant), jid 0, uid 0: exited on signal 10 (core > > dumped) > > > > Reading symbols from /usr/sbin/wpa_supplicant... > > Reading symbols from /usr/lib/debug//usr/sbin/wpa_supplicant.debug... > > [New LWP 112604] > > Core was generated by `/usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_su > > pplicant.conf -D bsd -P /v'. > > Program terminated with signal SIGBUS, Bus error. > > #0 0x00000000010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/l > > ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304 > > 304 /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wp > > a_i.h: No such file or directory. > > (gdb) bt > > #0 0x00000000010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/l > > ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304 > > #1 wpa_supplicant_process_3_of_4 (sm=0x801e12700, key=, ver=< > > optimized out>, key_data=, key_data_len=) > > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa > > .c:1572 > > #2 wpa_sm_rx_eapol (sm=, src_addr=, buf= > ized out>, len=) > > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa > > .c:2434 > > #3 0x00000000010e372e in l2_packet_receive (sock=, eloop_ctx= > > 0x801e286e0, sock_ctx=) > > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/l2_packet/l2 > > _packet_freebsd.c:98 > > #4 0x0000000001112b23 in eloop_sock_table_dispatch (table=, f > > ds=0x801e44080) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/ > > utils/eloop.c:600 > > #5 eloop_run () at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src > > /utils/eloop.c:1223 > > #6 0x00000000010af228 in wpa_supplicant_run (global=, global@ > > entry=0x801e2d000) > > at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/w > > pa_supplicant.c:6526 > > #7 0x000000000109ab6c in main (argc=, argv=) a > > t /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/main.c > > :397 > > > > I'll try to revert the update later this week but if you have any idea in th > > e mean time. > > Hi Emmanuel, > > The commit you quote was only to the vendor branch which has not landed in > main yet. However the SIGBUS you have been experiencing, a SIBGUS at line > 304 of wpa_i.h, caused by 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 and > fixed by the following commit: > > commit 9a0f82285322a338548d13fcda07e1d574301190 > Author: Cy Schubert > Date: Wed Jun 2 12:46:02 2021 -0700 > > wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload > > Incorrectly linked built-in wpa functions resulted in overwriting > sm->ctx->set_rekey_offload with garbage. It was initialized correctly > however it changed after wpa_supplicant became a daemon. > > No SIGBUS violations reported by dhw@ were experienced during testing > of the original commit by msyelf or philip@. > > Reported by: dhw > Tested by: dhw > MFC after: 2 months > X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 > > If you already have 9a0f82285322a338548d13fcda07e1d574301190 applied and do > -DWITHOUT_CLEAN builds and still have the SIGBUS, rm -r > /usr/obj/${ARCH}/usr.sbin/wpa will remove incorrectly built .a files and > rebuild. They will rebuild correctly and the SIBGUS will resolve. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > The need of the many outweighs the greed of the few. > > Ok, will try a build without WITHOUT_CLEAN=y and let you know if I still have problems after. Thanks, -- Emmanuel Vadot From owner-dev-commits-src-all@freebsd.org Wed Jun 9 15:04:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B45464EE55; Wed, 9 Jun 2021 15:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0VkL3xRrz4mqn; Wed, 9 Jun 2021 15:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D9BF1E536; Wed, 9 Jun 2021 15:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159F4AXH051672; Wed, 9 Jun 2021 15:04:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159F4AdN051671; Wed, 9 Jun 2021 15:04:10 GMT (envelope-from git) Date: Wed, 9 Jun 2021 15:04:10 GMT Message-Id: <202106091504.159F4AdN051671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 5e5ca4c8fc53 - main - nfscl: Add a "has acquired a delegation" flag for delegations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e5ca4c8fc53d31bf71e182e08c4ccd8290428c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 15:04:10 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5e5ca4c8fc53d31bf71e182e08c4ccd8290428c7 commit 5e5ca4c8fc53d31bf71e182e08c4ccd8290428c7 Author: Rick Macklem AuthorDate: 2021-06-09 15:00:43 +0000 Commit: Rick Macklem CommitDate: 2021-06-09 15:00:43 +0000 nfscl: Add a "has acquired a delegation" flag for delegations A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. For a common case where delegations are not being issued by the NFSv4 server, the code acquires the mutex lock for open/lock state, finds the delegation list empty and just unlocks the mutex and returns. This patch adds an NFS mount point flag that is set when a delegation is issued for the mount. Then the patched code checks for this flag before acquiring the open/lock mutex, avoiding the need to acquire the lock for the case where delegations are not being issued by the NFSv4 server. This change appears to be performance neutral for a small number of opens, but should reduce lock contention for a large number of opens for the common case where server is not issuing delegations. This commit should not affect the high level semantics of delegation handling. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clstate.c | 44 +++++++++++++++++++++++++++++++++++++++--- sys/fs/nfsclient/nfsmount.h | 1 + 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 5e4ac2ae9d4d..0659e77289e9 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -438,20 +438,32 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) { struct nfscldeleg *dp = *dpp, *tdp; + struct nfsmount *nmp; + KASSERT(mp != NULL, ("nfscl_deleg: mp NULL")); + nmp = VFSTONFS(mp); /* * First, if we have received a Read delegation for a file on a * read/write file system, just return it, because they aren't * useful, imho. */ - if (mp != NULL && dp != NULL && !NFSMNT_RDONLY(mp) && + if (dp != NULL && !NFSMNT_RDONLY(mp) && (dp->nfsdl_flags & NFSCLDL_READ)) { - (void) nfscl_trydelegreturn(dp, cred, VFSTONFS(mp), p); + nfscl_trydelegreturn(dp, cred, nmp, p); free(dp, M_NFSCLDELEG); *dpp = NULL; return (0); } + /* + * Since a delegation might be added to the mount, + * set NFSMNTP_DELEGISSUED now. If a delegation already + * exagain ists, setting this flag is harmless. + */ + NFSLOCKMNT(nmp); + nmp->nm_privflag |= NFSMNTP_DELEGISSUED; + NFSUNLOCKMNT(nmp); + /* Look for the correct deleg, based upon FH */ NFSLOCKCLSTATE(); tdp = nfscl_finddeleg(clp, nfhp, fhlen); @@ -3356,12 +3368,20 @@ nfscl_delegreturnvp(vnode_t vp, NFSPROC_T *p) struct nfscldeleg *dp; struct ucred *cred; struct nfsnode *np; + struct nfsmount *nmp; + nmp = VFSTONFS(vp->v_mount); + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return; + } + NFSUNLOCKMNT(nmp); np = VTONFS(vp); cred = newnfs_getcred(); dp = NULL; NFSLOCKCLSTATE(); - clp = VFSTONFS(vp->v_mount)->nm_clp; + clp = nmp->nm_clp; if (clp != NULL) dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); @@ -4500,6 +4520,12 @@ nfscl_nodeleg(vnode_t vp, int writedeleg) nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return (1); + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return (1); + } + NFSUNLOCKMNT(nmp); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { @@ -4856,6 +4882,12 @@ nfscl_delegmodtime(vnode_t vp) nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return; + } + NFSUNLOCKMNT(nmp); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { @@ -4885,6 +4917,12 @@ nfscl_deleggetmodtime(vnode_t vp, struct timespec *mtime) nmp = VFSTONFS(vp->v_mount); if (!NFSHASNFSV4(nmp)) return; + NFSLOCKMNT(nmp); + if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { + NFSUNLOCKMNT(nmp); + return; + } + NFSUNLOCKMNT(nmp); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { diff --git a/sys/fs/nfsclient/nfsmount.h b/sys/fs/nfsclient/nfsmount.h index 57adcd8f2fca..f8ea8c9a1418 100644 --- a/sys/fs/nfsclient/nfsmount.h +++ b/sys/fs/nfsclient/nfsmount.h @@ -115,6 +115,7 @@ struct nfsmount { #define NFSMNTP_NOXATTR 0x00000080 #define NFSMNTP_NOADVISE 0x00000100 #define NFSMNTP_NOALLOCATE 0x00000200 +#define NFSMNTP_DELEGISSUED 0x00000400 /* New mount flags only used by the kernel via nmount(2). */ #define NFSMNT_TLS 0x00000001 From owner-dev-commits-src-all@freebsd.org Wed Jun 9 16:14:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9424E65008C; Wed, 9 Jun 2021 16:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XHv3dR8z4s3k; Wed, 9 Jun 2021 16:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 651721F522; Wed, 9 Jun 2021 16:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GEphE044200; Wed, 9 Jun 2021 16:14:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GEpcX044199; Wed, 9 Jun 2021 16:14:51 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:14:51 GMT Message-Id: <202106091614.159GEpcX044199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: 3045f4aa1a2b - stable/13 - libsa: Fix infinite loop in bzipfs & gzipfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:14:51 -0000 The branch stable/13 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab commit 3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab Author: David Bright AuthorDate: 2021-05-24 17:12:15 +0000 Commit: David Bright CommitDate: 2021-06-09 16:11:01 +0000 libsa: Fix infinite loop in bzipfs & gzipfs A bug in the loader's bzipfs & gzipfs filesystems caused compressed kernel and modules not to work on EFI systems with a veriexec-enabled loader. Since the size of files in these filesystems are not known _a priori_ `stat` would initialize the size to -1 and the loader would then hang in an infinite loop while trying to seek (read) to the end of file since the loop termination condition compares the current offset to that negative target position. Sponsored by: Dell EMC Isilon (cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2) --- stand/libsa/bzipfs.c | 3 +++ stand/libsa/gzipfs.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stand/libsa/bzipfs.c b/stand/libsa/bzipfs.c index 47380ae72e5e..bb67bda2aa19 100644 --- a/stand/libsa/bzipfs.c +++ b/stand/libsa/bzipfs.c @@ -340,6 +340,9 @@ bzf_seek(struct open_file *f, off_t offset, int where) target - bzf->bzf_bzstream.total_out_lo32), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (bzf->bzf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(bzf->bzf_bzstream.total_out_lo32); diff --git a/stand/libsa/gzipfs.c b/stand/libsa/gzipfs.c index 39e2f98eb1e0..8154b0f95a9a 100644 --- a/stand/libsa/gzipfs.c +++ b/stand/libsa/gzipfs.c @@ -315,6 +315,9 @@ zf_seek(struct open_file *f, off_t offset, int where) target - zf->zf_zstream.total_out), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (zf->zf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(zf->zf_zstream.total_out); From owner-dev-commits-src-all@freebsd.org Wed Jun 9 16:16:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C457650307; Wed, 9 Jun 2021 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XL51DDHz4ryV; Wed, 9 Jun 2021 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11ECD1F429; Wed, 9 Jun 2021 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GGiGO044447; Wed, 9 Jun 2021 16:16:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GGiCe044446; Wed, 9 Jun 2021 16:16:44 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:16:44 GMT Message-Id: <202106091616.159GGiCe044446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: 80a5d786a3cd - stable/12 - libsa: Fix infinite loop in bzipfs & gzipfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:16:45 -0000 The branch stable/12 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be commit 80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be Author: David Bright AuthorDate: 2021-05-24 17:12:15 +0000 Commit: David Bright CommitDate: 2021-06-09 16:15:33 +0000 libsa: Fix infinite loop in bzipfs & gzipfs A bug in the loader's bzipfs & gzipfs filesystems caused compressed kernel and modules not to work on EFI systems with a veriexec-enabled loader. Since the size of files in these filesystems are not known _a priori_ `stat` would initialize the size to -1 and the loader would then hang in an infinite loop while trying to seek (read) to the end of file since the loop termination condition compares the current offset to that negative target position. Sponsored by: Dell EMC Isilon (cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2) --- stand/libsa/bzipfs.c | 3 +++ stand/libsa/gzipfs.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stand/libsa/bzipfs.c b/stand/libsa/bzipfs.c index 47380ae72e5e..bb67bda2aa19 100644 --- a/stand/libsa/bzipfs.c +++ b/stand/libsa/bzipfs.c @@ -340,6 +340,9 @@ bzf_seek(struct open_file *f, off_t offset, int where) target - bzf->bzf_bzstream.total_out_lo32), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (bzf->bzf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(bzf->bzf_bzstream.total_out_lo32); diff --git a/stand/libsa/gzipfs.c b/stand/libsa/gzipfs.c index 39e2f98eb1e0..8154b0f95a9a 100644 --- a/stand/libsa/gzipfs.c +++ b/stand/libsa/gzipfs.c @@ -315,6 +315,9 @@ zf_seek(struct open_file *f, off_t offset, int where) target - zf->zf_zstream.total_out), NULL); if (errno) return(-1); + /* Break out of loop if end of file has been reached. */ + if (zf->zf_endseen) + break; } /* This is where we are (be honest if we overshot) */ return(zf->zf_zstream.total_out); From owner-dev-commits-src-all@freebsd.org Wed Jun 9 16:18:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 589C76500B4; Wed, 9 Jun 2021 16:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XN1283xz4sHk; Wed, 9 Jun 2021 16:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 334C81F336; Wed, 9 Jun 2021 16:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GIP6d044675; Wed, 9 Jun 2021 16:18:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GIPnu044674; Wed, 9 Jun 2021 16:18:25 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:18:25 GMT Message-Id: <202106091618.159GIPnu044674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: 7f06d6f3fdde - stable/13 - pciconf: Fix up pciconf -lc output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:18:25 -0000 The branch stable/13 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a commit 7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a Author: David Bright AuthorDate: 2021-05-24 19:02:43 +0000 Commit: David Bright CommitDate: 2021-06-09 16:17:58 +0000 pciconf: Fix up pciconf -lc output The pciconf command fails to emit newlines when particular ecap field values are seen. Fix them up. This has been seen on several systems at $JOB. The documentation for PCI capabilities says that capability type 0 should not be used once the spec for PCI capabilities was published, but that seems more wishful-thinking than reality. pciconf also chooses not to print fields related to field values that are zero, but it seems several of these fields are zero on actual hardware. Sponsored by: Dell EMC Isilon Submitted by: Robert Herndon (Robert.Herndon@dell.com) (cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514) --- usr.sbin/pciconf/cap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index bd7315beb047..eae53acbd250 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -861,8 +861,10 @@ ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t sta, mask; printf("AER %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4); mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4); printf(" %d fatal", bitcount32(sta & mask)); @@ -877,8 +879,10 @@ ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t cap1; printf("VC %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4); printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT); if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0) @@ -893,8 +897,10 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t high, low; printf("Serial %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4); high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4); printf(" %08x%08x\n", high, low); @@ -940,8 +946,10 @@ ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t val; printf("PCIe Sec %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } val = read_config(fd, &p->pc_sel, ptr + 8, 4); printf(" lane errors %#x\n", val); } From owner-dev-commits-src-all@freebsd.org Wed Jun 9 16:19:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C7D06500C4; Wed, 9 Jun 2021 16:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0XPq3scCz4s5D; Wed, 9 Jun 2021 16:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B4801EFD2; Wed, 9 Jun 2021 16:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159GJxGj044905; Wed, 9 Jun 2021 16:19:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GJxhd044904; Wed, 9 Jun 2021 16:19:59 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:19:59 GMT Message-Id: <202106091619.159GJxhd044904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: fe58db828934 - stable/12 - pciconf: Fix up pciconf -lc output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fe58db828934c40b5d84a6485573e04f6981f8b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:19:59 -0000 The branch stable/12 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=fe58db828934c40b5d84a6485573e04f6981f8b6 commit fe58db828934c40b5d84a6485573e04f6981f8b6 Author: David Bright AuthorDate: 2021-05-24 19:02:43 +0000 Commit: David Bright CommitDate: 2021-06-09 16:19:10 +0000 pciconf: Fix up pciconf -lc output The pciconf command fails to emit newlines when particular ecap field values are seen. Fix them up. This has been seen on several systems at $JOB. The documentation for PCI capabilities says that capability type 0 should not be used once the spec for PCI capabilities was published, but that seems more wishful-thinking than reality. pciconf also chooses not to print fields related to field values that are zero, but it seems several of these fields are zero on actual hardware. Sponsored by: Dell EMC Isilon Submitted by: Robert Herndon (Robert.Herndon@dell.com) (cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514) --- usr.sbin/pciconf/cap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index f990fdca7313..07f4b63bbcd2 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -854,8 +854,10 @@ ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t sta, mask; printf("AER %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4); mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4); printf(" %d fatal", bitcount32(sta & mask)); @@ -870,8 +872,10 @@ ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t cap1; printf("VC %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4); printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT); if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0) @@ -886,8 +890,10 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t high, low; printf("Serial %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4); high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4); printf(" %08x%08x\n", high, low); @@ -911,8 +917,10 @@ ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t val; printf("PCIe Sec %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } val = read_config(fd, &p->pc_sel, ptr + 8, 4); printf(" lane errors %#x\n", val); } From owner-dev-commits-src-all@freebsd.org Wed Jun 9 17:52:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DB02651581; Wed, 9 Jun 2021 17:52:24 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 4G0ZSR2jzTz3Dtr; Wed, 9 Jun 2021 17:52:23 +0000 (UTC) (envelope-from dab0816@gmail.com) Received: by mail-io1-xd2f.google.com with SMTP id b25so23684339iot.5; Wed, 09 Jun 2021 10:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Ap6wqQFQS8zYmq3KpW/N+I98IUd/mBulNO6B13rH5Ks=; b=uJ8Qz9rptWczpYIn73q5kmBWvRTx3oSROk/n2j6WFHZRY2v0K7CzK/XHRNECmu7XTQ hlDqpeU0e8SFmZAzTp+KlWd3CT/uslB26EC8JaG2oTTU0uR8mWMhb6GAigJM0rMMaqqJ cxXkonvQt19FNKvLrPfzGycLASqvyJan7j6saU71x5jk28LNHfyim+zlLDOA/jzKTm19 GMLO4ri5/TdhO3qm5Sn5vRgpu6Ba7PY7By5gq5/AmU+Lql6t7HvLRCTCQiWAm6BKo7wU CtW2QMfV8dIh5m7+rPcsrbrYEtLti0V0cCQloLBNXLmfenbpOaJeiVp15GRyu+pBgXnK wKWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Ap6wqQFQS8zYmq3KpW/N+I98IUd/mBulNO6B13rH5Ks=; b=MlnROE2RadofsI6SEy/3ARClEDF/iVXVbIdbkh1AdE2zzOaILLvOCJaP7sZ8DOJDJI hshDLOmXUG6nD0YjHNV4mj61Z7Psgv157fY/LiOuQKIEO0E8PUiF5eup9QjrphzM8ksF gCVYpwF796t63tonYGm+TmKiZSEi/Y72n3tLSigbIqgNJkj5wey17gqgV0peGZG5iucT IS45x1JIwP5r+o9RfSvjERXUz7wGDmI1Qzupbr3zU55Q3czPzZaGjHpzuX2nfnoQ1TxW Wno65zT38mJe4t/HrWMs68h6S5DB1sLxV81WEnbGEYAQ/5fWo3pXaHVlK4XZU4zWS4E6 D8kg== X-Gm-Message-State: AOAM530pAhQ2mgE+B1HxZu2aXJhhIIY2XBf+WnEm+nU3TE0inSBGA3rH 1fO4NE6Y85htMlguXhH6ZhcVLooR0l8= X-Google-Smtp-Source: ABdhPJyyJII+tPLJlWcoHsi/+wnC7MZmhCxKpaP9M9m1uHAqlcvUJ7NIM5QlXt4GOFH1V3eK80eE2A== X-Received: by 2002:a6b:6410:: with SMTP id t16mr516601iog.78.1623261141921; Wed, 09 Jun 2021 10:52:21 -0700 (PDT) Received: from smtpclient.apple ([135.129.115.77]) by smtp.gmail.com with ESMTPSA id z16sm375336ilp.73.2021.06.09.10.52.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jun 2021 10:52:21 -0700 (PDT) Sender: David Bright From: David Bright X-Google-Original-From: David Bright Message-Id: <6E4EA1A3-BEEB-4D7B-BB21-EAB13A07A9C2@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: 2f176a2b2010 - main - pciconf: Fix up pciconf -lc output Date: Wed, 9 Jun 2021 12:52:18 -0500 In-Reply-To: <93b7adea-1980-b097-cdf1-d3426dd0d531@FreeBSD.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: John Baldwin References: <202106011556.151Fu6ZE084734@gitrepo.freebsd.org> <93b7adea-1980-b097-cdf1-d3426dd0d531@FreeBSD.org> X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4G0ZSR2jzTz3Dtr X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=uJ8Qz9rp; dmarc=none; spf=pass (mx1.freebsd.org: domain of dab0816@gmail.com designates 2607:f8b0:4864:20::d2f as permitted sender) smtp.mailfrom=dab0816@gmail.com X-Spamd-Result: default: False [0.30 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[david@bright-family.net,dab0816@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[135.129.115.77:received]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[david@bright-family.net,dab0816@gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::d2f:from]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[bright-family.net]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::d2f:from:127.0.2.255]; MID_RHS_MATCH_TO(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2f:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 17:52:24 -0000 On Jun 1, 2021, at 12:44 PM, John Baldwin wrote: >=20 > On 6/1/21 8:56 AM, David Bright wrote: >> The branch main has been updated by dab: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2f176a2b20107f7a9132242223e9eef6= 57400514 >> commit 2f176a2b20107f7a9132242223e9eef657400514 >>=20 >> pciconf: Fix up pciconf -lc output >> The pciconf command fails to emit newlines when particular = ecap field >> values are seen. Fix them up. This has been seen on several = systems at >> $JOB. The documentation for PCI capabilities says that capability >> type 0 should not be used once the spec for PCI capabilities was >> published, but that seems more wishful-thinking than reality. = pciconf >> also chooses not to print fields related to field values that are >> zero, but it seems several of these fields are zero on actual >> hardware. >>=20 >=20 > Are the ecap registers actually valid for version 1 in this case? = That is, > should we treat version 0 as being version 1? The current checks are = just > defensive coding for not parsing something unless we know it is valid. > If the only version 0 caps in practice are always compatible with = version 1 > we could just treat 0 as if it were 1. I think the answer is =E2=80=9Cmaybe, but we don=E2=80=99t know for = sure=E2=80=9D. Robert Herndon did some looking at this; his findings are = paraphrased below: ----- Searching on version fields in PCI caps and ecaps doesn=E2=80=99t = produce a lot of information. There are references to particular devices = indicating that =E2=80=98version=E2=80=99 should be =E2=80=981=E2=80=99, = or that it should not be =E2=80=980=E2=80=99, but there=E2=80=99s = nothing that says so for any generic case, or in the standards I=E2=80=99v= e found. The version field is only four bits, so it seems a little odd = that zero wouldn=E2=80=99t be a reasonable-ish value. Internally we have = only found two hosts exhibiting this issue and both exhibit the same = behavior. When the early return on version 0 is disabled they show = multiple instances of: cap 10[40] =3D PCI-Express 2 root endpoint max data 128(128) ecap 000b[100] =3D Vendor 0 ID 1 none114@pci0:93:15:0: class=3D0x110100 card=3D0x00008086 = chip=3D0x20588086 rev=3D0x07 hdr=3D0x00 So they appear to be mainstream vendor (Intel) devices. All instances = showed =E2=80=98Vendor 0 ID 1=E2=80=99. In this particular instance, the = current FreeBSD code would print this much information and a little more = before refusing to dump more detailed information, printing printf("Vendor [%d] ID %04x Rev %d Length %d\n", ver, PCIR_VSEC_ID(hdr), PCIR_VSEC_REV(hdr), len); before returning. (After the return, it does read more registers out of = the capability, and prints more detailed information for extra registers = as found). It=E2=80=99s conceivable that reading these registers when a particular = field is zero could cause it to print erroneous or misleading = information, but there is a reasonable probability that it would be = helpful in real usage.=20 ----- --=20 David Bright dab@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Wed Jun 9 18:00:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FF3A65179F; Wed, 9 Jun 2021 18:00:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0ZfH0kc5z3FLK; Wed, 9 Jun 2021 18:00:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0096620AAA; Wed, 9 Jun 2021 18:00:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159I0shL085567; Wed, 9 Jun 2021 18:00:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159I0sdJ085566; Wed, 9 Jun 2021 18:00:54 GMT (envelope-from git) Date: Wed, 9 Jun 2021 18:00:54 GMT Message-Id: <202106091800.159I0sdJ085566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: b45daaea95ab - main - tcp: LRO timestamps have lost their previous precision MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b45daaea95abd8bda52caaacf120f9197caab3e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 18:00:55 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=b45daaea95abd8bda52caaacf120f9197caab3e7 commit b45daaea95abd8bda52caaacf120f9197caab3e7 Author: Randall Stewart AuthorDate: 2021-06-09 17:58:54 +0000 Commit: Randall Stewart CommitDate: 2021-06-09 17:58:54 +0000 tcp: LRO timestamps have lost their previous precision Recently we had a rewrite to tcp_lro.c that was tested but one subtle change was the move to a less precise timestamp. This causes all kinds of chaos in tcp's that do pacing and needs to be fixed to use the more precise time that was there before. Reviewed by: mtuexen, gallatin, hselasky Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30695 --- sys/netinet/tcp_lro.c | 23 +++++++++++++---------- sys/netinet/tcp_lro.h | 4 ++-- sys/sys/time.h | 11 +++++++++++ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 09fc024c3d73..ea84ca191eca 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -562,16 +562,18 @@ void tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout) { struct lro_entry *le, *le_tmp; - sbintime_t sbt; + uint64_t now, tov; + struct bintime bt; if (LIST_EMPTY(&lc->lro_active)) return; - /* get timeout time */ - sbt = getsbinuptime() - tvtosbt(*timeout); - + /* get timeout time and current time in ns */ + binuptime(&bt); + now = bintime2ns(&bt); + tov = ((timeout->tv_sec * 1000000000) + (timeout->tv_usec * 1000)); LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { - if (sbt >= le->alloc_time) { + if (now >= (bintime2ns(&le->alloc_time) + tov)) { tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } @@ -610,7 +612,7 @@ tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc, { if (tp->t_logstate != TCP_LOG_STATE_OFF) { union tcp_log_stackspecific log; - struct timeval tv; + struct timeval tv, btv; uint32_t cts; cts = tcp_get_usecs(&tv); @@ -637,7 +639,8 @@ tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc, log.u_bbr.cwnd_gain = le->window; log.u_bbr.cur_del_rate = (uintptr_t)m; log.u_bbr.bw_inuse = (uintptr_t)le->m_head; - log.u_bbr.flex6 = sbttous(lc->lro_last_queue_time); + bintime2timeval(&lc->lro_last_queue_time, &btv); + log.u_bbr.flex6 = tcp_tv_to_usectick(&btv); log.u_bbr.flex7 = le->compressed; log.u_bbr.pacing_gain = le->uncompressed; if (in_epoch(net_epoch_preempt)) @@ -1446,7 +1449,7 @@ tcp_lro_flush_all(struct lro_ctrl *lc) CURVNET_SET(lc->ifp->if_vnet); /* get current time */ - lc->lro_last_queue_time = getsbinuptime(); + binuptime(&lc->lro_last_queue_time); /* sort all mbufs according to stream */ tcp_lro_sort(lc->lro_mbuf_data, lc->lro_mbuf_count); @@ -1739,7 +1742,7 @@ tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, bool use_h #endif /* If no hardware or arrival stamp on the packet add timestamp */ if ((m->m_flags & (M_TSTMP_LRO | M_TSTMP)) == 0) { - m->m_pkthdr.rcv_tstmp = sbttons(lc->lro_last_queue_time); + m->m_pkthdr.rcv_tstmp = bintime2ns(&lc->lro_last_queue_time); m->m_flags |= M_TSTMP_LRO; } @@ -1834,7 +1837,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) int error; /* get current time */ - lc->lro_last_queue_time = getsbinuptime(); + binuptime(&lc->lro_last_queue_time); CURVNET_SET(lc->ifp->if_vnet); error = tcp_lro_rx_common(lc, m, csum, true); diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h index d2220a626b81..5ff15e2dc97e 100644 --- a/sys/netinet/tcp_lro.h +++ b/sys/netinet/tcp_lro.h @@ -140,7 +140,7 @@ struct lro_entry { uint16_t uncompressed; uint16_t window; uint16_t timestamp; /* flag, not a TCP hdr field. */ - sbintime_t alloc_time; /* time when entry was allocated */ + struct bintime alloc_time; /* time when entry was allocated */ }; LIST_HEAD(lro_head, lro_entry); @@ -154,7 +154,7 @@ struct lro_mbuf_sort { struct lro_ctrl { struct ifnet *ifp; struct lro_mbuf_sort *lro_mbuf_data; - sbintime_t lro_last_queue_time; /* last time data was queued */ + struct bintime lro_last_queue_time; /* last time data was queued */ uint64_t lro_queued; uint64_t lro_flushed; uint64_t lro_bad_csum; diff --git a/sys/sys/time.h b/sys/sys/time.h index 9bffca204d56..a48aa3fe5548 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -286,6 +286,17 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts) (uint32_t)(_bt->frac >> 32)) >> 32; } +static __inline uint64_t +bintime2ns(const struct bintime *_bt) +{ + uint64_t ret; + + ret = (uint64_t)(_bt->sec) * (uint64_t)1000000000; + ret += (((uint64_t)1000000000 * + (uint32_t)(_bt->frac >> 32)) >> 32); + return (ret); +} + static __inline void timespec2bintime(const struct timespec *_ts, struct bintime *_bt) { From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:20:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFBE16531F5; Wed, 9 Jun 2021 21:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5056Nkz3nMD; Wed, 9 Jun 2021 21:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 991B7233DD; Wed, 9 Jun 2021 21:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKqJk051375; Wed, 9 Jun 2021 21:20:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKqhO051374; Wed, 9 Jun 2021 21:20:52 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:52 GMT Message-Id: <202106092120.159LKqhO051374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5452cb6bf9f0 - stable/13 - etcupdate: Always extract to a temporary tree. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5452cb6bf9f07cdc479c24e880a3628fcb3dda49 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:52 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5452cb6bf9f07cdc479c24e880a3628fcb3dda49 commit 5452cb6bf9f07cdc479c24e880a3628fcb3dda49 Author: John Baldwin AuthorDate: 2021-04-20 20:21:42 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:38 +0000 etcupdate: Always extract to a temporary tree. etcupdate has had a somewhat nasty race condition since its creation in that its state machine can get very confused if it is interrupted while building the tree to compare against. This is exacerbated by the fact that etcupdate doesn't emit any output while building the tree which can take several seconds (especially in recent years with the addition of the tree-wide buildconfig/installconfig passes). To mitigate this, always install a new tree into a temporary directory created via mktemp as was previously done only for dry-runs via -n. The existing trees are only rotated and the new tree installed as /var/db/etcupdate/current after the update command has completed. Reported by: dim, np (and many others) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29843 (cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472) (cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71) --- usr.sbin/etcupdate/etcupdate.sh | 148 +++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 56 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 87d269f2ca69..41f13412f340 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -226,9 +226,11 @@ build_tree() return 0 } -# Generate a new NEWTREE tree. If tarball is set, then the tree is +# Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a # source tree. +# +# $1 - directory to store new tree in extract_tree() { local files @@ -239,16 +241,16 @@ extract_tree() if [ -n "$preworld" ]; then files="$PREWORLD_FILES" fi - if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \ + if ! (mkdir -p $1 && tar xf $tarball -C $1 $files) \ >&3 2>&1; then echo "Failed to extract new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi else - if ! build_tree $NEWTREE; then + if ! build_tree $1; then echo "Failed to build new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi fi @@ -1353,14 +1355,28 @@ extract_cmd() log "extract command: tarball=$tarball" + # Create a temporary directory to hold the tree + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi + + extract_tree $dir + if [ -d $NEWTREE ]; then if ! remove_tree $NEWTREE; then echo "Unable to remove current tree." + remove_tree $dir exit 1 fi fi - extract_tree + if ! mv $dir $NEWTREE >&3 2>&1; then + echo "Unable to rename temp tree to current tree." + remove_tree $dir + exit 1 + fi } # Resolve conflicts left from an earlier merge. @@ -1420,7 +1436,7 @@ status_cmd() # source tree. update_cmd() { - local dir + local dir new old if [ $# -ne 0 ]; then usage @@ -1449,60 +1465,44 @@ update_cmd() exit 1 fi + # Save tree names to use for rotation later. + old=$OLDTREE + new=$NEWTREE if [ -z "$rerun" ]; then - # For a dryrun that is not a rerun, do not rotate the existing - # stock tree. Instead, extract a tree to a temporary directory - # and use that for the comparison. - if [ -n "$dryrun" ]; then - dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` - if [ $? -ne 0 ]; then - echo "Unable to create temporary directory." - exit 1 - fi - - # A pre-world dryrun has already set OLDTREE to - # point to the current stock tree. - if [ -z "$preworld" ]; then - OLDTREE=$NEWTREE - fi - NEWTREE=$dir - - # For a pre-world update, blow away any pre-existing - # NEWTREE. - elif [ -n "$preworld" ]; then - if ! remove_tree $NEWTREE; then - echo "Unable to remove pre-world tree." - exit 1 - fi + # Extract the new tree to a temporary directory. The + # trees are only rotated after a successful update to + # avoid races if an update command is interrupted + # before it completes. + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi - # Rotate the existing stock tree to the old tree. - elif [ -d $NEWTREE ]; then - # First, delete the previous old tree if it exists. - if ! remove_tree $OLDTREE; then - echo "Unable to remove old tree." - exit 1 - fi + # Populate the new tree. + extract_tree $dir - # Move the current stock tree. - if ! mv $NEWTREE $OLDTREE >&3 2>&1; then - echo "Unable to rename current stock tree." - exit 1 - fi + # Compare the new tree against the previous tree. For + # the preworld case OLDTREE already points to the + # current stock tree. + if [ -z "$preworld" ]; then + OLDTREE=$NEWTREE fi + NEWTREE=$dir + fi - if ! [ -d $OLDTREE ]; then - cat <&3 2>&1; then + echo "Unable to rename old tree." + exit 1 + fi + fi + + # Rotate the new tree. Remove a previous pre-world + # tree if it exists. + if [ -d $new ]; then + if [ -z "$preworld" ]; then + panic "New tree should be rotated to old" + fi + if ! remove_tree $new; then + echo "Unable to remove previous pre-world tree." + exit 1 + fi + fi + + if ! mv $NEWTREE $new >&3 2>&1; then + echo "Unable to rename current tree." + exit 1 + fi fi } From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:20:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE2E16534BD; Wed, 9 Jun 2021 21:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g515kXhz3nWX; Wed, 9 Jun 2021 21:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD513233DF; Wed, 9 Jun 2021 21:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKrfw051407; Wed, 9 Jun 2021 21:20:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKrOd051406; Wed, 9 Jun 2021 21:20:53 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:53 GMT Message-Id: <202106092120.159LKrOd051406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6d55189fe7c3 - stable/13 - etcupdate: Gracefully handle SIGINT when building trees. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d55189fe7c38df13aac1ad980318387f3cbe7b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:54 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6d55189fe7c38df13aac1ad980318387f3cbe7b3 commit 6d55189fe7c38df13aac1ad980318387f3cbe7b3 Author: John Baldwin AuthorDate: 2021-04-20 20:22:11 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:38 +0000 etcupdate: Gracefully handle SIGINT when building trees. Run the 'build_tree' function inside of a subshell and trap SIGINT to return an error to the caller. This allows callers to gracefully cleanup a partially created tree. While here, redirect stdout/stderr of the subshell to the log file instead of applying redirections individually to each command executed while building the tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29844 (cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e) --- usr.sbin/etcupdate/etcupdate.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 41f13412f340..3fd2e87bf52a 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -179,17 +179,21 @@ always_install() return 1 } -# Build a new tree +# Build a new tree. This runs inside a subshell to trap SIGINT. # # $1 - directory to store new tree in build_tree() -{ +( local destdir dir file make make="make $MAKE_OPTIONS -DNO_FILEMON" log "Building tree at $1 with $make" - mkdir -p $1/usr/obj >&3 2>&1 + + exec >&3 2>&1 + trap 'return 1' INT + + mkdir -p $1/usr/obj destdir=`realpath $1` if [ -n "$preworld" ]; then @@ -197,34 +201,33 @@ build_tree() # crucial to installworld. for file in $PREWORLD_FILES; do name=$(basename $file) - mkdir -p $1/etc >&3 2>&1 || return 1 + mkdir -p $1/etc || return 1 cp -p $SRCDIR/$file $1/etc/$name || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc && MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \ - >&3 2>&1 || return 1 + MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \ + return 1 else (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && - $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1 + $make DESTDIR=$destdir distribution) || return 1 fi - chflags -R noschg $1 >&3 2>&1 || return 1 - rm -rf $1/usr/obj >&3 2>&1 || return 1 + chflags -R noschg $1 || return 1 + rm -rf $1/usr/obj || return 1 # Purge auto-generated files. Only the source files need to # be updated after which these files are regenerated. - rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \ - return 1 + rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db || return 1 # Remove empty files. These just clutter the output of 'diff'. - find $1 -type f -size 0 -delete >&3 2>&1 || return 1 + find $1 -type f -size 0 -delete || return 1 # Trim empty directories. - find -d $1 -type d -empty -delete >&3 2>&1 || return 1 + find -d $1 -type d -empty -delete || return 1 return 0 -} +) # Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:20:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B9BA6538F3; Wed, 9 Jun 2021 21:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5305d3z3nT6; Wed, 9 Jun 2021 21:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D38BA233E0; Wed, 9 Jun 2021 21:20:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKsLB051432; Wed, 9 Jun 2021 21:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKs6U051431; Wed, 9 Jun 2021 21:20:54 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:54 GMT Message-Id: <202106092120.159LKs6U051431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 76a0f6f3bfd8 - stable/13 - etcupdate: Trim trailing whitespace. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 76a0f6f3bfd8a77146d328c89b424565d4036761 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:55 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=76a0f6f3bfd8a77146d328c89b424565d4036761 commit 76a0f6f3bfd8a77146d328c89b424565d4036761 Author: John Baldwin AuthorDate: 2021-04-20 20:22:24 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:38 +0000 etcupdate: Trim trailing whitespace. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29845 (cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b) --- usr.sbin/etcupdate/etcupdate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 3fd2e87bf52a..dc26bc0c8aab 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -442,7 +442,7 @@ empty_destdir() # # $1 - first tree # $2 - second tree -# $3 - node name +# $3 - node name # $4 - label for first tree # $5 - label for second tree diffnode() @@ -867,7 +867,7 @@ merge_file() # $1 - pathname of the file to resolve (relative to DESTDIR) has_conflicts() { - + egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1 } @@ -1526,7 +1526,7 @@ EOF if [ -n "$preworld" ]; then > $WORKDIR/removed.files fi - + # The order for the following sections is important. In the # odd case that a directory is converted into a file, the # existing subfiles need to be removed if possible before the From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:20:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A4DC653A09; Wed, 9 Jun 2021 21:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g541P0bz3nP1; Wed, 9 Jun 2021 21:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07D7323579; Wed, 9 Jun 2021 21:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKtS5051456; Wed, 9 Jun 2021 21:20:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKtiV051455; Wed, 9 Jun 2021 21:20:55 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:55 GMT Message-Id: <202106092120.159LKtiV051455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 960c954c55f2 - stable/13 - etcupdate: Add a revert mode to restore one or more stock files. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 960c954c55f24d08b7cbd184b035f0e93e4be5ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:56 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=960c954c55f24d08b7cbd184b035f0e93e4be5ee commit 960c954c55f24d08b7cbd184b035f0e93e4be5ee Author: John Baldwin AuthorDate: 2021-04-20 20:22:35 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:39 +0000 etcupdate: Add a revert mode to restore one or more stock files. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29846 (cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d) --- usr.sbin/etcupdate/etcupdate.8 | 24 ++++++++++++-------- usr.sbin/etcupdate/etcupdate.sh | 49 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 24afbca12951..5f13ed1d6733 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 27, 2018 +.Dd April 20, 2021 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -69,6 +69,12 @@ .Op Fl D Ar destdir .Op Fl L Ar logfile .Nm +.Cm revert +.Op Fl d Ar workdir +.Op Fl D Ar destdir +.Op Fl L Ar logfile +.Ar +.Nm .Cm status .Op Fl d Ar workdir .Op Fl D Ar destdir @@ -342,6 +348,14 @@ tree and discard any local changes made to the file. .It (h) help Display the list of commands. .El +.Ss Revert Mode +The +.Cm revert +mode is used to restore the stock versions of files. +In this mode, +.Nm +installs the stock version of requested files. +This mode cannot be used to restore directories, only individual files. .Ss Status Mode The .Cm status @@ -880,14 +894,6 @@ For example, one can imagine a syntax along the lines of .Pp to resolve a specific conflict in an automated fashion. .Pp -It might be nice to have something like a -.Sq revert -command to replace a locally modified version of a file with the stock -version of the file. -For example: -.Pp -.Dl "etcupdate revert /etc/mail/freebsd.cf" -.Pp Bootstrapping .Nm often results in gratuitous diffs in diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index dc26bc0c8aab..254a72abae08 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -58,7 +58,6 @@ # TODO: # - automatable conflict resolution -# - a 'revert' command to make a file "stock" usage() { @@ -72,6 +71,7 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] + etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] EOF exit 1 @@ -1415,6 +1415,47 @@ resolve_cmd() fi } +# Restore files to the stock version. Only files with a local change +# are restored from the stock version. +revert_cmd() +{ + local cmp file + + if [ $# -eq 0 ]; then + usage + fi + + for file; do + log "revert $file" + + if ! [ -e $NEWTREE/$file ]; then + echo "File $file does not exist in the current tree." + exit 1 + fi + if [ -d $NEWTREE/$file ]; then + echo "File $file is a directory." + exit 1 + fi + + compare $DESTDIR/$file $NEWTREE/$file + cmp=$? + if [ $cmp -eq $COMPARE_EQUAL ]; then + continue + fi + + if update_unmodified $file; then + # If this file had a conflict, clean up the + # conflict. + if [ -e $CONFLICTS/$file ]; then + if ! rm $CONFLICTS/$file >&3 2>&1; then + echo "Failed to remove conflict " \ + "for $file". + fi + fi + fi + done +} + # Report a summary of the previous merge. Specifically, list any # remaining conflicts followed by any warnings from the previous # update. @@ -1622,7 +1663,7 @@ EOF command="update" if [ $# -gt 0 ]; then case "$1" in - build|diff|extract|status|resolve) + build|diff|extract|status|resolve|revert) command="$1" shift ;; @@ -1801,7 +1842,7 @@ case $command in usage fi ;; - build|diff|status) + build|diff|status|revert) if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \ -n "$preworld" ]; then usage @@ -1835,7 +1876,7 @@ if ! mkdir -p $WORKDIR 2>/dev/null; then fi case $command in - diff|resolve|status) + diff|resolve|revert|status) exec 3>>$LOGFILE ;; *) From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:20:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B015B653A12; Wed, 9 Jun 2021 21:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g551hgRz3n9L; Wed, 9 Jun 2021 21:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22A92235A0; Wed, 9 Jun 2021 21:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LKvS1051480; Wed, 9 Jun 2021 21:20:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LKvo2051479; Wed, 9 Jun 2021 21:20:57 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:20:57 GMT Message-Id: <202106092120.159LKvo2051479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c417b618b933 - stable/13 - etcupdate: Add -D destdir to usage for 'extract'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c417b618b93395c2b084382646e94ee9ac6a1451 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:20:57 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c417b618b93395c2b084382646e94ee9ac6a1451 commit c417b618b93395c2b084382646e94ee9ac6a1451 Author: John Baldwin AuthorDate: 2021-04-26 16:49:34 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:39 +0000 etcupdate: Add -D destdir to usage for 'extract'. Reported by: Mark Millard (cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2) --- usr.sbin/etcupdate/etcupdate.8 | 1 + usr.sbin/etcupdate/etcupdate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 5f13ed1d6733..3d48e218494c 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -60,6 +60,7 @@ .Op Fl B .Op Fl d Ar workdir .Op Fl s Ar source | Fl t Ar tarball +.Op Fl D Ar destdir .Op Fl L Ar logfile .Op Fl M Ar options .Nm diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 254a72abae08..acfc601b93af 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -68,8 +68,8 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options] etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile] - etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] - [-M options] + etcupdate extract [-B] [-d workdir] [-s source | -t tarball] + [-D destdir] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:21:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AB16653C83; Wed, 9 Jun 2021 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5F3zMjz3nRj; Wed, 9 Jun 2021 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705EA233E6; Wed, 9 Jun 2021 21:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL592051658; Wed, 9 Jun 2021 21:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL5Wg051657; Wed, 9 Jun 2021 21:21:05 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:05 GMT Message-Id: <202106092121.159LL5Wg051657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6914b924d579 - stable/12 - etcupdate: Always extract to a temporary tree. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6914b924d57989b1da56588c247b9e248a9190ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:05 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6914b924d57989b1da56588c247b9e248a9190ff commit 6914b924d57989b1da56588c247b9e248a9190ff Author: John Baldwin AuthorDate: 2021-04-20 20:21:42 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Always extract to a temporary tree. etcupdate has had a somewhat nasty race condition since its creation in that its state machine can get very confused if it is interrupted while building the tree to compare against. This is exacerbated by the fact that etcupdate doesn't emit any output while building the tree which can take several seconds (especially in recent years with the addition of the tree-wide buildconfig/installconfig passes). To mitigate this, always install a new tree into a temporary directory created via mktemp as was previously done only for dry-runs via -n. The existing trees are only rotated and the new tree installed as /var/db/etcupdate/current after the update command has completed. Reported by: dim, np (and many others) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29843 (cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472) (cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71) --- usr.sbin/etcupdate/etcupdate.sh | 148 +++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 56 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 9144498544da..a84323890828 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -226,9 +226,11 @@ build_tree() return 0 } -# Generate a new NEWTREE tree. If tarball is set, then the tree is +# Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a # source tree. +# +# $1 - directory to store new tree in extract_tree() { local files @@ -239,16 +241,16 @@ extract_tree() if [ -n "$preworld" ]; then files="$PREWORLD_FILES" fi - if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \ + if ! (mkdir -p $1 && tar xf $tarball -C $1 $files) \ >&3 2>&1; then echo "Failed to extract new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi else - if ! build_tree $NEWTREE; then + if ! build_tree $1; then echo "Failed to build new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi fi @@ -1353,14 +1355,28 @@ extract_cmd() log "extract command: tarball=$tarball" + # Create a temporary directory to hold the tree + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi + + extract_tree $dir + if [ -d $NEWTREE ]; then if ! remove_tree $NEWTREE; then echo "Unable to remove current tree." + remove_tree $dir exit 1 fi fi - extract_tree + if ! mv $dir $NEWTREE >&3 2>&1; then + echo "Unable to rename temp tree to current tree." + remove_tree $dir + exit 1 + fi } # Resolve conflicts left from an earlier merge. @@ -1420,7 +1436,7 @@ status_cmd() # source tree. update_cmd() { - local dir + local dir new old if [ $# -ne 0 ]; then usage @@ -1449,60 +1465,44 @@ update_cmd() exit 1 fi + # Save tree names to use for rotation later. + old=$OLDTREE + new=$NEWTREE if [ -z "$rerun" ]; then - # For a dryrun that is not a rerun, do not rotate the existing - # stock tree. Instead, extract a tree to a temporary directory - # and use that for the comparison. - if [ -n "$dryrun" ]; then - dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` - if [ $? -ne 0 ]; then - echo "Unable to create temporary directory." - exit 1 - fi - - # A pre-world dryrun has already set OLDTREE to - # point to the current stock tree. - if [ -z "$preworld" ]; then - OLDTREE=$NEWTREE - fi - NEWTREE=$dir - - # For a pre-world update, blow away any pre-existing - # NEWTREE. - elif [ -n "$preworld" ]; then - if ! remove_tree $NEWTREE; then - echo "Unable to remove pre-world tree." - exit 1 - fi + # Extract the new tree to a temporary directory. The + # trees are only rotated after a successful update to + # avoid races if an update command is interrupted + # before it completes. + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi - # Rotate the existing stock tree to the old tree. - elif [ -d $NEWTREE ]; then - # First, delete the previous old tree if it exists. - if ! remove_tree $OLDTREE; then - echo "Unable to remove old tree." - exit 1 - fi + # Populate the new tree. + extract_tree $dir - # Move the current stock tree. - if ! mv $NEWTREE $OLDTREE >&3 2>&1; then - echo "Unable to rename current stock tree." - exit 1 - fi + # Compare the new tree against the previous tree. For + # the preworld case OLDTREE already points to the + # current stock tree. + if [ -z "$preworld" ]; then + OLDTREE=$NEWTREE fi + NEWTREE=$dir + fi - if ! [ -d $OLDTREE ]; then - cat <&3 2>&1; then + echo "Unable to rename old tree." + exit 1 + fi + fi + + # Rotate the new tree. Remove a previous pre-world + # tree if it exists. + if [ -d $new ]; then + if [ -z "$preworld" ]; then + panic "New tree should be rotated to old" + fi + if ! remove_tree $new; then + echo "Unable to remove previous pre-world tree." + exit 1 + fi + fi + + if ! mv $NEWTREE $new >&3 2>&1; then + echo "Unable to rename current tree." + exit 1 + fi fi } From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:21:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75290653D00; Wed, 9 Jun 2021 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5G5y4jz3nRm; Wed, 9 Jun 2021 21:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A524A235A8; Wed, 9 Jun 2021 21:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL6tW051682; Wed, 9 Jun 2021 21:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL6Qb051681; Wed, 9 Jun 2021 21:21:06 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:06 GMT Message-Id: <202106092121.159LL6Qb051681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 29ed8efb3b1e - stable/12 - etcupdate: Gracefully handle SIGINT when building trees. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 29ed8efb3b1e834a5c6f4726fa2516a5af3266a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:07 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=29ed8efb3b1e834a5c6f4726fa2516a5af3266a9 commit 29ed8efb3b1e834a5c6f4726fa2516a5af3266a9 Author: John Baldwin AuthorDate: 2021-04-20 20:22:11 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Gracefully handle SIGINT when building trees. Run the 'build_tree' function inside of a subshell and trap SIGINT to return an error to the caller. This allows callers to gracefully cleanup a partially created tree. While here, redirect stdout/stderr of the subshell to the log file instead of applying redirections individually to each command executed while building the tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29844 (cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e) --- usr.sbin/etcupdate/etcupdate.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index a84323890828..f64e58e4ecd1 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -179,17 +179,21 @@ always_install() return 1 } -# Build a new tree +# Build a new tree. This runs inside a subshell to trap SIGINT. # # $1 - directory to store new tree in build_tree() -{ +( local destdir dir file make make="make $MAKE_OPTIONS -DNO_FILEMON" log "Building tree at $1 with $make" - mkdir -p $1/usr/obj >&3 2>&1 + + exec >&3 2>&1 + trap 'return 1' INT + + mkdir -p $1/usr/obj destdir=`realpath $1` if [ -n "$preworld" ]; then @@ -197,34 +201,33 @@ build_tree() # crucial to installworld. for file in $PREWORLD_FILES; do dir=`dirname /$file` - mkdir -p $1/$dir >&3 2>&1 || return 1 + mkdir -p $1/$dir || return 1 cp -p $SRCDIR/$file $1/$file || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc && MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \ - >&3 2>&1 || return 1 + MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \ + return 1 else (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && - $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1 + $make DESTDIR=$destdir distribution) || return 1 fi - chflags -R noschg $1 >&3 2>&1 || return 1 - rm -rf $1/usr/obj >&3 2>&1 || return 1 + chflags -R noschg $1 || return 1 + rm -rf $1/usr/obj || return 1 # Purge auto-generated files. Only the source files need to # be updated after which these files are regenerated. - rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \ - return 1 + rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db || return 1 # Remove empty files. These just clutter the output of 'diff'. - find $1 -type f -size 0 -delete >&3 2>&1 || return 1 + find $1 -type f -size 0 -delete || return 1 # Trim empty directories. - find -d $1 -type d -empty -delete >&3 2>&1 || return 1 + find -d $1 -type d -empty -delete || return 1 return 0 -} +) # Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:21:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C924653C05; Wed, 9 Jun 2021 21:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5H6Xj6z3ncK; Wed, 9 Jun 2021 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDF9223689; Wed, 9 Jun 2021 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL7hB051708; Wed, 9 Jun 2021 21:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL7Mq051707; Wed, 9 Jun 2021 21:21:07 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:07 GMT Message-Id: <202106092121.159LL7Mq051707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ea6546fa1dd4 - stable/12 - etcupdate: Trim trailing whitespace. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ea6546fa1dd4fad52421585ebbfce56a07d8284d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:08 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ea6546fa1dd4fad52421585ebbfce56a07d8284d commit ea6546fa1dd4fad52421585ebbfce56a07d8284d Author: John Baldwin AuthorDate: 2021-04-20 20:22:24 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Trim trailing whitespace. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29845 (cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b) --- usr.sbin/etcupdate/etcupdate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index f64e58e4ecd1..28f6cbb42aff 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -442,7 +442,7 @@ empty_destdir() # # $1 - first tree # $2 - second tree -# $3 - node name +# $3 - node name # $4 - label for first tree # $5 - label for second tree diffnode() @@ -867,7 +867,7 @@ merge_file() # $1 - pathname of the file to resolve (relative to DESTDIR) has_conflicts() { - + egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1 } @@ -1526,7 +1526,7 @@ EOF if [ -n "$preworld" ]; then > $WORKDIR/removed.files fi - + # The order for the following sections is important. In the # odd case that a directory is converted into a file, the # existing subfiles need to be removed if possible before the From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:21:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBB6B6534E3; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5L2HVBz3nQ3; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0752523701; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL9Fw051758; Wed, 9 Jun 2021 21:21:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL9u2051757; Wed, 9 Jun 2021 21:21:09 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:09 GMT Message-Id: <202106092121.159LL9u2051757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 73a9788cf474 - stable/12 - etcupdate: Add -D destdir to usage for 'extract'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 73a9788cf474ba3c168286a1a0ffa9bd04aef30d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:11 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=73a9788cf474ba3c168286a1a0ffa9bd04aef30d commit 73a9788cf474ba3c168286a1a0ffa9bd04aef30d Author: John Baldwin AuthorDate: 2021-04-26 16:49:34 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Add -D destdir to usage for 'extract'. Reported by: Mark Millard (cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2) --- usr.sbin/etcupdate/etcupdate.8 | 1 + usr.sbin/etcupdate/etcupdate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index c3d95b3261ef..22e1eb3c4483 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -60,6 +60,7 @@ .Op Fl B .Op Fl d Ar workdir .Op Fl s Ar source | Fl t Ar tarball +.Op Fl D Ar destdir .Op Fl L Ar logfile .Op Fl M Ar options .Nm diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index aa7d12e80be6..1070c6905e46 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -68,8 +68,8 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options] etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile] - etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] - [-M options] + etcupdate extract [-B] [-d workdir] [-s source | -t tarball] + [-D destdir] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:21:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A319653979; Wed, 9 Jun 2021 21:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0g5K0Nmzz3nfw; Wed, 9 Jun 2021 21:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7FA5235AA; Wed, 9 Jun 2021 21:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LL8RS051734; Wed, 9 Jun 2021 21:21:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LL8o2051733; Wed, 9 Jun 2021 21:21:08 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:21:08 GMT Message-Id: <202106092121.159LL8o2051733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5cb183fe4369 - stable/12 - etcupdate: Add a revert mode to restore one or more stock files. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5cb183fe4369ca7170038d5333f297e9a60168d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:21:11 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5cb183fe4369ca7170038d5333f297e9a60168d6 commit 5cb183fe4369ca7170038d5333f297e9a60168d6 Author: John Baldwin AuthorDate: 2021-04-20 20:22:35 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:19:19 +0000 etcupdate: Add a revert mode to restore one or more stock files. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29846 (cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d) --- usr.sbin/etcupdate/etcupdate.8 | 24 ++++++++++++-------- usr.sbin/etcupdate/etcupdate.sh | 49 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 4cc5d69eb195..c3d95b3261ef 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2015 +.Dd April 20, 2021 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -69,6 +69,12 @@ .Op Fl D Ar destdir .Op Fl L Ar logfile .Nm +.Cm revert +.Op Fl d Ar workdir +.Op Fl D Ar destdir +.Op Fl L Ar logfile +.Ar +.Nm .Cm status .Op Fl d Ar workdir .Op Fl D Ar destdir @@ -342,6 +348,14 @@ tree and discard any local changes made to the file. .It (h) help Display the list of commands. .El +.Ss Revert Mode +The +.Cm revert +mode is used to restore the stock versions of files. +In this mode, +.Nm +installs the stock version of requested files. +This mode cannot be used to restore directories, only individual files. .Ss Status Mode The .Cm status @@ -879,14 +893,6 @@ For example, one can imagine a syntax along the lines of .Pp to resolve a specific conflict in an automated fashion. .Pp -It might be nice to have something like a -.Sq revert -command to replace a locally modified version of a file with the stock -version of the file. -For example: -.Pp -.Dl "etcupdate revert /etc/mail/freebsd.cf" -.Pp Bootstrapping .Nm often results in gratuitous diffs in diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 28f6cbb42aff..aa7d12e80be6 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -58,7 +58,6 @@ # TODO: # - automatable conflict resolution -# - a 'revert' command to make a file "stock" usage() { @@ -72,6 +71,7 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] + etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] EOF exit 1 @@ -1415,6 +1415,47 @@ resolve_cmd() fi } +# Restore files to the stock version. Only files with a local change +# are restored from the stock version. +revert_cmd() +{ + local cmp file + + if [ $# -eq 0 ]; then + usage + fi + + for file; do + log "revert $file" + + if ! [ -e $NEWTREE/$file ]; then + echo "File $file does not exist in the current tree." + exit 1 + fi + if [ -d $NEWTREE/$file ]; then + echo "File $file is a directory." + exit 1 + fi + + compare $DESTDIR/$file $NEWTREE/$file + cmp=$? + if [ $cmp -eq $COMPARE_EQUAL ]; then + continue + fi + + if update_unmodified $file; then + # If this file had a conflict, clean up the + # conflict. + if [ -e $CONFLICTS/$file ]; then + if ! rm $CONFLICTS/$file >&3 2>&1; then + echo "Failed to remove conflict " \ + "for $file". + fi + fi + fi + done +} + # Report a summary of the previous merge. Specifically, list any # remaining conflicts followed by any warnings from the previous # update. @@ -1622,7 +1663,7 @@ EOF command="update" if [ $# -gt 0 ]; then case "$1" in - build|diff|extract|status|resolve) + build|diff|extract|status|resolve|revert) command="$1" shift ;; @@ -1801,7 +1842,7 @@ case $command in usage fi ;; - build|diff|status) + build|diff|status|revert) if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \ -n "$preworld" ]; then usage @@ -1835,7 +1876,7 @@ if ! mkdir -p $WORKDIR 2>/dev/null; then fi case $command in - diff|resolve|status) + diff|resolve|revert|status) exec 3>>$LOGFILE ;; *) From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:38:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 101E96541AD; Wed, 9 Jun 2021 21:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0gTl6pZCz3pqN; Wed, 9 Jun 2021 21:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2C4723994; Wed, 9 Jun 2021 21:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LcpXc070334; Wed, 9 Jun 2021 21:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LcpCe070333; Wed, 9 Jun 2021 21:38:51 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:38:51 GMT Message-Id: <202106092138.159LcpCe070333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Gmelin Subject: git: 278e37006673 - main - freebsd-tips: Add fortune on kern.tty_info_kstacks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grembo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 278e370066734a06f6b35e585568ac34969b1e84 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:38:52 -0000 The branch main has been updated by grembo (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=278e370066734a06f6b35e585568ac34969b1e84 commit 278e370066734a06f6b35e585568ac34969b1e84 Author: Michael Gmelin AuthorDate: 2021-05-21 16:10:26 +0000 Commit: Michael Gmelin CommitDate: 2021-06-09 21:35:38 +0000 freebsd-tips: Add fortune on kern.tty_info_kstacks Add fortune explaining how to use `sysctl kern.tty_info_kstacks' to alter the output of ^T (tty info). Reviewed by: ceri Differential Revision: https://reviews.freebsd.org/D30388 --- usr.bin/fortune/datfiles/freebsd-tips | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index eb7339cec698..cbbaff9eb84f 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -836,3 +836,10 @@ $ cu -s 9600 -l /dev/ttyU0 -- Daniel Ebdrup Jensen % +You can control kernel stack(9) traces on ^T (tty info) by setting +kern.tty_info_kstacks to 0 (off), 1 (on), or 2 (verbose), e.g.: + +# sysctl kern.tty_info_kstacks=2 + + -- Michael Gmelin +% From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:41:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2299F6540E7; Wed, 9 Jun 2021 21:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0gXz0Yv3z3q90; Wed, 9 Jun 2021 21:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE57D23761; Wed, 9 Jun 2021 21:41:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159Lfckv083023; Wed, 9 Jun 2021 21:41:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LfcZ1083022; Wed, 9 Jun 2021 21:41:38 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:41:38 GMT Message-Id: <202106092141.159LfcZ1083022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: fee0d486ef34 - main - linuxkpi: Add _RET_IP_ macro in kernel.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fee0d486ef34c6bd113ed743e33357ff626f2495 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:41:39 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fee0d486ef34c6bd113ed743e33357ff626f2495 commit fee0d486ef34c6bd113ed743e33357ff626f2495 Author: Neel Chauhan AuthorDate: 2021-06-09 21:34:58 +0000 Commit: Neel Chauhan CommitDate: 2021-06-09 21:41:44 +0000 linuxkpi: Add _RET_IP_ macro in kernel.h This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30707 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index f34179d9566b..aba5896111f7 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -301,6 +301,8 @@ extern int linuxkpi_debug; #define u64_to_user_ptr(val) ((void *)(uintptr_t)(val)) +#define _RET_IP_ __builtin_return_address(0) + static inline unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base) { From owner-dev-commits-src-all@freebsd.org Wed Jun 9 21:41:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB3D76543DD; Wed, 9 Jun 2021 21:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0gY01kyxz3qJF; Wed, 9 Jun 2021 21:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2122B237E0; Wed, 9 Jun 2021 21:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159LfdEB083053; Wed, 9 Jun 2021 21:41:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159LfdWr083052; Wed, 9 Jun 2021 21:41:39 GMT (envelope-from git) Date: Wed, 9 Jun 2021 21:41:39 GMT Message-Id: <202106092141.159LfdWr083052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: 8a1a42b2a7a4 - main - linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a1a42b2a7a428fb97fda9f19fd0d67a4eec7535 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 21:41:40 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8a1a42b2a7a428fb97fda9f19fd0d67a4eec7535 commit 8a1a42b2a7a428fb97fda9f19fd0d67a4eec7535 Author: Neel Chauhan AuthorDate: 2021-06-09 21:38:52 +0000 Commit: Neel Chauhan CommitDate: 2021-06-09 21:41:44 +0000 linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock() In Linux, these are macros to locks in the kernel for scheduling purposes. But as with other macros in this header, we aren't doing anything with them so we are doing `do {} while (0)` for now. This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30710 --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 5 +++++ sys/sys/param.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index de82d06a419e..d12bd049b820 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -79,6 +79,7 @@ lockdep_is_held(void *__m) #define might_lock(m) do { } while (0) #define might_lock_read(m) do { } while (0) +#define might_lock_nested(m, n) do { } while (0) #define lock_acquire(...) do { } while (0) #define lock_release(...) do { } while (0) @@ -91,4 +92,8 @@ lockdep_is_held(void *__m) #define lock_map_acquire_read(_map) do { } while (0) #define lock_map_release(_map) do { } while (0) +#define lockdep_pin_lock(l) do { } while (0) +#define lockdep_repin_lock(l,c) do { } while (0) +#define lockdep_unpin_lock(l,c) do { } while (0) + #endif /* _LINUX_LOCKDEP_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index d3a6fae783d4..d78612b5ebb9 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400019 +#define __FreeBSD_version 1400020 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Wed Jun 9 22:19:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CD90654B8B; Wed, 9 Jun 2021 22:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0hNx10r9z3sT2; Wed, 9 Jun 2021 22:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A43F24035; Wed, 9 Jun 2021 22:19:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159MJi0d023745; Wed, 9 Jun 2021 22:19:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159MJiiS023744; Wed, 9 Jun 2021 22:19:44 GMT (envelope-from git) Date: Wed, 9 Jun 2021 22:19:44 GMT Message-Id: <202106092219.159MJiiS023744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f8edb3f9c725 - stable/13 - libcrypto: Add symbol versions for symbols added since 1.1.1d. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8edb3f9c725e5b4a60981ee19a56395b0497e13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 22:19:45 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f8edb3f9c725e5b4a60981ee19a56395b0497e13 commit f8edb3f9c725e5b4a60981ee19a56395b0497e13 Author: John Baldwin AuthorDate: 2021-05-28 22:18:15 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:53:42 +0000 libcrypto: Add symbol versions for symbols added since 1.1.1d. While here, trim a spurious local: I missed when added SSL_sendfile. PR: 255277 Reported by: yuri Reviewed by: jkim Differential Revision: https://reviews.freebsd.org/D30483 (cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf) --- secure/lib/libcrypto/Version.map | 17 ++++++++++++++++- secure/lib/libssl/Version.map | 1 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/Version.map b/secure/lib/libcrypto/Version.map index 33432019a023..bed7623b9c47 100644 --- a/secure/lib/libcrypto/Version.map +++ b/secure/lib/libcrypto/Version.map @@ -4450,7 +4450,22 @@ OPENSSL_1_1_1d { global: X509_get0_authority_issuer; X509_get0_authority_serial; - local: *; } OPENSSL_1_1_1c; +OPENSSL_1_1_1e { + global: + EVP_PKEY_meth_get_digestsign; + EVP_PKEY_meth_get_digestverify; + EVP_PKEY_meth_set_digestsign; + EVP_PKEY_meth_set_digestverify; + RSA_get0_pss_params; +} OPENSSL_1_1_1d; +OPENSSL_1_1_1h { + global: + EC_KEY_decoded_from_explicit_params; + X509_ALGOR_copy; + X509_REQ_set0_signature; + X509_REQ_set1_signature_algo; + local: *; +} OPENSSL_1_1_1e; diff --git a/secure/lib/libssl/Version.map b/secure/lib/libssl/Version.map index 8c5eba6795ec..3e4e00950def 100644 --- a/secure/lib/libssl/Version.map +++ b/secure/lib/libssl/Version.map @@ -512,7 +512,6 @@ OPENSSL_1_1_1 { OPENSSL_1_1_1a { global: SSL_get_signature_type_nid; - local: *; } OPENSSL_1_1_1; OPENSSL_1_1_1e { From owner-dev-commits-src-all@freebsd.org Wed Jun 9 22:19:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92623654B78; Wed, 9 Jun 2021 22:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0hP23lq5z3sbc; Wed, 9 Jun 2021 22:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6966B23DFE; Wed, 9 Jun 2021 22:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159MJoPN023873; Wed, 9 Jun 2021 22:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159MJo4E023872; Wed, 9 Jun 2021 22:19:50 GMT (envelope-from git) Date: Wed, 9 Jun 2021 22:19:50 GMT Message-Id: <202106092219.159MJo4E023872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f29f5cc6f2d3 - stable/12 - libcrypto: Add symbol versions for symbols added since 1.1.1d. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f29f5cc6f2d390b1ae4a6c526271e37233aafc70 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 22:19:50 -0000 The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f29f5cc6f2d390b1ae4a6c526271e37233aafc70 commit f29f5cc6f2d390b1ae4a6c526271e37233aafc70 Author: John Baldwin AuthorDate: 2021-05-28 22:18:15 +0000 Commit: John Baldwin CommitDate: 2021-06-09 21:54:13 +0000 libcrypto: Add symbol versions for symbols added since 1.1.1d. While here, trim a spurious local: I missed when added SSL_sendfile. PR: 255277 Reported by: yuri Reviewed by: jkim Differential Revision: https://reviews.freebsd.org/D30483 (cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf) --- secure/lib/libcrypto/Version.map | 17 ++++++++++++++++- secure/lib/libssl/Version.map | 1 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/Version.map b/secure/lib/libcrypto/Version.map index 33432019a023..bed7623b9c47 100644 --- a/secure/lib/libcrypto/Version.map +++ b/secure/lib/libcrypto/Version.map @@ -4450,7 +4450,22 @@ OPENSSL_1_1_1d { global: X509_get0_authority_issuer; X509_get0_authority_serial; - local: *; } OPENSSL_1_1_1c; +OPENSSL_1_1_1e { + global: + EVP_PKEY_meth_get_digestsign; + EVP_PKEY_meth_get_digestverify; + EVP_PKEY_meth_set_digestsign; + EVP_PKEY_meth_set_digestverify; + RSA_get0_pss_params; +} OPENSSL_1_1_1d; +OPENSSL_1_1_1h { + global: + EC_KEY_decoded_from_explicit_params; + X509_ALGOR_copy; + X509_REQ_set0_signature; + X509_REQ_set1_signature_algo; + local: *; +} OPENSSL_1_1_1e; diff --git a/secure/lib/libssl/Version.map b/secure/lib/libssl/Version.map index 9011ff99d88d..118ac93966e3 100644 --- a/secure/lib/libssl/Version.map +++ b/secure/lib/libssl/Version.map @@ -512,5 +512,4 @@ OPENSSL_1_1_1 { OPENSSL_1_1_1a { global: SSL_get_signature_type_nid; - local: *; } OPENSSL_1_1_1; From owner-dev-commits-src-all@freebsd.org Wed Jun 9 23:12:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2946A65561A; Wed, 9 Jun 2021 23:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0jZF0YM3z3w4R; Wed, 9 Jun 2021 23:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF57024C49; Wed, 9 Jun 2021 23:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 159NCqMK003253; Wed, 9 Jun 2021 23:12:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159NCqGc003252; Wed, 9 Jun 2021 23:12:52 GMT (envelope-from git) Date: Wed, 9 Jun 2021 23:12:52 GMT Message-Id: <202106092312.159NCqGc003252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 597cc550e7b9 - main - LinuxKPI: add fault_flag_allow_retry_first MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 597cc550e7b98294617cdd41800e9f132b6bcad9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 23:12:53 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=597cc550e7b98294617cdd41800e9f132b6bcad9 commit 597cc550e7b98294617cdd41800e9f132b6bcad9 Author: Greg V AuthorDate: 2021-06-09 23:09:16 +0000 Commit: Ed Maste CommitDate: 2021-06-09 23:11:41 +0000 LinuxKPI: add fault_flag_allow_retry_first Used by drm 5.7. Reviewed by: bz, hselasky, nc MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30673 --- sys/compat/linuxkpi/common/include/linux/mm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 68a0f34acaf3..74709299ba1a 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -92,6 +92,9 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0); #define FAULT_FLAG_REMOTE (1 << 7) #define FAULT_FLAG_INSTRUCTION (1 << 8) +#define fault_flag_allow_retry_first(flags) \ + (((flags) & (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_TRIED)) == FAULT_FLAG_ALLOW_RETRY) + typedef int (*pte_fn_t)(linux_pte_t *, pgtable_t, unsigned long addr, void *data); struct vm_area_struct { From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:11:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD273656385; Thu, 10 Jun 2021 00:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0ksJ5z2xz4TMx; Thu, 10 Jun 2021 00:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B520A255D6; Thu, 10 Jun 2021 00:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0B0td080543; Thu, 10 Jun 2021 00:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0B0oI080542; Thu, 10 Jun 2021 00:11:00 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:11:00 GMT Message-Id: <202106100011.15A0B0oI080542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4d987cd137cb2d0d54a3e35d9258ca7c175d291 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:11:00 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f4d987cd137cb2d0d54a3e35d9258ca7c175d291 commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291 Author: Warner Losh AuthorDate: 2021-06-10 00:10:12 +0000 Commit: Warner Losh CommitDate: 2021-06-10 00:10:52 +0000 mk: WITH_FOO=no now generates a warning Many people are used to gnu configure's behavior of changing --with-foo=no to --without-foo. At the same time, several folks have WITH_FOO=no in their config files to enable this ironic form of the option because of an old meme from IRC, a mailing list or the forums (I forget which). Add a warning to allow to alert people w/o breaking POLA. Reviewed by: allanjude, bdrewery, manu MFC After: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30684 --- share/mk/bsd.mkopt.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk index 5a9cf1b2f1be..98d23dd46c2a 100644 --- a/share/mk/bsd.mkopt.mk +++ b/share/mk/bsd.mkopt.mk @@ -36,6 +36,9 @@ # .for var in ${__DEFAULT_YES_OPTIONS} .if !defined(MK_${var}) +.if defined(WITH_${var}) && ${WITH_${var}} == "no" +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" +.endif .if defined(WITHOUT_${var}) # WITHOUT always wins MK_${var}:= no .else @@ -54,6 +57,9 @@ MK_${var}:= yes # .for var in ${__DEFAULT_NO_OPTIONS} .if !defined(MK_${var}) +.if defined(WITH_${var}) && ${WITH_${var}} == "no" +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" +.endif .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins MK_${var}:= yes .else From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:14:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E66D656472; Thu, 10 Jun 2021 00:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0kxq0fypz4TXX; Thu, 10 Jun 2021 00:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF0FA25C8E; Thu, 10 Jun 2021 00:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0Es7f082568; Thu, 10 Jun 2021 00:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0Es5j082567; Thu, 10 Jun 2021 00:14:54 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:14:54 GMT Message-Id: <202106100014.15A0Es5j082567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a4f99b3c2384 - stable/13 - Disable building svnlite(1) by default. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4f99b3c2384e04118182d917c689d446a63be71 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:14:55 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a4f99b3c2384e04118182d917c689d446a63be71 commit a4f99b3c2384e04118182d917c689d446a63be71 Author: John Baldwin AuthorDate: 2021-05-05 21:05:10 +0000 Commit: John Baldwin CommitDate: 2021-06-09 22:21:59 +0000 Disable building svnlite(1) by default. Now that all repositories have switched to git, initiate the de-orbit burn for svnlite(1). Reviewed by: emaste Relnotes: yes Differential Revision: https://reviews.freebsd.org/D30105 (cherry picked from commit a2bc17474b962ba9e29c4526356203fe48a549eb) --- share/mk/src.opts.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index d01472c7fae6..70462adb6a37 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -176,7 +176,6 @@ __DEFAULT_YES_OPTIONS = \ SOURCELESS_HOST \ SOURCELESS_UCODE \ STATS \ - SVNLITE \ SYSCONS \ SYSTEM_COMPILER \ SYSTEM_LINKER \ @@ -216,6 +215,7 @@ __DEFAULT_NO_OPTIONS = \ RPCBIND_WARMSTART_SUPPORT \ SORT_THREADS \ SVN \ + SVNLITE \ ZONEINFO_LEAPSECONDS_SUPPORT \ # LEFT/RIGHT. Left options which default to "yes" unless their corresponding From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:14:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6628C65604A; Thu, 10 Jun 2021 00:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0kxs1ztGz4TM0; Thu, 10 Jun 2021 00:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 241C325C52; Thu, 10 Jun 2021 00:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0Ev9o082623; Thu, 10 Jun 2021 00:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0EvuP082622; Thu, 10 Jun 2021 00:14:57 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:14:57 GMT Message-Id: <202106100014.15A0EvuP082622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cbf2dc5ffc8b - stable/13 - src.conf.5: Regen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:14:57 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c commit cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c Author: John Baldwin AuthorDate: 2021-06-09 22:24:42 +0000 Commit: John Baldwin CommitDate: 2021-06-09 22:24:42 +0000 src.conf.5: Regen. --- share/man/man5/src.conf.5 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 90905413175e..dad8d465e3fd 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 4, 2021 +.Dd June 9, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1250,10 +1250,19 @@ Set to build nvme related tools and kernel modules. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. -.It Va WITH_OFED -Set to build the +.It Va WITHOUT_OFED +Set to disable the build of the .Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. +Infiniband software stack, including kernel modules and userspace libraries. +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_OFED_EXTRA +.El .It Va WITH_OFED_EXTRA Set to build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" @@ -1497,8 +1506,8 @@ Set to install .Xr svnlite 1 as .Xr svn 1 . -.It Va WITHOUT_SVNLITE -Set to not build +.It Va WITH_SVNLITE +Build .Xr svnlite 1 and related programs. .It Va WITHOUT_SYSCONS From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:14:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 873A3656473; Thu, 10 Jun 2021 00:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0kxr2kTpz4TRd; Thu, 10 Jun 2021 00:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C3462592B; Thu, 10 Jun 2021 00:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0EtVT082599; Thu, 10 Jun 2021 00:14:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0Ett1082598; Thu, 10 Jun 2021 00:14:55 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:14:55 GMT Message-Id: <202106100014.15A0Ett1082598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 214bbc2ddca8 - stable/13 - Add a description for WITH_SVNLITE. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 214bbc2ddca8708004df7577fe70d38c91c69e5e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:14:56 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=214bbc2ddca8708004df7577fe70d38c91c69e5e commit 214bbc2ddca8708004df7577fe70d38c91c69e5e Author: John Baldwin AuthorDate: 2021-05-05 21:05:38 +0000 Commit: John Baldwin CommitDate: 2021-06-09 22:22:43 +0000 Add a description for WITH_SVNLITE. Reviewed by: emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D30106 (cherry picked from commit 0ac711e07ece9ac260023a62250d50fb2f37e975) --- tools/build/options/WITH_SVNLITE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/build/options/WITH_SVNLITE b/tools/build/options/WITH_SVNLITE new file mode 100644 index 000000000000..25aeec40fab1 --- /dev/null +++ b/tools/build/options/WITH_SVNLITE @@ -0,0 +1,3 @@ +Build +.Xr svnlite 1 +and related programs. From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:48:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20878656FC6; Thu, 10 Jun 2021 00:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhF0P5Sz4Wl8; Thu, 10 Jun 2021 00:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D1325E3C; Thu, 10 Jun 2021 00:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mCks022994; Thu, 10 Jun 2021 00:48:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mCsT022993; Thu, 10 Jun 2021 00:48:12 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:12 GMT Message-Id: <202106100048.15A0mCsT022993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b48d1066d54b - stable/13 - madt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b48d1066d54b1a134cbf64f86c0bc2035fd08251 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:13 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b48d1066d54b1a134cbf64f86c0bc2035fd08251 commit b48d1066d54b1a134cbf64f86c0bc2035fd08251 Author: Konstantin Belousov AuthorDate: 2021-06-02 22:01:28 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 madt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC (cherry picked from commit a603d41aca48ff21df59967c55ddef181e16ec14) --- sys/x86/acpica/madt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index 5683f7eb321d..11c7b9de52d7 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -158,7 +158,9 @@ madt_setup_local(void) reason = "by DMAR table"; acpi_unmap_table(dmartbl); } - if (vm_guest == VM_GUEST_VMWARE) { + if (reason != NULL) { + /* Already disabled */ + } else if (vm_guest == VM_GUEST_VMWARE) { vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:48:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34CF7657142; Thu, 10 Jun 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhG1124z4WlB; Thu, 10 Jun 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C39D25E3D; Thu, 10 Jun 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mDnt023018; Thu, 10 Jun 2021 00:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mDXd023017; Thu, 10 Jun 2021 00:48:13 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:13 GMT Message-Id: <202106100048.15A0mDXd023017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ca473f38c156 - stable/13 - madt_setup_local: convert series of strcmp to iteration over the array MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca473f38c1568c89113e64e1495df3f17271b433 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:14 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ca473f38c1568c89113e64e1495df3f17271b433 commit ca473f38c1568c89113e64e1495df3f17271b433 Author: Konstantin Belousov AuthorDate: 2021-06-02 22:19:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 madt_setup_local: convert series of strcmp to iteration over the array (cherry picked from commit 92adf00d0512b674ce18eb1a542ae42e85dd5bca) --- sys/x86/acpica/madt.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index 11c7b9de52d7..035a618f68a3 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -128,6 +128,11 @@ madt_probe_cpus(void) return (0); } +static const char *x2apic_sandy_dis[] = { + "LENOVO", + "ASUSTeK Computer Inc.", +}; + /* * Initialize the local APIC on the BSP. */ @@ -139,7 +144,7 @@ madt_setup_local(void) const char *reason; char *hw_vendor; u_int p[4]; - int user_x2apic; + int i, user_x2apic; bool bios_x2apic; if ((cpu_feature2 & CPUID2_X2APIC) != 0) { @@ -173,21 +178,22 @@ madt_setup_local(void) CPUID_TO_MODEL(cpu_id) == 0x2a) { hw_vendor = kern_getenv("smbios.planar.maker"); /* - * It seems that some Lenovo and ASUS - * SandyBridge-based notebook BIOSes have a - * bug which prevents booting AP in x2APIC - * mode. Since the only way to detect mobile - * CPU is to check northbridge pci id, which - * cannot be done that early, disable x2APIC - * for all Lenovo and ASUS SandyBridge + * It seems that some SandyBridge-based + * notebook BIOSes have a bug which prevents + * booting AP in x2APIC mode. Since the only + * way to detect mobile CPU is to check + * northbridge pci id, which cannot be done + * that early, disable x2APIC for all such * machines. */ if (hw_vendor != NULL) { - if (!strcmp(hw_vendor, "LENOVO") || - !strcmp(hw_vendor, - "ASUSTeK Computer Inc.")) { - reason = + for (i = 0; i < nitems(x2apic_sandy_dis); i++) { + if (strcmp(hw_vendor, + x2apic_sandy_dis[i]) == 0) { + reason = "for a suspected SandyBridge BIOS bug"; + break; + } } freeenv(hw_vendor); } From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:48:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B4E4656F68; Thu, 10 Jun 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhH1z51z4Wc0; Thu, 10 Jun 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C4882597B; Thu, 10 Jun 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mFcG023042; Thu, 10 Jun 2021 00:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mFpH023041; Thu, 10 Jun 2021 00:48:15 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:15 GMT Message-Id: <202106100048.15A0mFpH023041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9e500de92587 - stable/13 - madt_setup_local: extract special case checks into a helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9e500de925873bb16e45def54512d3abda958ae3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:15 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9e500de925873bb16e45def54512d3abda958ae3 commit 9e500de925873bb16e45def54512d3abda958ae3 Author: Konstantin Belousov AuthorDate: 2021-06-02 22:27:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 madt_setup_local: extract special case checks into a helper (cherry picked from commit e9e00cc0c98738f0ce7bface221c920c36a1356e) --- sys/x86/acpica/madt.c | 114 ++++++++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 50 deletions(-) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index 035a618f68a3..e041296d4ca5 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -134,70 +134,84 @@ static const char *x2apic_sandy_dis[] = { }; /* - * Initialize the local APIC on the BSP. + * Automatically detect several configurations where x2APIC mode is + * known to cause troubles. User can override the setting with + * hw.x2apic_enable tunable. */ -static int -madt_setup_local(void) +static const char * +madt_x2apic_disable_reason(void) { ACPI_TABLE_DMAR *dmartbl; vm_paddr_t dmartbl_physaddr; const char *reason; char *hw_vendor; u_int p[4]; - int i, user_x2apic; - bool bios_x2apic; + int i; - if ((cpu_feature2 & CPUID2_X2APIC) != 0) { - reason = NULL; + reason = NULL; + dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR); + if (dmartbl_physaddr != 0) { + dmartbl = acpi_map_table(dmartbl_physaddr, ACPI_SIG_DMAR); + if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) + reason = "by DMAR table"; + acpi_unmap_table(dmartbl); + if (reason != NULL) + return (reason); + } + + if (vm_guest == VM_GUEST_VMWARE) { + vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); + if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || + (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) + return ("inside VMWare without intr redirection"); + } + + if (vm_guest == VM_GUEST_XEN) + return ("due to running under XEN"); + + if (vm_guest == VM_GUEST_NO && + CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) == 0x2a) { + hw_vendor = kern_getenv("smbios.planar.maker"); /* - * Automatically detect several configurations where - * x2APIC mode is known to cause troubles. User can - * override the setting with hw.x2apic_enable tunable. + * It seems that some SandyBridge-based notebook + * BIOSes have a bug which prevents booting AP in + * x2APIC mode. Since the only way to detect mobile + * CPU is to check northbridge pci id, which cannot be + * done that early, disable x2APIC for all such + * machines. */ - dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR); - if (dmartbl_physaddr != 0) { - dmartbl = acpi_map_table(dmartbl_physaddr, - ACPI_SIG_DMAR); - if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) - reason = "by DMAR table"; - acpi_unmap_table(dmartbl); - } - if (reason != NULL) { - /* Already disabled */ - } else if (vm_guest == VM_GUEST_VMWARE) { - vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p); - if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 || - (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) - reason = - "inside VMWare without intr redirection"; - } else if (vm_guest == VM_GUEST_XEN) { - reason = "due to running under XEN"; - } else if (vm_guest == VM_GUEST_NO && - CPUID_TO_FAMILY(cpu_id) == 0x6 && - CPUID_TO_MODEL(cpu_id) == 0x2a) { - hw_vendor = kern_getenv("smbios.planar.maker"); - /* - * It seems that some SandyBridge-based - * notebook BIOSes have a bug which prevents - * booting AP in x2APIC mode. Since the only - * way to detect mobile CPU is to check - * northbridge pci id, which cannot be done - * that early, disable x2APIC for all such - * machines. - */ - if (hw_vendor != NULL) { - for (i = 0; i < nitems(x2apic_sandy_dis); i++) { - if (strcmp(hw_vendor, - x2apic_sandy_dis[i]) == 0) { - reason = - "for a suspected SandyBridge BIOS bug"; - break; - } + if (hw_vendor != NULL) { + for (i = 0; i < nitems(x2apic_sandy_dis); i++) { + if (strcmp(hw_vendor, x2apic_sandy_dis[i]) == + 0) { + reason = + "for a suspected SandyBridge BIOS bug"; + break; } - freeenv(hw_vendor); } + freeenv(hw_vendor); } + if (reason != NULL) + return (reason); + } + + return (NULL); +} + +/* + * Initialize the local APIC on the BSP. + */ +static int +madt_setup_local(void) +{ + const char *reason; + int user_x2apic; + bool bios_x2apic; + + if ((cpu_feature2 & CPUID2_X2APIC) != 0) { + reason = madt_x2apic_disable_reason(); bios_x2apic = lapic_is_x2apic(); if (reason != NULL && bios_x2apic) { if (bootverbose) From owner-dev-commits-src-all@freebsd.org Thu Jun 10 00:48:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B37F3656AF5; Thu, 10 Jun 2021 00:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0lhJ3Vgwz4Wc8; Thu, 10 Jun 2021 00:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DD3026124; Thu, 10 Jun 2021 00:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A0mGhY023072; Thu, 10 Jun 2021 00:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A0mG0W023071; Thu, 10 Jun 2021 00:48:16 GMT (envelope-from git) Date: Thu, 10 Jun 2021 00:48:16 GMT Message-Id: <202106100048.15A0mG0W023071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c04954bb39d8 - stable/13 - Disable x2APIC for SandyBridge laptops with Samsung BIOS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c04954bb39d807860d27ffe867d86c1f12465f6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 00:48:17 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c04954bb39d807860d27ffe867d86c1f12465f6e commit c04954bb39d807860d27ffe867d86c1f12465f6e Author: Konstantin Belousov AuthorDate: 2021-06-02 22:29:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-10 00:47:50 +0000 Disable x2APIC for SandyBridge laptops with Samsung BIOS PR: 256389 (cherry picked from commit 37f780d3e0a2e8e4c64c526b6e7dc77ff6b91057) --- sys/x86/acpica/madt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index e041296d4ca5..8e343a6619f3 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -131,6 +131,7 @@ madt_probe_cpus(void) static const char *x2apic_sandy_dis[] = { "LENOVO", "ASUSTeK Computer Inc.", + "SAMSUNG ELECTRONICS CO., LTD.", }; /* From owner-dev-commits-src-all@freebsd.org Thu Jun 10 02:17:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6F7B64045D; Thu, 10 Jun 2021 02:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0ngG5qjYz4jk5; Thu, 10 Jun 2021 02:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF979271F3; Thu, 10 Jun 2021 02:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A2HUqN043818; Thu, 10 Jun 2021 02:17:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A2HUS0043817; Thu, 10 Jun 2021 02:17:30 GMT (envelope-from git) Date: Thu, 10 Jun 2021 02:17:30 GMT Message-Id: <202106100217.15A2HUS0043817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 36435ca5d3fa - main - insetad -> instead MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36435ca5d3faa869c76f488c41daa9d195496f1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 02:17:30 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=36435ca5d3faa869c76f488c41daa9d195496f1f commit 36435ca5d3faa869c76f488c41daa9d195496f1f Author: Warner Losh AuthorDate: 2021-06-10 02:17:22 +0000 Commit: Warner Losh CommitDate: 2021-06-10 02:17:22 +0000 insetad -> instead --- share/mk/bsd.mkopt.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk index 98d23dd46c2a..794f4108b7d7 100644 --- a/share/mk/bsd.mkopt.mk +++ b/share/mk/bsd.mkopt.mk @@ -37,7 +37,7 @@ .for var in ${__DEFAULT_YES_OPTIONS} .if !defined(MK_${var}) .if defined(WITH_${var}) && ${WITH_${var}} == "no" -.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" +.warning "Use WITHOUT_${var}=1 instead of WITH_${var}=no" .endif .if defined(WITHOUT_${var}) # WITHOUT always wins MK_${var}:= no @@ -58,7 +58,7 @@ MK_${var}:= yes .for var in ${__DEFAULT_NO_OPTIONS} .if !defined(MK_${var}) .if defined(WITH_${var}) && ${WITH_${var}} == "no" -.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" +.warning "Use WITHOUT_${var}=1 instead of WITH_${var}=no" .endif .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins MK_${var}:= yes From owner-dev-commits-src-all@freebsd.org Thu Jun 10 02:31:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E7A5640A5C; Thu, 10 Jun 2021 02:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0nz50WNyz4kfR; Thu, 10 Jun 2021 02:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB8E27903; Thu, 10 Jun 2021 02:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A2VCxl066249; Thu, 10 Jun 2021 02:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A2VCsx066248; Thu, 10 Jun 2021 02:31:12 GMT (envelope-from git) Date: Thu, 10 Jun 2021 02:31:12 GMT Message-Id: <202106100231.15A2VCsx066248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 4ab5c88da287 - main - stress2: Exclude new syzkaller tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ab5c88da28780334f48eae56db52d8e77c871cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 02:31:13 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=4ab5c88da28780334f48eae56db52d8e77c871cf commit 4ab5c88da28780334f48eae56db52d8e77c871cf Author: Peter Holm AuthorDate: 2021-06-10 02:30:12 +0000 Commit: Peter Holm CommitDate: 2021-06-10 02:30:12 +0000 stress2: Exclude new syzkaller tests --- tools/test/stress2/misc/all.exclude | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index 4f818b53a976..833e4fb0dbd3 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -64,6 +64,9 @@ syzkaller30.sh May change policy for random threads to to domainset_fixed 20210 syzkaller31.sh panic: Bad tailq NEXT(0xfffffe0079608f00->tqh_last) != NULL 20210322 syzkaller32.sh Fatal trap 18: integer divide fault while in kernel mode 20210322 syzkaller33.sh Fatal trap 18: integer divide fault while in kernel mode 20210418 +syzkaller39.sh WiP 20210607 +syzkaller40.sh WiP 20210607 +syzkaller41.sh WiP 20210607 truss3.sh WiP 20200915 unionfs.sh insmntque: non-locked vp: xx is not exclusive locked... 20130909 unionfs2.sh insmntque: mp-safe fs and non-locked vp is not ... 20111219 From owner-dev-commits-src-all@freebsd.org Thu Jun 10 06:13:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 817F16435C1; Thu, 10 Jun 2021 06:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0tvh3Jb5z3FFp; Thu, 10 Jun 2021 06:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FD9E26B3; Thu, 10 Jun 2021 06:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A6Dasb063845; Thu, 10 Jun 2021 06:13:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A6Daiu063844; Thu, 10 Jun 2021 06:13:36 GMT (envelope-from git) Date: Thu, 10 Jun 2021 06:13:36 GMT Message-Id: <202106100613.15A6Daiu063844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e34c3d0721bc - stable/12 - rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e34c3d0721bc52b4130489170e509266ce4e4b96 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 06:13:36 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e34c3d0721bc52b4130489170e509266ce4e4b96 commit e34c3d0721bc52b4130489170e509266ce4e4b96 Author: Dmitry Chagin AuthorDate: 2021-05-27 18:52:10 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 06:13:04 +0000 rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. PR: 256203 Submitted by: Steve Kargl sgk at troutmask.apl.washington.edu (cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09) --- share/man/man4/rtwn_usb.4 | 3 ++- sys/dev/rtwn/usb/rtwn_usb_attach.h | 1 + sys/dev/usb/usbdevs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index b146cfe4fe09..86c4c02aafa9 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 26, 2021 +.Dd May 27, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -99,6 +99,7 @@ based USB wireless network adapters, including: .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0 +.It "TP-Link Archer T2U v3" Ta RTL8821AU Ta USB 2.0 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0 diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.h b/sys/dev/rtwn/usb/rtwn_usb_attach.h index 40076dbb941c..c7a0f1ce1576 100644 --- a/sys/dev/rtwn/usb/rtwn_usb_attach.h +++ b/sys/dev/rtwn/usb/rtwn_usb_attach.h @@ -167,6 +167,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2), RTWN_RTL8821AU_DEV(TPLINK, T2UNANO), RTWN_RTL8821AU_DEV(TPLINK, T2UPLUS), + RTWN_RTL8821AU_DEV(TPLINK, T2UV3), #undef RTWN_RTL8821AU_DEV }; diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 9add31c6d781..15cd996745e6 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4694,6 +4694,7 @@ product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 product TPLINK T2UNANO 0x011e Archer T2U Nano +product TPLINK T2UV3 0x011f Archer T2U ver 3 product TPLINK T2UPLUS 0x0120 Archer T2U Plus product TPLINK RTL8153 0x0601 RTL8153 USB 10/100/1000 LAN From owner-dev-commits-src-all@freebsd.org Thu Jun 10 06:14:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D4E36438C9; Thu, 10 Jun 2021 06:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0twz5c33z3FfJ; Thu, 10 Jun 2021 06:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 527241F71; Thu, 10 Jun 2021 06:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A6Eh7K064079; Thu, 10 Jun 2021 06:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A6EhF1064078; Thu, 10 Jun 2021 06:14:43 GMT (envelope-from git) Date: Thu, 10 Jun 2021 06:14:43 GMT Message-Id: <202106100614.15A6EhF1064078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 923cd7e05af8 - stable/13 - rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 923cd7e05af843421b6eb46086f9a786f643361c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 06:14:44 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=923cd7e05af843421b6eb46086f9a786f643361c commit 923cd7e05af843421b6eb46086f9a786f643361c Author: Dmitry Chagin AuthorDate: 2021-05-27 18:52:10 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 06:14:22 +0000 rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3. PR: 256203 Submitted by: Steve Kargl sgk at troutmask.apl.washington.edu (cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09) --- share/man/man4/rtwn_usb.4 | 3 ++- sys/dev/rtwn/usb/rtwn_usb_attach.h | 1 + sys/dev/usb/usbdevs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4 index b146cfe4fe09..86c4c02aafa9 100644 --- a/share/man/man4/rtwn_usb.4 +++ b/share/man/man4/rtwn_usb.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 26, 2021 +.Dd May 27, 2021 .Dt RTWN_USB 4 .Os .Sh NAME @@ -99,6 +99,7 @@ based USB wireless network adapters, including: .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0 +.It "TP-Link Archer T2U v3" Ta RTL8821AU Ta USB 2.0 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0 diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.h b/sys/dev/rtwn/usb/rtwn_usb_attach.h index 40076dbb941c..c7a0f1ce1576 100644 --- a/sys/dev/rtwn/usb/rtwn_usb_attach.h +++ b/sys/dev/rtwn/usb/rtwn_usb_attach.h @@ -167,6 +167,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2), RTWN_RTL8821AU_DEV(TPLINK, T2UNANO), RTWN_RTL8821AU_DEV(TPLINK, T2UPLUS), + RTWN_RTL8821AU_DEV(TPLINK, T2UV3), #undef RTWN_RTL8821AU_DEV }; diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 1239449b4697..b3cf80be01a4 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -4699,6 +4699,7 @@ product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 product TPLINK T2UNANO 0x011e Archer T2U Nano +product TPLINK T2UV3 0x011f Archer T2U ver 3 product TPLINK T2UPLUS 0x0120 Archer T2U Plus product TPLINK RTL8153 0x0601 RTL8153 USB 10/100/1000 LAN From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:30:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40174646378; Thu, 10 Jun 2021 09:30:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHH1P2Wz3lQQ; Thu, 10 Jun 2021 09:30:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18D254E7B; Thu, 10 Jun 2021 09:30:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9Up8P029460; Thu, 10 Jun 2021 09:30:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9UpO2029459; Thu, 10 Jun 2021 09:30:51 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:30:51 GMT Message-Id: <202106100930.15A9UpO2029459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 37370a6773cd - stable/13 - netgraph/ng_base: Renaming a node to the same name is a noop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 37370a6773cde7fcae063aed0a4cc024f95534bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:30:51 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=37370a6773cde7fcae063aed0a4cc024f95534bd commit 37370a6773cde7fcae063aed0a4cc024f95534bd Author: Lutz Donnerhacke AuthorDate: 2021-05-04 19:20:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-10 09:29:34 +0000 netgraph/ng_base: Renaming a node to the same name is a noop Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong Differential Revision: https://reviews.freebsd.org/D30110 (cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a) --- sys/netgraph/ng_base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 63bc251f52f9..ae179cf13a45 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -855,6 +855,10 @@ ng_name_node(node_p node, const char *name) node_p node2; int i; + /* Rename without change is a noop */ + if (strcmp(NG_NODE_NAME(node), name) == 0) + return (0); + /* Check the name is valid */ for (i = 0; i < NG_NODESIZ; i++) { if (name[i] == '\0' || name[i] == '.' || name[i] == ':') From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:30:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBF356467C5; Thu, 10 Jun 2021 09:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHR5Pp1z3lct; Thu, 10 Jun 2021 09:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A161E4EDD; Thu, 10 Jun 2021 09:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9UxpZ030121; Thu, 10 Jun 2021 09:30:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9Ux5W030120; Thu, 10 Jun 2021 09:30:59 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:30:59 GMT Message-Id: <202106100930.15A9Ux5W030120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 540206069cb6 - stable/12 - Direct commit: MFC r367395 (e9b13c6612fea4e74f0c9c543e21d29d91a24dff) by cem: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 540206069cb6c0449a00745c57b74d19f4b216b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:30:59 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=540206069cb6c0449a00745c57b74d19f4b216b8 commit 540206069cb6c0449a00745c57b74d19f4b216b8 Author: Dmitry Chagin AuthorDate: 2021-06-10 09:22:43 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:22:43 +0000 Direct commit: MFC r367395 (e9b13c6612fea4e74f0c9c543e21d29d91a24dff) by cem: linux(4): Deduplicate unimpl/dummy syscall handlers No functional change. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27099 --- sys/amd64/linux/linux_dummy.c | 192 --------------------- sys/amd64/linux/linux_dummy_machdep.c | 74 ++++++++ sys/amd64/linux32/linux32_dummy.c | 119 ------------- sys/arm64/linux/linux_dummy_machdep.c | 63 +++++++ sys/{arm64 => compat}/linux/linux_dummy.c | 24 +-- sys/conf/files.amd64 | 2 + sys/conf/files.i386 | 4 +- .../linux/{linux_dummy.c => linux_dummy_machdep.c} | 131 +------------- sys/modules/linux/Makefile | 6 + sys/modules/linux64/Makefile | 8 +- sys/modules/linux_common/Makefile | 2 +- sys/x86/linux/linux_dummy_x86.c | 69 ++++++++ 12 files changed, 242 insertions(+), 452 deletions(-) diff --git a/sys/amd64/linux/linux_dummy.c b/sys/amd64/linux/linux_dummy.c deleted file mode 100644 index ee21b4da212b..000000000000 --- a/sys/amd64/linux/linux_dummy.c +++ /dev/null @@ -1,192 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2013 Dmitry Chagin - * 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 -#include -#include -#include -#include - -#include -#include -#include -#include - -/* DTrace init */ -LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); - -UNIMPLEMENTED(afs_syscall); -UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(epoll_ctl_old); -UNIMPLEMENTED(epoll_wait_old); -UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(get_thread_area); -UNIMPLEMENTED(getpmsg); -UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ -UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ -UNIMPLEMENTED(tuxcall); -UNIMPLEMENTED(security); -UNIMPLEMENTED(set_thread_area); -UNIMPLEMENTED(uselib); -UNIMPLEMENTED(vserver); - -DUMMY(sendfile); -DUMMY(setfsuid); -DUMMY(setfsgid); -DUMMY(sysfs); -DUMMY(vhangup); -DUMMY(modify_ldt); -DUMMY(pivot_root); -DUMMY(adjtimex); -DUMMY(swapoff); -DUMMY(init_module); -DUMMY(ioperm); -DUMMY(delete_module); -DUMMY(quotactl); -DUMMY(readahead); -DUMMY(io_setup); -DUMMY(io_destroy); -DUMMY(io_getevents); -DUMMY(io_submit); -DUMMY(io_cancel); -DUMMY(lookup_dcookie); -DUMMY(remap_file_pages); -DUMMY(restart_syscall); -DUMMY(semtimedop); -DUMMY(mbind); -DUMMY(get_mempolicy); -DUMMY(set_mempolicy); -DUMMY(mq_open); -DUMMY(mq_unlink); -DUMMY(mq_timedsend); -DUMMY(mq_timedreceive); -DUMMY(mq_notify); -DUMMY(mq_getsetattr); -DUMMY(kexec_load); -/* Linux 2.6.11: */ -DUMMY(add_key); -DUMMY(request_key); -DUMMY(keyctl); -/* Linux 2.6.13: */ -DUMMY(ioprio_set); -DUMMY(ioprio_get); -DUMMY(inotify_init); -DUMMY(inotify_add_watch); -DUMMY(inotify_rm_watch); -/* Linux 2.6.16: */ -DUMMY(migrate_pages); -DUMMY(unshare); -/* Linux 2.6.17: */ -DUMMY(tee); -DUMMY(vmsplice); -/* Linux 2.6.18: */ -DUMMY(move_pages); -/* Linux 2.6.22: */ -DUMMY(signalfd); -/* Linux 2.6.27: */ -DUMMY(signalfd4); -DUMMY(inotify_init1); -/* Linux 2.6.31: */ -DUMMY(perf_event_open); -/* Linux 2.6.36: */ -DUMMY(fanotify_init); -DUMMY(fanotify_mark); -/* Linux 2.6.39: */ -DUMMY(name_to_handle_at); -DUMMY(open_by_handle_at); -DUMMY(clock_adjtime); -/* Linux 3.0: */ -DUMMY(setns); -/* Linux 3.2: */ -DUMMY(process_vm_readv); -DUMMY(process_vm_writev); -/* Linux 3.5: */ -DUMMY(kcmp); -/* Linux 3.8: */ -DUMMY(finit_module); -DUMMY(sched_setattr); -DUMMY(sched_getattr); -/* Linux 3.15: */ -DUMMY(kexec_file_load); -/* Linux 3.17: */ -DUMMY(memfd_create); -DUMMY(seccomp); -/* Linux 3.18: */ -DUMMY(bpf); -/* Linux 3.19: */ -DUMMY(execveat); -/* Linux 4.2: */ -DUMMY(userfaultfd); -/* Linux 4.3: */ -DUMMY(membarrier); -/* Linux 4.4: */ -DUMMY(mlock2); -/* Linux 4.5: */ -DUMMY(copy_file_range); -/* Linux 4.6: */ -DUMMY(preadv2); -DUMMY(pwritev2); -/* Linux 4.8: */ -DUMMY(pkey_mprotect); -DUMMY(pkey_alloc); -DUMMY(pkey_free); -/* Linux 4.11: */ -DUMMY(statx); -/* Linux 4.18: */ -DUMMY(io_pgetevents); -DUMMY(rseq); -/* Linux 5.0: */ -DUMMY(pidfd_send_signal); -DUMMY(io_uring_setup); -DUMMY(io_uring_enter); -DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/amd64/linux/linux_dummy_machdep.c b/sys/amd64/linux/linux_dummy_machdep.c new file mode 100644 index 000000000000..aba79b69d55d --- /dev/null +++ b/sys/amd64/linux/linux_dummy_machdep.c @@ -0,0 +1,74 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 Dmitry Chagin + * 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 +#include +#include +#include +#include + +#include +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* + * Before adding new stubs to this file, please check if a stub can be added to + * the machine-independent code in sys/compat/linux/linux_dummy.c (or + * sys/x86/linux/linux_dummy_x86.c). + */ + +UNIMPLEMENTED(get_thread_area); +UNIMPLEMENTED(set_thread_area); +UNIMPLEMENTED(uselib); + +DUMMY(modify_ldt); + +DUMMY(ioperm); +DUMMY(io_setup); +DUMMY(io_destroy); +DUMMY(io_getevents); +DUMMY(io_submit); +DUMMY(io_cancel); +DUMMY(mq_open); +DUMMY(mq_unlink); +DUMMY(mq_timedsend); +DUMMY(mq_timedreceive); +DUMMY(mq_notify); +DUMMY(mq_getsetattr); +DUMMY(readahead); +DUMMY(restart_syscall); +DUMMY(semtimedop); +/* Linux 3.15: */ +DUMMY(kexec_file_load); diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c index 97a8aa0d3ddd..5eb54fefd276 100644 --- a/sys/amd64/linux32/linux32_dummy.c +++ b/sys/amd64/linux32/linux32_dummy.c @@ -43,123 +43,29 @@ __FBSDID("$FreeBSD$"); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); -UNIMPLEMENTED(afs_syscall); UNIMPLEMENTED(break); -UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(ftime); -UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(gtty); UNIMPLEMENTED(stty); UNIMPLEMENTED(lock); UNIMPLEMENTED(mpx); -UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(prof); UNIMPLEMENTED(profil); -UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(ulimit); -UNIMPLEMENTED(vserver); DUMMY(stime); DUMMY(olduname); DUMMY(uname); -DUMMY(vhangup); -DUMMY(swapoff); -DUMMY(adjtimex); -DUMMY(init_module); -DUMMY(delete_module); -DUMMY(quotactl); DUMMY(bdflush); -DUMMY(sysfs); -DUMMY(sendfile); -DUMMY(setfsuid); -DUMMY(setfsgid); -DUMMY(pivot_root); DUMMY(ptrace); -DUMMY(lookup_dcookie); -DUMMY(remap_file_pages); -DUMMY(mbind); -DUMMY(get_mempolicy); -DUMMY(set_mempolicy); DUMMY(mq_open); DUMMY(mq_unlink); DUMMY(mq_timedsend); DUMMY(mq_timedreceive); DUMMY(mq_notify); DUMMY(mq_getsetattr); -DUMMY(kexec_load); -/* Linux 2.6.11: */ -DUMMY(add_key); -DUMMY(request_key); -DUMMY(keyctl); -/* Linux 2.6.13: */ -DUMMY(ioprio_set); -DUMMY(ioprio_get); -DUMMY(inotify_init); -DUMMY(inotify_add_watch); -DUMMY(inotify_rm_watch); -/* Linux 2.6.16: */ -DUMMY(migrate_pages); -DUMMY(unshare); -/* Linux 2.6.17: */ -DUMMY(tee); -DUMMY(vmsplice); -/* Linux 2.6.18: */ -DUMMY(move_pages); -/* Linux 2.6.22: */ -DUMMY(signalfd); -/* Linux 2.6.27: */ -DUMMY(signalfd4); -DUMMY(inotify_init1); -/* Linux 2.6.31: */ -DUMMY(perf_event_open); -/* Linux 2.6.36: */ -DUMMY(fanotify_init); -DUMMY(fanotify_mark); -/* Linux 2.6.39: */ -DUMMY(name_to_handle_at); -DUMMY(open_by_handle_at); -DUMMY(clock_adjtime); -/* Linux 3.0: */ -DUMMY(setns); -/* Linux 3.2: */ -DUMMY(process_vm_readv); -DUMMY(process_vm_writev); -/* Linux 3.5: */ -DUMMY(kcmp); -/* Linux 3.8: */ -DUMMY(finit_module); -DUMMY(sched_setattr); -DUMMY(sched_getattr); -/* Linux 3.17: */ -DUMMY(memfd_create); -DUMMY(seccomp); -/* Linux 3.18: */ -DUMMY(bpf); -/* Linux 3.19: */ -DUMMY(execveat); -/* Linux 4.2: */ -DUMMY(userfaultfd); -/* Linux 4.3: */ -DUMMY(membarrier); -/* Linux 4.4: */ -DUMMY(mlock2); -/* Linux 4.5: */ -DUMMY(copy_file_range); -/* Linux 4.6: */ -DUMMY(preadv2); -DUMMY(pwritev2); -/* Linux 4.8: */ -DUMMY(pkey_mprotect); -DUMMY(pkey_alloc); -DUMMY(pkey_free); /* Linux 4.11: */ -DUMMY(statx); DUMMY(arch_prctl); -/* Linux 4.18: */ -DUMMY(io_pgetevents); -DUMMY(rseq); /* Linux 5.0: */ DUMMY(clock_gettime64); DUMMY(clock_settime64); @@ -181,28 +87,3 @@ DUMMY(semtimedop_time64); DUMMY(rt_sigtimedwait_time64); DUMMY(futex_time64); DUMMY(sched_rr_get_interval_time64); -DUMMY(pidfd_send_signal); -DUMMY(io_uring_setup); -DUMMY(io_uring_enter); -DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/arm64/linux/linux_dummy_machdep.c b/sys/arm64/linux/linux_dummy_machdep.c new file mode 100644 index 000000000000..b006809740d7 --- /dev/null +++ b/sys/arm64/linux/linux_dummy_machdep.c @@ -0,0 +1,63 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 Dmitry Chagin + * 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_compat.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* + * Before adding new stubs to this file, please check if a stub can be added to + * the machine-independent code in sys/compat/linux/linux_dummy.c. + */ + +UNIMPLEMENTED(get_thread_area); +UNIMPLEMENTED(set_thread_area); +UNIMPLEMENTED(uselib); + +DUMMY(mq_open); +DUMMY(mq_unlink); +DUMMY(mq_timedsend); +DUMMY(mq_timedreceive); +DUMMY(mq_notify); +DUMMY(mq_getsetattr); +DUMMY(semtimedop); diff --git a/sys/arm64/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c similarity index 90% rename from sys/arm64/linux/linux_dummy.c rename to sys/compat/linux/linux_dummy.c index 92a0feb94f73..1003b7d4c6e4 100644 --- a/sys/arm64/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -37,14 +37,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif + #include #include -// LINUXTODO: deduplicate arm64 dummy against other archs? -// LINUXTODO: review/update/add unimplemented syscalls - /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -53,15 +56,11 @@ UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(epoll_ctl_old); UNIMPLEMENTED(epoll_wait_old); UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(get_thread_area); UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(putpmsg); UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(security); -UNIMPLEMENTED(set_thread_area); -UNIMPLEMENTED(tuxcall); -UNIMPLEMENTED(uselib); UNIMPLEMENTED(vserver); DUMMY(sendfile); @@ -75,16 +74,9 @@ DUMMY(init_module); DUMMY(delete_module); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); -DUMMY(semtimedop); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); -DUMMY(mq_open); -DUMMY(mq_unlink); -DUMMY(mq_timedsend); -DUMMY(mq_timedreceive); -DUMMY(mq_notify); -DUMMY(mq_getsetattr); DUMMY(kexec_load); /* Linux 2.6.11: */ DUMMY(add_key); diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index b78d99336b03..5effa0f5f9c6 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -714,6 +714,7 @@ amd64/linux32/linux32_support.s optional compat_linux32 \ dependency "linux32_assym.h" amd64/linux32/linux32_sysent.c optional compat_linux32 amd64/linux32/linux32_sysvec.c optional compat_linux32 +compat/linux/linux_dummy.c optional compat_linux32 compat/linux/linux_emul.c optional compat_linux32 compat/linux/linux_errno.c optional compat_linux32 compat/linux/linux_file.c optional compat_linux32 @@ -737,6 +738,7 @@ compat/linux/linux_vdso.c optional compat_linux32 compat/linux/linux_common.c optional compat_linux32 compat/linux/linux_event.c optional compat_linux32 compat/linux/linux.c optional compat_linux32 +x86/linux/linux_dummy_x86.c optional compat_linux32 dev/amr/amr_linux.c optional compat_linux32 amr dev/mfi/mfi_linux.c optional compat_linux32 mfi # diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 8077a7bafa0f..ffbb8c314e3e 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -86,6 +86,7 @@ cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs +compat/linux/linux_dummy.c optional compat_linux compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux compat/linux/linux_errno.c optional compat_linux @@ -542,7 +543,7 @@ i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_copyout.c optional compat_linux -i386/linux/linux_dummy.c optional compat_linux +i386/linux/linux_dummy_machdep.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux i386/linux/linux_sysent.c optional compat_linux @@ -608,6 +609,7 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa +x86/linux/linux_dummy_x86.c optional compat_linux x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci x86/x86/autoconf.c standard diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy_machdep.c similarity index 50% rename from sys/i386/linux/linux_dummy.c rename to sys/i386/linux/linux_dummy_machdep.c index 05c873529c15..dfcc691a3582 100644 --- a/sys/i386/linux/linux_dummy.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -43,119 +43,31 @@ __FBSDID("$FreeBSD$"); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); -UNIMPLEMENTED(afs_syscall); +/* + * Before adding new stubs to this file, please check if a stub can be added to + * the machine-independent code in sys/compat/linux/linux_dummy.c (or + * sys/x86/linux/linux_dummy_x86.c). + */ + UNIMPLEMENTED(break); -UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(ftime); -UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ -UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(gtty); UNIMPLEMENTED(stty); UNIMPLEMENTED(lock); UNIMPLEMENTED(mpx); -UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(prof); UNIMPLEMENTED(profil); -UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(ulimit); -UNIMPLEMENTED(vserver); -DUMMY(stime); +DUMMY(bdflush); DUMMY(fstat); DUMMY(olduname); +DUMMY(stime); DUMMY(uname); -DUMMY(vhangup); -DUMMY(vm86old); -DUMMY(swapoff); -DUMMY(adjtimex); -DUMMY(init_module); -DUMMY(delete_module); -DUMMY(quotactl); -DUMMY(bdflush); -DUMMY(sysfs); DUMMY(vm86); -DUMMY(sendfile); /* different semantics */ -DUMMY(setfsuid); -DUMMY(setfsgid); -DUMMY(pivot_root); -DUMMY(lookup_dcookie); -DUMMY(remap_file_pages); -DUMMY(mbind); -DUMMY(get_mempolicy); -DUMMY(set_mempolicy); -DUMMY(kexec_load); -/* Linux 2.6.11: */ -DUMMY(add_key); -DUMMY(request_key); -DUMMY(keyctl); -/* Linux 2.6.13: */ -DUMMY(ioprio_set); -DUMMY(ioprio_get); -DUMMY(inotify_init); -DUMMY(inotify_add_watch); -DUMMY(inotify_rm_watch); -/* Linux 2.6.16: */ -DUMMY(migrate_pages); -DUMMY(unshare); -/* Linux 2.6.17: */ -DUMMY(tee); -DUMMY(vmsplice); -/* Linux 2.6.18: */ -DUMMY(move_pages); -/* Linux 2.6.22: */ -DUMMY(signalfd); -/* Linux 2.6.27: */ -DUMMY(signalfd4); -DUMMY(inotify_init1); -/* Linux 2.6.31: */ -DUMMY(perf_event_open); -/* Linux 2.6.36: */ -DUMMY(fanotify_init); -DUMMY(fanotify_mark); -/* Linux 2.6.39: */ -DUMMY(name_to_handle_at); -DUMMY(open_by_handle_at); -DUMMY(clock_adjtime); -/* Linux 3.0: */ -DUMMY(setns); -/* Linux 3.2: */ -DUMMY(process_vm_readv); -DUMMY(process_vm_writev); -/* Linux 3.5: */ -DUMMY(kcmp); -/* Linux 3.8: */ -DUMMY(finit_module); -DUMMY(sched_setattr); -DUMMY(sched_getattr); -/* Linux 3.17: */ -DUMMY(memfd_create); -DUMMY(seccomp); -/* Linux 3.18: */ -DUMMY(bpf); -/* Linux 3.19: */ -DUMMY(execveat); -/* Linux 4.2: */ -DUMMY(userfaultfd); -/* Linux 4.3: */ -DUMMY(membarrier); -/* Linux 4.4: */ -DUMMY(mlock2); -/* Linux 4.5: */ -DUMMY(copy_file_range); -/* Linux 4.6: */ -DUMMY(preadv2); -DUMMY(pwritev2); -/* Linux 4.8: */ -DUMMY(pkey_mprotect); -DUMMY(pkey_alloc); -DUMMY(pkey_free); +DUMMY(vm86old); /* Linux 4.11: */ -DUMMY(statx); DUMMY(arch_prctl); -/* Linux 4.18: */ -DUMMY(io_pgetevents); -DUMMY(rseq); /* Linux 5.0: */ DUMMY(clock_gettime64); DUMMY(clock_settime64); @@ -177,28 +89,3 @@ DUMMY(semtimedop_time64); DUMMY(rt_sigtimedwait_time64); DUMMY(futex_time64); DUMMY(sched_rr_get_interval_time64); -DUMMY(pidfd_send_signal); -DUMMY(io_uring_setup); -DUMMY(io_uring_enter); -DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 7065c1f0f6cd..3092c5d81d80 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -6,6 +6,9 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 .endif .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE_CPUARCH}/linux${SFX} +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.PATH: ${SRCTOP}/sys/x86/linux +.endif VDSO= linux${SFX}_vdso @@ -18,6 +21,9 @@ SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \ linux_timer.c linux_vdso.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ device_if.h bus_if.h +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +SRCS+= linux_dummy_x86.c +.endif .if ${MACHINE_CPUARCH} == "amd64" SRCS+= linux${SFX}_support.s .else diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 046eeeda30f2..ec1aee563aa3 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -1,11 +1,14 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE}/linux +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.PATH: ${SRCTOP}/sys/x86/linux +.endif VDSO= linux_vdso KMOD= linux64 -SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \ +SRCS= linux_fork.c linux_dummy_machdep.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ linux_machdep.c linux_misc.c linux_ptrace.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ @@ -13,6 +16,9 @@ SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \ opt_compat.h opt_inet6.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h \ linux_support.s +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +SRCS+= linux_dummy_x86.c +.endif DPSRCS= assym.inc linux_genassym.c # XXX: for assym.inc diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile index 5b49a7409997..b4b71a709b70 100644 --- a/sys/modules/linux_common/Makefile +++ b/sys/modules/linux_common/Makefile @@ -4,7 +4,7 @@ KMOD= linux_common SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ - linux_errno.c \ + linux_dummy.c linux_errno.c \ linux.c device_if.h vnode_if.h bus_if.h opt_inet6.h EXPORT_SYMS= diff --git a/sys/x86/linux/linux_dummy_x86.c b/sys/x86/linux/linux_dummy_x86.c new file mode 100644 index 000000000000..1defe4e9674e --- /dev/null +++ b/sys/x86/linux/linux_dummy_x86.c @@ -0,0 +1,69 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 Dmitry Chagin + * 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_compat.h" + +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif + +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +DUMMY(sysfs); +DUMMY(quotactl); +/* Linux 2.6.13: */ +DUMMY(inotify_init); +/* Linux 2.6.22: */ +DUMMY(signalfd); +/* Linux 4.11: */ +DUMMY(statx); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:31:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E6B0646070; Thu, 10 Jun 2021 09:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHT09n5z3llV; Thu, 10 Jun 2021 09:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD36B504B; Thu, 10 Jun 2021 09:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V0e3030461; Thu, 10 Jun 2021 09:31:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V00V030460; Thu, 10 Jun 2021 09:31:00 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:00 GMT Message-Id: <202106100931.15A9V00V030460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: a2760a540fbf - stable/12 - linux(4): Fix loadable modules after r367395 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a2760a540fbf38584798a057d43adb659e0bb50e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:01 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=a2760a540fbf38584798a057d43adb659e0bb50e commit a2760a540fbf38584798a057d43adb659e0bb50e Author: Conrad Meyer AuthorDate: 2020-11-06 22:04:57 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:23:48 +0000 linux(4): Fix loadable modules after r367395 Move dtrace SDT definitions into linux_common module code. Also, build linux_dummy.c into the linux_common kld -- we don't need separate versions of these stubs for 32- and 64-bit emulation. Reported by: several PR: 250897 Discussed with: emaste, trasz Tested by: John Kennedy, Yasuhiro KIMURA, Oleg Sidorkin X-MFC-With: r367395 Differential Revision: https://reviews.freebsd.org/D27124 (cherry picked from commit 76b2bfeda42bbb686c74d3608dbc9b84b8e22e29) --- sys/compat/linux/linux_common.c | 15 +++++++++++++++ sys/compat/linux/linux_dummy.c | 12 +++++------- sys/compat/linux/linux_misc.c | 13 ------------- sys/conf/files.i386 | 1 + 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index a6c780bd5e10..6eebfb91d002 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -49,6 +50,20 @@ FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); MODULE_VERSION(linux_common, 1); +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(linuxulator); +LIN_SDT_PROVIDER_DEFINE(linuxulator32); + SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 1003b7d4c6e4..39e0d0a914b9 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -29,21 +29,19 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include #include #include -#ifdef COMPAT_LINUX32 -#include -#include -#else +/* + * Including linux vs linux32 here is arbitrary -- the syscall args structures + * (proto.h) are not dereferenced by the DUMMY stub implementations, and + * suitable for use by both native and compat32 entrypoints. + */ #include #include -#endif #include #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index af3e774f3505..d436aadf0035 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -99,19 +99,6 @@ __FBSDID("$FreeBSD$"); #include #include -/** - * Special DTrace provider for the linuxulator. - * - * In this file we define the provider for the entire linuxulator. All - * modules (= files of the linuxulator) use it. - * - * We define a different name depending on the emulated bitsize, see - * ../..//linux{,32}/linux.h, e.g.: - * native bitsize = linuxulator - * amd64, 32bit emulation = linuxulator32 - */ -LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); - int stclohz; /* Statistics clock frequency */ static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index ffbb8c314e3e..aa26d29c02f9 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -86,6 +86,7 @@ cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs +compat/linux/linux_common.c optional compat_linux compat/linux/linux_dummy.c optional compat_linux compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:31:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56E6A646A04; Thu, 10 Jun 2021 09:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHW1dh4z3lj4; Thu, 10 Jun 2021 09:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 157CB548E; Thu, 10 Jun 2021 09:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V2Lh030516; Thu, 10 Jun 2021 09:31:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V2xG030515; Thu, 10 Jun 2021 09:31:02 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:02 GMT Message-Id: <202106100931.15A9V2xG030515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 1f717a8166a1 - stable/12 - Move V4L feature declarations and DTrace provider definitions from linux_common.c to linux_util.c so they become available on i386. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1f717a8166a13e74f0190a4b18d79587ed39d204 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:03 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=1f717a8166a13e74f0190a4b18d79587ed39d204 commit 1f717a8166a13e74f0190a4b18d79587ed39d204 Author: Tijl Coosemans AuthorDate: 2020-12-06 10:58:55 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:25:16 +0000 Move V4L feature declarations and DTrace provider definitions from linux_common.c to linux_util.c so they become available on i386. linux_common.c defines the linux_common kernel module but this module does not exist on i386 and linux_common.c is not included in the linux module. linux_util.c is included in the linux_common module on amd64 and the linux module on i386. Remove linux_common.c from files.i386 again. It was added recently in r367433 when the DTrace provider definitions were moved. The V4L feature declarations were moved to linux_common in r283423. (cherry picked from commit 77fb6b6644446beb0ea45085b953f464c729c049) --- sys/compat/linux/linux_common.c | 19 ------------------- sys/compat/linux/linux_util.c | 18 ++++++++++++++++++ sys/conf/files.i386 | 1 - 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 6eebfb91d002..4a6d8718b8af 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -36,34 +36,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include #include -FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); -FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); - MODULE_VERSION(linux_common, 1); -/** - * Special DTrace provider for the linuxulator. - * - * In this file we define the provider for the entire linuxulator. All - * modules (= files of the linuxulator) use it. - * - * We define a different name depending on the emulated bitsize, see - * ../..//linux{,32}/linux.h, e.g.: - * native bitsize = linuxulator - * amd64, 32bit emulation = linuxulator32 - */ -LIN_SDT_PROVIDER_DEFINE(linuxulator); -LIN_SDT_PROVIDER_DEFINE(linuxulator32); - SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 59fc844e1cbe..9b801b522a45 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -60,6 +61,23 @@ MALLOC_DEFINE(M_EPOLL, "lepoll", "Linux events structures"); MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futex waiting proc"); +FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); +FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); + +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(linuxulator); +LIN_SDT_PROVIDER_DEFINE(linuxulator32); + char linux_emul_path[MAXPATHLEN] = "/compat/linux"; SYSCTL_STRING(_compat_linux, OID_AUTO, emul_path, CTLFLAG_RWTUN, diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index aa26d29c02f9..ffbb8c314e3e 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -86,7 +86,6 @@ cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs -compat/linux/linux_common.c optional compat_linux compat/linux/linux_dummy.c optional compat_linux compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:31:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B2F3646910; Thu, 10 Jun 2021 09:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHV1cV4z3lZP; Thu, 10 Jun 2021 09:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE3A7504C; Thu, 10 Jun 2021 09:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V1pM030485; Thu, 10 Jun 2021 09:31:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V1l6030484; Thu, 10 Jun 2021 09:31:01 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:01 GMT Message-Id: <202106100931.15A9V1l6030484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: bb687ce01268 - stable/12 - Fix i386 linux module after r367395. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bb687ce0126833710ac5fc9a9d80240e94735df6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:03 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=bb687ce0126833710ac5fc9a9d80240e94735df6 commit bb687ce0126833710ac5fc9a9d80240e94735df6 Author: Tijl Coosemans AuthorDate: 2020-12-05 14:53:24 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:24:32 +0000 Fix i386 linux module after r367395. In r367395 parts of machine dependent linux_dummy.c were moved to a new machine independent file sys/compat/linux/linux_dummy.c and the existing linux_dummy.c was renamed to linux_dummy_machdep.c. Add linux_dummy_machdep.c to the linux module for i386. Rename sys/amd64/linux32/linux_dummy.c for consistency. Add the new linux_dummy.c to the linux module for i386. (cherry picked from commit df4ca45cf943fb62c7771e479f5f999570ec6928) --- sys/amd64/linux32/{linux32_dummy.c => linux32_dummy_machdep.c} | 0 sys/conf/files.amd64 | 2 +- sys/modules/linux/Makefile | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy_machdep.c similarity index 100% rename from sys/amd64/linux32/linux32_dummy.c rename to sys/amd64/linux32/linux32_dummy_machdep.c diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 5effa0f5f9c6..c49728bff1aa 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -708,7 +708,7 @@ compat/linsysfs/linsysfs.c optional linsysfs # # Linux/i386 binary support # -amd64/linux32/linux32_dummy.c optional compat_linux32 +amd64/linux32/linux32_dummy_machdep.c optional compat_linux32 amd64/linux32/linux32_machdep.c optional compat_linux32 amd64/linux32/linux32_support.s optional compat_linux32 \ dependency "linux32_assym.h" diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 3092c5d81d80..0cf780106be7 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -13,7 +13,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 VDSO= linux${SFX}_vdso KMOD= linux -SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \ +SRCS= linux_fork.c linux${SFX}_dummy_machdep.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ linux${SFX}_machdep.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ @@ -41,7 +41,7 @@ OBJS= ${VDSO}.so .if ${MACHINE_CPUARCH} == "i386" SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c linux_mmap.c \ - linux_emul.c linux_errno.c opt_cpu.h linux.c + linux_dummy.c linux_emul.c linux_errno.c opt_cpu.h linux.c .endif .if ${MACHINE_CPUARCH} == "i386" From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:31:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 932EE64691C; Thu, 10 Jun 2021 09:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHX2Vv8z3lZb; Thu, 10 Jun 2021 09:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33B944C79; Thu, 10 Jun 2021 09:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V4X2030540; Thu, 10 Jun 2021 09:31:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V4mn030539; Thu, 10 Jun 2021 09:31:04 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:04 GMT Message-Id: <202106100931.15A9V4mn030539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 2d7565bbbc53 - stable/12 - linux_common: retire extra module version. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2d7565bbbc537b1e338bd98468bd7fc25ccccdca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:05 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2d7565bbbc537b1e338bd98468bd7fc25ccccdca commit 2d7565bbbc537b1e338bd98468bd7fc25ccccdca Author: Dmitry Chagin AuthorDate: 2021-05-26 05:34:32 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:26:07 +0000 linux_common: retire extra module version. The second 'linuxcommon' line was added by c66f5b079d2a259c3a65b1efe0f2143cd030dc52 but Linuxulator's modules dependend on 'linux_common'. To avoid such mistakes in the future rename moduledata name and module name to 'linux_common' and retire 'linuxcommon' line. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D30409 MFC after: 2 weeks (cherry picked from commit 5184e2da41921dfec5a3668756890b5c073fbad9) --- sys/compat/linux/linux_common.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 4a6d8718b8af..15ae502a22d1 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -MODULE_VERSION(linux_common, 1); - SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = @@ -94,10 +92,10 @@ linux_common_modevent(module_t mod, int type, void *data) } static moduledata_t linux_common_mod = { - "linuxcommon", + "linux_common", linux_common_modevent, 0 }; -DECLARE_MODULE(linuxcommon, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_VERSION(linuxcommon, 1); +DECLARE_MODULE(linux_common, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(linux_common, 1); From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:31:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCB29646030; Thu, 10 Jun 2021 09:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHY4F9Sz3lWn; Thu, 10 Jun 2021 09:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55BCD4EDF; Thu, 10 Jun 2021 09:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V5pv030564; Thu, 10 Jun 2021 09:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V5Re030563; Thu, 10 Jun 2021 09:31:05 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:05 GMT Message-Id: <202106100931.15A9V5Re030563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 4d0dc71a7bf0 - stable/12 - linux_renameat2: improve flag checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4d0dc71a7bf0e5ffd2a4a60244f915642d3d2899 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:06 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4d0dc71a7bf0e5ffd2a4a60244f915642d3d2899 commit 4d0dc71a7bf0e5ffd2a4a60244f915642d3d2899 Author: Ed Maste AuthorDate: 2019-11-07 15:51:44 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:27:45 +0000 linux_renameat2: improve flag checks In the cases where Linux returns an error (e.g. passing in an undefined flag) there's no need for us to emit a message. (The target of this message is a developer working on the linuxulatorm, not the author of presumably broken Linux software). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21606 (cherry picked from commit 01b9ee4c509e2882147af35eea4772d06ecd4150) --- sys/compat/linux/linux_file.c | 7 +++++++ sys/compat/linux/linux_file.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index dfa428e714d7..0b7efb6fa964 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -708,6 +708,13 @@ linux_renameat2(struct thread *td, struct linux_renameat2_args *args) int error, olddfd, newdfd; if (args->flags != 0) { + if (args->flags & ~(LINUX_RENAME_EXCHANGE | + LINUX_RENAME_NOREPLACE | LINUX_RENAME_WHITEOUT)) + return (EINVAL); + if (args->flags & LINUX_RENAME_EXCHANGE && + args->flags & (LINUX_RENAME_NOREPLACE | + LINUX_RENAME_WHITEOUT)) + return (EINVAL); linux_msg(td, "renameat2 unsupported flags 0x%x", args->flags); return (EINVAL); diff --git a/sys/compat/linux/linux_file.h b/sys/compat/linux/linux_file.h index 756a3b2be3e2..c3b1eeb8d7f4 100644 --- a/sys/compat/linux/linux_file.h +++ b/sys/compat/linux/linux_file.h @@ -127,6 +127,13 @@ #define LINUX_F_UNLCK 2 #endif +/* + * renameat2 flags + */ +#define LINUX_RENAME_NOREPLACE 0x00000001 +#define LINUX_RENAME_EXCHANGE 0x00000002 +#define LINUX_RENAME_WHITEOUT 0x00000004 + /* * sync_file_range flags */ From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:31:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D145C646AA5; Thu, 10 Jun 2021 09:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHZ4jMhz3lWx; Thu, 10 Jun 2021 09:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74BAD5490; Thu, 10 Jun 2021 09:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V6bX030588; Thu, 10 Jun 2021 09:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V6VE030587; Thu, 10 Jun 2021 09:31:06 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:06 GMT Message-Id: <202106100931.15A9V6VE030587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e1e6daa8cf8e - stable/12 - linux: silence renameat2 flags warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1e6daa8cf8e385a0c94c5275296252488646615 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:07 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e1e6daa8cf8e385a0c94c5275296252488646615 commit e1e6daa8cf8e385a0c94c5275296252488646615 Author: Mateusz Guzik AuthorDate: 2020-10-26 18:03:50 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:28:35 +0000 linux: silence renameat2 flags warning Hogs the console while building the Linux kernel in a Ubuntu Focal jail. (cherry picked from commit fe76bef462048f9beb3bffd448ae1adb01969594) --- sys/compat/linux/linux_file.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 0b7efb6fa964..ae7dbe76c96d 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -715,8 +715,16 @@ linux_renameat2(struct thread *td, struct linux_renameat2_args *args) args->flags & (LINUX_RENAME_NOREPLACE | LINUX_RENAME_WHITEOUT)) return (EINVAL); +#if 0 + /* + * This spams the console on Ubuntu Focal. + * + * What's needed here is a general mechanism to let users know + * about missing features without hogging the system. + */ linux_msg(td, "renameat2 unsupported flags 0x%x", args->flags); +#endif return (EINVAL); } From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:31:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 515FB646B1F; Thu, 10 Jun 2021 09:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zHc05Npz3ljB; Thu, 10 Jun 2021 09:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 997805505; Thu, 10 Jun 2021 09:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9V7nI030612; Thu, 10 Jun 2021 09:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9V7oX030611; Thu, 10 Jun 2021 09:31:07 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:31:07 GMT Message-Id: <202106100931.15A9V7oX030611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 6fab8f9b8ae7 - stable/12 - Get rid of i386 ref here as linux64 is a 64-bit module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6fab8f9b8ae7a2f5489191714393494c88bd937b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:31:08 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=6fab8f9b8ae7a2f5489191714393494c88bd937b commit 6fab8f9b8ae7a2f5489191714393494c88bd937b Author: Dmitry Chagin AuthorDate: 2021-03-24 15:56:46 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:29:21 +0000 Get rid of i386 ref here as linux64 is a 64-bit module. Reviewed By: emaste, imp Differential Revision: https://reviews.freebsd.org/D29412 (cherry picked from commit 88588c4b7611a39cdf965c3c07d8fcc13ed553b4) --- sys/modules/linux64/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index ec1aee563aa3..3730c019c559 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE}/linux -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" .PATH: ${SRCTOP}/sys/x86/linux .endif @@ -16,16 +16,13 @@ SRCS= linux_fork.c linux_dummy_machdep.c linux_file.c linux_event.c \ opt_compat.h opt_inet6.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h \ linux_support.s -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= linux_dummy_x86.c .endif DPSRCS= assym.inc linux_genassym.c # XXX: for assym.inc SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h -.if ${MACHINE_CPUARCH} == "i386" -SRCS+= opt_apic.h -.endif CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \ genassym.o From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:33:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C901D646E50; Thu, 10 Jun 2021 09:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zLg5JtLz3mry; Thu, 10 Jun 2021 09:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F62A54BC; Thu, 10 Jun 2021 09:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9Xl2E033354; Thu, 10 Jun 2021 09:33:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9XltM033353; Thu, 10 Jun 2021 09:33:47 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:33:47 GMT Message-Id: <202106100933.15A9XltM033353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: a0694da5d035 - stable/12 - netgraph/ng_base: Renaming a node to the same name is a noop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a0694da5d035ea0e686ad1bae95709e52df0913a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:33:47 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=a0694da5d035ea0e686ad1bae95709e52df0913a commit a0694da5d035ea0e686ad1bae95709e52df0913a Author: Lutz Donnerhacke AuthorDate: 2021-05-04 19:20:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-10 09:33:19 +0000 netgraph/ng_base: Renaming a node to the same name is a noop Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong Differential Revision: https://reviews.freebsd.org/D30110 (cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a) --- sys/netgraph/ng_base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 4c6a2f606119..f7c2cdb9afb0 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -854,6 +854,10 @@ ng_name_node(node_p node, const char *name) node_p node2; int i; + /* Rename without change is a noop */ + if (strcmp(NG_NODE_NAME(node), name) == 0) + return (0); + /* Check the name is valid */ for (i = 0; i < NG_NODESIZ; i++) { if (name[i] == '\0' || name[i] == '.' || name[i] == ':') From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:36:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B07D64710E; Thu, 10 Jun 2021 09:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zPG2yb9z3nXx; Thu, 10 Jun 2021 09:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C6C95519; Thu, 10 Jun 2021 09:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9a2wt033620; Thu, 10 Jun 2021 09:36:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9a2Oo033619; Thu, 10 Jun 2021 09:36:02 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:36:02 GMT Message-Id: <202106100936.15A9a2Oo033619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: b57a593cb2d6 - stable/11 - netgraph/ng_base: Renaming a node to the same name is a noop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: b57a593cb2d69a684e4be04e8cea7fe7a7f43b24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:36:02 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=b57a593cb2d69a684e4be04e8cea7fe7a7f43b24 commit b57a593cb2d69a684e4be04e8cea7fe7a7f43b24 Author: Lutz Donnerhacke AuthorDate: 2021-05-04 19:20:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-10 09:35:21 +0000 netgraph/ng_base: Renaming a node to the same name is a noop Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong Differential Revision: https://reviews.freebsd.org/D30110 (cherry picked from commit 0345fd891fe13a191fc0fae9463ea9458bfaff5a) --- sys/netgraph/ng_base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 065a539a7eec..b39c1b831b31 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -854,6 +854,10 @@ ng_name_node(node_p node, const char *name) node_p node2; int i; + /* Rename without change is a noop */ + if (strcmp(NG_NODE_NAME(node), name) == 0) + return (0); + /* Check the name is valid */ for (i = 0; i < NG_NODESIZ; i++) { if (name[i] == '\0' || name[i] == '.' || name[i] == ':') From owner-dev-commits-src-all@freebsd.org Thu Jun 10 09:42:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBE45647134; Thu, 10 Jun 2021 09:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G0zXy5lx4z3r0K; Thu, 10 Jun 2021 09:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE5635630; Thu, 10 Jun 2021 09:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15A9ggs2046501; Thu, 10 Jun 2021 09:42:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15A9ggis046500; Thu, 10 Jun 2021 09:42:42 GMT (envelope-from git) Date: Thu, 10 Jun 2021 09:42:42 GMT Message-Id: <202106100942.15A9ggis046500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: e06cbb2b7ac1 - stable/13 - linux_common: retire extra module version. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e06cbb2b7ac1f522af22cc5002c4ee3cf1d0eb3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 09:42:43 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e06cbb2b7ac1f522af22cc5002c4ee3cf1d0eb3b commit e06cbb2b7ac1f522af22cc5002c4ee3cf1d0eb3b Author: Dmitry Chagin AuthorDate: 2021-05-26 05:34:32 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 09:39:38 +0000 linux_common: retire extra module version. The second 'linuxcommon' line was added by c66f5b079d2a259c3a65b1efe0f2143cd030dc52 but Linuxulator's modules dependend on 'linux_common'. To avoid such mistakes in the future rename moduledata name and module name to 'linux_common' and retire 'linuxcommon' line. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D30409 (cherry picked from commit 5184e2da41921dfec5a3668756890b5c073fbad9) --- sys/compat/linux/linux_common.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 5a0ac015ed0e..4d81470649de 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -MODULE_VERSION(linux_common, 1); - SET_DECLARE(linux_device_handler_set, struct linux_device_handler); TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = @@ -83,10 +81,10 @@ linux_common_modevent(module_t mod, int type, void *data) } static moduledata_t linux_common_mod = { - "linuxcommon", + "linux_common", linux_common_modevent, 0 }; -DECLARE_MODULE(linuxcommon, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_VERSION(linuxcommon, 1); +DECLARE_MODULE(linux_common, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_VERSION(linux_common, 1); From owner-dev-commits-src-all@freebsd.org Thu Jun 10 10:41:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7621647B31; Thu, 10 Jun 2021 10:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G10s65lqMz4RbS; Thu, 10 Jun 2021 10:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3BC8650C; Thu, 10 Jun 2021 10:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AAfkt0022065; Thu, 10 Jun 2021 10:41:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AAfkh7022064; Thu, 10 Jun 2021 10:41:46 GMT (envelope-from git) Date: Thu, 10 Jun 2021 10:41:46 GMT Message-Id: <202106101041.15AAfkh7022064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: aa310ebfba3d - main - libcasper: fix descriptors numbers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa310ebfba3d49a0b6b03a103b969731a8136a73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 10:41:46 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=aa310ebfba3d49a0b6b03a103b969731a8136a73 commit aa310ebfba3d49a0b6b03a103b969731a8136a73 Author: Mariusz Zaborski AuthorDate: 2021-06-09 21:46:51 +0000 Commit: Mariusz Zaborski CommitDate: 2021-06-10 10:41:29 +0000 libcasper: fix descriptors numbers Casper services expect that the first 3 descriptors (stdin/stdout/stderr) will point to /dev/null. Which Casper will ensure later. The Casper services are forked from the original process. If the initial process closes one of those descriptors, Casper may reuse one of them for it on purpose. If this is the case, then renumarate the descriptors used by Casper to higher numbers. This is done already after the fork, so it doesn't break the parent process. PR: 225343 Reported by: Borja Marcos Tested by: jkim@ --- lib/libcasper/libcasper/libcasper_impl.c | 27 +++++++++++++++++++++++++++ lib/libcasper/libcasper/libcasper_impl.h | 1 + lib/libcasper/libcasper/service.c | 23 +++++++++++++---------- lib/libcasper/libcasper/zygote.c | 15 +++++++++------ 4 files changed, 50 insertions(+), 16 deletions(-) diff --git a/lib/libcasper/libcasper/libcasper_impl.c b/lib/libcasper/libcasper/libcasper_impl.c index e4411630c8a1..ae28c8769a07 100644 --- a/lib/libcasper/libcasper/libcasper_impl.c +++ b/lib/libcasper/libcasper/libcasper_impl.c @@ -32,8 +32,10 @@ * $FreeBSD$ */ +#include #include #include +#include #include #include "libcasper_impl.h" @@ -44,3 +46,28 @@ fd_is_valid(int fd) return (fcntl(fd, F_GETFL) != -1 || errno != EBADF); } + +void +fd_fix_environment(int *fdp) +{ + int nullfd, nfd; + + if (*fdp > STDERR_FILENO) + return; + + nullfd = open(_PATH_DEVNULL, O_RDWR); + if (nullfd == -1) + errx(1, "Unable to open %s", _PATH_DEVNULL); + + while (*fdp <= STDERR_FILENO) { + nfd = dup(*fdp); + if (nfd == -1) + errx(1, "Unable to secure fd"); + if (dup2(nullfd, *fdp) == -1) + errx(1, "Unable to secure fd"); + *fdp = nfd; + } + + close(nullfd); +} + diff --git a/lib/libcasper/libcasper/libcasper_impl.h b/lib/libcasper/libcasper/libcasper_impl.h index 11e43f083977..24049a0c07c8 100644 --- a/lib/libcasper/libcasper/libcasper_impl.h +++ b/lib/libcasper/libcasper/libcasper_impl.h @@ -44,6 +44,7 @@ struct service; struct service_connection; bool fd_is_valid(int fd); +void fd_fix_environment(int *fdp); /* Private service functions. */ struct service *service_alloc(const char *name, diff --git a/lib/libcasper/libcasper/service.c b/lib/libcasper/libcasper/service.c index 5c1c64d9a9d7..e87d0640347c 100644 --- a/lib/libcasper/libcasper/service.c +++ b/lib/libcasper/libcasper/service.c @@ -386,24 +386,27 @@ stdnull(void) } static void -service_clean(int sock, int procfd, uint64_t flags) +service_clean(int *sockp, int *procfdp, uint64_t flags) { int fd, maxfd, minfd; - assert(sock > STDERR_FILENO); - assert(procfd > STDERR_FILENO); - assert(sock != procfd); + fd_fix_environment(sockp); + fd_fix_environment(procfdp); + + assert(*sockp > STDERR_FILENO); + assert(*procfdp > STDERR_FILENO); + assert(*sockp != *procfdp); if ((flags & CASPER_SERVICE_STDIO) == 0) stdnull(); if ((flags & CASPER_SERVICE_FD) == 0) { - if (procfd > sock) { - maxfd = procfd; - minfd = sock; + if (*procfdp > *sockp) { + maxfd = *procfdp; + minfd = *sockp; } else { - maxfd = sock; - minfd = procfd; + maxfd = *sockp; + minfd = *procfdp; } for (fd = STDERR_FILENO + 1; fd < maxfd; fd++) { @@ -424,7 +427,7 @@ service_start(struct service *service, int sock, int procfd) assert(service != NULL); assert(service->s_magic == SERVICE_MAGIC); setproctitle("%s", service->s_name); - service_clean(sock, procfd, service->s_flags); + service_clean(&sock, &procfd, service->s_flags); if (service_connection_add(service, sock, NULL) == NULL) _exit(1); diff --git a/lib/libcasper/libcasper/zygote.c b/lib/libcasper/libcasper/zygote.c index 2b84bb49a695..5cdd139cc134 100644 --- a/lib/libcasper/libcasper/zygote.c +++ b/lib/libcasper/libcasper/zygote.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "libcasper_impl.h" #include "zygote.h" /* Zygote info. */ @@ -104,7 +105,7 @@ zygote_clone_service_execute(int *chanfdp, int *procfdp) * between sandbox and its owner. */ static void -zygote_main(int sock) +zygote_main(int *sockp) { int error, procfd; int chanfd[2]; @@ -113,12 +114,14 @@ zygote_main(int sock) zygote_func_t *func; pid_t pid; - assert(sock > STDERR_FILENO); + fd_fix_environment(sockp); + + assert(*sockp > STDERR_FILENO); setproctitle("zygote"); for (;;) { - nvlin = nvlist_recv(sock, 0); + nvlin = nvlist_recv(*sockp, 0); if (nvlin == NULL) { if (errno == ENOTCONN) { /* Casper exited. */ @@ -157,7 +160,7 @@ zygote_main(int sock) break; case 0: /* Child. */ - close(sock); + close(*sockp); close(chanfd[0]); func(chanfd[1]); /* NOTREACHED */ @@ -179,7 +182,7 @@ send: nvlist_move_descriptor(nvlout, "chanfd", chanfd[0]); nvlist_move_descriptor(nvlout, "procfd", procfd); } - (void)nvlist_send(sock, nvlout); + (void)nvlist_send(*sockp, nvlout); nvlist_destroy(nvlout); } /* NOTREACHED */ @@ -206,7 +209,7 @@ zygote_init(void) case 0: /* Child. */ close(sp[0]); - zygote_main(sp[1]); + zygote_main(&sp[1]); /* NOTREACHED */ abort(); default: From owner-dev-commits-src-all@freebsd.org Thu Jun 10 10:43:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53147647D4E; Thu, 10 Jun 2021 10:43:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4G10vY18hXz4SBJ; Thu, 10 Jun 2021 10:43:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5F6BD260111; Thu, 10 Jun 2021 12:43:50 +0200 (CEST) Subject: Re: git: aa310ebfba3d - main - libcasper: fix descriptors numbers To: Mariusz Zaborski , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202106101041.15AAfkh7022064@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 10 Jun 2021 12:43:48 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <202106101041.15AAfkh7022064@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4G10vY18hXz4SBJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 10:43:53 -0000 On 6/10/21 12:41 PM, Mariusz Zaborski wrote: > PR: 225343 Wrong PR number?? --HPS From owner-dev-commits-src-all@freebsd.org Thu Jun 10 10:46:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02825647E7E; Thu, 10 Jun 2021 10:46:55 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 4G10z26BgTz4SCk; Thu, 10 Jun 2021 10:46:54 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lj1-f175.google.com with SMTP id s22so4208043ljg.5; Thu, 10 Jun 2021 03:46:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Wetgb/4leZ2q0cCsF6vPE509q5RlLmDKDW9SxUtgvrU=; b=HlZez4GPzKMVn7rFWSw/aZGaBKUdA0V1lKszJHShalwdToeWysbWMEZoW6UsfpNGvv /cvSg2Q8GK9aC8V00fRSpccWw2h6KGNMb1fzF/zvCdKMxRDt3UoF1df8pbaEfcVqpKbi 0rASHOvE3SwR8Y68hA98Pz//YlxND8Q47RYkkgiUoGB8K1AWoNyk4cq14fPbuxU1XVZK p9t1ZOQkAghn+36jsH60URbqQTUFGZo0ZgZyiZuw5jGv4gQNDHir8/ZOMblO7mQKZ0r+ dCc9LpZ3BT/w7RepoDry6rxzxmGjpoxI+f19dBmrghcZbHL/WtO8l2Nfr89eu4jzNv8g XdLg== X-Gm-Message-State: AOAM531gJkMDFxR4p+GQ12tG4WGCdAYVpmBxCkiB1F6zvTvi0Rv7MqJP vZoz2VTZeLHKbyrJ2Gvhov3TkWl3RUzGlz4tqhGzDqDe0hqC6A== X-Google-Smtp-Source: ABdhPJxTnXXtDohgF9xuok2bTEuTGVT+c9elfSi2k9sYEl766Vwc2b3YLKN8GJBRk3lecKm6qqL9jEpDQQyutMDoEGw= X-Received: by 2002:a05:651c:b28:: with SMTP id b40mr1712793ljr.9.1623322013076; Thu, 10 Jun 2021 03:46:53 -0700 (PDT) MIME-Version: 1.0 References: <202106101041.15AAfkh7022064@gitrepo.freebsd.org> In-Reply-To: From: Mariusz Zaborski Date: Thu, 10 Jun 2021 12:46:41 +0200 Message-ID: Subject: Re: git: aa310ebfba3d - main - libcasper: fix descriptors numbers To: Hans Petter Selasky Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4G10z26BgTz4SCk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 10:46:55 -0000 Yes should be. PR: 255339 Thanks for noticing! On Thu, 10 Jun 2021 at 12:44, Hans Petter Selasky wrote: > On 6/10/21 12:41 PM, Mariusz Zaborski wrote: > > PR: 225343 > > Wrong PR number?? > > --HPS > From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:29:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7648649043; Thu, 10 Jun 2021 11:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G11wk5yNXz4Wbf; Thu, 10 Jun 2021 11:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B45606C25; Thu, 10 Jun 2021 11:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ABTwMO080412; Thu, 10 Jun 2021 11:29:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ABTwK3080411; Thu, 10 Jun 2021 11:29:58 GMT (envelope-from git) Date: Thu, 10 Jun 2021 11:29:58 GMT Message-Id: <202106101129.15ABTwK3080411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 3c1de151e365 - main - linux(4): Change Linux futex syscall definition to match Linux actual one. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c1de151e365f05809264352b1d57125d792f373 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:29:59 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=3c1de151e365f05809264352b1d57125d792f373 commit 3c1de151e365f05809264352b1d57125d792f373 Author: Dmitry Chagin AuthorDate: 2021-06-10 11:00:00 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 11:00:00 +0000 linux(4): Change Linux futex syscall definition to match Linux actual one. MFC after: 2 weeks --- sys/amd64/linux/syscalls.master | 8 ++++---- sys/amd64/linux32/syscalls.master | 4 ++-- sys/arm/linux/syscalls.master | 5 +++-- sys/arm64/linux/syscalls.master | 11 ++++++----- sys/i386/linux/syscalls.master | 4 ++-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master index 51f9fe00eb7d..0cac26337ef1 100644 --- a/sys/amd64/linux/syscalls.master +++ b/sys/amd64/linux/syscalls.master @@ -1214,12 +1214,12 @@ } 202 AUE_NULL STD { int linux_sys_futex( - void *uaddr, + uint32_t *uaddr, l_int op, - l_int val, + uint32_t val, struct l_timespec *timeout, - void *uaddr2, - l_int val3 + uint32_t *uaddr2, + uint32_t val3 ); } 203 AUE_NULL STD { diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 79ee1f30a00d..03523f45ced6 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -1322,8 +1322,8 @@ } 240 AUE_NULL STD { int linux_sys_futex( - void *uaddr, - int op, + uint32_t *uaddr, + l_int op, uint32_t val, struct l_timespec *timeout, uint32_t *uaddr2, diff --git a/sys/arm/linux/syscalls.master b/sys/arm/linux/syscalls.master index d67f9c3b2069..42adc18bbe1e 100644 --- a/sys/arm/linux/syscalls.master +++ b/sys/arm/linux/syscalls.master @@ -1104,8 +1104,9 @@ ); } 240 AUE_NULL STD { - int linux_sys_futex(void *uaddr, - int op, + int linux_sys_futex( + uint32_t *uaddr, + l_int op, uint32_t val, struct l_timespec *timeout, uint32_t *uaddr2, diff --git a/sys/arm64/linux/syscalls.master b/sys/arm64/linux/syscalls.master index 202425581e8e..dcb43553e469 100644 --- a/sys/arm64/linux/syscalls.master +++ b/sys/arm64/linux/syscalls.master @@ -596,12 +596,13 @@ int linux_unshare(void); } 98 AUE_NULL STD { - int linux_sys_futex(void *uaddr, - int op, - int val, + int linux_sys_futex( + uint32_t *uaddr, + l_int op, + uint32_t val, struct l_timespec *timeout, - void *uaddr2, - int val3 + uint32_t *uaddr2, + uint32_t val3 ); } 99 AUE_NULL STD { diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index aa6eb7c1c46f..a60129ccdaa9 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -1343,8 +1343,8 @@ } 240 AUE_NULL STD { int linux_sys_futex( - void *uaddr, - int op, + uint32_t *uaddr, + l_int op, uint32_t val, struct l_timespec *timeout, uint32_t *uaddr2, From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:30:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42379649129; Thu, 10 Jun 2021 11:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G11wl6vX5z4WdV; Thu, 10 Jun 2021 11:29:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3AA569D2; Thu, 10 Jun 2021 11:29:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ABTx7e080436; Thu, 10 Jun 2021 11:29:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ABTxM6080435; Thu, 10 Jun 2021 11:29:59 GMT (envelope-from git) Date: Thu, 10 Jun 2021 11:29:59 GMT Message-Id: <202106101129.15ABTxM6080435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: ee64d9820495 - main - linux(4): Regen for futex system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee64d982049544b1e8a77acc01fd230c906fb305 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:30:00 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ee64d982049544b1e8a77acc01fd230c906fb305 commit ee64d982049544b1e8a77acc01fd230c906fb305 Author: Dmitry Chagin AuthorDate: 2021-06-10 11:16:40 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 11:16:40 +0000 linux(4): Regen for futex system call. MFC after: 2 weeks --- sys/amd64/linux/linux_proto.h | 8 ++++---- sys/amd64/linux/linux_systrace_args.c | 16 ++++++++-------- sys/amd64/linux32/linux32_proto.h | 4 ++-- sys/amd64/linux32/linux32_systrace_args.c | 8 ++++---- sys/arm/linux/linux_proto.h | 4 ++-- sys/arm/linux/linux_systrace_args.c | 8 ++++---- sys/arm64/linux/linux_proto.h | 10 +++++----- sys/arm64/linux/linux_systrace_args.c | 20 ++++++++++---------- sys/i386/linux/linux_proto.h | 4 ++-- sys/i386/linux/linux_systrace_args.c | 8 ++++---- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h index 60e880d891e8..cfd2f0cf2ca7 100644 --- a/sys/amd64/linux/linux_proto.h +++ b/sys/amd64/linux/linux_proto.h @@ -706,12 +706,12 @@ struct linux_time_args { char tm_l_[PADL_(l_time_t *)]; l_time_t * tm; char tm_r_[PADR_(l_time_t *)]; }; struct linux_sys_futex_args { - char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; + char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; - char val_l_[PADL_(l_int)]; l_int val; char val_r_[PADR_(l_int)]; + char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; - char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; - char val3_l_[PADL_(l_int)]; l_int val3; char val3_r_[PADR_(l_int)]; + char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; + char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)]; }; struct linux_sched_setaffinity_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; diff --git a/sys/amd64/linux/linux_systrace_args.c b/sys/amd64/linux/linux_systrace_args.c index d1f2f30f60e0..a4c861b789fd 100644 --- a/sys/amd64/linux/linux_systrace_args.c +++ b/sys/amd64/linux/linux_systrace_args.c @@ -1563,12 +1563,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_sys_futex */ case 202: { struct linux_sys_futex_args *p = params; - uarg[0] = (intptr_t)p->uaddr; /* void * */ + uarg[0] = (intptr_t)p->uaddr; /* uint32_t * */ iarg[1] = p->op; /* l_int */ - iarg[2] = p->val; /* l_int */ + uarg[2] = p->val; /* uint32_t */ uarg[3] = (intptr_t)p->timeout; /* struct l_timespec * */ - uarg[4] = (intptr_t)p->uaddr2; /* void * */ - iarg[5] = p->val3; /* l_int */ + uarg[4] = (intptr_t)p->uaddr2; /* uint32_t * */ + uarg[5] = p->val3; /* uint32_t */ *n_args = 6; break; } @@ -5237,22 +5237,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 202: switch (ndx) { case 0: - p = "userland void *"; + p = "userland uint32_t *"; break; case 1: p = "l_int"; break; case 2: - p = "l_int"; + p = "uint32_t"; break; case 3: p = "userland struct l_timespec *"; break; case 4: - p = "userland void *"; + p = "userland uint32_t *"; break; case 5: - p = "l_int"; + p = "uint32_t"; break; default: break; diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index d8ac24f8492b..aa48b0b50b89 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -782,8 +782,8 @@ struct linux_sendfile64_args { char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; }; struct linux_sys_futex_args { - char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; - char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index 9eb9bfc15390..bd6201cf4469 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -1692,8 +1692,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_sys_futex */ case 240: { struct linux_sys_futex_args *p = params; - uarg[0] = (intptr_t)p->uaddr; /* void * */ - iarg[1] = p->op; /* int */ + uarg[0] = (intptr_t)p->uaddr; /* uint32_t * */ + iarg[1] = p->op; /* l_int */ uarg[2] = p->val; /* uint32_t */ uarg[3] = (intptr_t)p->timeout; /* struct l_timespec * */ uarg[4] = (intptr_t)p->uaddr2; /* uint32_t * */ @@ -5851,10 +5851,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 240: switch (ndx) { case 0: - p = "userland void *"; + p = "userland uint32_t *"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: p = "uint32_t"; diff --git a/sys/arm/linux/linux_proto.h b/sys/arm/linux/linux_proto.h index e458adb30a10..b07dc8290016 100644 --- a/sys/arm/linux/linux_proto.h +++ b/sys/arm/linux/linux_proto.h @@ -648,8 +648,8 @@ struct linux_sendfile64_args { char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; }; struct linux_sys_futex_args { - char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; - char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; diff --git a/sys/arm/linux/linux_systrace_args.c b/sys/arm/linux/linux_systrace_args.c index 608d8c1ed238..87608f6992bf 100644 --- a/sys/arm/linux/linux_systrace_args.c +++ b/sys/arm/linux/linux_systrace_args.c @@ -1477,8 +1477,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_sys_futex */ case 240: { struct linux_sys_futex_args *p = params; - uarg[0] = (intptr_t)p->uaddr; /* void * */ - iarg[1] = p->op; /* int */ + uarg[0] = (intptr_t)p->uaddr; /* uint32_t * */ + iarg[1] = p->op; /* l_int */ uarg[2] = p->val; /* uint32_t */ uarg[3] = (intptr_t)p->timeout; /* struct l_timespec * */ uarg[4] = (intptr_t)p->uaddr2; /* uint32_t * */ @@ -4741,10 +4741,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 240: switch (ndx) { case 0: - p = "userland void *"; + p = "userland uint32_t *"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: p = "uint32_t"; diff --git a/sys/arm64/linux/linux_proto.h b/sys/arm64/linux/linux_proto.h index 66d9cad8b442..768a0b8be28f 100644 --- a/sys/arm64/linux/linux_proto.h +++ b/sys/arm64/linux/linux_proto.h @@ -408,12 +408,12 @@ struct linux_unshare_args { register_t dummy; }; struct linux_sys_futex_args { - char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; - char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; - char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)]; + char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; - char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; - char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)]; + char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; + char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)]; }; struct linux_set_robust_list_args { char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; diff --git a/sys/arm64/linux/linux_systrace_args.c b/sys/arm64/linux/linux_systrace_args.c index 18b6201516e7..34e6185180f3 100644 --- a/sys/arm64/linux/linux_systrace_args.c +++ b/sys/arm64/linux/linux_systrace_args.c @@ -772,12 +772,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_sys_futex */ case 98: { struct linux_sys_futex_args *p = params; - uarg[0] = (intptr_t)p->uaddr; /* void * */ - iarg[1] = p->op; /* int */ - iarg[2] = p->val; /* int */ + uarg[0] = (intptr_t)p->uaddr; /* uint32_t * */ + iarg[1] = p->op; /* l_int */ + uarg[2] = p->val; /* uint32_t */ uarg[3] = (intptr_t)p->timeout; /* struct l_timespec * */ - uarg[4] = (intptr_t)p->uaddr2; /* void * */ - iarg[5] = p->val3; /* int */ + uarg[4] = (intptr_t)p->uaddr2; /* uint32_t * */ + uarg[5] = p->val3; /* uint32_t */ *n_args = 6; break; } @@ -3635,22 +3635,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 98: switch (ndx) { case 0: - p = "userland void *"; + p = "userland uint32_t *"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: - p = "int"; + p = "uint32_t"; break; case 3: p = "userland struct l_timespec *"; break; case 4: - p = "userland void *"; + p = "userland uint32_t *"; break; case 5: - p = "int"; + p = "uint32_t"; break; default: break; diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index 1b3512c5b890..a417f7804c3b 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -779,8 +779,8 @@ struct linux_sendfile64_args { char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; }; struct linux_sys_futex_args { - char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; - char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index b8e07e3cc985..37dcd1db59d8 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -1731,8 +1731,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_sys_futex */ case 240: { struct linux_sys_futex_args *p = params; - uarg[0] = (intptr_t)p->uaddr; /* void * */ - iarg[1] = p->op; /* int */ + uarg[0] = (intptr_t)p->uaddr; /* uint32_t * */ + iarg[1] = p->op; /* l_int */ uarg[2] = p->val; /* uint32_t */ uarg[3] = (intptr_t)p->timeout; /* struct l_timespec * */ uarg[4] = (intptr_t)p->uaddr2; /* uint32_t * */ @@ -5939,10 +5939,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 240: switch (ndx) { case 0: - p = "userland void *"; + p = "userland uint32_t *"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: p = "uint32_t"; From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:30:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 490FB64921F; Thu, 10 Jun 2021 11:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G11wn0qhDz4WhB; Thu, 10 Jun 2021 11:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECEFD6D90; Thu, 10 Jun 2021 11:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ABU0bd081407; Thu, 10 Jun 2021 11:30:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ABU0SG081396; Thu, 10 Jun 2021 11:30:00 GMT (envelope-from git) Date: Thu, 10 Jun 2021 11:30:00 GMT Message-Id: <202106101130.15ABU0SG081396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 25b09d6f398e - main - linux(4): Prevent integer overflow in futex_requeue. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25b09d6f398ea8a260ee8e2e8209fd76c61e13ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:30:01 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=25b09d6f398ea8a260ee8e2e8209fd76c61e13ee commit 25b09d6f398ea8a260ee8e2e8209fd76c61e13ee Author: Dmitry Chagin AuthorDate: 2021-06-10 11:23:11 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 11:23:11 +0000 linux(4): Prevent integer overflow in futex_requeue. To prevent a signed integer overflow in futex_requeue add a sanity check to catch negative values of nrwake or nrrequeue. MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index da1a91916869..11836e93d71c 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -520,7 +520,8 @@ futex_wake(struct futex *f, int n, uint32_t bitset) } static int -futex_requeue(struct futex *f, int n, struct futex *f2, int n2) +futex_requeue(struct futex *f, int nrwake, struct futex *f2, + int nrrequeue) { struct waiting_proc *wp, *wpt; int count = 0; @@ -529,7 +530,7 @@ futex_requeue(struct futex *f, int n, struct futex *f2, int n2) FUTEX_ASSERT_LOCKED(f2); TAILQ_FOREACH_SAFE(wp, &f->f_waiting_proc, wp_list, wpt) { - if (++count <= n) { + if (++count <= nrwake) { LINUX_CTR2(sys_futex, "futex_req_wake uaddr %p wp %p", f->f_uaddr, wp); wp->wp_flags |= FUTEX_WP_REMOVED; @@ -555,7 +556,7 @@ futex_requeue(struct futex *f, int n, struct futex *f2, int n2) FUTEXES_LOCK; ++f2->f_refcount; FUTEXES_UNLOCK; - if (count - n >= n2) + if (count - nrwake >= nrrequeue) break; } } @@ -657,7 +658,7 @@ futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) int linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) { - int clockrt, nrwake, op_ret, ret; + int clockrt, nrwake, nrrequeue, op_ret, ret; struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; @@ -786,6 +787,15 @@ retry0: return (EINVAL); } + nrrequeue = (int)(unsigned long)args->timeout; + nrwake = args->val; + /* + * Sanity check to prevent signed integer overflow, + * see Linux CVE-2018-6927 + */ + if (nrwake < 0 || nrrequeue < 0) + return (EINVAL); + retry1: error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) @@ -829,8 +839,7 @@ retry1: return (EAGAIN); } - nrwake = (int)(unsigned long)args->timeout; - td->td_retval[0] = futex_requeue(f, args->val, f2, nrwake); + td->td_retval[0] = futex_requeue(f, nrwake, f2, nrrequeue); futex_put(f2, NULL); futex_put(f, NULL); break; From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:30:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCA936493A2; Thu, 10 Jun 2021 11:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G11wp1Fl2z4WMm; Thu, 10 Jun 2021 11:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 052AD6B34; Thu, 10 Jun 2021 11:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ABU1E0082232; Thu, 10 Jun 2021 11:30:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ABU1jg082228; Thu, 10 Jun 2021 11:30:01 GMT (envelope-from git) Date: Thu, 10 Jun 2021 11:30:01 GMT Message-Id: <202106101130.15ABU1jg082228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 2e46d0c3d983 - main - linux(4): Implement futex_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e46d0c3d983ccd603b9bcfb318c37404b0dbc7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:30:03 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2e46d0c3d983ccd603b9bcfb318c37404b0dbc7f commit 2e46d0c3d983ccd603b9bcfb318c37404b0dbc7f Author: Dmitry Chagin AuthorDate: 2021-06-10 11:27:06 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 11:27:06 +0000 linux(4): Implement futex_time64 system call. MFC after: 2 weeks --- sys/amd64/linux32/linux32_dummy_machdep.c | 1 - sys/amd64/linux32/syscalls.master | 9 +- sys/compat/linux/linux_futex.c | 218 ++++++++++++++++++------------ sys/compat/linux/linux_futex.h | 3 + sys/i386/linux/linux_dummy_machdep.c | 1 - sys/i386/linux/syscalls.master | 9 +- 6 files changed, 153 insertions(+), 88 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy_machdep.c b/sys/amd64/linux32/linux32_dummy_machdep.c index 041156bd514b..bfb4ff71e0b1 100644 --- a/sys/amd64/linux32/linux32_dummy_machdep.c +++ b/sys/amd64/linux32/linux32_dummy_machdep.c @@ -80,5 +80,4 @@ DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); DUMMY(rt_sigtimedwait_time64); -DUMMY(futex_time64); DUMMY(sched_rr_get_interval_time64); diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 03523f45ced6..bf2778bb91fd 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -2415,7 +2415,14 @@ int linux_rt_sigtimedwait_time64(void); } 422 AUE_NULL STD { - int linux_futex_time64(void); + int linux_sys_futex_time64( + uint32_t *uaddr, + l_int op, + uint32_t val, + struct l_timespec64 *timeout, + uint32_t *uaddr2, + uint32_t val3 + ); } 423 AUE_NULL STD { int linux_sched_rr_get_interval_time64(void); diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 11836e93d71c..6d4c31a8a6df 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -117,29 +117,29 @@ LIN_SDT_PROBE_DEFINE4(futex, futex_atomic_op, decoded_op, "int", "int", "int", LIN_SDT_PROBE_DEFINE0(futex, futex_atomic_op, missing_access_check); LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_op, "int"); LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_cmp, "int"); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); -LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); -LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unimplemented_clockswitch); +LIN_SDT_PROBE_DEFINE1(futex, linux_futex, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, invalid_cmp_requeue_use); +LIN_SDT_PROBE_DEFINE3(futex, linux_futex, debug_wait, "uint32_t *", "uint32_t", "uint32_t"); -LIN_SDT_PROBE_DEFINE4(futex, linux_sys_futex, debug_wait_value_neq, +LIN_SDT_PROBE_DEFINE4(futex, linux_futex, debug_wait_value_neq, "uint32_t *", "uint32_t", "int", "uint32_t"); -LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wake, "uint32_t *", +LIN_SDT_PROBE_DEFINE3(futex, linux_futex, debug_wake, "uint32_t *", "uint32_t", "uint32_t"); -LIN_SDT_PROBE_DEFINE5(futex, linux_sys_futex, debug_cmp_requeue, "uint32_t *", +LIN_SDT_PROBE_DEFINE5(futex, linux_futex, debug_cmp_requeue, "uint32_t *", "uint32_t", "uint32_t", "uint32_t *", "struct l_timespec *"); -LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, debug_cmp_requeue_value_neq, +LIN_SDT_PROBE_DEFINE2(futex, linux_futex, debug_cmp_requeue_value_neq, "uint32_t", "int"); -LIN_SDT_PROBE_DEFINE5(futex, linux_sys_futex, debug_wake_op, "uint32_t *", +LIN_SDT_PROBE_DEFINE5(futex, linux_futex, debug_wake_op, "uint32_t *", "int", "uint32_t", "uint32_t *", "uint32_t"); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unhandled_efault); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_lock_pi); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_unlock_pi); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_trylock_pi); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, deprecated_requeue); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_wait_requeue_pi); -LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_cmp_requeue_pi); -LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, unknown_operation, "int"); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unhandled_efault); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unimplemented_lock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unimplemented_unlock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unimplemented_trylock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, deprecated_requeue); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unimplemented_wait_requeue_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unimplemented_cmp_requeue_pi); +LIN_SDT_PROBE_DEFINE1(futex, linux_futex, unknown_operation, "int"); LIN_SDT_PROBE_DEFINE0(futex, linux_set_robust_list, size_error); LIN_SDT_PROBE_DEFINE1(futex, linux_get_robust_list, copyout_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, handle_futex_death, copyin_error, "int"); @@ -215,8 +215,6 @@ static int futex_get(uint32_t *, struct waiting_proc **, struct futex **, static int futex_sleep(struct futex *, struct waiting_proc *, struct timespec *); static int futex_wake(struct futex *, int, uint32_t); static int futex_requeue(struct futex *, int, struct futex *, int); -static int futex_copyin_timeout(int, struct l_timespec *, int, - struct timespec *); static int futex_wait(struct futex *, struct waiting_proc *, struct timespec *, uint32_t); static void futex_lock(struct futex *); @@ -227,30 +225,17 @@ static int handle_futex_death(struct linux_emuldata *, uint32_t *, static int fetch_robust_entry(struct linux_robust_list **, struct linux_robust_list **, unsigned int *); -static int -futex_copyin_timeout(int op, struct l_timespec *luts, int clockrt, - struct timespec *ts) -{ - struct l_timespec lts; - struct timespec kts; - int error; - - error = copyin(luts, <s, sizeof(lts)); - if (error) - return (error); +struct linux_futex_args { + uint32_t *uaddr; + int32_t op; + uint32_t val; + struct timespec *ts; + uint32_t *uaddr2; + uint32_t val3; + struct timespec kts; +}; - error = linux_to_native_timespec(ts, <s); - if (error) - return (error); - if (clockrt) { - nanotime(&kts); - timespecsub(ts, &kts, ts); - } else if (op == LINUX_FUTEX_WAIT_BITSET) { - nanouptime(&kts); - timespecsub(ts, &kts, ts); - } - return (error); -} +static int linux_futex(struct thread *, struct linux_futex_args *); static void futex_put(struct futex *f, struct waiting_proc *wp) @@ -430,19 +415,17 @@ futex_unlock(struct futex *f) static int futex_sleep(struct futex *f, struct waiting_proc *wp, struct timespec *ts) { - struct timespec uts; sbintime_t sbt, prec, tmp; time_t over; int error; FUTEX_ASSERT_LOCKED(f); if (ts != NULL) { - uts = *ts; - if (uts.tv_sec > INT32_MAX / 2) { - over = uts.tv_sec - INT32_MAX / 2; - uts.tv_sec -= over; + if (ts->tv_sec > INT32_MAX / 2) { + over = ts->tv_sec - INT32_MAX / 2; + ts->tv_sec -= over; } - tmp = tstosbt(uts); + tmp = tstosbt(*ts); if (TIMESEL(&sbt, tmp)) sbt += tc_tick_sbt; sbt += tmp; @@ -655,14 +638,14 @@ futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) return (ret); } -int -linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) +static int +linux_futex(struct thread *td, struct linux_futex_args *args) { int clockrt, nrwake, nrrequeue, op_ret, ret; struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; - struct timespec uts, *ts; + struct timespec kts; int error, save; uint32_t flags, val; @@ -682,7 +665,7 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) args->op = args->op & ~LINUX_FUTEX_CLOCK_REALTIME; if (clockrt && args->op != LINUX_FUTEX_WAIT_BITSET && args->op != LINUX_FUTEX_WAIT_REQUEUE_PI) { - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, unimplemented_clockswitch); return (ENOSYS); } @@ -696,22 +679,20 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) /* FALLTHROUGH */ case LINUX_FUTEX_WAIT_BITSET: - LIN_SDT_PROBE3(futex, linux_sys_futex, debug_wait, args->uaddr, + LIN_SDT_PROBE3(futex, linux_futex, debug_wait, args->uaddr, args->val, args->val3); LINUX_CTR3(sys_futex, "WAIT uaddr %p val 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); - if (args->timeout != NULL) { - error = futex_copyin_timeout(args->op, args->timeout, - clockrt, &uts); - if (error) { - LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, - error); - return (error); + if (args->ts != NULL) { + if (clockrt) { + nanotime(&kts); + timespecsub(args->ts, &kts, args->ts); + } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { + nanouptime(&kts); + timespecsub(args->ts, &kts, args->ts); } - ts = &uts; - } else - ts = NULL; + } retry0: error = futex_get(args->uaddr, &wp, &f, @@ -725,14 +706,14 @@ retry0: error = copyin(args->uaddr, &val, sizeof(val)); if (error == 0) goto retry0; - LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, + LIN_SDT_PROBE1(futex, linux_futex, copyin_error, error); LINUX_CTR1(sys_futex, "WAIT copyin failed %d", error); return (error); } if (val != args->val) { - LIN_SDT_PROBE4(futex, linux_sys_futex, + LIN_SDT_PROBE4(futex, linux_futex, debug_wait_value_neq, args->uaddr, args->val, val, args->val3); LINUX_CTR3(sys_futex, @@ -742,7 +723,7 @@ retry0: return (EWOULDBLOCK); } - error = futex_wait(f, wp, ts, args->val3); + error = futex_wait(f, wp, args->ts, args->val3); break; case LINUX_FUTEX_WAKE: @@ -750,7 +731,7 @@ retry0: /* FALLTHROUGH */ case LINUX_FUTEX_WAKE_BITSET: - LIN_SDT_PROBE3(futex, linux_sys_futex, debug_wake, args->uaddr, + LIN_SDT_PROBE3(futex, linux_futex, debug_wake, args->uaddr, args->val, args->val3); LINUX_CTR3(sys_futex, "WAKE uaddr %p nrwake 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); @@ -769,25 +750,25 @@ retry0: break; case LINUX_FUTEX_CMP_REQUEUE: - LIN_SDT_PROBE5(futex, linux_sys_futex, debug_cmp_requeue, + LIN_SDT_PROBE5(futex, linux_futex, debug_cmp_requeue, args->uaddr, args->val, args->val3, args->uaddr2, - args->timeout); + args->ts); LINUX_CTR5(sys_futex, "CMP_REQUEUE uaddr %p " "nrwake 0x%x uval 0x%x uaddr2 %p nrequeue 0x%x", args->uaddr, args->val, args->val3, args->uaddr2, - args->timeout); + args->ts); /* * Linux allows this, we would not, it is an incorrect * usage of declared ABI, so return EINVAL. */ if (args->uaddr == args->uaddr2) { - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, invalid_cmp_requeue_use); return (EINVAL); } - nrrequeue = (int)(unsigned long)args->timeout; + nrrequeue = (int)(unsigned long)args->ts; nrwake = args->val; /* * Sanity check to prevent signed integer overflow, @@ -823,14 +804,14 @@ retry1: error = copyin(args->uaddr, &val, sizeof(val)); if (error == 0) goto retry1; - LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, + LIN_SDT_PROBE1(futex, linux_futex, copyin_error, error); LINUX_CTR1(sys_futex, "CMP_REQUEUE copyin failed %d", error); return (error); } if (val != args->val3) { - LIN_SDT_PROBE2(futex, linux_sys_futex, + LIN_SDT_PROBE2(futex, linux_futex, debug_cmp_requeue_value_neq, args->val, val); LINUX_CTR2(sys_futex, "CMP_REQUEUE val 0x%x != uval 0x%x", args->val, val); @@ -845,12 +826,12 @@ retry1: break; case LINUX_FUTEX_WAKE_OP: - LIN_SDT_PROBE5(futex, linux_sys_futex, debug_wake_op, + LIN_SDT_PROBE5(futex, linux_futex, debug_wake_op, args->uaddr, args->op, args->val, args->uaddr2, args->val3); LINUX_CTR5(sys_futex, "WAKE_OP " "uaddr %p nrwake 0x%x uaddr2 %p op 0x%x nrwake2 0x%x", args->uaddr, args->val, args->uaddr2, args->val3, - args->timeout); + args->ts); if (args->uaddr == args->uaddr2) return (EINVAL); @@ -893,7 +874,7 @@ retry2: if (op_ret > 0) { op_ret = 0; - nrwake = (int)(unsigned long)args->timeout; + nrwake = (int)(unsigned long)args->ts; if (f2 != NULL) op_ret += futex_wake(f2, nrwake, args->val3); @@ -913,7 +894,7 @@ retry2: if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { linux_msg(td, "unsupported FUTEX_LOCK_PI"); pem->flags |= LINUX_XUNSUP_FUTEXPIOP; - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, unimplemented_lock_pi); } return (ENOSYS); @@ -924,7 +905,7 @@ retry2: if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { linux_msg(td, "unsupported FUTEX_UNLOCK_PI"); pem->flags |= LINUX_XUNSUP_FUTEXPIOP; - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, unimplemented_unlock_pi); } return (ENOSYS); @@ -935,7 +916,7 @@ retry2: if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { linux_msg(td, "unsupported FUTEX_TRYLOCK_PI"); pem->flags |= LINUX_XUNSUP_FUTEXPIOP; - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, unimplemented_trylock_pi); } return (ENOSYS); @@ -951,7 +932,7 @@ retry2: if ((pem->flags & LINUX_XDEPR_REQUEUEOP) == 0) { linux_msg(td, "unsupported FUTEX_REQUEUE"); pem->flags |= LINUX_XDEPR_REQUEUEOP; - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, deprecated_requeue); } return (EINVAL); @@ -962,7 +943,7 @@ retry2: if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { linux_msg(td, "unsupported FUTEX_WAIT_REQUEUE_PI"); pem->flags |= LINUX_XUNSUP_FUTEXPIOP; - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, unimplemented_wait_requeue_pi); } return (ENOSYS); @@ -973,14 +954,14 @@ retry2: if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { linux_msg(td, "unsupported FUTEX_CMP_REQUEUE_PI"); pem->flags |= LINUX_XUNSUP_FUTEXPIOP; - LIN_SDT_PROBE0(futex, linux_sys_futex, + LIN_SDT_PROBE0(futex, linux_futex, unimplemented_cmp_requeue_pi); } return (ENOSYS); default: linux_msg(td, "unsupported futex op %d", args->op); - LIN_SDT_PROBE1(futex, linux_sys_futex, unknown_operation, + LIN_SDT_PROBE1(futex, linux_futex, unknown_operation, args->op); return (ENOSYS); } @@ -988,6 +969,75 @@ retry2: return (error); } +int +linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) +{ + struct linux_futex_args fargs = { + .uaddr = args->uaddr, + .op = args->op, + .val = args->val, + .ts = NULL, + .uaddr2 = args->uaddr2, + .val3 = args->val3, + }; + struct l_timespec lts; + int error; + + switch (args->op & LINUX_FUTEX_CMD_MASK) { + case LINUX_FUTEX_WAIT: + case LINUX_FUTEX_WAIT_BITSET: + if (args->timeout != NULL) { + error = copyin(args->timeout, <s, sizeof(lts)); + if (error != 0) + return (error); + error = linux_to_native_timespec(&fargs.kts, <s); + if (error != 0) + return (error); + fargs.ts = &fargs.kts; + } + break; + default: + fargs.ts = PTRIN(args->timeout); + } + return (linux_futex(td, &fargs)); +} + +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_sys_futex_time64(struct thread *td, + struct linux_sys_futex_time64_args *args) +{ + struct linux_futex_args fargs = { + .uaddr = args->uaddr, + .op = args->op, + .val = args->val, + .ts = NULL, + .uaddr2 = args->uaddr2, + .val3 = args->val3, + }; + struct l_timespec64 lts; + int error; + + switch (args->op & LINUX_FUTEX_CMD_MASK) { + case LINUX_FUTEX_WAIT: + case LINUX_FUTEX_WAIT_BITSET: + if (args->timeout != NULL) { + error = copyin(args->timeout, <s, sizeof(lts)); + if (error != 0) + return (error); + error = linux_to_native_timespec64(&fargs.kts, <s); + if (error != 0) + return (error); + fargs.ts = &fargs.kts; + } + break; + default: + fargs.ts = PTRIN(args->timeout); + } + return (linux_futex(td, &fargs)); +} +#endif + int linux_set_robust_list(struct thread *td, struct linux_set_robust_list_args *args) { diff --git a/sys/compat/linux/linux_futex.h b/sys/compat/linux/linux_futex.h index bf546538c981..6ea873d98411 100644 --- a/sys/compat/linux/linux_futex.h +++ b/sys/compat/linux/linux_futex.h @@ -55,6 +55,9 @@ #define LINUX_FUTEX_PRIVATE_FLAG 128 #define LINUX_FUTEX_CLOCK_REALTIME 256 +#define LINUX_FUTEX_CMD_MASK ~(LINUX_FUTEX_PRIVATE_FLAG | \ + LINUX_FUTEX_CLOCK_REALTIME) + #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ #define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ #define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */ diff --git a/sys/i386/linux/linux_dummy_machdep.c b/sys/i386/linux/linux_dummy_machdep.c index f679e090c7c1..78503b9453ee 100644 --- a/sys/i386/linux/linux_dummy_machdep.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -82,5 +82,4 @@ DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); DUMMY(rt_sigtimedwait_time64); -DUMMY(futex_time64); DUMMY(sched_rr_get_interval_time64); diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index a60129ccdaa9..d78f000530e3 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -2433,7 +2433,14 @@ int linux_rt_sigtimedwait_time64(void); } 422 AUE_NULL STD { - int linux_futex_time64(void); + int linux_sys_futex_time64( + uint32_t *uaddr, + l_int op, + uint32_t val, + struct l_timespec64 *timeout, + uint32_t *uaddr2, + uint32_t val3 + ); } 423 AUE_NULL STD { int linux_sched_rr_get_interval_time64(void); From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:30:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CC5E648D57; Thu, 10 Jun 2021 11:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G11wq1VDgz4Wq2; Thu, 10 Jun 2021 11:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13FFB6BAB; Thu, 10 Jun 2021 11:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ABU3XZ082446; Thu, 10 Jun 2021 11:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ABU2JW082440; Thu, 10 Jun 2021 11:30:02 GMT (envelope-from git) Date: Thu, 10 Jun 2021 11:30:02 GMT Message-Id: <202106101130.15ABU2JW082440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 985978806e21 - main - linux(4): Regen for futex_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 985978806e21073c5578198fedfdd414290c3e64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:30:03 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=985978806e21073c5578198fedfdd414290c3e64 commit 985978806e21073c5578198fedfdd414290c3e64 Author: Dmitry Chagin AuthorDate: 2021-06-10 11:28:25 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 11:28:25 +0000 linux(4): Regen for futex_time64 system call. MFC after: 2 weeks --- sys/amd64/linux32/linux32_proto.h | 13 ++++++---- sys/amd64/linux32/linux32_syscall.h | 2 +- sys/amd64/linux32/linux32_syscalls.c | 2 +- sys/amd64/linux32/linux32_sysent.c | 2 +- sys/amd64/linux32/linux32_systrace_args.c | 40 +++++++++++++++++++++++++++---- sys/i386/linux/linux_proto.h | 13 ++++++---- sys/i386/linux/linux_syscall.h | 2 +- sys/i386/linux/linux_syscalls.c | 2 +- sys/i386/linux/linux_sysent.c | 2 +- sys/i386/linux/linux_systrace_args.c | 40 +++++++++++++++++++++++++++---- 10 files changed, 96 insertions(+), 22 deletions(-) diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index aa48b0b50b89..5379aaf9c4f6 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -1581,8 +1581,13 @@ struct linux_semtimedop_time64_args { struct linux_rt_sigtimedwait_time64_args { register_t dummy; }; -struct linux_futex_time64_args { - register_t dummy; +struct linux_sys_futex_time64_args { + char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; + char timeout_l_[PADL_(struct l_timespec64 *)]; struct l_timespec64 * timeout; char timeout_r_[PADR_(struct l_timespec64 *)]; + char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; + char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)]; }; struct linux_sched_rr_get_interval_time64_args { register_t dummy; @@ -1989,7 +1994,7 @@ int linux_mq_timedsend_time64(struct thread *, struct linux_mq_timedsend_time64_ int linux_mq_timedreceive_time64(struct thread *, struct linux_mq_timedreceive_time64_args *); int linux_semtimedop_time64(struct thread *, struct linux_semtimedop_time64_args *); int linux_rt_sigtimedwait_time64(struct thread *, struct linux_rt_sigtimedwait_time64_args *); -int linux_futex_time64(struct thread *, struct linux_futex_time64_args *); +int linux_sys_futex_time64(struct thread *, struct linux_sys_futex_time64_args *); int linux_sched_rr_get_interval_time64(struct thread *, struct linux_sched_rr_get_interval_time64_args *); int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); @@ -2400,7 +2405,7 @@ int linux_mount_setattr(struct thread *, struct linux_mount_setattr_args *); #define LINUX32_SYS_AUE_linux_mq_timedreceive_time64 AUE_NULL #define LINUX32_SYS_AUE_linux_semtimedop_time64 AUE_NULL #define LINUX32_SYS_AUE_linux_rt_sigtimedwait_time64 AUE_NULL -#define LINUX32_SYS_AUE_linux_futex_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_sys_futex_time64 AUE_NULL #define LINUX32_SYS_AUE_linux_sched_rr_get_interval_time64 AUE_NULL #define LINUX32_SYS_AUE_linux_pidfd_send_signal AUE_NULL #define LINUX32_SYS_AUE_linux_io_uring_setup AUE_NULL diff --git a/sys/amd64/linux32/linux32_syscall.h b/sys/amd64/linux32/linux32_syscall.h index e82029ce6705..4c9db70621d3 100644 --- a/sys/amd64/linux32/linux32_syscall.h +++ b/sys/amd64/linux32/linux32_syscall.h @@ -383,7 +383,7 @@ #define LINUX32_SYS_linux_mq_timedreceive_time64 419 #define LINUX32_SYS_linux_semtimedop_time64 420 #define LINUX32_SYS_linux_rt_sigtimedwait_time64 421 -#define LINUX32_SYS_linux_futex_time64 422 +#define LINUX32_SYS_linux_sys_futex_time64 422 #define LINUX32_SYS_linux_sched_rr_get_interval_time64 423 #define LINUX32_SYS_linux_pidfd_send_signal 424 #define LINUX32_SYS_linux_io_uring_setup 425 diff --git a/sys/amd64/linux32/linux32_syscalls.c b/sys/amd64/linux32/linux32_syscalls.c index c60e40452d35..b427a94c87a0 100644 --- a/sys/amd64/linux32/linux32_syscalls.c +++ b/sys/amd64/linux32/linux32_syscalls.c @@ -429,7 +429,7 @@ const char *linux32_syscallnames[] = { "linux_mq_timedreceive_time64", /* 419 = linux_mq_timedreceive_time64 */ "linux_semtimedop_time64", /* 420 = linux_semtimedop_time64 */ "linux_rt_sigtimedwait_time64", /* 421 = linux_rt_sigtimedwait_time64 */ - "linux_futex_time64", /* 422 = linux_futex_time64 */ + "linux_sys_futex_time64", /* 422 = linux_sys_futex_time64 */ "linux_sched_rr_get_interval_time64", /* 423 = linux_sched_rr_get_interval_time64 */ "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c index dd59369c7fe4..f84844d58e20 100644 --- a/sys/amd64/linux32/linux32_sysent.c +++ b/sys/amd64/linux32/linux32_sysent.c @@ -439,7 +439,7 @@ struct sysent linux32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_mq_timedreceive_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 419 = linux_mq_timedreceive_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_semtimedop_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 420 = linux_semtimedop_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_rt_sigtimedwait_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_futex_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 422 = linux_futex_time64 */ + { .sy_narg = AS(linux_sys_futex_time64_args), .sy_call = (sy_call_t *)linux_sys_futex_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 422 = linux_sys_futex_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_sched_rr_get_interval_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 423 = linux_sched_rr_get_interval_time64 */ { .sy_narg = AS(linux_pidfd_send_signal_args), .sy_call = (sy_call_t *)linux_pidfd_send_signal, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_io_uring_setup, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index bd6201cf4469..10a400677f07 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -3069,9 +3069,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 0; break; } - /* linux_futex_time64 */ + /* linux_sys_futex_time64 */ case 422: { - *n_args = 0; + struct linux_sys_futex_time64_args *p = params; + uarg[0] = (intptr_t)p->uaddr; /* uint32_t * */ + iarg[1] = p->op; /* l_int */ + uarg[2] = p->val; /* uint32_t */ + uarg[3] = (intptr_t)p->timeout; /* struct l_timespec64 * */ + uarg[4] = (intptr_t)p->uaddr2; /* uint32_t * */ + uarg[5] = p->val3; /* uint32_t */ + *n_args = 6; break; } /* linux_sched_rr_get_interval_time64 */ @@ -8119,8 +8126,30 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) /* linux_rt_sigtimedwait_time64 */ case 421: break; - /* linux_futex_time64 */ + /* linux_sys_futex_time64 */ case 422: + switch (ndx) { + case 0: + p = "userland uint32_t *"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "userland struct l_timespec64 *"; + break; + case 4: + p = "userland uint32_t *"; + break; + case 5: + p = "uint32_t"; + break; + default: + break; + }; break; /* linux_sched_rr_get_interval_time64 */ case 423: @@ -9886,8 +9915,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 420: /* linux_rt_sigtimedwait_time64 */ case 421: - /* linux_futex_time64 */ + /* linux_sys_futex_time64 */ case 422: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sched_rr_get_interval_time64 */ case 423: /* linux_pidfd_send_signal */ diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index a417f7804c3b..42e8d0a17f85 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -1574,8 +1574,13 @@ struct linux_semtimedop_time64_args { struct linux_rt_sigtimedwait_time64_args { register_t dummy; }; -struct linux_futex_time64_args { - register_t dummy; +struct linux_sys_futex_time64_args { + char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; + char timeout_l_[PADL_(struct l_timespec64 *)]; struct l_timespec64 * timeout; char timeout_r_[PADR_(struct l_timespec64 *)]; + char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; + char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)]; }; struct linux_sched_rr_get_interval_time64_args { register_t dummy; @@ -1984,7 +1989,7 @@ int linux_mq_timedsend_time64(struct thread *, struct linux_mq_timedsend_time64_ int linux_mq_timedreceive_time64(struct thread *, struct linux_mq_timedreceive_time64_args *); int linux_semtimedop_time64(struct thread *, struct linux_semtimedop_time64_args *); int linux_rt_sigtimedwait_time64(struct thread *, struct linux_rt_sigtimedwait_time64_args *); -int linux_futex_time64(struct thread *, struct linux_futex_time64_args *); +int linux_sys_futex_time64(struct thread *, struct linux_sys_futex_time64_args *); int linux_sched_rr_get_interval_time64(struct thread *, struct linux_sched_rr_get_interval_time64_args *); int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); @@ -2397,7 +2402,7 @@ int linux_mount_setattr(struct thread *, struct linux_mount_setattr_args *); #define LINUX_SYS_AUE_linux_mq_timedreceive_time64 AUE_NULL #define LINUX_SYS_AUE_linux_semtimedop_time64 AUE_NULL #define LINUX_SYS_AUE_linux_rt_sigtimedwait_time64 AUE_NULL -#define LINUX_SYS_AUE_linux_futex_time64 AUE_NULL +#define LINUX_SYS_AUE_linux_sys_futex_time64 AUE_NULL #define LINUX_SYS_AUE_linux_sched_rr_get_interval_time64 AUE_NULL #define LINUX_SYS_AUE_linux_pidfd_send_signal AUE_NULL #define LINUX_SYS_AUE_linux_io_uring_setup AUE_NULL diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h index 49ce9295642b..9488c637fff0 100644 --- a/sys/i386/linux/linux_syscall.h +++ b/sys/i386/linux/linux_syscall.h @@ -390,7 +390,7 @@ #define LINUX_SYS_linux_mq_timedreceive_time64 419 #define LINUX_SYS_linux_semtimedop_time64 420 #define LINUX_SYS_linux_rt_sigtimedwait_time64 421 -#define LINUX_SYS_linux_futex_time64 422 +#define LINUX_SYS_linux_sys_futex_time64 422 #define LINUX_SYS_linux_sched_rr_get_interval_time64 423 #define LINUX_SYS_linux_pidfd_send_signal 424 #define LINUX_SYS_linux_io_uring_setup 425 diff --git a/sys/i386/linux/linux_syscalls.c b/sys/i386/linux/linux_syscalls.c index 71a7312aa7ee..748d2eb18fc1 100644 --- a/sys/i386/linux/linux_syscalls.c +++ b/sys/i386/linux/linux_syscalls.c @@ -429,7 +429,7 @@ const char *linux_syscallnames[] = { "linux_mq_timedreceive_time64", /* 419 = linux_mq_timedreceive_time64 */ "linux_semtimedop_time64", /* 420 = linux_semtimedop_time64 */ "linux_rt_sigtimedwait_time64", /* 421 = linux_rt_sigtimedwait_time64 */ - "linux_futex_time64", /* 422 = linux_futex_time64 */ + "linux_sys_futex_time64", /* 422 = linux_sys_futex_time64 */ "linux_sched_rr_get_interval_time64", /* 423 = linux_sched_rr_get_interval_time64 */ "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index c905daebd9d6..d5435b99e51b 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -439,7 +439,7 @@ struct sysent linux_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_mq_timedreceive_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 419 = linux_mq_timedreceive_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_semtimedop_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 420 = linux_semtimedop_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_rt_sigtimedwait_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_futex_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 422 = linux_futex_time64 */ + { .sy_narg = AS(linux_sys_futex_time64_args), .sy_call = (sy_call_t *)linux_sys_futex_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 422 = linux_sys_futex_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_sched_rr_get_interval_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 423 = linux_sched_rr_get_interval_time64 */ { .sy_narg = AS(linux_pidfd_send_signal_args), .sy_call = (sy_call_t *)linux_pidfd_send_signal, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_io_uring_setup, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index 37dcd1db59d8..3355d72448e3 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -3108,9 +3108,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 0; break; } - /* linux_futex_time64 */ + /* linux_sys_futex_time64 */ case 422: { - *n_args = 0; + struct linux_sys_futex_time64_args *p = params; + uarg[0] = (intptr_t)p->uaddr; /* uint32_t * */ + iarg[1] = p->op; /* l_int */ + uarg[2] = p->val; /* uint32_t */ + uarg[3] = (intptr_t)p->timeout; /* struct l_timespec64 * */ + uarg[4] = (intptr_t)p->uaddr2; /* uint32_t * */ + uarg[5] = p->val3; /* uint32_t */ + *n_args = 6; break; } /* linux_sched_rr_get_interval_time64 */ @@ -8196,8 +8203,30 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) /* linux_rt_sigtimedwait_time64 */ case 421: break; - /* linux_futex_time64 */ + /* linux_sys_futex_time64 */ case 422: + switch (ndx) { + case 0: + p = "userland uint32_t *"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "userland struct l_timespec64 *"; + break; + case 4: + p = "userland uint32_t *"; + break; + case 5: + p = "uint32_t"; + break; + default: + break; + }; break; /* linux_sched_rr_get_interval_time64 */ case 423: @@ -9992,8 +10021,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 420: /* linux_rt_sigtimedwait_time64 */ case 421: - /* linux_futex_time64 */ + /* linux_sys_futex_time64 */ case 422: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sched_rr_get_interval_time64 */ case 423: /* linux_pidfd_send_signal */ From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:46:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9E446498B2; Thu, 10 Jun 2021 11:46:12 +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 4G12HS2DyGz4XpP; Thu, 10 Jun 2021 11:46:11 +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 15ABk3rm019565; Thu, 10 Jun 2021 04:46:03 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 15ABk345019564; Thu, 10 Jun 2021 04:46:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202106101146.15ABk345019564@gndrsh.dnsmgr.net> Subject: Re: git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning In-Reply-To: <202106100011.15A0B0oI080542@gitrepo.freebsd.org> To: Warner Losh Date: Thu, 10 Jun 2021 04:46:03 -0700 (PDT) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@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: 4G12HS2DyGz4XpP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:46:12 -0000 > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > Author: Warner Losh > AuthorDate: 2021-06-10 00:10:12 +0000 > Commit: Warner Losh > CommitDate: 2021-06-10 00:10:52 +0000 > > mk: WITH_FOO=no now generates a warning First off thank you, this may stop some head scratching! But what about WITHOUT_foo=no the symetrical mistake? I see bdrewey raised this in the review, but it was dismissed using the argument that some languages, spanish specifically, allow double negatives. This is computers engineering, and in that field of science double negatives are clearly defined and understood, so using an argument of a language that simply does not apply to the field, IMHO, is an arguement of low standing. Also I do not believe == is a case insensitive operation so this code fails for NO, No, and nO(sic). Regards, Rod > > Many people are used to gnu configure's behavior of changing > --with-foo=no to --without-foo. At the same time, several folks have > WITH_FOO=no in their config files to enable this ironic form of the > option because of an old meme from IRC, a mailing list or the forums (I > forget which). Add a warning to allow to alert people w/o breaking POLA. > > Reviewed by: allanjude, bdrewery, manu > MFC After: 2 weeks > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D30684 > --- > share/mk/bsd.mkopt.mk | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk > index 5a9cf1b2f1be..98d23dd46c2a 100644 > --- a/share/mk/bsd.mkopt.mk > +++ b/share/mk/bsd.mkopt.mk > @@ -36,6 +36,9 @@ > # > .for var in ${__DEFAULT_YES_OPTIONS} > .if !defined(MK_${var}) > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > +.endif > .if defined(WITHOUT_${var}) # WITHOUT always wins > MK_${var}:= no > .else > @@ -54,6 +57,9 @@ MK_${var}:= yes > # > .for var in ${__DEFAULT_NO_OPTIONS} > .if !defined(MK_${var}) > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > +.endif > .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins > MK_${var}:= yes > .else > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:48:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D52166497AC; Thu, 10 Jun 2021 11:48:03 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [IPv6:2001:19f0:6400:80a1:5054:ff:fe7a:a27d]) (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 4G12KZ6lKcz4Xs2; Thu, 10 Jun 2021 11:48:02 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.16.1/8.16.1) with ESMTP id 15ABlt4C002871; Thu, 10 Jun 2021 14:47:55 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.16.1/8.16.1/Submit) id 15ABltX0002870; Thu, 10 Jun 2021 14:47:55 +0300 (MSK) (envelope-from dchagin) Date: Thu, 10 Jun 2021 14:47:55 +0300 From: Dmitry Chagin To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Cc: markj@freebsd.org, philip@freebsd.org Subject: Re: git: 25b09d6f398e - main - linux(4): Prevent integer overflow in futex_requeue. Message-ID: References: <202106101130.15ABU0SG081396@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wbC13Q0zx5eikzrU" Content-Disposition: inline In-Reply-To: <202106101130.15ABU0SG081396@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4G12KZ6lKcz4Xs2 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of dchagin@heemeyer.club has no SPF policy when checking 2001:19f0:6400:80a1:5054:ff:fe7a:a27d) smtp.mailfrom=dchagin@heemeyer.club X-Spamd-Result: default: False [-0.00 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[dchagin]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:19f0:6400:80a1:5054:ff:fe7a:a27d:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; SPAMHAUS_ZRD(0.00)[2001:19f0:6400:80a1:5054:ff:fe7a:a27d:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; NEURAL_SPAM_SHORT(0.90)[0.899]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[dchagin@freebsd.org,dchagin@heemeyer.club]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:6400::/38, country:US]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,dchagin@heemeyer.club]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:48:03 -0000 --wbC13Q0zx5eikzrU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 10, 2021 at 11:30:00AM +0000, Dmitry Chagin wrote: > The branch main has been updated by dchagin: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D25b09d6f398ea8a260ee8e2e82= 09fd76c61e13ee >=20 > commit 25b09d6f398ea8a260ee8e2e8209fd76c61e13ee > Author: Dmitry Chagin > AuthorDate: 2021-06-10 11:23:11 +0000 > Commit: Dmitry Chagin > CommitDate: 2021-06-10 11:23:11 +0000 >=20 > linux(4): Prevent integer overflow in futex_requeue. > =20 > To prevent a signed integer overflow in futex_requeue add a sanity ch= eck > to catch negative values of nrwake or nrrequeue. > =20 > MFC after: 2 weeks > --- we discussed this with secteam@, there will be a EN about it --wbC13Q0zx5eikzrU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQ/P4uHzgmeEDYGasrS3ZNvc4787QUCYMH75wAKCRDS3ZNvc478 7d1iAJ92fUrFjXnxY+l1Ed02aSID9Iez7gCcD0Z99sAKSkrPwZXmrs2TQGqN6YI= =r80A -----END PGP SIGNATURE----- --wbC13Q0zx5eikzrU-- From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:53:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08F29649CAE; Thu, 10 Jun 2021 11:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G12Rl6v5bz4YGd; Thu, 10 Jun 2021 11:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D57C56E79; Thu, 10 Jun 2021 11:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ABrNx8018886; Thu, 10 Jun 2021 11:53:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ABrNdB018885; Thu, 10 Jun 2021 11:53:23 GMT (envelope-from git) Date: Thu, 10 Jun 2021 11:53:23 GMT Message-Id: <202106101153.15ABrNdB018885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: db4a1f331b73 - main - linux(4): Implement rt_sigtimedwait_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db4a1f331b73eb821d5d9c3cbb478ad50223f023 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:53:24 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=db4a1f331b73eb821d5d9c3cbb478ad50223f023 commit db4a1f331b73eb821d5d9c3cbb478ad50223f023 Author: Dmitry Chagin AuthorDate: 2021-06-10 11:51:30 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 11:51:30 +0000 linux(4): Implement rt_sigtimedwait_time64 system call. It still does not work as intended, awaits D30675. MFC after: 2 weeks --- sys/amd64/linux32/linux32_dummy_machdep.c | 1 - sys/amd64/linux32/syscalls.master | 7 +++- sys/compat/linux/linux_signal.c | 70 +++++++++++++++++++++++-------- sys/i386/linux/linux_dummy_machdep.c | 1 - sys/i386/linux/syscalls.master | 7 +++- 5 files changed, 64 insertions(+), 22 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy_machdep.c b/sys/amd64/linux32/linux32_dummy_machdep.c index bfb4ff71e0b1..837496641311 100644 --- a/sys/amd64/linux32/linux32_dummy_machdep.c +++ b/sys/amd64/linux32/linux32_dummy_machdep.c @@ -79,5 +79,4 @@ DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); -DUMMY(rt_sigtimedwait_time64); DUMMY(sched_rr_get_interval_time64); diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index bf2778bb91fd..92c1c0e53cdc 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -2412,7 +2412,12 @@ int linux_semtimedop_time64(void); } 421 AUE_NULL STD { - int linux_rt_sigtimedwait_time64(void); + int linux_rt_sigtimedwait_time64( + l_sigset_t *mask, + l_siginfo_t *ptr, + struct l_timespec64 *timeout, + l_size_t sigsetsize + ); } 422 AUE_NULL STD { int linux_sys_futex_time64( diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 5310895cb92c..d0f1bb1c3b32 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$"); static int linux_do_tkill(struct thread *td, struct thread *tdt, ksiginfo_t *ksi); static void sicode_to_lsicode(int si_code, int *lsi_code); +static int linux_common_rt_sigtimedwait(struct thread *, + l_sigset_t *, struct timespec *, l_siginfo_t *, + l_size_t); static void linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa) @@ -386,29 +389,14 @@ linux_rt_sigpending(struct thread *td, struct linux_rt_sigpending_args *args) return (copyout(&lset, args->set, args->sigsetsize)); } -/* - * MPSAFE - */ int linux_rt_sigtimedwait(struct thread *td, struct linux_rt_sigtimedwait_args *args) { - int error, sig; struct timespec ts, *tsa; struct l_timespec lts; - l_sigset_t lset; - sigset_t bset; - l_siginfo_t lsi; - ksiginfo_t ksi; - - if (args->sigsetsize != sizeof(l_sigset_t)) - return (EINVAL); - - if ((error = copyin(args->mask, &lset, sizeof(lset)))) - return (error); - linux_to_bsd_sigset(&lset, &bset); + int error; - tsa = NULL; if (args->timeout) { if ((error = copyin(args->timeout, <s, sizeof(lts)))) return (error); @@ -419,16 +407,38 @@ linux_rt_sigtimedwait(struct thread *td, } else tsa = NULL; + return (linux_common_rt_sigtimedwait(td, args->mask, tsa, + args->ptr, args->sigsetsize)); +} + +static int +linux_common_rt_sigtimedwait(struct thread *td, l_sigset_t *mask, + struct timespec *tsa, l_siginfo_t *ptr, l_size_t sigsetsize) +{ + int error, sig; + l_sigset_t lset; + sigset_t bset; + l_siginfo_t lsi; + ksiginfo_t ksi; + + if (sigsetsize != sizeof(l_sigset_t)) + return (EINVAL); + + if ((error = copyin(mask, &lset, sizeof(lset)))) + return (error); + linux_to_bsd_sigset(&lset, &bset); + + ksiginfo_init(&ksi); error = kern_sigtimedwait(td, bset, &ksi, tsa); if (error) return (error); sig = bsd_to_linux_signal(ksi.ksi_signo); - if (args->ptr) { + if (ptr) { memset(&lsi, 0, sizeof(lsi)); siginfo_to_lsiginfo(&ksi.ksi_info, &lsi, sig); - error = copyout(&lsi, args->ptr, sizeof(lsi)); + error = copyout(&lsi, ptr, sizeof(lsi)); } if (error == 0) td->td_retval[0] = sig; @@ -436,6 +446,30 @@ linux_rt_sigtimedwait(struct thread *td, return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_rt_sigtimedwait_time64(struct thread *td, + struct linux_rt_sigtimedwait_time64_args *args) +{ + struct timespec ts, *tsa; + struct l_timespec64 lts; + int error; + + if (args->timeout) { + if ((error = copyin(args->timeout, <s, sizeof(lts)))) + return (error); + error = linux_to_native_timespec64(&ts, <s); + if (error != 0) + return (error); + tsa = &ts; + } else + tsa = NULL; + + return (linux_common_rt_sigtimedwait(td, args->mask, tsa, + args->ptr, args->sigsetsize)); +} +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ + int linux_kill(struct thread *td, struct linux_kill_args *args) { diff --git a/sys/i386/linux/linux_dummy_machdep.c b/sys/i386/linux/linux_dummy_machdep.c index 78503b9453ee..a349fab5b637 100644 --- a/sys/i386/linux/linux_dummy_machdep.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -81,5 +81,4 @@ DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); -DUMMY(rt_sigtimedwait_time64); DUMMY(sched_rr_get_interval_time64); diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index d78f000530e3..c42d9af0058d 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -2430,7 +2430,12 @@ int linux_semtimedop_time64(void); } 421 AUE_NULL STD { - int linux_rt_sigtimedwait_time64(void); + int linux_rt_sigtimedwait_time64( + l_sigset_t *mask, + l_siginfo_t *ptr, + struct l_timespec64 *timeout, + l_size_t sigsetsize + ); } 422 AUE_NULL STD { int linux_sys_futex_time64( From owner-dev-commits-src-all@freebsd.org Thu Jun 10 11:53:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D5146498E8; Thu, 10 Jun 2021 11:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G12Rn1myFz4YJK; Thu, 10 Jun 2021 11:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 131DD6FE2; Thu, 10 Jun 2021 11:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ABrOfm018910; Thu, 10 Jun 2021 11:53:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ABrOPX018909; Thu, 10 Jun 2021 11:53:24 GMT (envelope-from git) Date: Thu, 10 Jun 2021 11:53:24 GMT Message-Id: <202106101153.15ABrOPX018909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: c00252900060 - main - linux(4): Regen for rt_sigtimedwait_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0025290006044d2dd7e3b1b52c04d796dddc374 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 11:53:25 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c0025290006044d2dd7e3b1b52c04d796dddc374 commit c0025290006044d2dd7e3b1b52c04d796dddc374 Author: Dmitry Chagin AuthorDate: 2021-06-10 11:52:43 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 11:52:43 +0000 linux(4): Regen for rt_sigtimedwait_time64 system call. MFC after: 2 weeks --- sys/amd64/linux32/linux32_proto.h | 5 ++++- sys/amd64/linux32/linux32_sysent.c | 2 +- sys/amd64/linux32/linux32_systrace_args.c | 26 +++++++++++++++++++++++++- sys/i386/linux/linux_proto.h | 5 ++++- sys/i386/linux/linux_sysent.c | 2 +- sys/i386/linux/linux_systrace_args.c | 26 +++++++++++++++++++++++++- 6 files changed, 60 insertions(+), 6 deletions(-) diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index 5379aaf9c4f6..6d23a13ca4c3 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -1579,7 +1579,10 @@ struct linux_semtimedop_time64_args { register_t dummy; }; struct linux_rt_sigtimedwait_time64_args { - register_t dummy; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char ptr_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * ptr; char ptr_r_[PADR_(l_siginfo_t *)]; + char timeout_l_[PADL_(struct l_timespec64 *)]; struct l_timespec64 * timeout; char timeout_r_[PADR_(struct l_timespec64 *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; }; struct linux_sys_futex_time64_args { char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c index f84844d58e20..d131db0a570c 100644 --- a/sys/amd64/linux32/linux32_sysent.c +++ b/sys/amd64/linux32/linux32_sysent.c @@ -438,7 +438,7 @@ struct sysent linux32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_mq_timedsend_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 418 = linux_mq_timedsend_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_mq_timedreceive_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 419 = linux_mq_timedreceive_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_semtimedop_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 420 = linux_semtimedop_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_rt_sigtimedwait_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ + { .sy_narg = AS(linux_rt_sigtimedwait_time64_args), .sy_call = (sy_call_t *)linux_rt_sigtimedwait_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ { .sy_narg = AS(linux_sys_futex_time64_args), .sy_call = (sy_call_t *)linux_sys_futex_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 422 = linux_sys_futex_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_sched_rr_get_interval_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 423 = linux_sched_rr_get_interval_time64 */ { .sy_narg = AS(linux_pidfd_send_signal_args), .sy_call = (sy_call_t *)linux_pidfd_send_signal, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index 10a400677f07..e31c309800e5 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -3066,7 +3066,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_rt_sigtimedwait_time64 */ case 421: { - *n_args = 0; + struct linux_rt_sigtimedwait_time64_args *p = params; + uarg[0] = (intptr_t)p->mask; /* l_sigset_t * */ + uarg[1] = (intptr_t)p->ptr; /* l_siginfo_t * */ + uarg[2] = (intptr_t)p->timeout; /* struct l_timespec64 * */ + iarg[3] = p->sigsetsize; /* l_size_t */ + *n_args = 4; break; } /* linux_sys_futex_time64 */ @@ -8125,6 +8130,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_rt_sigtimedwait_time64 */ case 421: + switch (ndx) { + case 0: + p = "userland l_sigset_t *"; + break; + case 1: + p = "userland l_siginfo_t *"; + break; + case 2: + p = "userland struct l_timespec64 *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_sys_futex_time64 */ case 422: @@ -9915,6 +9936,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 420: /* linux_rt_sigtimedwait_time64 */ case 421: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sys_futex_time64 */ case 422: if (ndx == 0 || ndx == 1) diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index 42e8d0a17f85..8ba444340fea 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -1572,7 +1572,10 @@ struct linux_semtimedop_time64_args { register_t dummy; }; struct linux_rt_sigtimedwait_time64_args { - register_t dummy; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char ptr_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * ptr; char ptr_r_[PADR_(l_siginfo_t *)]; + char timeout_l_[PADL_(struct l_timespec64 *)]; struct l_timespec64 * timeout; char timeout_r_[PADR_(struct l_timespec64 *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; }; struct linux_sys_futex_time64_args { char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index d5435b99e51b..722fe27ca8cb 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -438,7 +438,7 @@ struct sysent linux_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_mq_timedsend_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 418 = linux_mq_timedsend_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_mq_timedreceive_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 419 = linux_mq_timedreceive_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_semtimedop_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 420 = linux_semtimedop_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_rt_sigtimedwait_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ + { .sy_narg = AS(linux_rt_sigtimedwait_time64_args), .sy_call = (sy_call_t *)linux_rt_sigtimedwait_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ { .sy_narg = AS(linux_sys_futex_time64_args), .sy_call = (sy_call_t *)linux_sys_futex_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 422 = linux_sys_futex_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_sched_rr_get_interval_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 423 = linux_sched_rr_get_interval_time64 */ { .sy_narg = AS(linux_pidfd_send_signal_args), .sy_call = (sy_call_t *)linux_pidfd_send_signal, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index 3355d72448e3..7d2189734252 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -3105,7 +3105,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_rt_sigtimedwait_time64 */ case 421: { - *n_args = 0; + struct linux_rt_sigtimedwait_time64_args *p = params; + uarg[0] = (intptr_t)p->mask; /* l_sigset_t * */ + uarg[1] = (intptr_t)p->ptr; /* l_siginfo_t * */ + uarg[2] = (intptr_t)p->timeout; /* struct l_timespec64 * */ + iarg[3] = p->sigsetsize; /* l_size_t */ + *n_args = 4; break; } /* linux_sys_futex_time64 */ @@ -8202,6 +8207,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_rt_sigtimedwait_time64 */ case 421: + switch (ndx) { + case 0: + p = "userland l_sigset_t *"; + break; + case 1: + p = "userland l_siginfo_t *"; + break; + case 2: + p = "userland struct l_timespec64 *"; + break; + case 3: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_sys_futex_time64 */ case 422: @@ -10021,6 +10042,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 420: /* linux_rt_sigtimedwait_time64 */ case 421: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sys_futex_time64 */ case 422: if (ndx == 0 || ndx == 1) From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:04:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38B1E64A396; Thu, 10 Jun 2021 12:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G12j019RRz4Z0P; Thu, 10 Jun 2021 12:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 104587428; Thu, 10 Jun 2021 12:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AC4p3Y033440; Thu, 10 Jun 2021 12:04:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AC4pLP033439; Thu, 10 Jun 2021 12:04:51 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:04:51 GMT Message-Id: <202106101204.15AC4pLP033439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: f6d075ecd769 - main - linux(4): Implement pselect6_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6d075ecd76925cbe56ea528a59bd74e4dd9451e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:04:52 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f6d075ecd76925cbe56ea528a59bd74e4dd9451e commit f6d075ecd76925cbe56ea528a59bd74e4dd9451e Author: Dmitry Chagin AuthorDate: 2021-06-10 12:03:30 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 12:03:30 +0000 linux(4): Implement pselect6_time64 system call. MFC after: 2 weeks --- sys/amd64/linux32/linux32_dummy_machdep.c | 1 - sys/amd64/linux32/syscalls.master | 9 ++- sys/compat/linux/linux_misc.c | 96 ++++++++++++++++++++++++------- sys/i386/linux/linux_dummy_machdep.c | 1 - sys/i386/linux/syscalls.master | 9 ++- 5 files changed, 92 insertions(+), 24 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy_machdep.c b/sys/amd64/linux32/linux32_dummy_machdep.c index 837496641311..81e0ed51ae31 100644 --- a/sys/amd64/linux32/linux32_dummy_machdep.c +++ b/sys/amd64/linux32/linux32_dummy_machdep.c @@ -72,7 +72,6 @@ DUMMY(timer_gettime64); DUMMY(timer_settime64); DUMMY(timerfd_gettime64); DUMMY(timerfd_settime64); -DUMMY(pselect6_time64); DUMMY(ppoll_time64); DUMMY(io_pgetevents_time64); DUMMY(recvmmsg_time64); diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 92c1c0e53cdc..ef89e331b429 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -2390,7 +2390,14 @@ ); } 413 AUE_NULL STD { - int linux_pselect6_time64(void); + int linux_pselect6_time64( + l_int nfds, + l_fd_set *readfds, + l_fd_set *writefds, + l_fd_set *exceptfds, + struct l_timespec64 *tsp, + l_uintptr_t *sig + ); } 414 AUE_NULL STD { int linux_ppoll_time64(void); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index bfa7bb659d5f..78dc37d9a19f 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -138,6 +138,9 @@ static int linux_utimensat_lts64_to_ts(struct l_timespec64 *, #endif static int linux_common_utimensat(struct thread *, int, const char *, struct timespec *, int); +static int linux_common_pselect6(struct thread *, l_int, + l_fd_set *, l_fd_set *, l_fd_set *, + struct timespec *, l_uintptr_t *); int linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) @@ -2347,19 +2350,50 @@ linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) int linux_pselect6(struct thread *td, struct linux_pselect6_args *args) +{ + struct l_timespec lts; + struct timespec ts, *tsp; + int error; + + if (args->tsp != NULL) { + error = copyin(args->tsp, <s, sizeof(lts)); + if (error != 0) + return (error); + error = linux_to_native_timespec(&ts, <s); + if (error != 0) + return (error); + tsp = &ts; + } else + tsp = NULL; + + error = linux_common_pselect6(td, args->nfds, args->readfds, + args->writefds, args->exceptfds, tsp, args->sig); + if (error != 0) + return (error); + + if (args->tsp != NULL) { + error = native_to_linux_timespec(<s, tsp); + if (error == 0) + error = copyout(<s, args->tsp, sizeof(lts)); + } + return (error); +} + +static int +linux_common_pselect6(struct thread *td, l_int nfds, l_fd_set *readfds, + l_fd_set *writefds, l_fd_set *exceptfds, struct timespec *tsp, + l_uintptr_t *sig) { struct timeval utv, tv0, tv1, *tvp; struct l_pselect6arg lpse6; - struct l_timespec lts; - struct timespec uts; l_sigset_t l_ss; sigset_t *ssp; sigset_t ss; int error; ssp = NULL; - if (args->sig != NULL) { - error = copyin(args->sig, &lpse6, sizeof(lpse6)); + if (sig != NULL) { + error = copyin(sig, &lpse6, sizeof(lpse6)); if (error != 0) return (error); if (lpse6.ss_len != sizeof(l_ss)) @@ -2372,21 +2406,15 @@ linux_pselect6(struct thread *td, struct linux_pselect6_args *args) linux_to_bsd_sigset(&l_ss, &ss); ssp = &ss; } - } + } else + ssp = NULL; /* * Currently glibc changes nanosecond number to microsecond. * This mean losing precision but for now it is hardly seen. */ - if (args->tsp != NULL) { - error = copyin(args->tsp, <s, sizeof(lts)); - if (error != 0) - return (error); - error = linux_to_native_timespec(&uts, <s); - if (error != 0) - return (error); - - TIMESPEC_TO_TIMEVAL(&utv, &uts); + if (tsp != NULL) { + TIMESPEC_TO_TIMEVAL(&utv, tsp); if (itimerfix(&utv)) return (EINVAL); @@ -2395,10 +2423,10 @@ linux_pselect6(struct thread *td, struct linux_pselect6_args *args) } else tvp = NULL; - error = kern_pselect(td, args->nfds, args->readfds, args->writefds, - args->exceptfds, tvp, ssp, LINUX_NFDBITS); + error = kern_pselect(td, nfds, readfds, writefds, + exceptfds, tvp, ssp, LINUX_NFDBITS); - if (error == 0 && args->tsp != NULL) { + if (error == 0 && tsp != NULL) { if (td->td_retval[0] != 0) { /* * Compute how much time was left of the timeout, @@ -2414,16 +2442,44 @@ linux_pselect6(struct thread *td, struct linux_pselect6_args *args) timevalclear(&utv); } else timevalclear(&utv); + TIMEVAL_TO_TIMESPEC(&utv, tsp); + } + return (error); +} - TIMEVAL_TO_TIMESPEC(&utv, &uts); +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_pselect6_time64(struct thread *td, + struct linux_pselect6_time64_args *args) +{ + struct l_timespec64 lts; + struct timespec ts, *tsp; + int error; - error = native_to_linux_timespec(<s, &uts); + if (args->tsp != NULL) { + error = copyin(args->tsp, <s, sizeof(lts)); + if (error != 0) + return (error); + error = linux_to_native_timespec64(&ts, <s); + if (error != 0) + return (error); + tsp = &ts; + } else + tsp = NULL; + + error = linux_common_pselect6(td, args->nfds, args->readfds, + args->writefds, args->exceptfds, tsp, args->sig); + if (error != 0) + return (error); + + if (args->tsp != NULL) { + error = native_to_linux_timespec64(<s, tsp); if (error == 0) error = copyout(<s, args->tsp, sizeof(lts)); } - return (error); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_ppoll(struct thread *td, struct linux_ppoll_args *args) diff --git a/sys/i386/linux/linux_dummy_machdep.c b/sys/i386/linux/linux_dummy_machdep.c index a349fab5b637..67c70afa15b3 100644 --- a/sys/i386/linux/linux_dummy_machdep.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -74,7 +74,6 @@ DUMMY(timer_gettime64); DUMMY(timer_settime64); DUMMY(timerfd_gettime64); DUMMY(timerfd_settime64); -DUMMY(pselect6_time64); DUMMY(ppoll_time64); DUMMY(io_pgetevents_time64); DUMMY(recvmmsg_time64); diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index c42d9af0058d..056ac42eaad7 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -2408,7 +2408,14 @@ ); } 413 AUE_NULL STD { - int linux_pselect6_time64(void); + int linux_pselect6_time64( + l_int nfds, + l_fd_set *readfds, + l_fd_set *writefds, + l_fd_set *exceptfds, + struct l_timespec64 *tsp, + l_uintptr_t *sig + ); } 414 AUE_NULL STD { int linux_ppoll_time64(void); From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:04:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCD5764A2EF; Thu, 10 Jun 2021 12:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G12j12Vw6z4YdD; Thu, 10 Jun 2021 12:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EE1C71C2; Thu, 10 Jun 2021 12:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AC4ri3033470; Thu, 10 Jun 2021 12:04:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AC4rGf033469; Thu, 10 Jun 2021 12:04:53 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:04:53 GMT Message-Id: <202106101204.15AC4rGf033469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 981a60f112e2 - main - linux(4): Regen for pselect6_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 981a60f112e213e7b8de04bf66588cab5c480b34 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:04:53 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=981a60f112e213e7b8de04bf66588cab5c480b34 commit 981a60f112e213e7b8de04bf66588cab5c480b34 Author: Dmitry Chagin AuthorDate: 2021-06-10 12:04:37 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 12:04:37 +0000 linux(4): Regen for pselect6_time64 system call. MFC after: 2 weeks --- sys/amd64/linux32/linux32_proto.h | 7 ++++++- sys/amd64/linux32/linux32_sysent.c | 2 +- sys/amd64/linux32/linux32_systrace_args.c | 34 ++++++++++++++++++++++++++++++- sys/i386/linux/linux_proto.h | 7 ++++++- sys/i386/linux/linux_sysent.c | 2 +- sys/i386/linux/linux_systrace_args.c | 34 ++++++++++++++++++++++++++++++- 6 files changed, 80 insertions(+), 6 deletions(-) diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index 6d23a13ca4c3..4897fa3615ea 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -1558,7 +1558,12 @@ struct linux_utimensat_time64_args { char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_pselect6_time64_args { - register_t dummy; + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char tsp_l_[PADL_(struct l_timespec64 *)]; struct l_timespec64 * tsp; char tsp_r_[PADR_(struct l_timespec64 *)]; + char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_time64_args { register_t dummy; diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c index d131db0a570c..de14c75605b5 100644 --- a/sys/amd64/linux32/linux32_sysent.c +++ b/sys/amd64/linux32/linux32_sysent.c @@ -430,7 +430,7 @@ struct sysent linux32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_timerfd_gettime64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 410 = linux_timerfd_gettime64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_timerfd_settime64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 411 = linux_timerfd_settime64 */ { .sy_narg = AS(linux_utimensat_time64_args), .sy_call = (sy_call_t *)linux_utimensat_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 412 = linux_utimensat_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_pselect6_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ + { .sy_narg = AS(linux_pselect6_time64_args), .sy_call = (sy_call_t *)linux_pselect6_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_ppoll_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 415 = nosys */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_io_pgetevents_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 416 = linux_io_pgetevents_time64 */ diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index e31c309800e5..2f0683a053ef 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -3031,7 +3031,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_pselect6_time64 */ case 413: { - *n_args = 0; + struct linux_pselect6_time64_args *p = params; + iarg[0] = p->nfds; /* l_int */ + uarg[1] = (intptr_t)p->readfds; /* l_fd_set * */ + uarg[2] = (intptr_t)p->writefds; /* l_fd_set * */ + uarg[3] = (intptr_t)p->exceptfds; /* l_fd_set * */ + uarg[4] = (intptr_t)p->tsp; /* struct l_timespec64 * */ + uarg[5] = (intptr_t)p->sig; /* l_uintptr_t * */ + *n_args = 6; break; } /* linux_ppoll_time64 */ @@ -8109,6 +8116,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_pselect6_time64 */ case 413: + switch (ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "userland l_fd_set *"; + break; + case 2: + p = "userland l_fd_set *"; + break; + case 3: + p = "userland l_fd_set *"; + break; + case 4: + p = "userland struct l_timespec64 *"; + break; + case 5: + p = "userland l_uintptr_t *"; + break; + default: + break; + }; break; /* linux_ppoll_time64 */ case 414: @@ -9922,6 +9951,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_pselect6_time64 */ case 413: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_ppoll_time64 */ case 414: /* linux_io_pgetevents_time64 */ diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index 8ba444340fea..cc4cd3a2923c 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -1551,7 +1551,12 @@ struct linux_utimensat_time64_args { char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_pselect6_time64_args { - register_t dummy; + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char tsp_l_[PADL_(struct l_timespec64 *)]; struct l_timespec64 * tsp; char tsp_r_[PADR_(struct l_timespec64 *)]; + char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_time64_args { register_t dummy; diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index 722fe27ca8cb..85de46a008b9 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -430,7 +430,7 @@ struct sysent linux_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_timerfd_gettime64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 410 = linux_timerfd_gettime64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_timerfd_settime64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 411 = linux_timerfd_settime64 */ { .sy_narg = AS(linux_utimensat_time64_args), .sy_call = (sy_call_t *)linux_utimensat_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 412 = linux_utimensat_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_pselect6_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ + { .sy_narg = AS(linux_pselect6_time64_args), .sy_call = (sy_call_t *)linux_pselect6_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_ppoll_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 415 = nosys */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_io_pgetevents_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 416 = linux_io_pgetevents_time64 */ diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index 7d2189734252..8985a25fa0c3 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -3070,7 +3070,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_pselect6_time64 */ case 413: { - *n_args = 0; + struct linux_pselect6_time64_args *p = params; + iarg[0] = p->nfds; /* l_int */ + uarg[1] = (intptr_t)p->readfds; /* l_fd_set * */ + uarg[2] = (intptr_t)p->writefds; /* l_fd_set * */ + uarg[3] = (intptr_t)p->exceptfds; /* l_fd_set * */ + uarg[4] = (intptr_t)p->tsp; /* struct l_timespec64 * */ + uarg[5] = (intptr_t)p->sig; /* l_uintptr_t * */ + *n_args = 6; break; } /* linux_ppoll_time64 */ @@ -8186,6 +8193,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_pselect6_time64 */ case 413: + switch (ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "userland l_fd_set *"; + break; + case 2: + p = "userland l_fd_set *"; + break; + case 3: + p = "userland l_fd_set *"; + break; + case 4: + p = "userland struct l_timespec64 *"; + break; + case 5: + p = "userland l_uintptr_t *"; + break; + default: + break; + }; break; /* linux_ppoll_time64 */ case 414: @@ -10028,6 +10057,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_pselect6_time64 */ case 413: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_ppoll_time64 */ case 414: /* linux_io_pgetevents_time64 */ From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:13:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FB0D64A70F; Thu, 10 Jun 2021 12:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G12td0pwLz4bL9; Thu, 10 Jun 2021 12:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04FFA77D2; Thu, 10 Jun 2021 12:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ACDC2T046315; Thu, 10 Jun 2021 12:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ACDCkv046314; Thu, 10 Jun 2021 12:13:12 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:13:12 GMT Message-Id: <202106101213.15ACDCkv046314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e884512ad143 - main - Split kern_poll() on two counterparts. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e884512ad143952f0dbacad631487ce28363fd08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:13:13 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e884512ad143952f0dbacad631487ce28363fd08 commit e884512ad143952f0dbacad631487ce28363fd08 Author: Dmitry Chagin AuthorDate: 2021-06-10 12:11:25 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 12:11:25 +0000 Split kern_poll() on two counterparts. The kern_poll_kfds() operates on clear kernel data, kfds points to an array in the kernel, while kern_poll() operates on user supplied pollfd. Move nfds check to kern_poll_maxfds(). No functional changes, it's for future use in the Linux emulation layer. Reviewd by: kib Differential Revision: https://reviews.freebsd.org/D30690 MFC after: 2 weeks --- sys/kern/sys_generic.c | 83 +++++++++++++++++++++++++++++--------------------- sys/sys/syscallsubr.h | 3 ++ 2 files changed, 52 insertions(+), 34 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 6fcdee7a088f..c89a643cfcf9 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1417,12 +1417,13 @@ sys_poll(struct thread *td, struct poll_args *uap) return (kern_poll(td, uap->fds, uap->nfds, tsp, NULL)); } +/* + * kfds points to an array in the kernel. + */ int -kern_poll(struct thread *td, struct pollfd *ufds, u_int nfds, +kern_poll_kfds(struct thread *td, struct pollfd *kfds, u_int nfds, struct timespec *tsp, sigset_t *uset) { - struct pollfd *kfds; - struct pollfd stackfds[32]; sbintime_t sbt, precision, tmp; time_t over; struct timespec ts; @@ -1453,28 +1454,11 @@ kern_poll(struct thread *td, struct pollfd *ufds, u_int nfds, } else sbt = -1; - /* - * This is kinda bogus. We have fd limits, but that is not - * really related to the size of the pollfd array. Make sure - * we let the process use at least FD_SETSIZE entries and at - * least enough for the system-wide limits. We want to be reasonably - * safe, but not overly restrictive. - */ - if (nfds > maxfilesperproc && nfds > FD_SETSIZE) - return (EINVAL); - if (nfds > nitems(stackfds)) - kfds = mallocarray(nfds, sizeof(*kfds), M_TEMP, M_WAITOK); - else - kfds = stackfds; - error = copyin(ufds, kfds, nfds * sizeof(*kfds)); - if (error) - goto done; - if (uset != NULL) { error = kern_sigprocmask(td, SIG_SETMASK, uset, &td->td_oldsigmask, 0); if (error) - goto done; + return (error); td->td_pflags |= TDP_OLDMASK; /* * Make sure that ast() is called on return to @@ -1501,20 +1485,11 @@ kern_poll(struct thread *td, struct pollfd *ufds, u_int nfds, } seltdclear(td); -done: /* poll is not restarted after signals... */ if (error == ERESTART) error = EINTR; if (error == EWOULDBLOCK) error = 0; - if (error == 0) { - error = pollout(td, kfds, ufds, nfds); - if (error) - goto out; - } -out: - if (nfds > nitems(stackfds)) - free(kfds, M_TEMP); return (error); } @@ -1539,12 +1514,52 @@ sys_ppoll(struct thread *td, struct ppoll_args *uap) ssp = &set; } else ssp = NULL; + return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp)); +} + +/* + * ufds points to an array in user space. + */ +int +kern_poll(struct thread *td, struct pollfd *ufds, u_int nfds, + struct timespec *tsp, sigset_t *set) +{ + struct pollfd *kfds; + struct pollfd stackfds[32]; + int error; + + if (kern_poll_maxfds(nfds)) + return (EINVAL); + if (nfds > nitems(stackfds)) + kfds = mallocarray(nfds, sizeof(*kfds), M_TEMP, M_WAITOK); + else + kfds = stackfds; + error = copyin(ufds, kfds, nfds * sizeof(*kfds)); + if (error != 0) + goto out; + + error = kern_poll_kfds(td, kfds, nfds, tsp, set); + if (error == 0) + error = pollout(td, kfds, ufds, nfds); + +out: + if (nfds > nitems(stackfds)) + free(kfds, M_TEMP); + return (error); +} + +bool +kern_poll_maxfds(u_int nfds) +{ + /* - * fds is still a pointer to user space. kern_poll() will - * take care of copyin that array to the kernel space. + * This is kinda bogus. We have fd limits, but that is not + * really related to the size of the pollfd array. Make sure + * we let the process use at least FD_SETSIZE entries and at + * least enough for the system-wide limits. We want to be reasonably + * safe, but not overly restrictive. */ - - return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp)); + return (nfds > maxfilesperproc && nfds > FD_SETSIZE); } static int diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 471c38ab0e12..eb7b82946988 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -225,6 +225,9 @@ int kern_pipe(struct thread *td, int fildes[2], int flags, struct filecaps *fcaps1, struct filecaps *fcaps2); int kern_poll(struct thread *td, struct pollfd *fds, u_int nfds, struct timespec *tsp, sigset_t *uset); +int kern_poll_kfds(struct thread *td, struct pollfd *fds, u_int nfds, + struct timespec *tsp, sigset_t *uset); +bool kern_poll_maxfds(u_int nfds); int kern_posix_error(struct thread *td, int error); int kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len, int advice); From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:19:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E480064A7FD; Thu, 10 Jun 2021 12:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G132068Fqz4bZ5; Thu, 10 Jun 2021 12:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B787A71E6; Thu, 10 Jun 2021 12:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ACJaNV047097; Thu, 10 Jun 2021 12:19:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ACJadH047096; Thu, 10 Jun 2021 12:19:36 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:19:36 GMT Message-Id: <202106101219.15ACJadH047096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: ed61e0ce1d29 - main - linux(4): Implement ppoll_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed61e0ce1d293d659b86e382def05a31ac337e03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:19:37 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ed61e0ce1d293d659b86e382def05a31ac337e03 commit ed61e0ce1d293d659b86e382def05a31ac337e03 Author: Dmitry Chagin AuthorDate: 2021-06-10 12:18:46 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 12:18:46 +0000 linux(4): Implement ppoll_time64 system call. MFC after: 2 weeks --- sys/amd64/linux32/linux32_dummy_machdep.c | 1 - sys/amd64/linux32/syscalls.master | 8 ++- sys/compat/linux/linux_misc.c | 98 +++++++++++++++++++++++-------- sys/i386/linux/linux_dummy_machdep.c | 1 - sys/i386/linux/syscalls.master | 8 ++- 5 files changed, 87 insertions(+), 29 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy_machdep.c b/sys/amd64/linux32/linux32_dummy_machdep.c index 81e0ed51ae31..fb7c88629af7 100644 --- a/sys/amd64/linux32/linux32_dummy_machdep.c +++ b/sys/amd64/linux32/linux32_dummy_machdep.c @@ -72,7 +72,6 @@ DUMMY(timer_gettime64); DUMMY(timer_settime64); DUMMY(timerfd_gettime64); DUMMY(timerfd_settime64); -DUMMY(ppoll_time64); DUMMY(io_pgetevents_time64); DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index ef89e331b429..0ca919182998 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -2400,7 +2400,13 @@ ); } 414 AUE_NULL STD { - int linux_ppoll_time64(void); + int linux_ppoll_time64( + struct pollfd *fds, + uint32_t nfds, + struct l_timespec *tsp, + l_sigset_t *sset, + l_size_t ssize + ); } 415 AUE_NULL UNIMPL nosys 416 AUE_NULL STD { diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 78dc37d9a19f..53dd27dc23db 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -141,6 +141,9 @@ static int linux_common_utimensat(struct thread *, int, static int linux_common_pselect6(struct thread *, l_int, l_fd_set *, l_fd_set *, l_fd_set *, struct timespec *, l_uintptr_t *); +static int linux_common_ppoll(struct thread *, struct pollfd *, + uint32_t, struct timespec *, l_sigset_t *, + l_size_t); int linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) @@ -2484,24 +2487,10 @@ linux_pselect6_time64(struct thread *td, int linux_ppoll(struct thread *td, struct linux_ppoll_args *args) { - struct timespec ts0, ts1; - struct l_timespec lts; struct timespec uts, *tsp; - l_sigset_t l_ss; - sigset_t *ssp; - sigset_t ss; + struct l_timespec lts; int error; - if (args->sset != NULL) { - if (args->ssize != sizeof(l_ss)) - return (EINVAL); - error = copyin(args->sset, &l_ss, sizeof(l_ss)); - if (error) - return (error); - linux_to_bsd_sigset(&l_ss, &ss); - ssp = &ss; - } else - ssp = NULL; if (args->tsp != NULL) { error = copyin(args->tsp, <s, sizeof(lts)); if (error) @@ -2509,31 +2498,90 @@ linux_ppoll(struct thread *td, struct linux_ppoll_args *args) error = linux_to_native_timespec(&uts, <s); if (error != 0) return (error); - - nanotime(&ts0); tsp = &uts; } else tsp = NULL; - error = kern_poll(td, args->fds, args->nfds, tsp, ssp); + error = linux_common_ppoll(td, args->fds, args->nfds, tsp, + args->sset, args->ssize); + if (error != 0) + return (error); + if (tsp != NULL) { + error = native_to_linux_timespec(<s, tsp); + if (error == 0) + error = copyout(<s, args->tsp, sizeof(lts)); + } + return (error); +} + +static int +linux_common_ppoll(struct thread *td, struct pollfd *fds, uint32_t nfds, + struct timespec *tsp, l_sigset_t *sset, l_size_t ssize) +{ + struct timespec ts0, ts1; + l_sigset_t l_ss; + sigset_t *ssp; + sigset_t ss; + int error; - if (error == 0 && args->tsp != NULL) { + if (sset != NULL) { + if (ssize != sizeof(l_ss)) + return (EINVAL); + error = copyin(sset, &l_ss, sizeof(l_ss)); + if (error) + return (error); + linux_to_bsd_sigset(&l_ss, &ss); + ssp = &ss; + } else + ssp = NULL; + if (tsp != NULL) + nanotime(&ts0); + + error = kern_poll(td, fds, nfds, tsp, ssp); + + if (error == 0 && tsp != NULL) { if (td->td_retval[0]) { nanotime(&ts1); timespecsub(&ts1, &ts0, &ts1); - timespecsub(&uts, &ts1, &uts); - if (uts.tv_sec < 0) - timespecclear(&uts); + timespecsub(tsp, &ts1, tsp); + if (tsp->tv_sec < 0) + timespecclear(tsp); } else - timespecclear(&uts); + timespecclear(tsp); + } + return (error); +} - error = native_to_linux_timespec(<s, &uts); +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_ppoll_time64(struct thread *td, struct linux_ppoll_time64_args *args) +{ + struct timespec uts, *tsp; + struct l_timespec64 lts; + int error; + + if (args->tsp != NULL) { + error = copyin(args->tsp, <s, sizeof(lts)); + if (error != 0) + return (error); + error = linux_to_native_timespec64(&uts, <s); + if (error != 0) + return (error); + tsp = &uts; + } else + tsp = NULL; + error = linux_common_ppoll(td, args->fds, args->nfds, tsp, + args->sset, args->ssize); + if (error != 0) + return (error); + if (tsp != NULL) { + error = native_to_linux_timespec64(<s, tsp); if (error == 0) error = copyout(<s, args->tsp, sizeof(lts)); } - return (error); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_sched_rr_get_interval(struct thread *td, diff --git a/sys/i386/linux/linux_dummy_machdep.c b/sys/i386/linux/linux_dummy_machdep.c index 67c70afa15b3..071f5fff6f47 100644 --- a/sys/i386/linux/linux_dummy_machdep.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -74,7 +74,6 @@ DUMMY(timer_gettime64); DUMMY(timer_settime64); DUMMY(timerfd_gettime64); DUMMY(timerfd_settime64); -DUMMY(ppoll_time64); DUMMY(io_pgetevents_time64); DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index 056ac42eaad7..f75b1253bc14 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -2418,7 +2418,13 @@ ); } 414 AUE_NULL STD { - int linux_ppoll_time64(void); + int linux_ppoll_time64( + struct pollfd *fds, + uint32_t nfds, + struct l_timespec64 *tsp, + l_sigset_t *sset, + l_size_t ssize + ); } 415 AUE_NULL UNIMPL nosys 416 AUE_NULL STD { From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:19:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 267D264A9A4; Thu, 10 Jun 2021 12:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G132206zXz4bXV; Thu, 10 Jun 2021 12:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D656F7648; Thu, 10 Jun 2021 12:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ACJbN1047128; Thu, 10 Jun 2021 12:19:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ACJb4m047127; Thu, 10 Jun 2021 12:19:37 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:19:37 GMT Message-Id: <202106101219.15ACJb4m047127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 89f15b79b187 - main - linux(4): Regen for ppoll_time64 system call. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89f15b79b187a31815b2d65d900e4ba78a9754ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:19:38 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=89f15b79b187a31815b2d65d900e4ba78a9754ef commit 89f15b79b187a31815b2d65d900e4ba78a9754ef Author: Dmitry Chagin AuthorDate: 2021-06-10 12:19:12 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-10 12:19:12 +0000 linux(4): Regen for ppoll_time64 system call. MFC after: 2 weeks --- sys/amd64/linux32/linux32_proto.h | 6 +++++- sys/amd64/linux32/linux32_sysent.c | 2 +- sys/amd64/linux32/linux32_systrace_args.c | 30 +++++++++++++++++++++++++++++- sys/i386/linux/linux_proto.h | 6 +++++- sys/i386/linux/linux_sysent.c | 2 +- sys/i386/linux/linux_systrace_args.c | 30 +++++++++++++++++++++++++++++- 6 files changed, 70 insertions(+), 6 deletions(-) diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index 4897fa3615ea..8a0950d8c754 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -1566,7 +1566,11 @@ struct linux_pselect6_time64_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_time64_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_io_pgetevents_time64_args { register_t dummy; diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c index de14c75605b5..c4d35efaef96 100644 --- a/sys/amd64/linux32/linux32_sysent.c +++ b/sys/amd64/linux32/linux32_sysent.c @@ -431,7 +431,7 @@ struct sysent linux32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_timerfd_settime64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 411 = linux_timerfd_settime64 */ { .sy_narg = AS(linux_utimensat_time64_args), .sy_call = (sy_call_t *)linux_utimensat_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 412 = linux_utimensat_time64 */ { .sy_narg = AS(linux_pselect6_time64_args), .sy_call = (sy_call_t *)linux_pselect6_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_ppoll_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ + { .sy_narg = AS(linux_ppoll_time64_args), .sy_call = (sy_call_t *)linux_ppoll_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 415 = nosys */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_io_pgetevents_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 416 = linux_io_pgetevents_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_recvmmsg_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 417 = linux_recvmmsg_time64 */ diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index 2f0683a053ef..f9a3794c309a 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -3043,7 +3043,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_ppoll_time64 */ case 414: { - *n_args = 0; + struct linux_ppoll_time64_args *p = params; + uarg[0] = (intptr_t)p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t)p->tsp; /* struct l_timespec * */ + uarg[3] = (intptr_t)p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_io_pgetevents_time64 */ @@ -8141,6 +8147,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_ppoll_time64 */ case 414: + switch (ndx) { + case 0: + p = "userland struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "userland struct l_timespec *"; + break; + case 3: + p = "userland l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_io_pgetevents_time64 */ case 416: @@ -9956,6 +9981,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_ppoll_time64 */ case 414: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_io_pgetevents_time64 */ case 416: /* linux_recvmmsg_time64 */ diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index cc4cd3a2923c..0c7bdd56db97 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -1559,7 +1559,11 @@ struct linux_pselect6_time64_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_time64_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec64 *)]; struct l_timespec64 * tsp; char tsp_r_[PADR_(struct l_timespec64 *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_io_pgetevents_time64_args { register_t dummy; diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index 85de46a008b9..216f46798e3a 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -431,7 +431,7 @@ struct sysent linux_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)linux_timerfd_settime64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 411 = linux_timerfd_settime64 */ { .sy_narg = AS(linux_utimensat_time64_args), .sy_call = (sy_call_t *)linux_utimensat_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 412 = linux_utimensat_time64 */ { .sy_narg = AS(linux_pselect6_time64_args), .sy_call = (sy_call_t *)linux_pselect6_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)linux_ppoll_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ + { .sy_narg = AS(linux_ppoll_time64_args), .sy_call = (sy_call_t *)linux_ppoll_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 415 = nosys */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_io_pgetevents_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 416 = linux_io_pgetevents_time64 */ { .sy_narg = 0, .sy_call = (sy_call_t *)linux_recvmmsg_time64, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 417 = linux_recvmmsg_time64 */ diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index 8985a25fa0c3..15232a900447 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -3082,7 +3082,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_ppoll_time64 */ case 414: { - *n_args = 0; + struct linux_ppoll_time64_args *p = params; + uarg[0] = (intptr_t)p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t)p->tsp; /* struct l_timespec64 * */ + uarg[3] = (intptr_t)p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_io_pgetevents_time64 */ @@ -8218,6 +8224,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_ppoll_time64 */ case 414: + switch (ndx) { + case 0: + p = "userland struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "userland struct l_timespec64 *"; + break; + case 3: + p = "userland l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_io_pgetevents_time64 */ case 416: @@ -10062,6 +10087,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_ppoll_time64 */ case 414: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_io_pgetevents_time64 */ case 416: /* linux_recvmmsg_time64 */ From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:21:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE48664A779; Thu, 10 Jun 2021 12:21:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G134M6ThTz4bpM; Thu, 10 Jun 2021 12:21:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C71C97672; Thu, 10 Jun 2021 12:21:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ACLd4O058798; Thu, 10 Jun 2021 12:21:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ACLdPd058797; Thu, 10 Jun 2021 12:21:39 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:21:39 GMT Message-Id: <202106101221.15ACLdPd058797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ea21980a3fac - main - pf: use M_WAITOK where possible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea21980a3facfed4c2c6fd10d0f16276564fb540 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:21:40 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ea21980a3facfed4c2c6fd10d0f16276564fb540 commit ea21980a3facfed4c2c6fd10d0f16276564fb540 Author: Kristof Provost AuthorDate: 2021-06-09 12:00:07 +0000 Commit: Kristof Provost CommitDate: 2021-06-10 10:20:10 +0000 pf: use M_WAITOK where possible In the ioctl path use M_WAITOK allocations whereever possible. These are less sensitive to memory pressure, and ioctl requests have no hard deadlines. Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30702 --- sys/netpfil/pf/pf_ioctl.c | 78 ++++++++--------------------------------------- 1 file changed, 13 insertions(+), 65 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 766710afd1dd..a5903dc1b4ff 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -3772,11 +3772,7 @@ DIOCCHANGEADDR_error: totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_NOWAIT); - if (pfrts == NULL) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -3861,11 +3857,7 @@ DIOCCHANGEADDR_error: } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_NOWAIT); - if (! pfras) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -3899,11 +3891,7 @@ DIOCCHANGEADDR_error: } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_NOWAIT); - if (! pfras) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -3941,11 +3929,7 @@ DIOCCHANGEADDR_error: } totlen = count * sizeof(struct pfr_addr); pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, - M_NOWAIT); - if (! pfras) { - error = ENOMEM; - break; - } + M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -3980,11 +3964,7 @@ DIOCCHANGEADDR_error: } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_NOWAIT); - if (! pfras) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); PF_RULES_RLOCK(); error = pfr_get_addrs(&io->pfrio_table, pfras, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -4012,11 +3992,7 @@ DIOCCHANGEADDR_error: } totlen = io->pfrio_size * sizeof(struct pfr_astats); pfrastats = mallocarray(io->pfrio_size, - sizeof(struct pfr_astats), M_TEMP, M_NOWAIT); - if (! pfrastats) { - error = ENOMEM; - break; - } + sizeof(struct pfr_astats), M_TEMP, M_WAITOK); PF_RULES_RLOCK(); error = pfr_get_astats(&io->pfrio_table, pfrastats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); @@ -4044,11 +4020,7 @@ DIOCCHANGEADDR_error: } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_NOWAIT); - if (! pfras) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -4082,11 +4054,7 @@ DIOCCHANGEADDR_error: } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_NOWAIT); - if (! pfras) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -4120,11 +4088,7 @@ DIOCCHANGEADDR_error: } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_NOWAIT); - if (! pfras) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfras, totlen); if (error) { free(pfras, M_TEMP); @@ -4173,11 +4137,7 @@ DIOCCHANGEADDR_error: } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_NOWAIT); - if (! ioes) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); @@ -4250,11 +4210,7 @@ DIOCCHANGEADDR_error: } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_NOWAIT); - if (! ioes) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); @@ -4329,11 +4285,7 @@ DIOCCHANGEADDR_error: totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_NOWAIT); - if (ioes == NULL) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->array, ioes, totlen); if (error) { free(ioes, M_TEMP); @@ -4536,11 +4488,7 @@ DIOCCHANGEADDR_error: bufsiz = io->pfiio_size * sizeof(struct pfi_kif); ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), - M_TEMP, M_NOWAIT); - if (ifstore == NULL) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:35:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0923764B045; Thu, 10 Jun 2021 12:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G13NY6D3zz4f3d; Thu, 10 Jun 2021 12:35:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDBA97B42; Thu, 10 Jun 2021 12:35:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ACZfJT073587; Thu, 10 Jun 2021 12:35:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ACZfol073586; Thu, 10 Jun 2021 12:35:41 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:35:41 GMT Message-Id: <202106101235.15ACZfol073586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 67e892819b26 - main - tcp: Mbuf leak while holding a socket buffer lock. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67e892819b26c198e4232c7586ead7f854f848c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:35:42 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=67e892819b26c198e4232c7586ead7f854f848c5 commit 67e892819b26c198e4232c7586ead7f854f848c5 Author: Randall Stewart AuthorDate: 2021-06-10 12:33:57 +0000 Commit: Randall Stewart CommitDate: 2021-06-10 12:33:57 +0000 tcp: Mbuf leak while holding a socket buffer lock. When running at NF the current Rack and BBR changes with the recent commits from Richard that cause the socket buffer lock to be held over the ip_output() call and then finally culminating in a call to tcp_handle_wakeup() we get a lot of leaked mbufs. I don't think that this leak is actually caused by holding the lock or what Richard has done, but is exposing some other bug that has probably been lying dormant for a long time. I will continue to look (using his changes) at what is going on to try to root cause out the issue. In the meantime I can't leave the leaks out for everyone else. So this commit will revert all of Richards changes and move both Rack and BBR back to just doing the old sorwakeup_locked() calls after messing with the so_rcv buffer. We may want to look at adding back in Richards changes after I have pinpointed the root cause of the mbuf leak and fixed it. Reviewed by: mtuexen,rscheff Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30704 --- sys/netinet/tcp_output.c | 2 ++ sys/netinet/tcp_stacks/bbr.c | 47 +++++++++++++++++------------ sys/netinet/tcp_stacks/rack.c | 69 ++++++++++++++++++++++--------------------- sys/netinet/tcp_var.h | 18 +++++++++++ 4 files changed, 84 insertions(+), 52 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 93c376f81f1a..8d78e639636b 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1559,6 +1559,8 @@ send: #endif /* INET */ out: + if (error == 0) + tcp_account_for_send(tp, len, (tp->snd_nxt != tp->snd_max), 0); /* * In transmit state, time the transmission and arrange for * the retransmit. In persist state, just set snd_max. diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index f6388c39cad3..d5da2d33c18f 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -486,7 +486,7 @@ static void uint32_t line, uint8_t is_start, uint16_t set); static struct bbr_sendmap * - bbr_find_lowest_rsm(struct tcp_bbr *bbr); + bbr_find_lowest_rsm(struct tcp_bbr *bbr); static __inline uint32_t bbr_get_rtt(struct tcp_bbr *bbr, int32_t rtt_type); static void @@ -1620,7 +1620,7 @@ bbr_init_sysctls(void) &bbr_drop_limit, 0, "Number of segments limit for drop (0=use min_cwnd w/flight)?"); - /* Timeout controls */ + /* Timeout controls */ bbr_timeout = SYSCTL_ADD_NODE(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, @@ -5750,7 +5750,7 @@ tcp_bbr_tso_size_check(struct tcp_bbr *bbr, uint32_t cts) * seg = goal_tso / mss * tso = seg * mss * else - * tso = mss + * tso = mss * if (tso > per-tcb-max) * tso = per-tcb-max * else if ( bw > 512Mbps) @@ -6736,7 +6736,7 @@ bbr_update_bbr_info(struct tcp_bbr *bbr, struct bbr_sendmap *rsm, uint32_t rtt, else bbr->rc_ack_is_cumack = 0; old_rttprop = bbr_get_rtt(bbr, BBR_RTT_PROP); - /* + /* * Note the following code differs to the original * BBR spec. It calls for <= not <. However after a * long discussion in email with Neal, he acknowledged @@ -8306,12 +8306,14 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, appended = #endif sbappendstream_locked(&so->so_rcv, m, 0); - tp->t_flags |= TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); #endif + } else { /* * XXX: Due to the header drop above "th" is @@ -8323,6 +8325,11 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; + if (tp->t_flags & TF_WAKESOR) { + tp->t_flags &= ~TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && @@ -8357,7 +8364,6 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, save_start + tlen); } } - tcp_handle_wakeup(tp, so); } else { m_freem(m); thflags &= ~TH_FIN; @@ -9164,7 +9170,11 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, if (tlen == 0 && (thflags & TH_FIN) == 0) { (void)tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); - tcp_handle_wakeup(tp, so); + if (tp->t_flags & TF_WAKESOR) { + tp->t_flags &= ~TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); + } } tp->snd_wl1 = th->th_seq - 1; if (bbr_process_ack(m, th, so, tp, to, tiwin, tlen, &ourfinisacked, thflags, &ret_val)) { @@ -11565,18 +11575,18 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { retval = 0; m_freem(m); - goto done_with_input; - } - /* - * If a segment with the ACK-bit set arrives in the SYN-SENT state - * check SEQ.ACK first as described on page 66 of RFC 793, section 3.9. - */ - if ((tp->t_state == TCPS_SYN_SENT) && (thflags & TH_ACK) && - (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) { + goto done_with_input; + } + /* + * If a segment with the ACK-bit set arrives in the SYN-SENT state + * check SEQ.ACK first as described on page 66 of RFC 793, section 3.9. + */ + if ((tp->t_state == TCPS_SYN_SENT) && (thflags & TH_ACK) && + (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) { tcp_log_end_status(tp, TCP_EI_STATUS_RST_IN_FRONT); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); - return (1); - } + return (1); + } in_recovery = IN_RECOVERY(tp->t_flags); if (tiwin > bbr->r_ctl.rc_high_rwnd) bbr->r_ctl.rc_high_rwnd = tiwin; @@ -11786,8 +11796,6 @@ bbr_do_send_accounting(struct tcpcb *tp, struct tcp_bbr *bbr, struct bbr_sendmap * own bin */ #ifdef NETFLIX_STATS - tp->t_sndtlppack++; - tp->t_sndtlpbyte += len; KMOD_TCPSTAT_INC(tcps_tlpresends); KMOD_TCPSTAT_ADD(tcps_tlpresend_bytes, len); #endif @@ -13741,6 +13749,7 @@ out: * retransmit. In persist state, just set snd_max. */ if (error == 0) { + tcp_account_for_send(tp, len, (rsm != NULL), doing_tlp); if (TCPS_HAVEESTABLISHED(tp->t_state) && (tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks > 0) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 98b8ff836ca5..5227ea59ba23 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -10221,7 +10221,8 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, sbappendstream_locked(&so->so_rcv, m, 0); rack_log_wakeup(tp,rack, &so->so_rcv, tlen, 1); - tp->t_flags |= TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && appended != mcnt) counter_fo_release(so->so_rcv.sb_shlim, @@ -10238,7 +10239,11 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; - + if (tp->t_flags & TF_WAKESOR) { + tp->t_flags &= ~TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); + } } if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0) && @@ -10278,7 +10283,6 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, save_start + tlen); } } - tcp_handle_wakeup(tp, so); } else { m_freem(m); thflags &= ~TH_FIN; @@ -10484,7 +10488,8 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, ctf_calc_rwin(so, tp); } rack_log_wakeup(tp,rack, &so->so_rcv, tlen, 1); - tp->t_flags |= TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim && mcnt != appended) counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); @@ -10492,7 +10497,6 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_handle_delayed_ack(tp, rack, tlen, 0); if (tp->snd_una == tp->snd_max) sack_filter_clear(&rack->r_ctl.rack_sf, tp->snd_una); - tcp_handle_wakeup(tp, so); return (1); } @@ -11085,7 +11089,11 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, if (tlen == 0 && (thflags & TH_FIN) == 0) { (void) tcp_reass(tp, (struct tcphdr *)0, NULL, 0, (struct mbuf *)0); - tcp_handle_wakeup(tp, so); + if (tp->t_flags & TF_WAKESOR) { + tp->t_flags &= ~TF_WAKESOR; + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); + } } tp->snd_wl1 = th->th_seq - 1; /* For syn-recv we need to possibly update the rtt */ @@ -12333,29 +12341,23 @@ rack_fini(struct tcpcb *tp, int32_t tcb_is_purged) rack = (struct tcp_rack *)tp->t_fb_ptr; if (tp->t_in_pkt) { /* - * Since we are switching we need to process any - * inbound packets in case a compressed ack is - * in queue or the new stack does not support - * mbuf queuing. These packets in theory should - * have been handled by the old stack anyway. + * It is unsafe to process the packets since a + * reset may be lurking in them (its rare but it + * can occur). If we were to find a RST, then we + * would end up dropping the connection and the + * INP lock, so when we return the caller (tcp_usrreq) + * will blow up when it trys to unlock the inp. */ - if ((rack->rc_inp->inp_flags & (INP_DROPPED|INP_TIMEWAIT)) || - (rack->rc_inp->inp_flags2 & INP_FREED)) { - /* Kill all the packets */ - struct mbuf *save, *m; - - m = tp->t_in_pkt; - tp->t_in_pkt = NULL; - tp->t_tail_pkt = NULL; - while (m) { - save = m->m_nextpkt; - m->m_nextpkt = NULL; - m_freem(m); - m = save; - } - } else { - /* Process all the packets */ - ctf_do_queued_segments(rack->rc_inp->inp_socket, rack->rc_tp, 0); + struct mbuf *save, *m; + + m = tp->t_in_pkt; + tp->t_in_pkt = NULL; + tp->t_tail_pkt = NULL; + while (m) { + save = m->m_nextpkt; + m->m_nextpkt = NULL; + m_freem(m); + m = save; } if ((tp->t_inpcb) && (tp->t_inpcb->inp_flags2 & INP_MBUF_ACKCMP)) @@ -13997,7 +13999,6 @@ rack_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, } if (rack_do_segment_nounlock(m, th, so, tp, drop_hdrlen, tlen, iptos, 0, &tv) == 0) { - tcp_handle_wakeup(tp, so); INP_WUNLOCK(tp->t_inpcb); } } @@ -15404,6 +15405,8 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma rack->rc_tlp_in_progress = 1; rack->r_ctl.rc_tlp_cnt_out++; } + if (error == 0) + tcp_account_for_send(tp, len, 1, doing_tlp); tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); rack->forced_ack = 0; /* If we send something zap the FA flag */ if (IN_FASTRECOVERY(tp->t_flags) && rsm) @@ -15882,6 +15885,9 @@ again: rack_log_progress_event(rack, tp, ticks, PROGRESS_START, __LINE__); tp->t_acktime = ticks; } + if (error == 0) + tcp_account_for_send(tp, len, 0, 0); + rack->forced_ack = 0; /* If we send something zap the FA flag */ tot_len += len; if ((tp->t_flags & TF_GPUTINPROG) == 0) @@ -16322,8 +16328,6 @@ again: tlen = rsm->r_end - rsm->r_start; if (tlen > segsiz) tlen = segsiz; - tp->t_sndtlppack++; - tp->t_sndtlpbyte += tlen; KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", __func__, __LINE__, @@ -18107,6 +18111,7 @@ out: * retransmit. In persist state, just set snd_max. */ if (error == 0) { + tcp_account_for_send(tp, len, (rsm != NULL), doing_tlp); rack->forced_ack = 0; /* If we send something zap the FA flag */ if (rsm && (doing_tlp == 0)) { /* Set we retransmitted */ @@ -18151,8 +18156,6 @@ out: if (doing_tlp && (rsm == NULL)) { /* New send doing a TLP */ add_flag |= RACK_TLP; - tp->t_sndtlppack++; - tp->t_sndtlpbyte += len; } rack_log_output(tp, &to, len, rack_seq, (uint8_t) flags, error, rack_to_usec_ts(&tv), diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 1742b3b1c514..553abaf6b334 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -261,6 +261,8 @@ struct tcpcb { uint32_t t_maxpeakrate; /* max peak rate set by user, in bytes/s */ uint32_t t_sndtlppack; /* tail loss probe packets sent */ uint64_t t_sndtlpbyte; /* total tail loss probe bytes sent */ + uint64_t t_sndbytes; /* total bytes sent */ + uint64_t t_snd_rxt_bytes; /* total bytes retransmitted */ uint8_t t_tfo_client_cookie_len; /* TCP Fast Open client cookie length */ uint32_t t_end_info_status; /* Status flag of end info */ @@ -1133,6 +1135,22 @@ tcp_fields_to_net(struct tcphdr *th) th->th_win = htons(th->th_win); th->th_urp = htons(th->th_urp); } + +static inline void +tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, uint8_t is_tlp) +{ + if (is_tlp) { + tp->t_sndtlppack++; + tp->t_sndtlpbyte += len; + } + /* To get total bytes sent you must add t_snd_rxt_bytes to t_sndbytes */ + if (is_rxt) + tp->t_snd_rxt_bytes += len; + else + tp->t_sndbytes += len; + +} + #endif /* _KERNEL */ #endif /* _NETINET_TCP_VAR_H_ */ From owner-dev-commits-src-all@freebsd.org Thu Jun 10 12:56:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A77064B0DB; Thu, 10 Jun 2021 12:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G13rD32rYz4hkf; Thu, 10 Jun 2021 12:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DAFE7CBF; Thu, 10 Jun 2021 12:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ACuCFB099537; Thu, 10 Jun 2021 12:56:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ACuCGc099536; Thu, 10 Jun 2021 12:56:12 GMT (envelope-from git) Date: Thu, 10 Jun 2021 12:56:12 GMT Message-Id: <202106101256.15ACuCGc099536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6eea2623b5c6 - stable/13 - Cirrus-CI: retry pkg installation on failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6eea2623b5c6d6aad9976b591c23c20c8a227c74 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 12:56:12 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6eea2623b5c6d6aad9976b591c23c20c8a227c74 commit 6eea2623b5c6d6aad9976b591c23c20c8a227c74 Author: Ed Maste AuthorDate: 2021-06-02 14:42:57 +0000 Commit: Ed Maste CommitDate: 2021-06-10 12:54:52 +0000 Cirrus-CI: retry pkg installation on failure Pkg installation failed somewhat frequently, always at: [62/104] Fetching jpeg-turbo-2.0.6.txz: .......... done pkg: http://pkgmir.geo.freebsd.org/FreeBSD:13:amd64/quarterly/All/jbigkit-2.1_1.txz: No route to host Move pkg installation to a script and retry once upon failure as a (hopefully temporary) workaround. Reviewed by: imp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30613 (cherry picked from commit dd41de95a84d979615a2ef11df6850622bf6184e) --- .cirrus-ci/pkg-install.sh | 15 +++++++++++++++ .cirrus.yml | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.cirrus-ci/pkg-install.sh b/.cirrus-ci/pkg-install.sh new file mode 100644 index 000000000000..ef83e5284078 --- /dev/null +++ b/.cirrus-ci/pkg-install.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +pkg install -y "$@" && exit 0 + +cat < Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF7D764B17B; Thu, 10 Jun 2021 13:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G142C5JTMz4jBc; Thu, 10 Jun 2021 13:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A87B1015A; Thu, 10 Jun 2021 13:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AD4pa8013375; Thu, 10 Jun 2021 13:04:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AD4paf013374; Thu, 10 Jun 2021 13:04:51 GMT (envelope-from git) Date: Thu, 10 Jun 2021 13:04:51 GMT Message-Id: <202106101304.15AD4paf013374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando Apestegu=C3=ADa=?= Subject: git: 49ddfdec19b9 - main - ports(7): Add install-missing-packages to target list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49ddfdec19b975ae098cbe9717306d08e8a5879c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 13:04:51 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=49ddfdec19b975ae098cbe9717306d08e8a5879c commit 49ddfdec19b975ae098cbe9717306d08e8a5879c Author: Fernando Apesteguía AuthorDate: 2021-04-30 10:39:04 +0000 Commit: Fernando Apesteguía CommitDate: 2021-06-10 12:58:24 +0000 ports(7): Add install-missing-packages to target list It is already used in the EXAMPLES section. Approved by: bcr@ (manpages) Differential Revision: https://reviews.freebsd.org/D30044 --- share/man/man7/ports.7 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7 index ed1e8633fe27..3a62a23d5a13 100644 --- a/share/man/man7/ports.7 +++ b/share/man/man7/ports.7 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2021 +.Dd June 10, 2021 .Dt PORTS 7 .Os .Sh NAME @@ -217,6 +217,8 @@ target. .It Cm install Install the port and register it with the package system. This is all you really need to do. +.It Cm install-missing-packages +Install missing dependencies from packages instead of building them. .El .Pp The following targets are not run during the normal install process. From owner-dev-commits-src-all@freebsd.org Thu Jun 10 13:17:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 243A364BA8D; Thu, 10 Jun 2021 13:17:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.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 4G14K001R7z4k1w; Thu, 10 Jun 2021 13:17:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f52.google.com with SMTP id a6so26964446ioe.0; Thu, 10 Jun 2021 06:17:39 -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=hm8UK3Gq2UFtPkbsddcHW1UH3P+gc8Piuqfi2jWZj4Y=; b=e6ugjomm3r37a5ca7Ci+vfz45JMjRLJ5eAcDUK0lk2bamyVJMWINS1Z2GWBs69z2Ck qZiKDPm6H5ip5ivINuMO2jlEfTig/sA541Jtg4c5lo+9zSG4g4QsYaQp+hSFtvxNI2CN XQxcddRRRhuHxhhyCAnV4dpFCUzdBSwTxgveEGI/inwPwtX3LrZ9KZDkl6Ytu++XVBO6 /LW9IKezr7XI3heLhAq3MgSDcvsB0lDIBiSy25k4gn69TsExU9r0Sy9S+b2LbAkAYUqh SKlMB451B2Y7B9ZFEn7GMCT4p87bX3Nl7kzlzD363BbqtuWc9YD9wki3uhs4wYHHiWBK oPYg== X-Gm-Message-State: AOAM53137TZGtghqh44XhAiBcmGhGAAZZuU5gswUES8G858RvFNkUF0E CRBMv3sdObJgFXLi40P+CtfgnOdiUqb1YySmHUlVoScJLV4= X-Google-Smtp-Source: ABdhPJzONAkw5g8eTGCUK6yCVKpfVLLlw3YuIopaod4hoBjAOm/Uf/Zf5YYDjHISonD1SLCTepIZYENx1IgjcBNNMTY= X-Received: by 2002:a5d:9c88:: with SMTP id p8mr3597133iop.31.1623331058111; Thu, 10 Jun 2021 06:17:38 -0700 (PDT) MIME-Version: 1.0 References: <202106081453.158Eri7k025234@gitrepo.freebsd.org> In-Reply-To: <202106081453.158Eri7k025234@gitrepo.freebsd.org> From: Ed Maste Date: Thu, 10 Jun 2021 09:16:59 -0400 Message-ID: Subject: Re: git: 160388166736 - main - zfs: merge openzfs/zfs@75b4cbf62 (master) into main To: Martin Matuska Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4G14K001R7z4k1w X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [1.00 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.166.52:from]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; SPAMHAUS_ZRD(0.00)[209.85.166.52:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.52:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.52:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 13:17:41 -0000 On Tue, 8 Jun 2021 at 10:53, Martin Matuska wrote: > > The branch main has been updated by mm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1603881667360c015f6685131f2f25474fa67a72 > > commit 1603881667360c015f6685131f2f25474fa67a72 > Merge: ed9215c8e05f 75b4cbf62590 > Author: Martin Matuska > AuthorDate: 2021-06-08 14:48:37 +0000 > Commit: Martin Matuska > CommitDate: 2021-06-08 14:52:44 +0000 > > zfs: merge openzfs/zfs@75b4cbf62 (master) into main The Cirrus-CI smoke test (which builds with Clang 12, using the llvm12 package) is failing, with: error: unknown -Werror warning specifier: '-Wno-error-atomic-alignment' [-Werror,-Wunknown-warning-option] *** [atomic.o] Error code 1 CI run link: https://cirrus-ci.com/build/4636225693810688 From owner-dev-commits-src-all@freebsd.org Thu Jun 10 13:20:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9563D64B838; Thu, 10 Jun 2021 13:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G14Ml3r1xz4jwh; Thu, 10 Jun 2021 13:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C484103E3; Thu, 10 Jun 2021 13:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ADK359029458; Thu, 10 Jun 2021 13:20:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ADK3FC029454; Thu, 10 Jun 2021 13:20:03 GMT (envelope-from git) Date: Thu, 10 Jun 2021 13:20:03 GMT Message-Id: <202106101320.15ADK3FC029454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando Apestegu=C3=ADa=?= Subject: git: cedaad93176e - main - mmc(4), mmcsc(4): Remove missing Xref MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cedaad93176e2a0680e929ff683cf8d173e3c562 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 13:20:03 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cedaad93176e2a0680e929ff683cf8d173e3c562 commit cedaad93176e2a0680e929ff683cf8d173e3c562 Author: Fernando Apesteguía AuthorDate: 2021-06-10 13:11:22 +0000 Commit: Fernando Apesteguía CommitDate: 2021-06-10 13:15:54 +0000 mmc(4), mmcsc(4): Remove missing Xref There is no evidence of at91_mci in the code whatsoever. Most of the at91 drivers where removed in 802baf0ba66c18ca52aeaf4a3e7b05e85d8e4d3b PR: 218970 Reported by: reezer@reezer.org Approved by: imp@ Differential Revision: https://reviews.freebsd.org/D29193 --- share/man/man4/mmc.4 | 3 +-- share/man/man4/mmcsd.4 | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/share/man/man4/mmc.4 b/share/man/man4/mmc.4 index 49f333135ade..430bca983280 100644 --- a/share/man/man4/mmc.4 +++ b/share/man/man4/mmc.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2008 +.Dd June 10, 2021 .Dt MMC 4 .Os .Sh NAME @@ -46,7 +46,6 @@ bus typically has only one slot, and only memory cards. MultiMediaCards exist only in memory. SD Cards exist as memory, I/O, or combination cards. .Sh SEE ALSO -.Xr at91_mci 4 , .Xr mmcsd 4 , .Xr sdhci 4 .Rs diff --git a/share/man/man4/mmcsd.4 b/share/man/man4/mmcsd.4 index e66867eb3453..9779183c64d4 100644 --- a/share/man/man4/mmcsd.4 +++ b/share/man/man4/mmcsd.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2008 +.Dd June 10, 2021 .Dt MMCSD 4 .Os .Sh NAME @@ -36,7 +36,6 @@ The .Nm driver implements direct access block device for MMC and SD memory cards. .Sh SEE ALSO -.Xr at91_mci 4 , .Xr mmc 4 , .Xr sdhci 4 .Rs From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:15:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C075164EF4B; Thu, 10 Jun 2021 15:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G16x94kJpz3JKm; Thu, 10 Jun 2021 15:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A7CB11FDA; Thu, 10 Jun 2021 15:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFFfhV091224; Thu, 10 Jun 2021 15:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFFfsJ091223; Thu, 10 Jun 2021 15:15:41 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:15:41 GMT Message-Id: <202106101515.15AFFfsJ091223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: b47f461c8e67 - main - linuxkpi: Add list_for_each_entry_lockless() macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b47f461c8e67253fdb394968428b760e880baa08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:15:41 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b47f461c8e67253fdb394968428b760e880baa08 commit b47f461c8e67253fdb394968428b760e880baa08 Author: Neel Chauhan AuthorDate: 2021-06-10 15:14:20 +0000 Commit: Neel Chauhan CommitDate: 2021-06-10 15:15:29 +0000 linuxkpi: Add list_for_each_entry_lockless() macro This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30708 --- sys/compat/linuxkpi/common/include/linux/list.h | 2 ++ sys/sys/param.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/list.h b/sys/compat/linuxkpi/common/include/linux/list.h index 37b5b751d21b..93db449a4473 100644 --- a/sys/compat/linuxkpi/common/include/linux/list.h +++ b/sys/compat/linuxkpi/common/include/linux/list.h @@ -202,6 +202,8 @@ list_del_init(struct list_head *entry) for (p = list_entry((h)->next, typeof(*p), field); &(p)->field != (h); \ p = list_entry((p)->field.next, typeof(*p), field)) +#define list_for_each_entry_lockless(...) list_for_each_entry(__VA_ARGS__) + #define list_for_each_entry_safe(p, n, h, field) \ for (p = list_entry((h)->next, typeof(*p), field), \ n = list_entry((p)->field.next, typeof(*p), field); &(p)->field != (h);\ diff --git a/sys/sys/param.h b/sys/sys/param.h index d78612b5ebb9..afcba3990b07 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400020 +#define __FreeBSD_version 1400021 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:24:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 116CD64EF89; Thu, 10 Jun 2021 15:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G176r6xShz3JYf; Thu, 10 Jun 2021 15:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5647122A0; Thu, 10 Jun 2021 15:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFO4k4004259; Thu, 10 Jun 2021 15:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFO44e004258; Thu, 10 Jun 2021 15:24:04 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:24:04 GMT Message-Id: <202106101524.15AFO44e004258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 21d163f8a101 - stable/13 - Fix test case header function name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 21d163f8a1013278ecdded77abf6c0dfda554a46 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:24:05 -0000 The branch stable/13 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=21d163f8a1013278ecdded77abf6c0dfda554a46 commit 21d163f8a1013278ecdded77abf6c0dfda554a46 Author: Math Ieu AuthorDate: 2021-06-02 04:09:55 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:22:24 +0000 Fix test case header function name This restores the expected behavior (skip) when running with non-root user MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30584 (cherry picked from commit 847b7d505490ae407a5c876e14e7788a4add7737) --- usr.sbin/jail/tests/jail_basic_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index f9d52cf8a780..ba691cb9b05a 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -99,7 +99,7 @@ nested_cleanup() jail -r basejail_nochild } -commands_header() +commands_head() { atf_set descr 'Commands jail test' atf_set require.user root From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:24:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA3D64EAEB; Thu, 10 Jun 2021 15:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G176y60dGz3Jc2; Thu, 10 Jun 2021 15:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B715411FF6; Thu, 10 Jun 2021 15:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFOAhV004376; Thu, 10 Jun 2021 15:24:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFOAJE004375; Thu, 10 Jun 2021 15:24:10 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:24:10 GMT Message-Id: <202106101524.15AFOAJE004375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: e76098b5c372 - stable/12 - Fix test case header function name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e76098b5c372f78a70b763021e9ea22d860ecc6a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:24:11 -0000 The branch stable/12 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=e76098b5c372f78a70b763021e9ea22d860ecc6a commit e76098b5c372f78a70b763021e9ea22d860ecc6a Author: Math Ieu AuthorDate: 2021-06-02 04:09:55 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:22:42 +0000 Fix test case header function name This restores the expected behavior (skip) when running with non-root user MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30584 (cherry picked from commit 847b7d505490ae407a5c876e14e7788a4add7737) --- usr.sbin/jail/tests/jail_basic_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index f9d52cf8a780..ba691cb9b05a 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -99,7 +99,7 @@ nested_cleanup() jail -r basejail_nochild } -commands_header() +commands_head() { atf_set descr 'Commands jail test' atf_set require.user root From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:24:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D1E064EA5E; Thu, 10 Jun 2021 15:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17732gRpz3Jt1; Thu, 10 Jun 2021 15:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45514122A1; Thu, 10 Jun 2021 15:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFOFex004493; Thu, 10 Jun 2021 15:24:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFOFfK004492; Thu, 10 Jun 2021 15:24:15 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:24:15 GMT Message-Id: <202106101524.15AFOFfK004492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: bd1139898643 - stable/11 - Fix test case header function name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: bd1139898643dd54529c464e6ff66011d6388b3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:24:15 -0000 The branch stable/11 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=bd1139898643dd54529c464e6ff66011d6388b3e commit bd1139898643dd54529c464e6ff66011d6388b3e Author: Math Ieu AuthorDate: 2021-06-02 04:09:55 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:22:50 +0000 Fix test case header function name This restores the expected behavior (skip) when running with non-root user MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30584 (cherry picked from commit 847b7d505490ae407a5c876e14e7788a4add7737) --- usr.sbin/jail/tests/jail_basic_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index f9d52cf8a780..ba691cb9b05a 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -99,7 +99,7 @@ nested_cleanup() jail -r basejail_nochild } -commands_header() +commands_head() { atf_set descr 'Commands jail test' atf_set require.user root From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:29:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99DC264F257; Thu, 10 Jun 2021 15:29:04 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17Db6ycnz3KkC; Thu, 10 Jun 2021 15:29:03 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1623338935; 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=Go211XGVK8qIB9E1eVbaB1uuFK2ZKKrDLyFIn2NQz74=; b=DMxNSwgmLwmTO2tvyUvlP/gU82Fw7nphLD3OvojURkcULcmaucibK6KYp6ghEGPHXXwZH/ lTzO3EaIug9NpoekLIl+/xra8RHeO6i891wRhsEgG7sXGLQBA64saU+xWReZvyTLxuQ2qd 3jEoxpDcBBO5oScdlRYhxLVaCesRalM= Received: from skull.home.blih.net (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 1bc17a98 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 10 Jun 2021 15:28:55 +0000 (UTC) Date: Thu, 10 Jun 2021 17:28:55 +0200 From: Emmanuel Vadot To: Neel Chauhan Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: b47f461c8e67 - main - linuxkpi: Add list_for_each_entry_lockless() macro Message-Id: <20210610172855.287c62fd10d7963e2364e342@bidouilliste.com> In-Reply-To: <202106101515.15AFFfsJ091223@gitrepo.freebsd.org> References: <202106101515.15AFFfsJ091223@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4G17Db6ycnz3KkC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:29:04 -0000 On Thu, 10 Jun 2021 15:15:41 GMT Neel Chauhan wrote: > The branch main has been updated by nc (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=b47f461c8e67253fdb394968428b760e880baa08 > > commit b47f461c8e67253fdb394968428b760e880baa08 > Author: Neel Chauhan > AuthorDate: 2021-06-10 15:14:20 +0000 > Commit: Neel Chauhan > CommitDate: 2021-06-10 15:15:29 +0000 > > linuxkpi: Add list_for_each_entry_lockless() macro > > This is needed by the drm-kmod 5.7 update. You did not explain why it's the same as list_for_each_entry. > Approved by: hselasky (src) > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D30708 > --- > sys/compat/linuxkpi/common/include/linux/list.h | 2 ++ > sys/sys/param.h | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/sys/compat/linuxkpi/common/include/linux/list.h b/sys/compat/linuxkpi/common/include/linux/list.h > index 37b5b751d21b..93db449a4473 100644 > --- a/sys/compat/linuxkpi/common/include/linux/list.h > +++ b/sys/compat/linuxkpi/common/include/linux/list.h > @@ -202,6 +202,8 @@ list_del_init(struct list_head *entry) > for (p = list_entry((h)->next, typeof(*p), field); &(p)->field != (h); \ > p = list_entry((p)->field.next, typeof(*p), field)) > > +#define list_for_each_entry_lockless(...) list_for_each_entry(__VA_ARGS__) > + > #define list_for_each_entry_safe(p, n, h, field) \ > for (p = list_entry((h)->next, typeof(*p), field), \ > n = list_entry((p)->field.next, typeof(*p), field); &(p)->field != (h);\ > diff --git a/sys/sys/param.h b/sys/sys/param.h > index d78612b5ebb9..afcba3990b07 100644 > --- a/sys/sys/param.h > +++ b/sys/sys/param.h > @@ -76,7 +76,7 @@ > * cannot include sys/param.h and should only be updated here. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1400020 > +#define __FreeBSD_version 1400021 No need to bump FreeBSD_version with each one of your commit to linuxkpi, this will only be painful for people tracking current and building there packages. > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, -- Emmanuel Vadot From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:29:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FE5764F26F; Thu, 10 Jun 2021 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17F11M83z3KpR; Thu, 10 Jun 2021 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D62B123D0; Thu, 10 Jun 2021 15:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFTOCP004944; Thu, 10 Jun 2021 15:29:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFTOfJ004943; Thu, 10 Jun 2021 15:29:24 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:29:24 GMT Message-Id: <202106101529.15AFTOfJ004943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 90372d8ec305 - stable/13 - Add freeze/thaw description to devctl(8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 90372d8ec305d75143378666a578d9ddc73f9ac1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:29:25 -0000 The branch stable/13 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=90372d8ec305d75143378666a578d9ddc73f9ac1 commit 90372d8ec305d75143378666a578d9ddc73f9ac1 Author: Li-Wen Hsu AuthorDate: 2021-06-01 04:33:12 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:28:29 +0000 Add freeze/thaw description to devctl(8) This is a follow-up to 5fa29797910346fc0c54829bd979856e83b9b7ea . PR: 256311 Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29867 (cherry picked from commit 315674fb6acc4fa54cf82de3863c349c5a71f498) --- usr.sbin/devctl/devctl.8 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/usr.sbin/devctl/devctl.8 b/usr.sbin/devctl/devctl.8 index 17f480bd66ee..965c310d0868 100644 --- a/usr.sbin/devctl/devctl.8 +++ b/usr.sbin/devctl/devctl.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2019 +.Dd June 1, 2021 .Dt DEVCTL 8 .Os .Sh NAME @@ -67,6 +67,10 @@ .Op Fl f .Ar device .Nm +.Cm freeze +.Nm +.Cm thaw +.Nm .Cm reset .Op Fl d .Ar device @@ -170,6 +174,23 @@ the device will be deleted even if it is physically present. This command should be used with care as a device that is deleted but present can no longer be used unless the parent bus device rediscovers the device via a rescan request. +.It Cm freeze +Freeze probe and attach processing initiated in response to drivers being +loaded. +Drivers are placed on a +.Do +frozen list +.Dc +and processed when a later +.Do +thaw +.Dc +occurs. +.It Cm thaw +Resume (thaw the freeze) probe and attach initiated in response to drivers +being loaded. +In addition to resuming, all pending actions that were frozen during the freeze +are performed. .It Xo Cm reset .Op Fl d .Ar device From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:29:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 721CF64F392; Thu, 10 Jun 2021 15:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17F31bwwz3Ksq; Thu, 10 Jun 2021 15:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20315122A3; Thu, 10 Jun 2021 15:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFTR54005054; Thu, 10 Jun 2021 15:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFTRB2005053; Thu, 10 Jun 2021 15:29:27 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:29:27 GMT Message-Id: <202106101529.15AFTRB2005053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 1e83183d38d5 - stable/12 - Add freeze/thaw description to devctl(8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1e83183d38d5ab0bb9971b95d088662402153988 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:29:27 -0000 The branch stable/12 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=1e83183d38d5ab0bb9971b95d088662402153988 commit 1e83183d38d5ab0bb9971b95d088662402153988 Author: Li-Wen Hsu AuthorDate: 2021-06-01 04:33:12 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:28:38 +0000 Add freeze/thaw description to devctl(8) This is a follow-up to 5fa29797910346fc0c54829bd979856e83b9b7ea . PR: 256311 Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29867 (cherry picked from commit 315674fb6acc4fa54cf82de3863c349c5a71f498) --- usr.sbin/devctl/devctl.8 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/usr.sbin/devctl/devctl.8 b/usr.sbin/devctl/devctl.8 index 17f480bd66ee..965c310d0868 100644 --- a/usr.sbin/devctl/devctl.8 +++ b/usr.sbin/devctl/devctl.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2019 +.Dd June 1, 2021 .Dt DEVCTL 8 .Os .Sh NAME @@ -67,6 +67,10 @@ .Op Fl f .Ar device .Nm +.Cm freeze +.Nm +.Cm thaw +.Nm .Cm reset .Op Fl d .Ar device @@ -170,6 +174,23 @@ the device will be deleted even if it is physically present. This command should be used with care as a device that is deleted but present can no longer be used unless the parent bus device rediscovers the device via a rescan request. +.It Cm freeze +Freeze probe and attach processing initiated in response to drivers being +loaded. +Drivers are placed on a +.Do +frozen list +.Dc +and processed when a later +.Do +thaw +.Dc +occurs. +.It Cm thaw +Resume (thaw the freeze) probe and attach initiated in response to drivers +being loaded. +In addition to resuming, all pending actions that were frozen during the freeze +are performed. .It Xo Cm reset .Op Fl d .Ar device From owner-dev-commits-src-all@freebsd.org Thu Jun 10 15:42:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9DC364F542; Thu, 10 Jun 2021 15:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G17Xg4p69z3MBB; Thu, 10 Jun 2021 15:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BAF5122F5; Thu, 10 Jun 2021 15:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15AFgxJc031059; Thu, 10 Jun 2021 15:42:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15AFgxCe031058; Thu, 10 Jun 2021 15:42:59 GMT (envelope-from git) Date: Thu, 10 Jun 2021 15:42:59 GMT Message-Id: <202106101542.15AFgxCe031058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: cb96c6ba30cb - stable/13 - Clarify that the new STABLE branch is branched off CURRENT, not renamed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb96c6ba30cb917bc1223247caa93d135818199a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 15:42:59 -0000 The branch stable/13 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=cb96c6ba30cb917bc1223247caa93d135818199a commit cb96c6ba30cb917bc1223247caa93d135818199a Author: Li-Wen Hsu AuthorDate: 2021-03-18 09:16:16 +0000 Commit: Li-Wen Hsu CommitDate: 2021-06-10 15:42:39 +0000 Clarify that the new STABLE branch is branched off CURRENT, not renamed Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D29317 (cherry picked from commit 53844d3ea4aa504c37c8bd679cfea9966ade1400) --- share/man/man7/development.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index f64f01f24d17..a0459ccfad72 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -77,8 +77,8 @@ Git branch represents CURRENT; all changes are first committed to CURRENT and then usually cherry-picked back to STABLE, which refers to Git branches such as .Ql stable/13 . -Every few years the CURRENT branch is renamed to STABLE, and a new -CURRENT is branched, with an incremented major version number. +Every few years a new STABLE is branched from CURRENT, +with an incremented major version number. Releases are then branched off STABLE and numbered with consecutive minor numbers. .Pp From owner-dev-commits-src-all@freebsd.org Thu Jun 10 19:21:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6ED8765279C; Thu, 10 Jun 2021 19:21:24 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 4G1DNh2PT8z4TMM; Thu, 10 Jun 2021 19:21:24 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f43.google.com with SMTP id u24so34341116edy.11; Thu, 10 Jun 2021 12:21:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s3/SYAEKvVLd9tK7dvIJcJWNpjbJlcNGJwaNFzeQiAc=; b=ClQdKKhhQughvziNgM8B1lMY70xKw4F/eV9Bs89Kfv44VOodVGUCIVlcoMzOs9fqHw /+h1E09f45rTZakGCMdwp1Nc95EQePLcCRd3HIjSMzvmEIdztfapDTS5/516401uuX0N CW12y65VDOrP8xnyOUXRtyiDCBOHB3zkrT4+rSu7tcYmr9U4IvlJbq4QBbJ+Sx2sJ3cv IYRtP4RwBvhpSdRze0WsF3ALF6dWpOQkBZLjcSnFmOD1ChpOxcqsI2Ft/nwGl7UxMDo5 WZVyCwVsVqN4KfFYqQJpN7atfLvF4GtFXAxCHnxujYILgJFDQj2xempmwLefYoGV9UkM CRLg== X-Gm-Message-State: AOAM5310Oykb5pqfa0w5SmT3QLF3ezhf/7ExOxnnaRAwXDKu98nmzTjz kf18cvdZygnh+65vi9/WemGSxIE1uVH9+A== X-Google-Smtp-Source: ABdhPJxLvZZL3yTNLoTBy1iX1dC9nBWNW7zwKUqNjff9s1l7RUctvaEaQ0wQLvMfZRDsoy1Qj5fGRw== X-Received: by 2002:aa7:cd9a:: with SMTP id x26mr29574edv.185.1623352882558; Thu, 10 Jun 2021 12:21:22 -0700 (PDT) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com. [209.85.128.50]) by smtp.gmail.com with ESMTPSA id y10sm1692334edc.66.2021.06.10.12.21.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 12:21:22 -0700 (PDT) Received: by mail-wm1-f50.google.com with SMTP id t4-20020a1c77040000b029019d22d84ebdso7232784wmi.3; Thu, 10 Jun 2021 12:21:22 -0700 (PDT) X-Received: by 2002:a7b:c042:: with SMTP id u2mr355774wmc.127.1623352881963; Thu, 10 Jun 2021 12:21:21 -0700 (PDT) MIME-Version: 1.0 References: <202106081453.158Eri7k025234@gitrepo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Thu, 10 Jun 2021 20:21:09 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 160388166736 - main - zfs: merge openzfs/zfs@75b4cbf62 (master) into main To: Ed Maste Cc: Martin Matuska , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4G1DNh2PT8z4TMM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 19:21:24 -0000 On Thu, 10 Jun 2021, 14:17 Ed Maste, wrote: > On Tue, 8 Jun 2021 at 10:53, Martin Matuska wrote: > > > > The branch main has been updated by mm: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=1603881667360c015f6685131f2f25474fa67a72 > > > > commit 1603881667360c015f6685131f2f25474fa67a72 > > Merge: ed9215c8e05f 75b4cbf62590 > > Author: Martin Matuska > > AuthorDate: 2021-06-08 14:48:37 +0000 > > Commit: Martin Matuska > > CommitDate: 2021-06-08 14:52:44 +0000 > > > > zfs: merge openzfs/zfs@75b4cbf62 (master) into main > > The Cirrus-CI smoke test (which builds with Clang 12, using the llvm12 > package) is failing, with: > > error: unknown -Werror warning specifier: > '-Wno-error-atomic-alignment' [-Werror,-Wunknown-warning-option] > *** [atomic.o] Error code 1 > > CI run link: https://cirrus-ci.com/build/4636225693810688 Clang no longer accepts -Wno-error-foo, it needs to be changed to -Wno-error=foo > > From owner-dev-commits-src-all@freebsd.org Thu Jun 10 19:32:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6360265267E for ; Thu, 10 Jun 2021 19:32:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 4G1Ddl256Vz4V1d for ; Thu, 10 Jun 2021 19:32:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id j189so28601791qkf.2 for ; Thu, 10 Jun 2021 12:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A2dloJr7g5mxhPDaNbGK04xNDHYi3oi8c+RusGRFsKI=; b=sR6LwDdQvLGRzlxkjBjXIp/aVK0OcOtjcQT2/lKLd9ItN2yKdnCpltYog9oTUCpPm3 c2h++DK9b9vQ0JmJyAbXy7NrAxAaCj+iS+PoLByhK3Ni4+1Z3pZvawjAwsgkBpMu4V27 +1Tb7iU5YH3vwWm5+TN2Wg4NqaBqPwvlWcbV5lHTnbL0sLySUWDMZKBsGS7W5h4fK7xa oqsFzpqjl6jBK0uQivqovI98rDQwQomZTPoDDHyJzZ/n2y/S4k85pcTLV73WBJM3OrGd chVkLMYH17BDuPo5U1R0cawGhj03mAFGR5ihko5LUEAdZMsXl13F814bl7VRmrKwgllL dZzg== 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=A2dloJr7g5mxhPDaNbGK04xNDHYi3oi8c+RusGRFsKI=; b=Y60evhFMWRkF+HFzm6gCgj8qzwvGuZ8htGLSKkZCBqSq5oYs2aH838hMXcPJtwHu0R xlPUpyOijwOE3zHiGP0To6dUFH/Cl6BiYP9citQie0JS3qF0/0aOoU02pr/rOCPQYHc3 7PdrHZqpkZPAOGNkHoRuuPFVKEqEGIY4m9768SPTihlGZ4LajnWahm2f6plTP114UIiV 32E5MztJ0rmgzVDEZxikNGSaVDx2Z9RPgqTr/rhPjymgN5ccFWWokaiDjrjnAY0+TBHj OX/UvmtfJ8IrP13J6ZXTrJhLfHszYWP1uZCgAdgB4Is8FJ7oi1EyeyC409mOiFdyvenO W4GA== X-Gm-Message-State: AOAM531EIC8pNRnaG6U9OoGgmKchSPkrQyf/pzKL2b2iLfG657udCteC HweA8BGkjOrSM+avkMnnHpb1t9YtoHZsazJxO9uZQQ== X-Google-Smtp-Source: ABdhPJzH9BodLyxWNm4S2xKGpvHLeq/hpkW+CQ+KQfr3xlcUgSj4Zbc+27ogCJAKvWfAeS81sXB9cwYYgIjEv3Ks4hk= X-Received: by 2002:a37:f502:: with SMTP id l2mr181394qkk.195.1623353562199; Thu, 10 Jun 2021 12:32:42 -0700 (PDT) MIME-Version: 1.0 References: <202106081453.158Eri7k025234@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 10 Jun 2021 13:32:31 -0600 Message-ID: Subject: Re: git: 160388166736 - main - zfs: merge openzfs/zfs@75b4cbf62 (master) into main To: Alexander Richardson Cc: Ed Maste , Martin Matuska , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4G1Ddl256Vz4V1d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 19:32:43 -0000 On Thu, Jun 10, 2021 at 1:21 PM Alexander Richardson < arichardson@freebsd.org> wrote: > > On Thu, 10 Jun 2021, 14:17 Ed Maste, wrote: > >> On Tue, 8 Jun 2021 at 10:53, Martin Matuska wrote: >> > >> > The branch main has been updated by mm: >> > >> > URL: >> https://cgit.FreeBSD.org/src/commit/?id=1603881667360c015f6685131f2f25474fa67a72 >> > >> > commit 1603881667360c015f6685131f2f25474fa67a72 >> > Merge: ed9215c8e05f 75b4cbf62590 >> > Author: Martin Matuska >> > AuthorDate: 2021-06-08 14:48:37 +0000 >> > Commit: Martin Matuska >> > CommitDate: 2021-06-08 14:52:44 +0000 >> > >> > zfs: merge openzfs/zfs@75b4cbf62 (master) into main >> >> The Cirrus-CI smoke test (which builds with Clang 12, using the llvm12 >> package) is failing, with: >> >> error: unknown -Werror warning specifier: >> '-Wno-error-atomic-alignment' [-Werror,-Wunknown-warning-option] >> *** [atomic.o] Error code 1 >> >> CI run link: https://cirrus-ci.com/build/4636225693810688 > > > Clang no longer accepts -Wno-error-foo, it needs to be changed to > -Wno-error=foo > I wonder why it worked for me :( Warner From owner-dev-commits-src-all@freebsd.org Thu Jun 10 19:38:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 503BA652C5A for ; Thu, 10 Jun 2021 19:38:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 4G1Dm91Ys8z4V2M for ; Thu, 10 Jun 2021 19:38:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id j184so28581402qkd.6 for ; Thu, 10 Jun 2021 12:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lit476FEPRpHQyltE1dnAJH6U1K9V519M/N8KpRMg8Y=; b=Cb6C72T0/BPPw4kCEyANzWNCqndIDt6wBez+zECLOPTC2dldYWMfyIVbxxaKGgVFZZ eM5wezcxh465HgrnkEvdC/XmEG3vzyRdcq90NGCGjBbrxXn0IRIG4L7fPE0TViSd5Uhu K+7/l/NYxXHL2mo0miO2BtJWfRJiY/H/w42S1XZLWzOkImb8r0sOB85vziU7b5bV3SBS q1viJ14yuwL2dEgBBA/sWCIEYXD8MhZ0ZbO2H8l2LH2tjCoTmFyRYdEHtckSyN+NZ6mo 4ujFK+78i2y/iy8opsM2wBwSGCfHF69hCf5HrIskuGkU768WUcqyxDM6wVsft9kgEHLw MvYw== 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=lit476FEPRpHQyltE1dnAJH6U1K9V519M/N8KpRMg8Y=; b=g1e032bWRAPUeSWSprpmF4H0SKb/qNgkDnSJlGFsNLNUZGgFA48/fde1U38WOaIn8b g1XCRk1jx/f1f1cgxLPR3q33O/qer6NCsQ95HXzEQ5B+xsonbdN20iED8yoepabW6Cu2 UtoxSJUb6yuSrcsn69Ps2ysz8Vve0G92Xe5HCNacSPBm97QU+Hl0NZ/C2myE4wc63NRB jDfiC8yQFzJeX+1SVlCJFoGzL7n0mpm3MZZA0ogAxlcavpzLJGsJw5drDNepnGM/A/xX PKMF4BrhJvNNqUPMDrcMxepIH58UcWmBDTthNANj1Ji2dbaphoTgfYi19zRxVkGOF05C yuSg== X-Gm-Message-State: AOAM532UQF3qfusKiwpMl6UtraypLw0+IYjx7khvtDkbRuBPWbhC5m2T flSUDyRaA0RIMUevjGIlwPEIuR+k9m0gHHu5w9nHyQ== X-Google-Smtp-Source: ABdhPJwKdIIZY4F8DeCKDIrECW4bVsgZ8aPVfbfWxH+SfrYIpy2588rPni3jNz1PoDJuKOt068fdFftPvqv8fn8YzH0= X-Received: by 2002:a37:9ccb:: with SMTP id f194mr234467qke.206.1623353896226; Thu, 10 Jun 2021 12:38:16 -0700 (PDT) MIME-Version: 1.0 References: <202106100011.15A0B0oI080542@gitrepo.freebsd.org> <202106101146.15ABk345019564@gndrsh.dnsmgr.net> In-Reply-To: <202106101146.15ABk345019564@gndrsh.dnsmgr.net> From: Warner Losh Date: Thu, 10 Jun 2021 13:38:05 -0600 Message-ID: Subject: Re: git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4G1Dm91Ys8z4V2M X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 19:38:17 -0000 On Thu, Jun 10, 2021 at 5:46 AM Rodney W. Grimes wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > > commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > Author: Warner Losh > > AuthorDate: 2021-06-10 00:10:12 +0000 > > Commit: Warner Losh > > CommitDate: 2021-06-10 00:10:52 +0000 > > > > mk: WITH_FOO=no now generates a warning > > First off thank you, this may stop some head scratching! > > But what about WITHOUT_foo=no the symetrical mistake? > I see bdrewey raised this in the review, but it was dismissed > using the argument that some languages, spanish specifically, > allow double negatives. This is computers engineering, > and in that field of science double negatives are clearly > defined and understood, so using an argument of a language > that simply does not apply to the field, IMHO, is an arguement > of low standing. > It's not the same, and I'm not solving that error because the mapping is ambiguous. I've seen a lot more instances of people using WITHOUT_FOO=no unironically because it makes sense to the person doing it. I disagree it's not a language issue, because language is involved here: how do we assign semantic meaning is unclear and I have no desire to get involved in what I clearly view as a quagmire. > Also I do not believe == is a case insensitive operation > so this code fails for NO, No, and nO(sic). > Also true. Again, this isn't perfect. I have no desire to make it perfect, because the list isn't finite. If you'd like to own this issue, feel free, but it's not something I wish to pursue further. Warner > Regards, > Rod > > > > Many people are used to gnu configure's behavior of changing > > --with-foo=no to --without-foo. At the same time, several folks have > > WITH_FOO=no in their config files to enable this ironic form of the > > option because of an old meme from IRC, a mailing list or the forums > (I > > forget which). Add a warning to allow to alert people w/o breaking > POLA. > > > > Reviewed by: allanjude, bdrewery, manu > > MFC After: 2 weeks > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D30684 > > --- > > share/mk/bsd.mkopt.mk | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk > > index 5a9cf1b2f1be..98d23dd46c2a 100644 > > --- a/share/mk/bsd.mkopt.mk > > +++ b/share/mk/bsd.mkopt.mk > > @@ -36,6 +36,9 @@ > > # > > .for var in ${__DEFAULT_YES_OPTIONS} > > .if !defined(MK_${var}) > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > +.endif > > .if defined(WITHOUT_${var}) # WITHOUT always wins > > MK_${var}:= no > > .else > > @@ -54,6 +57,9 @@ MK_${var}:= yes > > # > > .for var in ${__DEFAULT_NO_OPTIONS} > > .if !defined(MK_${var}) > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > +.endif > > .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always > wins > > MK_${var}:= yes > > .else > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-dev-commits-src-all@freebsd.org Thu Jun 10 19:48:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50DE06530AB; Thu, 10 Jun 2021 19:48:53 +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 4G1F0N697yz4VKV; Thu, 10 Jun 2021 19:48:52 +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 15AJmlwS021047; Thu, 10 Jun 2021 12:48:47 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 15AJmlgS021046; Thu, 10 Jun 2021 12:48:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202106101948.15AJmlgS021046@gndrsh.dnsmgr.net> Subject: Re: git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning In-Reply-To: To: Warner Losh Date: Thu, 10 Jun 2021 12:48:47 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , "" , dev-commits-src-main@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: 4G1F0N697yz4VKV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 19:48:53 -0000 > On Thu, Jun 10, 2021 at 5:46 AM Rodney W. Grimes > wrote: > > > > The branch main has been updated by imp: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > > > > commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > Author: Warner Losh > > > AuthorDate: 2021-06-10 00:10:12 +0000 > > > Commit: Warner Losh > > > CommitDate: 2021-06-10 00:10:52 +0000 > > > > > > mk: WITH_FOO=no now generates a warning > > > > First off thank you, this may stop some head scratching! > > > > But what about WITHOUT_foo=no the symetrical mistake? > > I see bdrewey raised this in the review, but it was dismissed > > using the argument that some languages, spanish specifically, > > allow double negatives. This is computers engineering, > > and in that field of science double negatives are clearly > > defined and understood, so using an argument of a language > > that simply does not apply to the field, IMHO, is an arguement > > of low standing. > > > > It's not the same, and I'm not solving that error because the mapping > is ambiguous. I've seen a lot more instances of people using > WITHOUT_FOO=no unironically because it makes sense to the > person doing it. I disagree it's not a language issue, because > language is involved here: how do we assign semantic meaning > is unclear and I have no desire to get involved in what I clearly > view as a quagmire. > > > > Also I do not believe == is a case insensitive operation > > so this code fails for NO, No, and nO(sic). > > > > Also true. Again, this isn't perfect. I have no desire to make it > perfect, because the list isn't finite. > > If you'd like to own this issue, feel free, but it's not something I > wish to pursue further. You touched it, you own it. > Warner > > > > Regards, > > Rod > > > > > > Many people are used to gnu configure's behavior of changing > > > --with-foo=no to --without-foo. At the same time, several folks have > > > WITH_FOO=no in their config files to enable this ironic form of the > > > option because of an old meme from IRC, a mailing list or the forums > > (I > > > forget which). Add a warning to allow to alert people w/o breaking > > POLA. > > > > > > Reviewed by: allanjude, bdrewery, manu > > > MFC After: 2 weeks > > > Sponsored by: Netflix > > > Differential Revision: https://reviews.freebsd.org/D30684 > > > --- > > > share/mk/bsd.mkopt.mk | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk > > > index 5a9cf1b2f1be..98d23dd46c2a 100644 > > > --- a/share/mk/bsd.mkopt.mk > > > +++ b/share/mk/bsd.mkopt.mk > > > @@ -36,6 +36,9 @@ > > > # > > > .for var in ${__DEFAULT_YES_OPTIONS} > > > .if !defined(MK_${var}) > > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > > +.endif > > > .if defined(WITHOUT_${var}) # WITHOUT always wins > > > MK_${var}:= no > > > .else > > > @@ -54,6 +57,9 @@ MK_${var}:= yes > > > # > > > .for var in ${__DEFAULT_NO_OPTIONS} > > > .if !defined(MK_${var}) > > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > > +.endif > > > .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always > > wins > > > MK_${var}:= yes > > > .else > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Thu Jun 10 21:43:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D629653EE1; Thu, 10 Jun 2021 21:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1HXR3nXSz4fbd; Thu, 10 Jun 2021 21:43:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E4DE1722D; Thu, 10 Jun 2021 21:43:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ALhJ09009459; Thu, 10 Jun 2021 21:43:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ALhJ62009458; Thu, 10 Jun 2021 21:43:19 GMT (envelope-from git) Date: Thu, 10 Jun 2021 21:43:19 GMT Message-Id: <202106102143.15ALhJ62009458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 294799c6b081 - main - libalias: tidy up housekeeping MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 294799c6b081faece556a5010a4f51552e131c2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 21:43:20 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=294799c6b081faece556a5010a4f51552e131c2f commit 294799c6b081faece556a5010a4f51552e131c2f Author: Lutz Donnerhacke AuthorDate: 2021-05-15 15:35:36 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-10 21:30:10 +0000 libalias: tidy up housekeeping Replace current expensive, but sparsly called housekeeping by a single, repetive action. This is part of a larger restructure of libalias in order to switch to more efficient data structures. The whole restructure process is split into 15 reviews to ease reviewing. All those steps will be squashed into a single commit for MFC in order to hide the intermediate states from production systems. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30277 --- sys/netinet/libalias/alias_db.c | 104 ++++++++++++++++--------------------- sys/netinet/libalias/alias_local.h | 6 +-- 2 files changed, 47 insertions(+), 63 deletions(-) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index d7027f4e25c2..fca2f33906d3 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -182,11 +182,6 @@ static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead); near relevant functions or structs) */ -/* Parameters used for cleanup of expired links */ -/* NOTE: ALIAS_CLEANUP_INTERVAL_SECS must be less then LINK_TABLE_OUT_SIZE */ -#define ALIAS_CLEANUP_INTERVAL_SECS 64 -#define ALIAS_CLEANUP_MAX_SPOKES (LINK_TABLE_OUT_SIZE/5) - /* Timeouts (in seconds) for different link types */ #define ICMP_EXPIRE_TIME 60 #define UDP_EXPIRE_TIME 60 @@ -329,6 +324,7 @@ struct alias_link { /* Linked list of pointers for input and output lookup tables */ LIST_ENTRY (alias_link) list_out; LIST_ENTRY (alias_link) list_in; + TAILQ_ENTRY (alias_link) list_expire; /* Auxiliary data */ union { char *frag_ptr; @@ -510,7 +506,7 @@ Port Allocation: Link creation and deletion: CleanupAliasData() - remove all link chains from lookup table - IncrementalCleanup() - look for stale links in a single chain + CleanupLink() - look for a stale link DeleteLink() - remove link AddLink() - add link ReLink() - change link @@ -529,8 +525,8 @@ static int GetNewPort(struct libalias *, struct alias_link *, int); static u_short GetSocket(struct libalias *, u_short, int *, int); #endif static void CleanupAliasData(struct libalias *); -static void IncrementalCleanup(struct libalias *); -static void DeleteLink(struct alias_link *); +static void CleanupLink(struct libalias *, struct alias_link **); +static void DeleteLink(struct alias_link **); static struct alias_link * ReLink(struct alias_link *, @@ -807,41 +803,38 @@ FindNewPortGroup(struct libalias *la, static void CleanupAliasData(struct libalias *la) { - struct alias_link *lnk; - int i; + struct alias_link *lnk, *lnk_tmp; LIBALIAS_LOCK_ASSERT(la); - for (i = 0; i < LINK_TABLE_OUT_SIZE; i++) { - lnk = LIST_FIRST(&la->linkTableOut[i]); - while (lnk != NULL) { - struct alias_link *link_next = LIST_NEXT(lnk, list_out); - DeleteLink(lnk); - lnk = link_next; - } - } - la->cleanupIndex = 0; + /* permanent entries may stay */ + TAILQ_FOREACH_SAFE(lnk, &la->checkExpire, list_expire, lnk_tmp) + DeleteLink(&lnk); } static void -IncrementalCleanup(struct libalias *la) +CleanupLink(struct libalias *la, struct alias_link **lnk) { - struct alias_link *lnk, *lnk_tmp; - LIBALIAS_LOCK_ASSERT(la); - LIST_FOREACH_SAFE(lnk, &la->linkTableOut[la->cleanupIndex++], - list_out, lnk_tmp) { - if (la->timeStamp - lnk->timestamp > lnk->expire_time) - DeleteLink(lnk); + + if (lnk == NULL || *lnk == NULL) + return; + + if (la->timeStamp - (*lnk)->timestamp > (*lnk)->expire_time) { + DeleteLink(lnk); + if ((*lnk) == NULL) + return; } - if (la->cleanupIndex == LINK_TABLE_OUT_SIZE) - la->cleanupIndex = 0; + /* move to end, swap may fail on a single entry list */ + TAILQ_REMOVE(&la->checkExpire, (*lnk), list_expire); + TAILQ_INSERT_TAIL(&la->checkExpire, (*lnk), list_expire); } static void -DeleteLink(struct alias_link *lnk) +DeleteLink(struct alias_link **plnk) { + struct alias_link *lnk = *plnk; struct libalias *la = lnk->la; LIBALIAS_LOCK_ASSERT(la); @@ -869,6 +862,10 @@ DeleteLink(struct alias_link *lnk) /* Adjust input table pointers */ LIST_REMOVE(lnk, list_in); + + /* remove from housekeeping */ + TAILQ_REMOVE(&la->checkExpire, lnk, list_expire); + #ifndef NO_USE_SOCKETS /* Close socket, if one has been allocated */ if (lnk->sockfd != -1) { @@ -908,6 +905,7 @@ DeleteLink(struct alias_link *lnk) /* Free memory */ free(lnk); + *plnk = NULL; /* Write statistics, if logging enabled */ if (la->packetAliasMode & PKT_ALIAS_LOG) { @@ -1039,6 +1037,9 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, /* Set up pointers for input lookup table */ start_point = StartPointIn(alias_addr, lnk->alias_port, link_type); LIST_INSERT_HEAD(&la->linkTableIn[start_point], lnk, list_in); + + /* Include the element into the housekeeping list */ + TAILQ_INSERT_TAIL(&la->checkExpire, lnk, list_expire); } else { #ifdef LIBALIAS_DEBUG fprintf(stderr, "PacketAlias/AddLink(): "); @@ -1079,7 +1080,7 @@ ReLink(struct alias_link *old_lnk, PunchFWHole(new_lnk); } #endif - DeleteLink(old_lnk); + DeleteLink(&old_lnk); return (new_lnk); } @@ -1102,12 +1103,14 @@ _FindLinkOut(struct libalias *la, struct in_addr src_addr, lnk->src_port == src_port && lnk->dst_port == dst_port && lnk->link_type == link_type && - lnk->server == NULL) { - lnk->timestamp = la->timeStamp; + lnk->server == NULL) break; - } } + CleanupLink(la, &lnk); + if (lnk != NULL) + lnk->timestamp = la->timeStamp; + /* Search for partially specified links. */ if (lnk == NULL && replace_partial_links) { if (dst_port != 0 && dst_addr.s_addr != INADDR_ANY) { @@ -1235,6 +1238,7 @@ _FindLinkIn(struct libalias *la, struct in_addr dst_addr, } } + CleanupLink(la, &lnk_fully_specified); if (lnk_fully_specified != NULL) { lnk_fully_specified->timestamp = la->timeStamp; lnk = lnk_fully_specified; @@ -1572,6 +1576,7 @@ FindPptpOutByCallId(struct libalias *la, struct in_addr src_addr, lnk->src_port == src_call_id) break; + CleanupLink(la, &lnk); return (lnk); } @@ -1592,6 +1597,7 @@ FindPptpOutByPeerCallId(struct libalias *la, struct in_addr src_addr, lnk->dst_port == dst_call_id) break; + CleanupLink(la, &lnk); return (lnk); } @@ -1612,6 +1618,7 @@ FindPptpInByCallId(struct libalias *la, struct in_addr dst_addr, lnk->dst_port == dst_call_id) break; + CleanupLink(la, &lnk); return (lnk); } @@ -2038,7 +2045,7 @@ SetExpire(struct alias_link *lnk, int expire) { if (expire == 0) { lnk->flags &= ~LINK_PERMANENT; - DeleteLink(lnk); + DeleteLink(&lnk); } else if (expire == -1) { lnk->flags |= LINK_PERMANENT; } else if (expire > 0) { @@ -2094,7 +2101,7 @@ SetDestCallId(struct alias_link *lnk, u_int16_t cid) void HouseKeeping(struct libalias *la) { - int i, n; + struct alias_link * lnk = TAILQ_FIRST(&la->checkExpire); #ifndef _KERNEL struct timeval tv; #endif @@ -2111,25 +2118,7 @@ HouseKeeping(struct libalias *la) gettimeofday(&tv, NULL); la->timeStamp = tv.tv_sec; #endif - - /* Compute number of spokes (output table link chains) to cover */ - n = LINK_TABLE_OUT_SIZE * (la->timeStamp - la->lastCleanupTime); - n /= ALIAS_CLEANUP_INTERVAL_SECS; - - /* Handle different cases */ - if (n > 0) { - if (n > ALIAS_CLEANUP_MAX_SPOKES) - n = ALIAS_CLEANUP_MAX_SPOKES; - la->lastCleanupTime = la->timeStamp; - for (i = 0; i < n; i++) - IncrementalCleanup(la); - } else if (n < 0) { -#ifdef LIBALIAS_DEBUG - fprintf(stderr, "PacketAlias/HouseKeeping(): "); - fprintf(stderr, "something unexpected in time values\n"); -#endif - la->lastCleanupTime = la->timeStamp; - } + CleanupLink(la, &lnk); } /* Init the log file and enable logging */ @@ -2356,7 +2345,7 @@ LibAliasRedirectDelete(struct libalias *la, struct alias_link *lnk) { LIBALIAS_LOCK(la); la->deleteAllLinks = 1; - DeleteLink(lnk); + DeleteLink(&lnk); la->deleteAllLinks = 0; LIBALIAS_UNLOCK(la); } @@ -2426,17 +2415,16 @@ LibAliasInit(struct libalias *la) #ifdef _KERNEL la->timeStamp = time_uptime; - la->lastCleanupTime = time_uptime; #else gettimeofday(&tv, NULL); la->timeStamp = tv.tv_sec; - la->lastCleanupTime = tv.tv_sec; #endif for (i = 0; i < LINK_TABLE_OUT_SIZE; i++) LIST_INIT(&la->linkTableOut[i]); for (i = 0; i < LINK_TABLE_IN_SIZE; i++) LIST_INIT(&la->linkTableIn[i]); + TAILQ_INIT(&la->checkExpire); #ifdef _KERNEL AliasSctpInit(la); #endif @@ -2466,8 +2454,6 @@ LibAliasInit(struct libalias *la) la->fragmentPtrLinkCount = 0; la->sockCount = 0; - la->cleanupIndex = 0; - la->packetAliasMode = PKT_ALIAS_SAME_PORTS #ifndef NO_USE_SOCKETS | PKT_ALIAS_USE_SOCKETS diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h index 61cd30737ce5..fcdaa1690470 100644 --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -94,6 +94,8 @@ struct libalias { * output lookup tables. */ LIST_HEAD (, alias_link) linkTableOut[LINK_TABLE_OUT_SIZE]; LIST_HEAD (, alias_link) linkTableIn[LINK_TABLE_IN_SIZE]; + /* HouseKeeping */ + TAILQ_HEAD (, alias_link) checkExpire; /* Link statistics */ int icmpLinkCount; int udpLinkCount; @@ -103,12 +105,8 @@ struct libalias { int fragmentIdLinkCount; int fragmentPtrLinkCount; int sockCount; - /* Index to chain of link table being inspected for old links */ - int cleanupIndex; /* System time in seconds for current packet */ int timeStamp; - /* Last time IncrementalCleanup() was called */ - int lastCleanupTime; /* If equal to zero, DeleteLink() * will not remove permanent links */ int deleteAllLinks; From owner-dev-commits-src-all@freebsd.org Thu Jun 10 22:26:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54614654D5B for ; Thu, 10 Jun 2021 22:26:47 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (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 4G1JVb1gSRz4hcQ for ; Thu, 10 Jun 2021 22:26:46 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2d.google.com with SMTP id c14so1545787ybk.3 for ; Thu, 10 Jun 2021 15:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KSYbp4QbRyU5mMszLcS73ZGMAkrepLmHzPFFjr66IPI=; b=KqkiM6rptD5BZwDj6Uxq337WH6dYoxdVa1J1VGQbTxGd2W29Gpt30igIhmaQwDsXM9 Wn19Ww650bW4mYQGiiuS1RizlN+yPSLEhSsHofUle3Jn9r9JFgQXYsxXRROAxT/UQ++3 YnNrP/orQQ2OhocLSlp8ThVKsxtrwKh3y6+Sc= 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=KSYbp4QbRyU5mMszLcS73ZGMAkrepLmHzPFFjr66IPI=; b=ElZvNBag5jWdumNhw5R0VJQ0qkNMMIz5smP0pDltVetk1uiZdAwBsIqTau2J3YECHJ qA8Ed/dSzBA3S9cVdiT5A0eqHCgZYS5QrefXZpYmSqI8PqQhMXDkFxiJMvC1l90sAUes li6JVXXntL7yea5PcsoiJFlcFh+n4xEbjG60pHqBx7MFl/ZN7RPjdwpZfG18ELqeqgnS XF+sexio5f5zgn2Uytn5lF//frrO+pyrqdAwhlTfv7gQiW0XPd1Bgi1jIQ7kyk5ghPDY RpGeHLP+8v0UxkCY2Sny14ROn5IWXdOSl1zZUkuWsruH6ZCUERfMhiGxjOtoFkP+HCEZ BVnA== X-Gm-Message-State: AOAM5334/YzZF1G3Se+XGc2BeKS1FtnjwNHfNNgnn+7KIJeGske6u37N 4nBkQTFlETiXQU+3h64Ekcttn7JGst3D4d8nFBXoNw== X-Google-Smtp-Source: ABdhPJwDxCCOCN8Hk9e1NCAlGjqMTkzx+kfP8Fj9e+QfMNjlXHyegC0PV1SxpwsBYQ3FqhcACBWmU7s/pnOJRm4ehp8= X-Received: by 2002:a25:9809:: with SMTP id a9mr1651869ybo.330.1623364005900; Thu, 10 Jun 2021 15:26:45 -0700 (PDT) MIME-Version: 1.0 References: <202106101948.15AJmlgS021046@gndrsh.dnsmgr.net> In-Reply-To: <202106101948.15AJmlgS021046@gndrsh.dnsmgr.net> From: Kevin Bowling Date: Thu, 10 Jun 2021 15:26:34 -0700 Message-ID: Subject: Re: git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning To: rgrimes@freebsd.org Cc: "" , Warner Losh , Warner Losh , dev-commits-src-main@freebsd.org, src-committers X-Rspamd-Queue-Id: 4G1JVb1gSRz4hcQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 22:26:47 -0000 Empirically that=E2=80=99s not how FreeBSD works these days and it=E2=80=99= s at least an unsustainable mantra as entities come and go (see TCP as a not too controversial example). Checking in a regression implies some level of ownership to revert it if identified quickly. Making a stepwise improvement or partial improvement and halting further work needs to be a valid contribution in a volunteer project. On Thu, Jun 10, 2021 at 12:49 PM Rodney W. Grimes wrote: > > On Thu, Jun 10, 2021 at 5:46 AM Rodney W. Grimes < > freebsd@gndrsh.dnsmgr.net> > > wrote: > > > > > > The branch main has been updated by imp: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=3Df4d987cd137cb2d0d54a3e35d9258ca= 7c175d291 > > > > > > > > commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > > Author: Warner Losh > > > > AuthorDate: 2021-06-10 00:10:12 +0000 > > > > Commit: Warner Losh > > > > CommitDate: 2021-06-10 00:10:52 +0000 > > > > > > > > mk: WITH_FOO=3Dno now generates a warning > > > > > > First off thank you, this may stop some head scratching! > > > > > > But what about WITHOUT_foo=3Dno the symetrical mistake? > > > I see bdrewey raised this in the review, but it was dismissed > > > using the argument that some languages, spanish specifically, > > > allow double negatives. This is computers engineering, > > > and in that field of science double negatives are clearly > > > defined and understood, so using an argument of a language > > > that simply does not apply to the field, IMHO, is an arguement > > > of low standing. > > > > > > > It's not the same, and I'm not solving that error because the mapping > > is ambiguous. I've seen a lot more instances of people using > > WITHOUT_FOO=3Dno unironically because it makes sense to the > > person doing it. I disagree it's not a language issue, because > > language is involved here: how do we assign semantic meaning > > is unclear and I have no desire to get involved in what I clearly > > view as a quagmire. > > > > > > > Also I do not believe =3D=3D is a case insensitive operation > > > so this code fails for NO, No, and nO(sic). > > > > > > > Also true. Again, this isn't perfect. I have no desire to make it > > perfect, because the list isn't finite. > > > > If you'd like to own this issue, feel free, but it's not something I > > wish to pursue further. > > You touched it, you own it. > > > Warner > > > > > > > Regards, > > > Rod > > > > > > > > Many people are used to gnu configure's behavior of changing > > > > --with-foo=3Dno to --without-foo. At the same time, several fol= ks > have > > > > WITH_FOO=3Dno in their config files to enable this ironic form = of > the > > > > option because of an old meme from IRC, a mailing list or the > forums > > > (I > > > > forget which). Add a warning to allow to alert people w/o > breaking > > > POLA. > > > > > > > > Reviewed by: allanjude, bdrewery, manu > > > > MFC After: 2 weeks > > > > Sponsored by: Netflix > > > > Differential Revision: https://reviews.freebsd.org/D30684 > > > > --- > > > > share/mk/bsd.mkopt.mk | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk > > > > index 5a9cf1b2f1be..98d23dd46c2a 100644 > > > > --- a/share/mk/bsd.mkopt.mk > > > > +++ b/share/mk/bsd.mkopt.mk > > > > @@ -36,6 +36,9 @@ > > > > # > > > > .for var in ${__DEFAULT_YES_OPTIONS} > > > > .if !defined(MK_${var}) > > > > +.if defined(WITH_${var}) && ${WITH_${var}} =3D=3D "no" > > > > +.warning "Use WITHOUT_${var}=3D1 insetad of WITH_${var}=3Dno" > > > > +.endif > > > > .if defined(WITHOUT_${var}) # WITHOUT always wins > > > > MK_${var}:=3D no > > > > .else > > > > @@ -54,6 +57,9 @@ MK_${var}:=3D yes > > > > # > > > > .for var in ${__DEFAULT_NO_OPTIONS} > > > > .if !defined(MK_${var}) > > > > +.if defined(WITH_${var}) && ${WITH_${var}} =3D=3D "no" > > > > +.warning "Use WITHOUT_${var}=3D1 insetad of WITH_${var}=3Dno" > > > > +.endif > > > > .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT > always > > > wins > > > > MK_${var}:=3D yes > > > > .else > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > -- > Rod Grimes > rgrimes@freebsd.org > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to " > dev-commits-src-main-unsubscribe@freebsd.org" > From owner-dev-commits-src-all@freebsd.org Thu Jun 10 23:36:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3463C6552AC; Thu, 10 Jun 2021 23:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1L3Z0tXxz4sxQ; Thu, 10 Jun 2021 23:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02CE7186D4; Thu, 10 Jun 2021 23:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ANavYw055262; Thu, 10 Jun 2021 23:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ANav1V055261; Thu, 10 Jun 2021 23:36:57 GMT (envelope-from git) Date: Thu, 10 Jun 2021 23:36:57 GMT Message-Id: <202106102336.15ANav1V055261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 47ddbfae278b - main - zfs: unbreak build with clang 12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47ddbfae278b617a01976db667b8f4b4c4155755 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 23:36:58 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=47ddbfae278b617a01976db667b8f4b4c4155755 commit 47ddbfae278b617a01976db667b8f4b4c4155755 Author: Martin Matuska AuthorDate: 2021-06-10 23:31:56 +0000 Commit: Martin Matuska CommitDate: 2021-06-10 23:34:46 +0000 zfs: unbreak build with clang 12 Change -Wno-error-atomic-alignment to -Wno-error=atomic-alignment in the Makefile of libspl. Reported by: Ed Maste Fix by: Alexander Richardson --- cddl/lib/libspl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/lib/libspl/Makefile b/cddl/lib/libspl/Makefile index f565683fba4e..59e0a7c51834 100644 --- a/cddl/lib/libspl/Makefile +++ b/cddl/lib/libspl/Makefile @@ -41,6 +41,6 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h -CFLAGS.atomic.c+= -Wno-error-atomic-alignment +CFLAGS.atomic.c+= -Wno-error=atomic-alignment .include From owner-dev-commits-src-all@freebsd.org Thu Jun 10 23:56:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99D96655BEF; Thu, 10 Jun 2021 23:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1LTy3gcfz4tn1; Thu, 10 Jun 2021 23:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66EA018678; Thu, 10 Jun 2021 23:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15ANuMT8081685; Thu, 10 Jun 2021 23:56:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ANuM25081684; Thu, 10 Jun 2021 23:56:22 GMT (envelope-from git) Date: Thu, 10 Jun 2021 23:56:22 GMT Message-Id: <202106102356.15ANuM25081684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: ab6d05336caa - main - tests/sys/netpfil: Move common tests out from behind MK_PF. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab6d05336caaa10ae315f81534851e3764a8660c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 23:56:22 -0000 The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=ab6d05336caaa10ae315f81534851e3764a8660c commit ab6d05336caaa10ae315f81534851e3764a8660c Author: Brad Davis AuthorDate: 2021-06-10 23:01:53 +0000 Commit: Brad Davis CommitDate: 2021-06-10 23:56:01 +0000 tests/sys/netpfil: Move common tests out from behind MK_PF. Approved by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/Makefile b/tests/sys/netpfil/Makefile index b6c90f2b3c86..89629b8c3bd2 100644 --- a/tests/sys/netpfil/Makefile +++ b/tests/sys/netpfil/Makefile @@ -3,10 +3,10 @@ .include TESTSDIR= ${TESTSBASE}/sys/netpfil +TESTS_SUBDIRS+= common .if ${MK_PF} != "no" -TESTS_SUBDIRS+= pf \ - common +TESTS_SUBDIRS+= pf .endif .include From owner-dev-commits-src-all@freebsd.org Fri Jun 11 00:42:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5258965621B for ; Fri, 11 Jun 2021 00:42:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 4G1MW31KFxz3G2r for ; Fri, 11 Jun 2021 00:42:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id v6so1362587qta.9 for ; Thu, 10 Jun 2021 17:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QBC1BXzN+RnfeQZGQNAki7HsWfbSxbn4tIzsy8vo/b8=; b=EvOrbsFp+t1pXLUiOfSXg57ElGQPdvEfRBoL35zVsdE8fh3oz8f7Zleeq5E+5Z+g7y oMK8oVsEu+EJu9x1vilsTa6AsuLObGUt4j3X5+qRpevsj0aeJmUCVweI0tiLqRVL7sC+ a8angFaOu/zkFip4sofmSwmN31K61OtAqdZMgEjSoVh3L5/wEZvUWKKqeO+92mhxWMzx TvKQX36rk4SkXfeKG0PnugZrendNhplTahNJlaBdvf19D8OUbM2ZO//UYmb6YFpGowuF 1ql3dj8aPsDdhz5Dh01NB4xivbNa2ocfWlEpjndryHxmmjW9M6AC8yahxk0rhKIwf/Fk xZrQ== 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=QBC1BXzN+RnfeQZGQNAki7HsWfbSxbn4tIzsy8vo/b8=; b=jfi5OUxjlDnxuhwnTttM5cwRDc6lbWdogLjqJrKWerZsAgvIFOsaXjkNXIjWSF+bzV rFkQKj063BnRleBupNefNDjjqj7VehIw2htnMtDd4GMg/mZxG5Mn2alcb9IY0ToK3CbH iNLTuGqe5ZshTp7/qCa14FpXk9crH6Uacs1+5CpgfWOAOnG3GmgIX13UYaOI4h05e8LQ ZVqS9b470Jtq65X8zB76JUMoYbRjglRkY/OOuanJ2fM/lVsUOAxfCexCJVZKTJUvf7oU xVrhCt1N4gM1FS4l97RZYOS7+51/KUiREjUBcGg49h8So2pkYe8LA18E+wwBgsBgTKcZ qRAg== X-Gm-Message-State: AOAM532sRbqO2Zyhvy0vw76paGCyBf3gG4395H+xaatVFTeeaTo/l1Vs l+Mb1mLAtfZRmHz5DkFeYE2R5RyXzgkSW1nBBsJYytbXl6x2Qhxj X-Google-Smtp-Source: ABdhPJz/uR2svhYXLldhLJfIXzOsE4e5sap/U9oIuEKp2g2rZaQK4QUQ4mYxmBY/kY4sIgP+stzgoWaYd1Phv1pikE8= X-Received: by 2002:ac8:6906:: with SMTP id e6mr1562144qtr.73.1623372141862; Thu, 10 Jun 2021 17:42:21 -0700 (PDT) MIME-Version: 1.0 References: <202106101948.15AJmlgS021046@gndrsh.dnsmgr.net> In-Reply-To: <202106101948.15AJmlgS021046@gndrsh.dnsmgr.net> From: Warner Losh Date: Thu, 10 Jun 2021 18:42:11 -0600 Message-ID: Subject: Re: git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4G1MW31KFxz3G2r X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 00:42:23 -0000 On Thu, Jun 10, 2021 at 1:48 PM Rodney W. Grimes wrote: > > On Thu, Jun 10, 2021 at 5:46 AM Rodney W. Grimes < > freebsd@gndrsh.dnsmgr.net> > > wrote: > > > > > > The branch main has been updated by imp: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > > > > > > commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > > Author: Warner Losh > > > > AuthorDate: 2021-06-10 00:10:12 +0000 > > > > Commit: Warner Losh > > > > CommitDate: 2021-06-10 00:10:52 +0000 > > > > > > > > mk: WITH_FOO=no now generates a warning > > > > > > First off thank you, this may stop some head scratching! > > > > > > But what about WITHOUT_foo=no the symetrical mistake? > > > I see bdrewey raised this in the review, but it was dismissed > > > using the argument that some languages, spanish specifically, > > > allow double negatives. This is computers engineering, > > > and in that field of science double negatives are clearly > > > defined and understood, so using an argument of a language > > > that simply does not apply to the field, IMHO, is an arguement > > > of low standing. > > > > > > > It's not the same, and I'm not solving that error because the mapping > > is ambiguous. I've seen a lot more instances of people using > > WITHOUT_FOO=no unironically because it makes sense to the > > person doing it. I disagree it's not a language issue, because > > language is involved here: how do we assign semantic meaning > > is unclear and I have no desire to get involved in what I clearly > > view as a quagmire. > > > > > > > Also I do not believe == is a case insensitive operation > > > so this code fails for NO, No, and nO(sic). > > > > > > > Also true. Again, this isn't perfect. I have no desire to make it > > perfect, because the list isn't finite. > > > > If you'd like to own this issue, feel free, but it's not something I > > wish to pursue further. > > You touched it, you own it. > % ./configure --without-fred=no configure: error: invalid package name: fred=no I accomplished what I set out to accomplish. We've never, ever, fixed all the bugs / issues pointed out by reviewers in this project for adjacent issues or code. Otherwise, I'd still only about half way through bde's feedback... Warner > > Warner > > > > > > > Regards, > > > Rod > > > > > > > > Many people are used to gnu configure's behavior of changing > > > > --with-foo=no to --without-foo. At the same time, several folks > have > > > > WITH_FOO=no in their config files to enable this ironic form of > the > > > > option because of an old meme from IRC, a mailing list or the > forums > > > (I > > > > forget which). Add a warning to allow to alert people w/o > breaking > > > POLA. > > > > > > > > Reviewed by: allanjude, bdrewery, manu > > > > MFC After: 2 weeks > > > > Sponsored by: Netflix > > > > Differential Revision: https://reviews.freebsd.org/D30684 > > > > --- > > > > share/mk/bsd.mkopt.mk | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk > > > > index 5a9cf1b2f1be..98d23dd46c2a 100644 > > > > --- a/share/mk/bsd.mkopt.mk > > > > +++ b/share/mk/bsd.mkopt.mk > > > > @@ -36,6 +36,9 @@ > > > > # > > > > .for var in ${__DEFAULT_YES_OPTIONS} > > > > .if !defined(MK_${var}) > > > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > > > +.endif > > > > .if defined(WITHOUT_${var}) # WITHOUT always wins > > > > MK_${var}:= no > > > > .else > > > > @@ -54,6 +57,9 @@ MK_${var}:= yes > > > > # > > > > .for var in ${__DEFAULT_NO_OPTIONS} > > > > .if !defined(MK_${var}) > > > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > > > +.endif > > > > .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT > always > > > wins > > > > MK_${var}:= yes > > > > .else > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-dev-commits-src-all@freebsd.org Fri Jun 11 00:48:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 652DC656699; Fri, 11 Jun 2021 00:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1MdZ0ygnz3Ftt; Fri, 11 Jun 2021 00:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF6EC196F7; Fri, 11 Jun 2021 00:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15B0m1rn047990; Fri, 11 Jun 2021 00:48:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15B0m1w9047989; Fri, 11 Jun 2021 00:48:01 GMT (envelope-from git) Date: Fri, 11 Jun 2021 00:48:01 GMT Message-Id: <202106110048.15B0m1w9047989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 043f20498526 - stable/13 - fdescfs: add an option to return underlying file vnode on lookup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 043f204985261d6daae69538c4609b3e143ee444 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 00:48:02 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=043f204985261d6daae69538c4609b3e143ee444 commit 043f204985261d6daae69538c4609b3e143ee444 Author: Konstantin Belousov AuthorDate: 2021-05-05 22:53:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-11 00:33:48 +0000 fdescfs: add an option to return underlying file vnode on lookup (cherry picked from commit f9b1e711f0d8c27f2d29e7a8e6276947d37a6a22) --- share/man/man5/fdescfs.5 | 94 +++++++++++++++++++++++++++++++++++++------ sys/fs/fdescfs/fdesc.h | 1 + sys/fs/fdescfs/fdesc_vfsops.c | 2 + sys/fs/fdescfs/fdesc_vnops.c | 12 +++++- 4 files changed, 95 insertions(+), 14 deletions(-) diff --git a/share/man/man5/fdescfs.5 b/share/man/man5/fdescfs.5 index 3f16104c0ac8..f2abda2bb4c2 100644 --- a/share/man/man5/fdescfs.5 +++ b/share/man/man5/fdescfs.5 @@ -1,3 +1,5 @@ +.\" Copyright (c) 2021 The FreeBSD Foundation, Inc. +.\" .\" Copyright (c) 1996 .\" Mike Pritchard . All rights reserved. .\" @@ -8,6 +10,10 @@ .\" This code is derived from software donated to Berkeley by .\" Jan-Simon Pendry. .\" +.\" Parts of this documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -34,7 +40,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2017 +.Dd May 17, 2021 .Dt FDESCFS 5 .Os .Sh NAME @@ -62,7 +68,40 @@ through .Pa /dev/fd/# refer to file descriptors which can be accessed through the file system. -If the file descriptor is open and the mode the file is being opened +.Pp +The following mount options can be used when mounting +.Nm +filesystem: +.Bl -tag -width linrdlnk +.It Cm nodup +For file descriptors referencing vnodes, instead of the +.Xr dup 2 +semantic described above, implement re-opening of the referenced vnode. +See below for more details. +.It Cm linrdlnk +Report the type of the +.Nm +vnode as +.Dv VLNK +instead of +.Fx +traditional +.Dv VCHR . +For +.Xr linux 4 +ABI compatibility mount +.Nm +volume with the +.Cm linrdlnk +option. +.El +.Pp +For +.Nm +mounted without the +.Cm nodup +mount option, +if the file descriptor is open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call: .Bd -literal -offset indent fd = open("/dev/fd/0", mode); @@ -74,7 +113,6 @@ fd = fcntl(0, F_DUPFD, 0); .Ed .Pp are equivalent. -.Pp Flags to the .Xr open 2 call other than @@ -84,6 +122,38 @@ and .Dv O_RDWR are ignored. .Pp +For +.Nm +mounted with the +.Cm nodup +option, and file descriptor referencing a vnode, the call: +.Bd -literal -offset indent +fd = open("/dev/fd/0", mode); +.Ed +.Pp +reopens the referenced vnode with the specified +.Fa mode . +In other words, the +.Fn open +call above is equivalent to +.Bd -literal -offset indent +fd = openat(0, "", O_EMPTY_PATH, mode); +.Ed +.Pp +In particular, if the file descriptor was opened with the +.Dv O_PATH +flag, then either +.Dv O_EMPTY_PATH +or +.Fn open +over +.Nm +mount with +.Cm nodup +option allows one to convert it to a regularly opened file, +assuming that the current permissions allow the requested +.Fa mode . +.Pp .Em "Note:" .Pa /dev/fd/0 , .Pa /dev/fd/1 @@ -92,14 +162,6 @@ and files are created by default when devfs alone is mounted. .Nm creates entries for all file descriptors opened by the process. -.Pp -For -.Xr linux 4 -ABI compatibility mount -.Nm -volume with -.Cm linrdlnk -option. .Sh FILES .Bl -tag -width /dev/stderr -compact .It Pa /dev/fd/# @@ -110,13 +172,19 @@ To mount a volume located on .Pa /dev/fd : .Pp -.Dl "mount -t fdescfs null /dev/fd" +.Dl "mount -t fdescfs none /dev/fd" .Pp For .Xr linux 4 ABI compatibility: .Pp -.Dl "mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd" +.Dl "mount -t fdescfs -o linrdlnk none /compat/linux/dev/fd" +.Pp +For substitute of +.Dv O_EMPTY_PATH +flag use: +.Pp +.Dl "mount -t fdescfs -o nodup none /dev/fdpath" .Sh SEE ALSO .Xr devfs 5 , .Xr mount 8 diff --git a/sys/fs/fdescfs/fdesc.h b/sys/fs/fdescfs/fdesc.h index b578b7309130..94682f42cdb3 100644 --- a/sys/fs/fdescfs/fdesc.h +++ b/sys/fs/fdescfs/fdesc.h @@ -42,6 +42,7 @@ /* Private mount flags for fdescfs. */ #define FMNT_UNMOUNTF 0x01 #define FMNT_LINRDLNKF 0x02 +#define FMNT_NODUP 0x04 struct fdescmount { struct vnode *f_root; /* Root node */ diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 64f8d28bdcfd..9d8fdda47cbf 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -101,6 +101,8 @@ fdesc_mount(struct mount *mp) fmp->flags = 0; if (vfs_getopt(mp->mnt_optnew, "linrdlnk", NULL, NULL) == 0) fmp->flags |= FMNT_LINRDLNKF; + if (vfs_getopt(mp->mnt_optnew, "nodup", NULL, NULL) == 0) + fmp->flags |= FMNT_NODUP; error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp); if (error) { free(fmp, M_FDESCMNT); diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 1271b50e6e94..c5a7b86f1de5 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -264,10 +264,20 @@ fdesc_get_ino_alloc(struct mount *mp, void *arg, int lkflags, struct vnode **rvp) { struct fdesc_get_ino_args *a; + struct fdescmount *fdm; + struct vnode *vp; int error; a = arg; - error = fdesc_allocvp(a->ftype, a->fd_fd, a->ix, mp, rvp); + fdm = VFSTOFDESC(mp); + if ((fdm->flags & FMNT_NODUP) != 0 && a->fp->f_type == DTYPE_VNODE) { + vp = a->fp->f_vnode; + vget(vp, lkflags | LK_RETRY); + *rvp = vp; + error = 0; + } else { + error = fdesc_allocvp(a->ftype, a->fd_fd, a->ix, mp, rvp); + } fdrop(a->fp, a->td); return (error); } From owner-dev-commits-src-all@freebsd.org Fri Jun 11 01:02:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 993136565E7; Fri, 11 Jun 2021 01:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1MyL3jxDz3Hgf; Fri, 11 Jun 2021 01:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 683A019ACA; Fri, 11 Jun 2021 01:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15B12YYO074503; Fri, 11 Jun 2021 01:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15B12YbP074502; Fri, 11 Jun 2021 01:02:34 GMT (envelope-from git) Date: Fri, 11 Jun 2021 01:02:34 GMT Message-Id: <202106110102.15B12YbP074502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 07d72396f8fb - main - tools: Remove obsolete svn information. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07d72396f8fba2d1a253149436c3f76c49e6190d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 01:02:34 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=07d72396f8fba2d1a253149436c3f76c49e6190d commit 07d72396f8fba2d1a253149436c3f76c49e6190d Author: Warner Losh AuthorDate: 2021-06-11 00:50:46 +0000 Commit: Warner Losh CommitDate: 2021-06-11 01:02:22 +0000 tools: Remove obsolete svn information. Reviewed by: jhb@ Differential Revision: https://reviews.freebsd.org/D30720 Sponsored by: Netflix --- tools/tools/git/HOWTO | 53 +---------- tools/tools/git/git-svn-init | 211 ----------------------------------------- tools/tools/git/git-svn-rebase | 57 ----------- tools/tools/git/importgit | 182 ----------------------------------- 4 files changed, 1 insertion(+), 502 deletions(-) diff --git a/tools/tools/git/HOWTO b/tools/tools/git/HOWTO index 3e95264789f0..160696c4d236 100644 --- a/tools/tools/git/HOWTO +++ b/tools/tools/git/HOWTO @@ -1,7 +1,7 @@ # $FreeBSD$ This directory contains tools intended to help committers use git when -interacting with standard FreeBSD project resources like Differential or svn. +interacting with standard FreeBSD project resources like Differential. I. arcgit @@ -113,54 +113,3 @@ commits. The intended workflow is: At this point, you are ready to commit your changes to head. The importgit script can be used to import your commits directly into git. - -II. importgit - -importgit is a script that can take a series of commits from git and commit them -to a svn repository. The script uses the git commit messages for the svn commit -message, which allows importgit to be fully automated. This does mean that once -you start importgit, it will start commit things to svn without giving any -further chance to sanity check what it's doing. - -importgit only supports importing commits that add or modify files. It does not -support importing commits that rename or delete files, to ensure that git's -rename detection heuristics do not introduce an error in the import process. -importgit also does not support importing merge commits. Only linear history -can be imported into svn. - -importgit must be run from a clean subversion checkout. You should ensure that -the working tree is up-to-date with "svn up" before running importgit. -importgit will run svn directly, so make sure that your ssh-agent is running -and has your ssh key loaded already. Run importgit as follows: - - $ importgit -r D1~..D2 -g /path/to/git/repo - -This will import every commit between D1 and D2, including both D1 and D2. The -invocation is very similar to the invocation given to arcgit but there is an -important point to note. When you rebased your commits as you followed steps 4 -and 5, the commit hashes of all of your commits changed, including C1 and C2. -You must go back and find the new commit hashes of your commits to pass to -importgit. Passing -r C1~..C2 would import your commits as they were *before* -your code review fixes were applied. - -III. git-svn-rebase - -git-svn-rebase is a script that helps you keep current when using git -plus subversion as outline in https://wiki.freebsd.org/GitWorkflow/GitSvn -since it's otherwise a pain to have many branches active. It will rebase -those branches that haven't been merged yet. Some tweaking may be needed -if you have other, weird branches in your tree (including any stable -branches). To run it just cd into the git subversion tree somewhere and -type - $ git-svn-rebase -and it will do its thing and leave the tree on the master branch. - -Your tree must be clean to start this, and while it tries to catch -some failures, not all of them have been allowed for. - -IV. git-svn-init -git-svn-init is a script that initializes the right git-svn connection as -outlined in https://wiki.freebsd.org/GitWorkflow/GitSvn. It would be a precursor -to the script git-svn-rebase. The script contains help, but generally you can -run the script with no arguments and it will attempt to set up both src and -ports repositories. diff --git a/tools/tools/git/git-svn-init b/tools/tools/git/git-svn-init deleted file mode 100755 index 3069514947f8..000000000000 --- a/tools/tools/git/git-svn-init +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/sh - -# $FreeBSD$ - -# SPDX-License-Identifier: BSD-2-Clause-FreeBSD -# -# Copyright(c) 2018 Intel Corporation. -# -# 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. - -# This is the codified version of what was/is on the wiki page for using git in -# your workflow. It sets up proper repositories, with the correct remotes. - -# Environment variables which can be overridden if desired. Not worth -# parameterizing them. -GIT_IN_PATH=$(which git) -GIT=${GIT-${GIT_IN_PATH}} - -GIT_DOCS_REPO=${GIT_DOCS_REPO-git://github.com/freebsd/freebsd-doc.git} -GIT_SVN_DOCS_ROOT_URI=${GIT_SVN_DOCS_ROOT_URI-svn.freebsd.org/doc} -GIT_SVN_DOCS_URI=${GIV_SVN_DOCS_URI-repo.freebsd.org/doc} - -GIT_PORTS_REPO=${GIT_PORTS_REPO-git://github.com/freebsd/freebsd-ports.git} -GIT_SVN_PORTS_ROOT_URI=${GIT_SVN_PORTS_ROOT_URI-svn.freebsd.org/ports} -GIT_SVN_PORTS_URI=${GIT_SVN_PORTS_URI-repo.freebsd.org/ports} - -GIT_SRC_REPO=${GIT_SRC_REPO-git://github.com/freebsd/freebsd.git} -GIT_SVN_SRC_ROOT_URI=${GIT_SVN_SRC_ROOT_URI-svn.freebsd.org/base} -GIT_SVN_SRC_URI=${GIT_SVN_SRC_URI-repo.freebsd.org/base} - -GIT_SVN_DOCS_PUSH_URI=$GIT_SVN_DOCS_URI -GIT_SVN_PORTS_PUSH_URI=$GIT_SVN_PORTS_URI -GIT_SVN_SRC_PUSH_URI=$GIT_SVN_SRC_URI - -usage() -{ - cat < -# -# 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. - -# -# simple script to keep all my branches up to date while tracking -# FreeBSD (or any upstream svn source) with git. Run it often, and it -# will rebase all the branches so they don't get too stale. -# Takes no args, and acts goofy if you have really old branches -# which is why stable/* and mfc* are excluded. Caution to should be taken -# when using this. -# - -FAIL= -echo ----------------- Checkout master for svn rebase ------------ -git checkout master -echo ----------------- Rebasing our master to svn upstream ------------ -git svn rebase -for i in $(git branch --no-merge | grep -v stable/ | grep -v mfc); do - echo ----------------- Rebasing $i to the tip of master ------------ - git rebase master $i || { - echo "****************** REBASE OF $i FAILED, ABORTING *****************" - FAIL="$FAIL $i" - git rebase --abort - } -done -echo ----------------- Checkout out master again ------------ -git checkout master -git branch -if [ -n "$FAIL" ]; then - echo Failed branches: $FAIL -fi diff --git a/tools/tools/git/importgit b/tools/tools/git/importgit deleted file mode 100755 index 5149f2d9e157..000000000000 --- a/tools/tools/git/importgit +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2015 Ryan Stone. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# $FreeBSD$ - -usage() -{ - echo "Usage: importgit <-c commit | -r c1..c2> -g /path/to/git/repo [-n]" >&2 -} - -error() -{ - local print_usage - - if [ "$1" = "-u" ] - then - shift - print_usage=1 - else - print_usage= - fi - - echo "$@" >&2 - if [ -n "$print_usage" ] - then - usage - fi - exit 1 -} - -unset git_repo range commit dry_run - -while getopts ":c:g:nr:" o -do - case "$o" in - c) - range="${OPTARG}~..${OPTARG}" - ;; - g) - git_repo=$OPTARG - ;; - n) - dry_run=1 - ;; - r) - range=$OPTARG - ;; - *) - error -u "Unrecognized argument '-$OPTARG'" - esac -done - -shift $((OPTIND - 1)) -OPTIND=1 - -if [ -n "$1" ] -then - error -u "Unrecognized argument $1" -fi - -if [ -z "$range" ] -then - error -u "-c or -r argument is mandatory" -fi - -if ! echo "$range" | egrep -qs '^[^.]+\.\.[^.]*$' -then - error -u "$range is not a range of commits. Did you mean '-c $range'?" -fi - -if [ -z "$git_repo" ] -then - error -u "-g argument is mandatory" -fi - -if ! type git > /dev/null 2> /dev/null -then - error "Install devel/git first" -fi - -GIT="git -C $git_repo" - -if ! $GIT rev-parse --git-dir 2> /dev/null > /dev/null -then - error "$git_repo does not seem to be a git repo" -fi - -if ! type svn > /dev/null 2> /dev/null -then - error "Install devel/subversion first" -fi - -if [ -n "$(svn status)" ] -then - error "Working tree is not clean" -fi - -if ! svn --non-interactive ls > /dev/null -then - error "Could not communicate with svn server. Is your ssh key loaded?" -fi - -$GIT log --format=%H $range | tail -r | while read -r commit -do - echo "Applying `$GIT show -s --oneline $commit`" - - if [ -n "$($GIT show --diff-filter=CDRTUXB $commit)" ] - then - error "Commit performed unsupported change (e.g. delete/rename)" - fi - - if [ "$($GIT show -s --format=%P $commit | wc -w)" -ne 1 ] - then - error "Cannot import merge commits" - fi - - $GIT diff --diff-filter=A --name-only \ - ${commit}~..$commit | while read -r newfile - do - if [ -f "$newfile" ] - then - error "New file $newfile already exists in tree" - fi - done - - # The previous while loop ran in a subshell, so we have to check if it - # exited with an error and bail out if so. - ret=$? - if [ "$ret" -ne 0 ] - then - exit $ret - fi - - if [ -n "$dry_run" ] - then - continue - fi - - $GIT show $commit | patch -p 1 -s || \ - error "Failed to apply patch" - - $GIT diff --diff-filter=A --name-only \ - ${commit}~..$commit | while read -r newfile - do - svn add --parents --depth=infinity $newfile || \ - error "Failed to add new file" - done - - # The previous while loop ran in a subshell, so we have to check if it - # exited with an error and bail out if so. - ret=$? - if [ "$ret" -ne 0 ] - then - exit $ret - fi - - $GIT show -s --format='%B' $commit | svn commit -F - || \ - error "Failed to commit" -done - From owner-dev-commits-src-all@freebsd.org Fri Jun 11 05:28:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12C29658EB5; Fri, 11 Jun 2021 05:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1TsB033Rz3kTP; Fri, 11 Jun 2021 05:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA9E81CD63; Fri, 11 Jun 2021 05:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15B5STZX018760; Fri, 11 Jun 2021 05:28:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15B5STns018759; Fri, 11 Jun 2021 05:28:29 GMT (envelope-from git) Date: Fri, 11 Jun 2021 05:28:29 GMT Message-Id: <202106110528.15B5STns018759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7aa2e90176ba - main - spl: Fix gcc6 build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7aa2e90176baaca3bf4a6813defeb3c4b08cac8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 05:28:30 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7aa2e90176baaca3bf4a6813defeb3c4b08cac8a commit 7aa2e90176baaca3bf4a6813defeb3c4b08cac8a Author: Warner Losh AuthorDate: 2021-06-11 03:28:52 +0000 Commit: Warner Losh CommitDate: 2021-06-11 03:28:52 +0000 spl: Fix gcc6 build -Wno-error= is only a clang flag, restrict its use to only clang. Sponsored by: Netflix --- cddl/lib/libspl/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cddl/lib/libspl/Makefile b/cddl/lib/libspl/Makefile index 59e0a7c51834..0aac141301e4 100644 --- a/cddl/lib/libspl/Makefile +++ b/cddl/lib/libspl/Makefile @@ -1,9 +1,11 @@ # $FreeBSD$ +.include +.include + .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl .PATH: ${SRCTOP}/sys/contrib/openzfs/include - LIB= spl LIBADD= PACKAGE= runtime @@ -41,6 +43,8 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +.if ${COMPILER_TYPE} == "clang" CFLAGS.atomic.c+= -Wno-error=atomic-alignment +.endif .include From owner-dev-commits-src-all@freebsd.org Fri Jun 11 08:06:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99B1565B01B; Fri, 11 Jun 2021 08:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1YM53l7Sz3vrc; Fri, 11 Jun 2021 08:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 698451F40A; Fri, 11 Jun 2021 08:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15B869VL030860; Fri, 11 Jun 2021 08:06:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15B869Cf030859; Fri, 11 Jun 2021 08:06:09 GMT (envelope-from git) Date: Fri, 11 Jun 2021 08:06:09 GMT Message-Id: <202106110806.15B869Cf030859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 224cf7b35b9b - main - tcp: fix compilation of IPv4-only builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 224cf7b35b9bbe8d075f6004249d850c620b7855 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 08:06:09 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=224cf7b35b9bbe8d075f6004249d850c620b7855 commit 224cf7b35b9bbe8d075f6004249d850c620b7855 Author: Michael Tuexen AuthorDate: 2021-06-11 07:50:46 +0000 Commit: Michael Tuexen CommitDate: 2021-06-11 07:50:46 +0000 tcp: fix compilation of IPv4-only builds PR: 256538 Reported by: iron.udjin@gmail.com MFC after: 3 days Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/rack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 5227ea59ba23..6ce866b77450 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -17677,9 +17677,11 @@ send: th = rack->r_ctl.fsb.th; udp = rack->r_ctl.fsb.udp; if (udp) { +#ifdef INET6 if (isipv6) ulen = hdrlen + len - sizeof(struct ip6_hdr); else +#endif /* INET6 */ ulen = hdrlen + len - sizeof(struct ip); udp->uh_ulen = htons(ulen); } From owner-dev-commits-src-all@freebsd.org Fri Jun 11 11:08:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59B6B65CE62; Fri, 11 Jun 2021 11:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1dPR1rs4z4kk8; Fri, 11 Jun 2021 11:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23DFF2199D; Fri, 11 Jun 2021 11:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BB8RFG071726; Fri, 11 Jun 2021 11:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BB8QdB071725; Fri, 11 Jun 2021 11:08:27 GMT (envelope-from git) Date: Fri, 11 Jun 2021 11:08:27 GMT Message-Id: <202106111108.15BB8QdB071725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: a7cf31da5a29 - main - Add new USB ID to u3g(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7cf31da5a29a762848c367aced61910efda95c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 11:08:27 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=a7cf31da5a29a762848c367aced61910efda95c1 commit a7cf31da5a29a762848c367aced61910efda95c1 Author: Hans Petter Selasky AuthorDate: 2021-06-11 10:53:22 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-11 11:05:58 +0000 Add new USB ID to u3g(4). Submitted by: pierre-jean.gineste@nuabee.fr PR: 231909 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/serial/u3g.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index fcff316d8d3a..8cc468dec880 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -245,6 +245,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(HP, HS2300, 0), U3G_DEV(HP, UN2420_QDL, 0), U3G_DEV(HP, UN2420, 0), + U3G_DEV(HP, LT4132, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, E1401, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1402, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1403, U3GINIT_HUAWEI), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 5e6a1db31650..53e074d3fd61 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2447,6 +2447,7 @@ product HP HN210E 0x811c Ethernet HN210E product HP2 C500 0x6002 PhotoSmart C500 product HP EV2200 0x1b1d ev2200 HSDPA (aka MC5720) product HP HS2300 0x1e1d hs2300 HSDPA (aka MC8775) +product HP LT4132 0xa31d lt4132 LTEHSPA+ (aka ME906s) /* HTC products */ product HTC WINMOBILE 0x00ce HTC USB Sync From owner-dev-commits-src-all@freebsd.org Fri Jun 11 13:40:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F075E65F388; Fri, 11 Jun 2021 13:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1hn56T1mz3FMc; Fri, 11 Jun 2021 13:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5C1D23B20; Fri, 11 Jun 2021 13:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BDefGG077898; Fri, 11 Jun 2021 13:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BDefYe077897; Fri, 11 Jun 2021 13:40:41 GMT (envelope-from git) Date: Fri, 11 Jun 2021 13:40:41 GMT Message-Id: <202106111340.15BDefYe077897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: fa3746be4203 - main - tcp: fix two bugs in new reno MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa3746be4203fc9a3414afb21d964eec8bad74f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 13:40:42 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fa3746be4203fc9a3414afb21d964eec8bad74f8 commit fa3746be4203fc9a3414afb21d964eec8bad74f8 Author: Michael Tuexen AuthorDate: 2021-06-11 13:37:39 +0000 Commit: Michael Tuexen CommitDate: 2021-06-11 13:40:34 +0000 tcp: fix two bugs in new reno * Completely initialise the CC module specific data * Use beta_ecn in case of an ECN event whenever ABE is enabled or it is requested by the stack. Reviewed by: rscheff, rrs MFC after: 3 days Sponsored by: Netflix, Inc. --- sys/netinet/cc/cc_newreno.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 8f8ca953169e..8f939ad70695 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -111,6 +111,7 @@ newreno_malloc(struct cc_var *ccv) /* NB: nreno is not zeroed, so initialise all fields. */ nreno->beta = V_newreno_beta; nreno->beta_ecn = V_newreno_beta_ecn; + nreno->newreno_flags = 0; ccv->cc_data = nreno; } @@ -254,8 +255,9 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) * has set a flag in our newreno_flags (due to pacing) telling * us to use the lower valued back-off. */ - if (V_cc_do_abe || - (nreno && (nreno->newreno_flags & CC_NEWRENO_BETA_ECN) && (type == CC_ECN))) + if ((type == CC_ECN) && + (V_cc_do_abe || + ((nreno != NULL) && (nreno->newreno_flags & CC_NEWRENO_BETA_ECN)))) factor = beta_ecn; else factor = beta; From owner-dev-commits-src-all@freebsd.org Fri Jun 11 14:18:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BD1765FA95; Fri, 11 Jun 2021 14:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1jc92qqwz3LkC; Fri, 11 Jun 2021 14:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4591F242C6; Fri, 11 Jun 2021 14:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BEI1DN023096; Fri, 11 Jun 2021 14:18:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BEI1LZ023095; Fri, 11 Jun 2021 14:18:01 GMT (envelope-from git) Date: Fri, 11 Jun 2021 14:18:01 GMT Message-Id: <202106111418.15BEI1LZ023095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: ca81bcbbf118 - stable/13 - Add missing chunks after cherry-picking 9ca874cf740ee68c5742df8b5f9e20910085c011 from main to stable/13: Add TCP LRO support for VLAN and VxLAN. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca81bcbbf1182b725d2f7c1eada932731a9d6432 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 14:18:01 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ca81bcbbf1182b725d2f7c1eada932731a9d6432 commit ca81bcbbf1182b725d2f7c1eada932731a9d6432 Author: Hans Petter Selasky AuthorDate: 2021-06-11 13:48:28 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-11 13:51:05 +0000 Add missing chunks after cherry-picking 9ca874cf740ee68c5742df8b5f9e20910085c011 from main to stable/13: Add TCP LRO support for VLAN and VxLAN. Make sure all counters are allocated. This is a direct commit. Reported by: Herbert J. Skuhra Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/tcp_subr.c | 4 ++++ sys/netinet/tcp_var.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index bb2c35c76fde..ec162d889902 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1509,6 +1509,10 @@ tcp_init(void) tcp_inp_lro_wokeup_queue = counter_u64_alloc(M_WAITOK); tcp_inp_lro_compressed = counter_u64_alloc(M_WAITOK); tcp_inp_lro_locks_taken = counter_u64_alloc(M_WAITOK); + tcp_extra_mbuf = counter_u64_alloc(M_WAITOK); + tcp_would_have_but = counter_u64_alloc(M_WAITOK); + tcp_comp_total = counter_u64_alloc(M_WAITOK); + tcp_uncomp_total = counter_u64_alloc(M_WAITOK); #ifdef TCPPCAP tcp_pcap_init(); #endif diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 7b51afbb42b6..1858d0146ce5 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1010,6 +1010,10 @@ extern counter_u64_t tcp_inp_lro_direct_queue; extern counter_u64_t tcp_inp_lro_wokeup_queue; extern counter_u64_t tcp_inp_lro_compressed; extern counter_u64_t tcp_inp_lro_locks_taken; +extern counter_u64_t tcp_extra_mbuf; +extern counter_u64_t tcp_would_have_but; +extern counter_u64_t tcp_comp_total; +extern counter_u64_t tcp_uncomp_total; #ifdef NETFLIX_EXP_DETECTION /* Various SACK attack thresholds */ From owner-dev-commits-src-all@freebsd.org Fri Jun 11 15:07:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84B6D660714; Fri, 11 Jun 2021 15:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1kjf3PJhz3jRK; Fri, 11 Jun 2021 15:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CCB72501B; Fri, 11 Jun 2021 15:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BF7ouU090321; Fri, 11 Jun 2021 15:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BF7oRL090320; Fri, 11 Jun 2021 15:07:50 GMT (envelope-from git) Date: Fri, 11 Jun 2021 15:07:50 GMT Message-Id: <202106111507.15BF7oRL090320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 6847ea50196f - main - Improve handling of USB device re-open in the LibUSB v1.x API. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6847ea50196f1a685be408a24f01cb8d407da19c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 15:07:50 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=6847ea50196f1a685be408a24f01cb8d407da19c commit 6847ea50196f1a685be408a24f01cb8d407da19c Author: Hans Petter Selasky AuthorDate: 2021-06-11 15:06:10 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-11 15:06:44 +0000 Improve handling of USB device re-open in the LibUSB v1.x API. Make sure the "device_is_gone" flag is cleared after every successful open, so that the "device_is_gone" flag doesn't persist forever. Found by: sergii.dmytruk@3mdeb.com PR: 256296 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- lib/libusb/libusb10.c | 9 +++++++++ lib/libusb/libusb10_io.c | 12 ++++++++++-- lib/libusb/libusb20.c | 5 +++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 1c45b87d8f0b..ffe0cf3f366a 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -529,6 +529,15 @@ libusb_open(libusb_device *dev, libusb_device_handle **devh) libusb_unref_device(dev); return (LIBUSB_ERROR_NO_MEM); } + + /* + * Clear the device gone flag, in case the device was opened + * after a re-attach, to allow new transaction: + */ + CTX_LOCK(ctx); + dev->device_is_gone = 0; + CTX_UNLOCK(ctx); + libusb10_add_pollfd(ctx, &dev->dev_poll, pdev, libusb20_dev_get_fd(pdev), POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM); diff --git a/lib/libusb/libusb10_io.c b/lib/libusb/libusb10_io.c index 53f5b040436d..0e32fc31c8e0 100644 --- a/lib/libusb/libusb10_io.c +++ b/lib/libusb/libusb10_io.c @@ -165,8 +165,16 @@ libusb10_handle_events_sub(struct libusb_context *ctx, struct timeval *tv) err = libusb20_dev_process(ppdev[i]); if (err) { - /* set device is gone */ - dev->device_is_gone = 1; + /* + * When the device is opened + * set the "device_is_gone" + * flag. This prevents the + * client from submitting new + * USB transfers to a detached + * device. + */ + if (ppdev[i]->is_opened) + dev->device_is_gone = 1; /* remove USB device from polling loop */ libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c index 6c2bf721bea9..4323552b83ad 100644 --- a/lib/libusb/libusb20.c +++ b/lib/libusb/libusb20.c @@ -608,6 +608,11 @@ libusb20_dev_close(struct libusb20_device *pdev) pdev->is_opened = 0; + /* + * Make sure libusb20_tr_get_pointer() fails: + */ + pdev->nTransfer = 0; + /* * The following variable is only used by the libusb v0.1 * compat layer: From owner-dev-commits-src-all@freebsd.org Fri Jun 11 15:40:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27E4D660CC8; Fri, 11 Jun 2021 15:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1lRV0QFsz3mbQ; Fri, 11 Jun 2021 15:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAA84255AF; Fri, 11 Jun 2021 15:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BFebi1038938; Fri, 11 Jun 2021 15:40:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BFebVe038937; Fri, 11 Jun 2021 15:40:37 GMT (envelope-from git) Date: Fri, 11 Jun 2021 15:40:37 GMT Message-Id: <202106111540.15BFebVe038937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: ba1b3e48f5be - main - tcp: Missing mfree in rack and bbr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba1b3e48f5be320f0590bc357ea53fdc3e4edc65 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 15:40:38 -0000 The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=ba1b3e48f5be320f0590bc357ea53fdc3e4edc65 commit ba1b3e48f5be320f0590bc357ea53fdc3e4edc65 Author: Randall Stewart AuthorDate: 2021-06-11 15:38:08 +0000 Commit: Randall Stewart CommitDate: 2021-06-11 15:38:08 +0000 tcp: Missing mfree in rack and bbr Recently (Nov) we added logic that protects against a peer negotiating a timestamp, and then not including a timestamp. This involved in the input path doing a goto done_with_input label. Now I suspect the code was cribbed from one in Rack that has to do with the SYN. This had a bug, i.e. it should have a m_freem(m) before going to the label (bbr had this missing m_freem() but rack did not). This then caused the missing m_freem to show up in both BBR and Rack. Also looking at the code referencing m->m_pkthdr.lro_nsegs later (after processing) is not a good idea, even though its only for logging. Best to copy that off before any frees can take place. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30727 --- sys/netinet/tcp_stacks/bbr.c | 1 + sys/netinet/tcp_stacks/rack.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index d5da2d33c18f..57abbbf694b6 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -11441,6 +11441,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS) && ((thflags & TH_RST) == 0) && (V_tcp_tolerate_missing_ts == 0)) { retval = 0; + m_freem(m); goto done_with_input; } /* diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 6ce866b77450..e5926eaf6171 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -13454,6 +13454,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, #ifdef TCP_ACCOUNTING int ack_val_set = 0xf; #endif + int nsegs; uint32_t us_cts; /* * tv passed from common code is from either M_TSTMP_LRO or @@ -13465,6 +13466,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, if (m->m_flags & M_ACKCMP) { panic("Impossible reach m has ackcmp? m:%p tp:%p", m, tp); } + nsegs = m->m_pkthdr.lro_nsegs; counter_u64_add(rack_proc_non_comp_ack, 1); thflags = th->th_flags; #ifdef TCP_ACCOUNTING @@ -13607,6 +13609,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { way_out = 4; retval = 0; + m_freem(m); goto done_with_input; } /* @@ -13641,6 +13644,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, ((thflags & TH_RST) == 0) && (V_tcp_tolerate_missing_ts == 0)) { way_out = 5; retval = 0; + m_freem(m); goto done_with_input; } @@ -13944,7 +13948,7 @@ do_output_now: way_out = 2; } done_with_input: - rack_log_doseg_done(rack, cts, nxt_pkt, did_out, way_out, max(1, m->m_pkthdr.lro_nsegs)); + rack_log_doseg_done(rack, cts, nxt_pkt, did_out, way_out, max(1, nsegs)); if (did_out) rack->r_wanted_output = 0; #ifdef INVARIANTS From owner-dev-commits-src-all@freebsd.org Fri Jun 11 15:51:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0180F660E9C; Fri, 11 Jun 2021 15:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1lhR6hTPz3nmc; Fri, 11 Jun 2021 15:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDFFA255F7; Fri, 11 Jun 2021 15:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BFppix055404; Fri, 11 Jun 2021 15:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BFpp8j055403; Fri, 11 Jun 2021 15:51:51 GMT (envelope-from git) Date: Fri, 11 Jun 2021 15:51:51 GMT Message-Id: <202106111551.15BFpp8j055403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 89d5cbb82294 - main - libnv: optimize nvlist size calculation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89d5cbb82294c8624e66f920d50353057ccab14b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 15:51:52 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=89d5cbb82294c8624e66f920d50353057ccab14b commit 89d5cbb82294c8624e66f920d50353057ccab14b Author: Mariusz Zaborski AuthorDate: 2021-06-11 15:35:36 +0000 Commit: Mariusz Zaborski CommitDate: 2021-06-11 15:51:29 +0000 libnv: optimize nvlist size calculation If we had a multiple nvlist, during nvlist_pack, we calculated the size of every nvlist separately. For example, if we had a nvlist with three nodes each containing another (A contains B, and B contains C), we first calculated the size of nvlist A (which contains B, C), then we calculate the size of B (which contains C, notice that we already did the calculation of B, when we calculate A), and finally C. This means that this calculation was O(N!). This was done because each time we pack nvlist, we have to put its size in the header (the separate header for A, B, and C). To not break the ABI and to reduce the complexity of nvlist_size, instead of calculating the nvlist size when requested, we track the size of each nvlist. Reported by: pjd, kp Tested by: kp --- sys/contrib/libnv/nvlist.c | 124 +++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 71 deletions(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 311325d822ce..31ab62abeb67 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -99,6 +99,7 @@ struct nvlist { int nvl_magic; int nvl_error; int nvl_flags; + size_t nvl_datasize; nvpair_t *nvl_parent; nvpair_t *nvl_array_next; struct nvl_head nvl_head; @@ -139,6 +140,7 @@ nvlist_create(int flags) nvl->nvl_flags = flags; nvl->nvl_parent = NULL; nvl->nvl_array_next = NULL; + nvl->nvl_datasize = sizeof(struct nvlist_header); TAILQ_INIT(&nvl->nvl_head); nvl->nvl_magic = NVLIST_MAGIC; @@ -247,6 +249,51 @@ nvlist_set_array_next(nvlist_t *nvl, nvpair_t *ele) nvl->nvl_array_next = ele; } +static void +nvlist_update_size(nvlist_t *nvl, nvpair_t *new, ssize_t mul) +{ + ssize_t size; + size_t nitems; + const nvlist_t *nvlistnew; + const nvlist_t * const *nvlarray; + nvlist_t *parent; + unsigned int ii; + + NVLIST_ASSERT(nvl); + NVPAIR_ASSERT(new); + PJDLOG_ASSERT(mul == 1 || mul == -1); + + size = nvpair_header_size(); + size += strlen(nvpair_name(new)) + 1; + + if (nvpair_type(new) == NV_TYPE_NVLIST) { + nvlistnew = nvpair_get_nvlist(new); + size += nvlistnew->nvl_datasize; + size += nvpair_header_size() + 1; + } else if (nvpair_type(new) == NV_TYPE_NVLIST_ARRAY) { + nvlarray = nvpair_get_nvlist_array(new, &nitems); + PJDLOG_ASSERT(nitems > 0); + + size += (nvpair_header_size() + 1) * nitems; + for (ii = 0; ii < nitems; ii++) { + PJDLOG_ASSERT(nvlarray[ii]->nvl_error == 0); + size += nvlarray[ii]->nvl_datasize; + } + } else { + size += nvpair_size(new); + } + + size *= mul; + + nvl->nvl_datasize += size; + + parent = nvl; + while ((parent = __DECONST(nvlist_t *, + nvlist_get_parent(parent, NULL))) != NULL) { + parent->nvl_datasize += size; + } +} + nvpair_t * nvlist_get_array_next_nvpair(nvlist_t *nvl) { @@ -640,78 +687,8 @@ nvlist_fdump(const nvlist_t *nvl, FILE *fp) size_t nvlist_size(const nvlist_t *nvl) { - const nvlist_t *tmpnvl; - const nvlist_t * const *nvlarray; - const nvpair_t *nvp, *tmpnvp; - void *cookie; - size_t size, nitems; - unsigned int ii; - - NVLIST_ASSERT(nvl); - PJDLOG_ASSERT(nvl->nvl_error == 0); - size = sizeof(struct nvlist_header); - nvp = nvlist_first_nvpair(nvl); - while (nvp != NULL) { - size += nvpair_header_size(); - size += strlen(nvpair_name(nvp)) + 1; - if (nvpair_type(nvp) == NV_TYPE_NVLIST) { - size += sizeof(struct nvlist_header); - size += nvpair_header_size() + 1; - tmpnvl = nvpair_get_nvlist(nvp); - PJDLOG_ASSERT(tmpnvl->nvl_error == 0); - tmpnvp = nvlist_first_nvpair(tmpnvl); - if (tmpnvp != NULL) { - nvl = tmpnvl; - nvp = tmpnvp; - continue; - } - } else if (nvpair_type(nvp) == NV_TYPE_NVLIST_ARRAY) { - nvlarray = nvpair_get_nvlist_array(nvp, &nitems); - PJDLOG_ASSERT(nitems > 0); - - size += (nvpair_header_size() + 1) * nitems; - size += sizeof(struct nvlist_header) * nitems; - - tmpnvl = NULL; - tmpnvp = NULL; - for (ii = 0; ii < nitems; ii++) { - PJDLOG_ASSERT(nvlarray[ii]->nvl_error == 0); - tmpnvp = nvlist_first_nvpair(nvlarray[ii]); - if (tmpnvp != NULL) { - tmpnvl = nvlarray[ii]; - break; - } - } - if (tmpnvp != NULL) { - nvp = tmpnvp; - nvl = tmpnvl; - continue; - } - - } else { - size += nvpair_size(nvp); - } - - while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { - do { - cookie = NULL; - nvl = nvlist_get_pararr(nvl, &cookie); - if (nvl == NULL) - goto out; - if (nvlist_in_array(nvl) && cookie == NULL) { - nvp = nvlist_first_nvpair(nvl); - } else { - nvp = cookie; - } - } while (nvp == NULL); - if (nvlist_in_array(nvl) && cookie == NULL) - break; - } - } - -out: - return (size); + return (nvl->nvl_datasize); } #ifndef _KERNEL @@ -1483,6 +1460,7 @@ nvlist_add_nvpair(nvlist_t *nvl, const nvpair_t *nvp) } nvpair_insert(&nvl->nvl_head, newnvp, nvl); + nvlist_update_size(nvl, newnvp, 1); } void @@ -1631,10 +1609,12 @@ nvlist_append_##type##_array(nvlist_t *nvl, const char *name, vtype value)\ nvlist_add_##type##_array(nvl, name, &value, 1); \ return; \ } \ + nvlist_update_size(nvl, nvp, -1); \ if (nvpair_append_##type##_array(nvp, value) == -1) { \ nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); \ ERRNO_SET(nvl->nvl_error); \ } \ + nvlist_update_size(nvl, nvp, 1); \ } NVLIST_APPEND_ARRAY(const bool, bool, BOOL) @@ -1669,6 +1649,7 @@ nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp) } nvpair_insert(&nvl->nvl_head, nvp, nvl); + nvlist_update_size(nvl, nvp, 1); return (true); } @@ -2020,6 +2001,7 @@ nvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *nvp) PJDLOG_ASSERT(nvpair_nvlist(nvp) == nvl); nvpair_remove(&nvl->nvl_head, nvp, nvl); + nvlist_update_size(nvl, nvp, -1); } void From owner-dev-commits-src-all@freebsd.org Fri Jun 11 16:53:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F4074661259; Fri, 11 Jun 2021 16:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1n466Zfjz3sJN; Fri, 11 Jun 2021 16:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAD232675D; Fri, 11 Jun 2021 16:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BGrwX0035419; Fri, 11 Jun 2021 16:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BGrwwG035418; Fri, 11 Jun 2021 16:53:58 GMT (envelope-from git) Date: Fri, 11 Jun 2021 16:53:58 GMT Message-Id: <202106111653.15BGrwwG035418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 157a960058c2 - stable/13 - fsck_ffs(8): fix divide by zero when debug messages are enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 157a960058c221bda068c902ba9ccf216fa2fbaa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 16:53:59 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=157a960058c221bda068c902ba9ccf216fa2fbaa commit 157a960058c221bda068c902ba9ccf216fa2fbaa Author: Robert Wing AuthorDate: 2021-05-20 20:53:52 +0000 Commit: Robert Wing CommitDate: 2021-06-11 16:44:29 +0000 fsck_ffs(8): fix divide by zero when debug messages are enabled Only print buffer cache debug message when a cache lookup has been done. When running `fsck_ffs -d` on a gjournal'ed filesystem, it's possible that totalreads is greater than zero when no cache lookup has been done - causing a divide by zero. This commit fixes the following error: Floating point exception (core dumped) Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D30370 (cherry picked from commit 20123b25ee51e9b122676a30d45c21a506bf1461) --- sbin/fsck_ffs/fsutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index b13ba4c54bde..db22ee5b20cf 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -576,7 +576,7 @@ ckfini(int markclean) rerun = 1; } } - if (debug && totalreads > 0) + if (debug && cachelookups > 0) printf("cache with %d buffers missed %d of %d (%d%%)\n", numbufs, cachereads, cachelookups, (int)(cachereads * 100 / cachelookups)); From owner-dev-commits-src-all@freebsd.org Fri Jun 11 16:54:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43F15661B03; Fri, 11 Jun 2021 16:54:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1n4g1Mx7z3sM0; Fri, 11 Jun 2021 16:54:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1733A26699; Fri, 11 Jun 2021 16:54:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BGsRqT035568; Fri, 11 Jun 2021 16:54:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BGsQNi035567; Fri, 11 Jun 2021 16:54:26 GMT (envelope-from git) Date: Fri, 11 Jun 2021 16:54:26 GMT Message-Id: <202106111654.15BGsQNi035567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ab6145c97683 - main - style: tweak tab after #define advice MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab6145c976833e4363f430143a16451b57cbf621 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 16:54:27 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ab6145c976833e4363f430143a16451b57cbf621 commit ab6145c976833e4363f430143a16451b57cbf621 Author: Warner Losh AuthorDate: 2021-06-11 16:33:04 +0000 Commit: Warner Losh CommitDate: 2021-06-11 16:54:06 +0000 style: tweak tab after #define advice Once upon a time, #define was cultural thing. However, even when it was promulgated, it was a minority usage. 20 years ago the split was 30k/69k (tab/space) and today the split is 80k/546k (tab/space). Update guidance to allow either with the usual suggestion to be consistent within a file. Reviewed by: sef, allenjude, 0mp (prior rev), jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30254 --- share/man/man9/style.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 10ca64cde817..9744b1c11a45 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -215,9 +215,9 @@ macros (ones that have side effects), and the names of macros for manifest constants, are all in uppercase. The expansions of expression-like macros are either a single token or have outer parentheses. -Put a single tab character between the +Put a single space or tab character between the .Ic #define -and the macro name. +and the macro name, but be consistent within a file. If a macro is an inline expansion of a function, the function name is all in lowercase and the macro has the same name all in uppercase. .\" XXX the above conflicts with ANSI style where the names are the From owner-dev-commits-src-all@freebsd.org Fri Jun 11 16:54:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 723AB661A94; Fri, 11 Jun 2021 16:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1n4h2cB6z3sXH; Fri, 11 Jun 2021 16:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39FC6265FB; Fri, 11 Jun 2021 16:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BGsSkh035592; Fri, 11 Jun 2021 16:54:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BGsS1u035591; Fri, 11 Jun 2021 16:54:28 GMT (envelope-from git) Date: Fri, 11 Jun 2021 16:54:28 GMT Message-Id: <202106111654.15BGsS1u035591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a3238e92d704 - main - style: Relax 80 column rule MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3238e92d704e84e70cc696a1cd2219fa4e4aa9e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 16:54:28 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a3238e92d704e84e70cc696a1cd2219fa4e4aa9e commit a3238e92d704e84e70cc696a1cd2219fa4e4aa9e Author: Warner Losh AuthorDate: 2021-06-11 16:37:36 +0000 Commit: Warner Losh CommitDate: 2021-06-11 16:54:06 +0000 style: Relax 80 column rule Note that the 80 column rule has been relaxed for some time when things are clearer when a little longer. Add in that things that people grep for, such as error messages, shouldn't be broken up which is the most common reason people exceed 80 columns intentionally. Reviewed by: jhb, domagoj.stolfa@gmail.com Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30255 --- share/man/man9/style.9 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 9744b1c11a45..77c8dbe8e7d7 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -36,6 +36,10 @@ This file specifies the preferred style for kernel source files in the .Fx source tree. It is also a guide for the preferred userland code style. +The preferred line width is 80 characters, but some exceptions are +made when a slightly longer line is clearer or easier to read. +Anything that is frequently grepped for, such as diagnostic, error or panic +messages, should not be broken up over multiple lines despite this rule. Many of the style rules are implicit in the examples. Be careful to check the examples before assuming that .Nm From owner-dev-commits-src-all@freebsd.org Fri Jun 11 16:59:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 120FC6617EF; Fri, 11 Jun 2021 16:59:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1nBW017Mz3tJK; Fri, 11 Jun 2021 16:59:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCFEC2663F; Fri, 11 Jun 2021 16:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BGxUHX036078; Fri, 11 Jun 2021 16:59:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BGxUwn036077; Fri, 11 Jun 2021 16:59:30 GMT (envelope-from git) Date: Fri, 11 Jun 2021 16:59:30 GMT Message-Id: <202106111659.15BGxUwn036077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 47ec64b3e801 - stable/13 - fsck_ufs: fix segfault with gjournal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 47ec64b3e801cbb793ccff49d21bc8eeb219ad9f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 16:59:31 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=47ec64b3e801cbb793ccff49d21bc8eeb219ad9f commit 47ec64b3e801cbb793ccff49d21bc8eeb219ad9f Author: Robert Wing AuthorDate: 2021-06-03 01:41:31 +0000 Commit: Robert Wing CommitDate: 2021-06-11 16:56:00 +0000 fsck_ufs: fix segfault with gjournal The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.c) while attempting to traverse the buffer cache. The tail queue used for the buffer cache was not initialized before dropping into gjournal_check(). Initialize the buffer cache before calling gjournal_check(). PR: 245907 Reviewed by: jhb, mckusick Differential Revision: https://reviews.freebsd.org/D30537 (cherry picked from commit 441e69e419effac0225a45f4cdb948280b8ce5ab) --- sbin/fsck_ffs/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 401ee10f9be3..67aff2dde73c 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -309,6 +309,7 @@ checkfilesys(char *filesys) exit(0); } if ((sblock.fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) == 0) { + bufinit(); gjournal_check(filesys); if (chkdoreload(mntp) == 0) exit(0); From owner-dev-commits-src-all@freebsd.org Fri Jun 11 17:58:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1D976626E8; Fri, 11 Jun 2021 17:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1pVc4jV9z4Rjs; Fri, 11 Jun 2021 17:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A2DF26FE7; Fri, 11 Jun 2021 17:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BHwWc5015735; Fri, 11 Jun 2021 17:58:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BHwWbM015734; Fri, 11 Jun 2021 17:58:32 GMT (envelope-from git) Date: Fri, 11 Jun 2021 17:58:32 GMT Message-Id: <202106111758.15BHwWbM015734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 01cf73198d1e - stable/13 - bectl(8): don't allow creation of boot environments with spaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 01cf73198d1e0b3d00f9bb75027e75327c2c5b9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 17:58:32 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=01cf73198d1e0b3d00f9bb75027e75327c2c5b9b commit 01cf73198d1e0b3d00f9bb75027e75327c2c5b9b Author: Robert Wing AuthorDate: 2021-06-03 16:36:11 +0000 Commit: Robert Wing CommitDate: 2021-06-11 17:28:41 +0000 bectl(8): don't allow creation of boot environments with spaces Boot environment datasets that contain spaces are not bootable. When a user attempts to create a boot environment with a space, abort the creation and print an error message. PR: 254441 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D30194 (cherry picked from commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a) --- sbin/bectl/bectl.c | 9 ++++++++- sbin/bectl/tests/bectl_test.sh | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index 50229b4b96b7..d3de58ea2982 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -233,7 +233,10 @@ bectl_cmd_create(int argc, char *argv[]) bootenv = *argv; err = BE_ERR_SUCCESS; - if ((atpos = strchr(bootenv, '@')) != NULL) { + if (strchr(bootenv, ' ') != NULL) + /* BE datasets with spaces are not bootable */ + err = BE_ERR_INVALIDNAME; + else if ((atpos = strchr(bootenv, '@')) != NULL) { /* * This is the "create a snapshot variant". No new boot * environment is to be created here. @@ -261,6 +264,10 @@ bectl_cmd_create(int argc, char *argv[]) switch (err) { case BE_ERR_SUCCESS: break; + case BE_ERR_INVALIDNAME: + fprintf(stderr, + "bectl create: boot environment name must not contain spaces\n"); + break; default: if (atpos != NULL) fprintf(stderr, diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 221fe21e29ed..b101591c3ee9 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -122,6 +122,10 @@ bectl_create_body() atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ ${zpool}/ROOT/default/usr + # BE datasets with spaces are not bootable, PR 254441. + atf_check -e not-empty -s not-exit:0 \ + bectl -r ${zpool}/ROOT create "foo bar" + # Test standard creation, creation of a snapshot, and creation from a # snapshot. atf_check bectl -r ${zpool}/ROOT create -e default default2 From owner-dev-commits-src-all@freebsd.org Fri Jun 11 18:03:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CAFB662786; Fri, 11 Jun 2021 18:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1pbv30Pjz4S8s; Fri, 11 Jun 2021 18:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EF522734B; Fri, 11 Jun 2021 18:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BI37ps029198; Fri, 11 Jun 2021 18:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BI37TY029197; Fri, 11 Jun 2021 18:03:07 GMT (envelope-from git) Date: Fri, 11 Jun 2021 18:03:07 GMT Message-Id: <202106111803.15BI37TY029197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: e1dfdff10967 - stable/12 - bectl(8): don't allow creation of boot environments with spaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1dfdff10967d294f8c9acb22812380901be3f80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 18:03:07 -0000 The branch stable/12 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=e1dfdff10967d294f8c9acb22812380901be3f80 commit e1dfdff10967d294f8c9acb22812380901be3f80 Author: Robert Wing AuthorDate: 2021-06-03 16:36:11 +0000 Commit: Robert Wing CommitDate: 2021-06-11 17:41:51 +0000 bectl(8): don't allow creation of boot environments with spaces Boot environment datasets that contain spaces are not bootable. When a user attempts to create a boot environment with a space, abort the creation and print an error message. PR: 254441 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D30194 (cherry picked from commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a) --- sbin/bectl/bectl.c | 9 ++++++++- sbin/bectl/tests/bectl_test.sh | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index 768d1cd89ac2..0c8b9c313488 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -217,7 +217,10 @@ bectl_cmd_create(int argc, char *argv[]) bootenv = *argv; err = BE_ERR_SUCCESS; - if ((atpos = strchr(bootenv, '@')) != NULL) { + if (strchr(bootenv, ' ') != NULL) + /* BE datasets with spaces are not bootable */ + err = BE_ERR_INVALIDNAME; + else if ((atpos = strchr(bootenv, '@')) != NULL) { /* * This is the "create a snapshot variant". No new boot * environment is to be created here. @@ -245,6 +248,10 @@ bectl_cmd_create(int argc, char *argv[]) switch (err) { case BE_ERR_SUCCESS: break; + case BE_ERR_INVALIDNAME: + fprintf(stderr, + "bectl create: boot environment name must not contain spaces\n"); + break; default: if (atpos != NULL) fprintf(stderr, diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 4a3fc78db0bc..c23cde13adb5 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -105,6 +105,10 @@ bectl_create_body() atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ ${zpool}/ROOT/default/usr + # BE datasets with spaces are not bootable, PR 254441. + atf_check -e not-empty -s not-exit:0 \ + bectl -r ${zpool}/ROOT create "foo bar" + # Test standard creation, creation of a snapshot, and creation from a # snapshot. atf_check bectl -r ${zpool}/ROOT create -e default default2 From owner-dev-commits-src-all@freebsd.org Fri Jun 11 18:23:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 624FA662C88; Fri, 11 Jun 2021 18:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1q3m2LJVz4TKQ; Fri, 11 Jun 2021 18:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39037275E7; Fri, 11 Jun 2021 18:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BINmFI056485; Fri, 11 Jun 2021 18:23:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BINmMD056484; Fri, 11 Jun 2021 18:23:48 GMT (envelope-from git) Date: Fri, 11 Jun 2021 18:23:48 GMT Message-Id: <202106111823.15BINmMD056484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: f1536bb53898 - main - tcp: remove debug output from RACK MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1536bb53898b12e2d19938f8fe2d04b5e5d12a6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 18:23:48 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f1536bb53898b12e2d19938f8fe2d04b5e5d12a6 commit f1536bb53898b12e2d19938f8fe2d04b5e5d12a6 Author: Michael Tuexen AuthorDate: 2021-06-11 13:43:38 +0000 Commit: Michael Tuexen CommitDate: 2021-06-11 18:23:39 +0000 tcp: remove debug output from RACK Reported by: iron.udjin@gmail.com, Marek Zarychta Reviewed by: rrs PR: 256538 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30723 Sponsored by: Netflix, Inc. --- sys/netinet/tcp_stacks/rack.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index e5926eaf6171..e37eedec460a 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -589,8 +589,6 @@ rack_set_cc_pacing(struct tcp_rack *rack) rack->rc_pacing_cc_set = 1; if (strcmp(tp->cc_algo->name, CCALGONAME_NEWRENO) != 0) { /* Not new-reno we can't play games with beta! */ - printf("cc_algo:%s is not NEWRENO:%s\n", - tp->cc_algo->name, CCALGONAME_NEWRENO); goto out; } ptr = ((struct newreno *)tp->ccv->cc_data); From owner-dev-commits-src-all@freebsd.org Fri Jun 11 18:26:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7FEC662DC3; Fri, 11 Jun 2021 18:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1q6c4Qp3z4THY; Fri, 11 Jun 2021 18:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80C5027BDA; Fri, 11 Jun 2021 18:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BIQGM8056781; Fri, 11 Jun 2021 18:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BIQGRY056780; Fri, 11 Jun 2021 18:26:16 GMT (envelope-from git) Date: Fri, 11 Jun 2021 18:26:16 GMT Message-Id: <202106111826.15BIQGRY056780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: fcfd3c7909ba - stable/13 - Enable IPIs on CPU 0 on arm and arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fcfd3c7909bad40506c7f27d6a76c0c90ec11569 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 18:26:16 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fcfd3c7909bad40506c7f27d6a76c0c90ec11569 commit fcfd3c7909bad40506c7f27d6a76c0c90ec11569 Author: Andrew Turner AuthorDate: 2021-05-02 07:43:34 +0000 Commit: Andrew Turner CommitDate: 2021-06-11 18:23:50 +0000 Enable IPIs on CPU 0 on arm and arm64 Not all interrupt controllers enable IPIs by default as the Arm GIC specs make it an implementation defined option. As at least two hypervisors have also previously masked the IPIs on boot. As we already enable these IPIs on the non-boot CPUs it is expected this is a safe operation. Differential Revision: https://reviews.freebsd.org/D26975 (cherry picked from commit 2420f6aed9e355ff65377152ba977b3a5ac441d1) --- sys/arm64/arm64/mp_machdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 8d5d82879571..3b1a8cc89cab 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -364,6 +364,8 @@ intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, ii->ii_send_arg = isrc; strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); ii->ii_count = intr_ipi_setup_counters(name); + + PIC_ENABLE_INTR(intr_irq_root_dev, isrc); } static void From owner-dev-commits-src-all@freebsd.org Fri Jun 11 18:26:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD54C662850; Fri, 11 Jun 2021 18:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1q6d5Qhzz4TKs; Fri, 11 Jun 2021 18:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A283A275EC; Fri, 11 Jun 2021 18:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BIQH3o056810; Fri, 11 Jun 2021 18:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BIQHIN056809; Fri, 11 Jun 2021 18:26:17 GMT (envelope-from git) Date: Fri, 11 Jun 2021 18:26:17 GMT Message-Id: <202106111826.15BIQHIN056809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 4b707591838d - stable/13 - Also enable IPIs on 32-bit arm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4b707591838de29c8b10a13c56f7da5489542d7c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 18:26:17 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4b707591838de29c8b10a13c56f7da5489542d7c commit 4b707591838de29c8b10a13c56f7da5489542d7c Author: Andrew Turner AuthorDate: 2021-05-02 10:05:03 +0000 Commit: Andrew Turner CommitDate: 2021-06-11 18:23:50 +0000 Also enable IPIs on 32-bit arm This was missed in 2420f6a Reported by: tuexen, imp (cherry picked from commit 0ec205197b56b9257cf0fdc1a5b268fef3e3f2dc) --- sys/arm/arm/machdep_intr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm/arm/machdep_intr.c b/sys/arm/arm/machdep_intr.c index e2fb34ce93c8..cc2e67a6211e 100644 --- a/sys/arm/arm/machdep_intr.c +++ b/sys/arm/arm/machdep_intr.c @@ -223,6 +223,7 @@ intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, isrc->isrc_handlers++; intr_ipi_setup(ipi, name, hand, arg, pic_ipi_send, isrc); + PIC_ENABLE_INTR(intr_irq_root_dev, isrc); return (0); } #endif From owner-dev-commits-src-all@freebsd.org Fri Jun 11 19:06:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78E5266341C; Fri, 11 Jun 2021 19:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1r1W31qPz4Ymp; Fri, 11 Jun 2021 19:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C9B1282AA; Fri, 11 Jun 2021 19:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BJ6tYT010292; Fri, 11 Jun 2021 19:06:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BJ6thI010291; Fri, 11 Jun 2021 19:06:55 GMT (envelope-from git) Date: Fri, 11 Jun 2021 19:06:55 GMT Message-Id: <202106111906.15BJ6thI010291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 2cfe870acdec - main - arm64: Add Soc audio framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cfe870acdecd35b621932f2b0cb702c48ce087a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 19:06:55 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=2cfe870acdecd35b621932f2b0cb702c48ce087a commit 2cfe870acdecd35b621932f2b0cb702c48ce087a Author: Oleksandr Tymoshenko AuthorDate: 2021-05-13 19:09:50 +0000 Commit: Emmanuel Vadot CommitDate: 2021-06-11 19:06:04 +0000 arm64: Add Soc audio framework This framework is initial implementation of the simple-audio-card compatible audio driver framework. It provides glue for CPU/codec/aux device. Differential Revision: https://reviews.freebsd.org/D27830 --- sys/conf/files.arm64 | 8 + sys/dev/sound/fdt/audio_dai.h | 72 +++++ sys/dev/sound/fdt/audio_dai_if.m | 95 ++++++ sys/dev/sound/fdt/audio_soc.c | 546 +++++++++++++++++++++++++++++++++++ sys/dev/sound/fdt/dummy_codec.c | 127 ++++++++ sys/dev/sound/fdt/simple_amplifier.c | 206 +++++++++++++ 6 files changed, 1054 insertions(+) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 7b9b2583aaa1..5c819001493d 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -148,6 +148,14 @@ cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" +## +## ASoC support +## +dev/sound/fdt/audio_dai_if.m optional sound fdt +dev/sound/fdt/audio_soc.c optional sound fdt +dev/sound/fdt/dummy_codec.c optional sound fdt +dev/sound/fdt/simple_amplifier.c optional sound fdt + ## ## Device drivers ## diff --git a/sys/dev/sound/fdt/audio_dai.h b/sys/dev/sound/fdt/audio_dai.h new file mode 100644 index 000000000000..f82fe9c7b838 --- /dev/null +++ b/sys/dev/sound/fdt/audio_dai.h @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2019 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR 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 __DAI_H__ +#define __DAI_H__ + +#define AUDIO_DAI_FORMAT_I2S 0 +#define AUDIO_DAI_FORMAT_RJ 1 +#define AUDIO_DAI_FORMAT_LJ 2 +#define AUDIO_DAI_FORMAT_DSPA 3 +#define AUDIO_DAI_FORMAT_DSPB 4 +#define AUDIO_DAI_FORMAT_AC97 5 +#define AUDIO_DAI_FORMAT_PDM 6 + +/* + * Polarity: Normal/Inverted BCLK/Frame + */ +#define AUDIO_DAI_POLARITY_NB_NF 0 +#define AUDIO_DAI_POLARITY_NB_IF 1 +#define AUDIO_DAI_POLARITY_IB_NF 2 +#define AUDIO_DAI_POLARITY_IB_IF 3 +#define AUDIO_DAI_POLARITY_INVERTED_FRAME(n) ((n) & 0x01) +#define AUDIO_DAI_POLARITY_INVERTED_BCLK(n) ((n) & 0x2) + +#define AUDIO_DAI_CLOCK_CBM_CFM 0 +#define AUDIO_DAI_CLOCK_CBS_CFM 1 +#define AUDIO_DAI_CLOCK_CBM_CFS 2 +#define AUDIO_DAI_CLOCK_CBS_CFS 3 + +#define AUDIO_DAI_CLOCK_IN 0 +#define AUDIO_DAI_CLOCK_OUT 1 + +#define AUDIO_DAI_JACK_HP 0 +#define AUDIO_DAI_JACK_MIC 1 + +/* + * Signal to audio_soc that chn_intr required + * for either recording or playback + */ +#define AUDIO_DAI_REC_INTR (1 << 1) +#define AUDIO_DAI_PLAY_INTR (1 << 0) + +#define AUDIO_DAI_FORMAT(fmt, pol, clk) (((fmt) << 16) | ((pol) << 8) | (clk)) +#define AUDIO_DAI_FORMAT_FORMAT(format) (((format) >> 16) & 0xff) +#define AUDIO_DAI_FORMAT_POLARITY(format) (((format) >> 8) & 0xff) +#define AUDIO_DAI_FORMAT_CLOCK(format) (((format) >> 0) & 0xff) + + +#endif /* __DAI_H__ */ diff --git a/sys/dev/sound/fdt/audio_dai_if.m b/sys/dev/sound/fdt/audio_dai_if.m new file mode 100644 index 000000000000..dc3ebbba5489 --- /dev/null +++ b/sys/dev/sound/fdt/audio_dai_if.m @@ -0,0 +1,95 @@ +#- +# Copyright (c) 2019 Oleksandr Tymoshenko +# +# 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$ +# + +CODE { + #include + #include + #include +} + +INTERFACE audio_dai; + +# set DAI format for communications between CPU/codec nodes +METHOD int init { + device_t dev; + uint32_t format; +} + +# Initialize DAI and set up interrrupt handler +METHOD int setup_intr { + device_t dev; + driver_intr_t intr_handler; + void *intr_arg; +} + +# Setup mixers for codec node +METHOD int setup_mixer { + device_t dev; + device_t ausocdev; +} + +# setup clock speed +METHOD int set_sysclk { + device_t dev; + uint32_t rate; + int dai_dir; +} + +METHOD int trigger { + device_t dev; + int go; + int pcm_dir; +} + +METHOD struct pcmchan_caps* get_caps { + device_t dev; +} + +METHOD uint32_t get_ptr { + device_t dev; + int pcm_dir; +} + +# Set PCM channel format +METHOD uint32_t set_chanformat { + device_t dev; + uint32_t format; +} + +# Set PCM channel sampling rate +METHOD uint32_t set_chanspeed { + device_t dev; + uint32_t speed; +} + +# call DAI interrupt handler +# returns 1 if call to chn_intr required, 0 otherwise +METHOD int intr { + device_t dev; + struct snd_dbuf *play_buf; + struct snd_dbuf *rec_buf; +} diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c new file mode 100644 index 000000000000..cd5807d955c9 --- /dev/null +++ b/sys/dev/sound/fdt/audio_soc.c @@ -0,0 +1,546 @@ +/*- + * Copyright (c) 2019 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR 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 "audio_dai_if.h" + +#define AUDIO_BUFFER_SIZE 48000 * 4 + +struct audio_soc_aux_node { + SLIST_ENTRY(audio_soc_aux_node) link; + device_t dev; +}; + +struct audio_soc_channel { + struct audio_soc_softc *sc; /* parent device's softc */ + struct pcm_channel *pcm; /* PCM channel */ + struct snd_dbuf *buf; /* PCM buffer */ + int dir; /* direction */ +}; + +struct audio_soc_softc { + /* + * pcm_register assumes that sc is snddev_info, + * so this has to be first structure member for "compatiblity" + */ + struct snddev_info info; + device_t dev; + char *name; + struct intr_config_hook init_hook; + device_t cpu_dev; + device_t codec_dev; + SLIST_HEAD(, audio_soc_aux_node) aux_devs; + unsigned int mclk_fs; + struct audio_soc_channel play_channel; + struct audio_soc_channel rec_channel; + /* + * The format is from the CPU node, for CODEC node clock roles + * need to be reversed. + */ + uint32_t format; + uint32_t link_mclk_fs; +}; + +static struct ofw_compat_data compat_data[] = { + {"simple-audio-card", 1}, + {NULL, 0}, +}; + +static struct { + const char *name; + unsigned int fmt; +} ausoc_dai_formats[] = { + { "i2s", AUDIO_DAI_FORMAT_I2S }, + { "right_j", AUDIO_DAI_FORMAT_RJ }, + { "left_j", AUDIO_DAI_FORMAT_LJ }, + { "dsp_a", AUDIO_DAI_FORMAT_DSPA }, + { "dsp_b", AUDIO_DAI_FORMAT_DSPB }, + { "ac97", AUDIO_DAI_FORMAT_AC97 }, + { "pdm", AUDIO_DAI_FORMAT_PDM }, +}; + +static int audio_soc_probe(device_t dev); +static int audio_soc_attach(device_t dev); +static int audio_soc_detach(device_t dev); + +/* + * Invert master/slave roles for CODEC side of the node + */ +static uint32_t +audio_soc_reverse_clocks(uint32_t format) +{ + int fmt, pol, clk; + + fmt = AUDIO_DAI_FORMAT_FORMAT(format); + pol = AUDIO_DAI_FORMAT_POLARITY(format); + clk = AUDIO_DAI_FORMAT_CLOCK(format); + + switch (clk) { + case AUDIO_DAI_CLOCK_CBM_CFM: + clk = AUDIO_DAI_CLOCK_CBS_CFS; + break; + case AUDIO_DAI_CLOCK_CBS_CFM: + clk = AUDIO_DAI_CLOCK_CBM_CFS; + break; + case AUDIO_DAI_CLOCK_CBM_CFS: + clk = AUDIO_DAI_CLOCK_CBS_CFM; + break; + case AUDIO_DAI_CLOCK_CBS_CFS: + clk = AUDIO_DAI_CLOCK_CBM_CFM; + break; + } + + return AUDIO_DAI_FORMAT(fmt, pol, clk); +} + +static uint32_t +audio_soc_chan_setblocksize(kobj_t obj, void *data, uint32_t blocksz) +{ + + return (blocksz); +} + +static int +audio_soc_chan_setformat(kobj_t obj, void *data, uint32_t format) +{ + + struct audio_soc_softc *sc; + struct audio_soc_channel *ausoc_chan; + + ausoc_chan = data; + sc = ausoc_chan->sc; + + return AUDIO_DAI_SET_CHANFORMAT(sc->cpu_dev, format); +} + +static uint32_t +audio_soc_chan_setspeed(kobj_t obj, void *data, uint32_t speed) +{ + + struct audio_soc_softc *sc; + struct audio_soc_channel *ausoc_chan; + uint32_t rate; + struct audio_soc_aux_node *aux_node; + + ausoc_chan = data; + sc = ausoc_chan->sc; + + if (sc->link_mclk_fs) { + rate = speed * sc->link_mclk_fs; + if (AUDIO_DAI_SET_SYSCLK(sc->cpu_dev, rate, AUDIO_DAI_CLOCK_IN)) + device_printf(sc->dev, "failed to set sysclk for CPU node\n"); + + if (AUDIO_DAI_SET_SYSCLK(sc->codec_dev, rate, AUDIO_DAI_CLOCK_OUT)) + device_printf(sc->dev, "failed to set sysclk for codec node\n"); + + SLIST_FOREACH(aux_node, &sc->aux_devs, link) { + if (AUDIO_DAI_SET_SYSCLK(aux_node->dev, rate, AUDIO_DAI_CLOCK_OUT)) + device_printf(sc->dev, "failed to set sysclk for aux node\n"); + } + } + + /* + * Let CPU node determine speed + */ + speed = AUDIO_DAI_SET_CHANSPEED(sc->cpu_dev, speed); + AUDIO_DAI_SET_CHANSPEED(sc->codec_dev, speed); + SLIST_FOREACH(aux_node, &sc->aux_devs, link) { + AUDIO_DAI_SET_CHANSPEED(aux_node->dev, speed); + } + + return (speed); +} + +static uint32_t +audio_soc_chan_getptr(kobj_t obj, void *data) +{ + struct audio_soc_softc *sc; + struct audio_soc_channel *ausoc_chan; + + ausoc_chan = data; + sc = ausoc_chan->sc; + + return AUDIO_DAI_GET_PTR(sc->cpu_dev, ausoc_chan->dir); +} + +static void * +audio_soc_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, + struct pcm_channel *c, int dir) +{ + struct audio_soc_softc *sc; + struct audio_soc_channel *ausoc_chan; + void *buffer; + + ausoc_chan = devinfo; + sc = ausoc_chan->sc; + buffer = malloc(AUDIO_BUFFER_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); + + if (sndbuf_setup(b, buffer, AUDIO_BUFFER_SIZE) != 0) { + free(buffer, M_DEVBUF); + return NULL; + } + + ausoc_chan->dir = dir; + ausoc_chan->buf = b; + ausoc_chan->pcm = c; + + return (devinfo); +} + +static int +audio_soc_chan_trigger(kobj_t obj, void *data, int go) +{ + struct audio_soc_softc *sc; + struct audio_soc_channel *ausoc_chan; + struct audio_soc_aux_node *aux_node; + + ausoc_chan = (struct audio_soc_channel *)data; + sc = ausoc_chan->sc; + AUDIO_DAI_TRIGGER(sc->codec_dev, go, ausoc_chan->dir); + SLIST_FOREACH(aux_node, &sc->aux_devs, link) { + AUDIO_DAI_TRIGGER(aux_node->dev, go, ausoc_chan->dir); + } + + return AUDIO_DAI_TRIGGER(sc->cpu_dev, go, ausoc_chan->dir); +} + +static int +audio_soc_chan_free(kobj_t obj, void *data) +{ + + struct audio_soc_softc *sc; + struct audio_soc_channel *ausoc_chan; + void *buffer; + + ausoc_chan = (struct audio_soc_channel *)data; + sc = ausoc_chan->sc; + + buffer = sndbuf_getbuf(ausoc_chan->buf); + if (buffer) + free(buffer, M_DEVBUF); + + return (0); +} + +static struct pcmchan_caps * +audio_soc_chan_getcaps(kobj_t obj, void *data) +{ + struct audio_soc_softc *sc; + struct audio_soc_channel *ausoc_chan; + + ausoc_chan = data; + sc = ausoc_chan->sc; + + return AUDIO_DAI_GET_CAPS(sc->cpu_dev); +} + +static kobj_method_t audio_soc_chan_methods[] = { + KOBJMETHOD(channel_init, audio_soc_chan_init), + KOBJMETHOD(channel_free, audio_soc_chan_free), + KOBJMETHOD(channel_setformat, audio_soc_chan_setformat), + KOBJMETHOD(channel_setspeed, audio_soc_chan_setspeed), + KOBJMETHOD(channel_setblocksize,audio_soc_chan_setblocksize), + KOBJMETHOD(channel_trigger, audio_soc_chan_trigger), + KOBJMETHOD(channel_getptr, audio_soc_chan_getptr), + KOBJMETHOD(channel_getcaps, audio_soc_chan_getcaps), + KOBJMETHOD_END +}; +CHANNEL_DECLARE(audio_soc_chan); + +static void +audio_soc_intr(void *arg) +{ + struct audio_soc_softc *sc; + int channel_intr_required; + + sc = (struct audio_soc_softc *)arg; + channel_intr_required = AUDIO_DAI_INTR(sc->cpu_dev, sc->play_channel.buf, sc->rec_channel.buf); + if (channel_intr_required & AUDIO_DAI_PLAY_INTR) + chn_intr(sc->play_channel.pcm); + if (channel_intr_required & AUDIO_DAI_REC_INTR) + chn_intr(sc->rec_channel.pcm); +} + +static int +audio_soc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "simple-audio-card"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static void +audio_soc_init(void *arg) +{ + struct audio_soc_softc *sc; + phandle_t node, child; + device_t daidev, auxdev; + uint32_t xref; + uint32_t *aux_devs; + int ncells, i; + struct audio_soc_aux_node *aux_node; + + sc = (struct audio_soc_softc *)arg; + config_intrhook_disestablish(&sc->init_hook); + + node = ofw_bus_get_node(sc->dev); + /* TODO: handle multi-link nodes */ + child = ofw_bus_find_child(node, "simple-audio-card,cpu"); + if (child == 0) { + device_printf(sc->dev, "cpu node is missing\n"); + return; + } + if ((OF_getencprop(child, "sound-dai", &xref, sizeof(xref))) <= 0) { + device_printf(sc->dev, "missing sound-dai property in cpu node\n"); + return; + } + daidev = OF_device_from_xref(xref); + if (daidev == NULL) { + device_printf(sc->dev, "no driver attached to cpu node\n"); + return; + } + sc->cpu_dev = daidev; + + child = ofw_bus_find_child(node, "simple-audio-card,codec"); + if (child == 0) { + device_printf(sc->dev, "codec node is missing\n"); + return; + } + if ((OF_getencprop(child, "sound-dai", &xref, sizeof(xref))) <= 0) { + device_printf(sc->dev, "missing sound-dai property in codec node\n"); + return; + } + daidev = OF_device_from_xref(xref); + if (daidev == NULL) { + device_printf(sc->dev, "no driver attached to codec node\n"); + return; + } + sc->codec_dev = daidev; + + /* Add AUX devices */ + aux_devs = NULL; + ncells = OF_getencprop_alloc_multi(node, "simple-audio-card,aux-devs", sizeof(*aux_devs), + (void **)&aux_devs); + + for (i = 0; i < ncells; i++) { + auxdev = OF_device_from_xref(aux_devs[i]); + if (auxdev == NULL) + device_printf(sc->dev, "warning: no driver attached to aux node\n"); + aux_node = (struct audio_soc_aux_node *)malloc(sizeof(*aux_node), M_DEVBUF, M_NOWAIT); + if (aux_node == NULL) { + device_printf(sc->dev, "failed to allocate aux node struct\n"); + return; + } + aux_node->dev = auxdev; + SLIST_INSERT_HEAD(&sc->aux_devs, aux_node, link); + } + + if (aux_devs) + OF_prop_free(aux_devs); + + if (AUDIO_DAI_INIT(sc->cpu_dev, sc->format)) { + device_printf(sc->dev, "failed to initialize cpu node\n"); + return; + } + + /* Reverse clock roles for CODEC */ + if (AUDIO_DAI_INIT(sc->codec_dev, audio_soc_reverse_clocks(sc->format))) { + device_printf(sc->dev, "failed to initialize codec node\n"); + return; + } + + SLIST_FOREACH(aux_node, &sc->aux_devs, link) { + if (AUDIO_DAI_INIT(aux_node->dev, audio_soc_reverse_clocks(sc->format))) { + device_printf(sc->dev, "failed to initialize aux node\n"); + return; + } + } + + if (pcm_register(sc->dev, sc, 1, 1)) { + device_printf(sc->dev, "failed to register PCM\n"); + return; + } + + pcm_getbuffersize(sc->dev, AUDIO_BUFFER_SIZE, AUDIO_BUFFER_SIZE, + AUDIO_BUFFER_SIZE); + sc->play_channel.sc = sc; + sc->rec_channel.sc = sc; + + pcm_addchan(sc->dev, PCMDIR_PLAY, &audio_soc_chan_class, &sc->play_channel); + pcm_addchan(sc->dev, PCMDIR_REC, &audio_soc_chan_class, &sc->rec_channel); + + pcm_setstatus(sc->dev, "at EXPERIMENT"); + + AUDIO_DAI_SETUP_INTR(sc->cpu_dev, audio_soc_intr, sc); + AUDIO_DAI_SETUP_MIXER(sc->codec_dev, sc->dev); + SLIST_FOREACH(aux_node, &sc->aux_devs, link) { + AUDIO_DAI_SETUP_MIXER(aux_node->dev, sc->dev); + } +} + +static int +audio_soc_attach(device_t dev) +{ + struct audio_soc_softc *sc; + char *name; + phandle_t node, cpu_child; + uint32_t xref; + int i, ret; + char tmp[32]; + unsigned int fmt, pol, clk; + bool frame_master, bitclock_master; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + ret = OF_getprop_alloc(node, "name", (void **)&name); + if (ret == -1) + name = "SoC audio"; + + sc->name = strdup(name, M_DEVBUF); + device_set_desc(dev, sc->name); + + if (ret != -1) + OF_prop_free(name); + + SLIST_INIT(&sc->aux_devs); + + ret = OF_getprop(node, "simple-audio-card,format", tmp, sizeof(tmp)); + if (ret == 0) { + for (i = 0; i < nitems(ausoc_dai_formats); i++) { + if (strcmp(tmp, ausoc_dai_formats[i].name) == 0) { + fmt = ausoc_dai_formats[i].fmt; + break; + } + } + if (i == nitems(ausoc_dai_formats)) + return (EINVAL); + } else + fmt = AUDIO_DAI_FORMAT_I2S; + + if (OF_getencprop(node, "simple-audio-card,mclk-fs", + &sc->link_mclk_fs, sizeof(sc->link_mclk_fs)) <= 0) + sc->link_mclk_fs = 0; + + /* Unless specified otherwise, CPU node is the master */ + frame_master = bitclock_master = true; + + cpu_child = ofw_bus_find_child(node, "simple-audio-card,cpu"); + + if ((OF_getencprop(node, "simple-audio-card,frame-master", &xref, sizeof(xref))) > 0) + frame_master = cpu_child == OF_node_from_xref(xref); + + if ((OF_getencprop(node, "simple-audio-card,bitclock-master", &xref, sizeof(xref))) > 0) + bitclock_master = cpu_child == OF_node_from_xref(xref); + + if (frame_master) { + clk = bitclock_master ? + AUDIO_DAI_CLOCK_CBM_CFM : AUDIO_DAI_CLOCK_CBS_CFM; + } else { + clk = bitclock_master ? + AUDIO_DAI_CLOCK_CBM_CFS : AUDIO_DAI_CLOCK_CBS_CFS; + } + + bool bitclock_inversion = OF_hasprop(node, "simple-audio-card,bitclock-inversion"); + bool frame_inversion = OF_hasprop(node, "simple-audio-card,frame-inversion"); + if (bitclock_inversion) { + pol = frame_inversion ? + AUDIO_DAI_POLARITY_IB_IF : AUDIO_DAI_POLARITY_IB_NF; + } else { + pol = frame_inversion ? + AUDIO_DAI_POLARITY_NB_IF : AUDIO_DAI_POLARITY_NB_NF; + } + + sc->format = AUDIO_DAI_FORMAT(fmt, pol, clk); + + sc->init_hook.ich_func = audio_soc_init; + sc->init_hook.ich_arg = sc; + if (config_intrhook_establish(&sc->init_hook) != 0) + return (ENOMEM); + + return (0); +} + +static int +audio_soc_detach(device_t dev) +{ + struct audio_soc_softc *sc; + struct audio_soc_aux_node *aux; + + sc = device_get_softc(dev); + if (sc->name) + free(sc->name, M_DEVBUF); + + while ((aux = SLIST_FIRST(&sc->aux_devs)) != NULL) { + SLIST_REMOVE_HEAD(&sc->aux_devs, link); + free(aux, M_DEVBUF); + } + + return (0); +} + +static device_method_t audio_soc_methods[] = { + /* device_if methods */ + DEVMETHOD(device_probe, audio_soc_probe), + DEVMETHOD(device_attach, audio_soc_attach), + DEVMETHOD(device_detach, audio_soc_detach), + + DEVMETHOD_END, +}; + +static driver_t audio_soc_driver = { + "pcm", + audio_soc_methods, + sizeof(struct audio_soc_softc), +}; + +DRIVER_MODULE(audio_soc, simplebus, audio_soc_driver, pcm_devclass, NULL, NULL); +MODULE_VERSION(audio_soc, 1); diff --git a/sys/dev/sound/fdt/dummy_codec.c b/sys/dev/sound/fdt/dummy_codec.c new file mode 100644 index 000000000000..6be2491a069d --- /dev/null +++ b/sys/dev/sound/fdt/dummy_codec.c @@ -0,0 +1,127 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "opt_snd.h" +#include +#include +#include "audio_dai_if.h" + +static struct ofw_compat_data compat_data[] = { + { "dummy-codec", 1}, + { NULL, 0 } +}; + +struct dummy_codec_softc { + device_t dev; +}; + +static int dummy_codec_probe(device_t dev); +static int dummy_codec_attach(device_t dev); +static int dummy_codec_detach(device_t dev); + +static int +dummy_codec_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "Dummy Codec"); + return (BUS_PROBE_DEFAULT); +} + +static int +dummy_codec_attach(device_t dev) +{ + struct dummy_codec_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + + node = ofw_bus_get_node(dev); + OF_device_register_xref(OF_xref_from_node(node), dev); + + return (0); +} + +static int +dummy_codec_detach(device_t dev) +{ + + return (0); +} + +static int +dummy_codec_dai_init(device_t dev, uint32_t format) +{ + + return (0); +} + +static device_method_t dummy_codec_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, dummy_codec_probe), + DEVMETHOD(device_attach, dummy_codec_attach), + DEVMETHOD(device_detach, dummy_codec_detach), + + DEVMETHOD(audio_dai_init, dummy_codec_dai_init), + + DEVMETHOD_END +}; + +static driver_t dummy_codec_driver = { + "dummycodec", + dummy_codec_methods, + sizeof(struct dummy_codec_softc), +}; + +static devclass_t dummy_codec_devclass; + +DRIVER_MODULE(dummy_codec, simplebus, dummy_codec_driver, dummy_codec_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); diff --git a/sys/dev/sound/fdt/simple_amplifier.c b/sys/dev/sound/fdt/simple_amplifier.c new file mode 100644 index 000000000000..a0531914d9be --- /dev/null +++ b/sys/dev/sound/fdt/simple_amplifier.c @@ -0,0 +1,206 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "opt_snd.h" +#include +#include +#include "audio_dai_if.h" + +static struct ofw_compat_data compat_data[] = { + { "simple-audio-amplifier", 1}, + { NULL, 0} +}; + +struct simple_amp_softc { + device_t dev; + regulator_t supply_vcc; + gpio_pin_t gpio_enable; + bool gpio_is_valid; +}; + +static int simple_amp_probe(device_t dev); +static int simple_amp_attach(device_t dev); +static int simple_amp_detach(device_t dev); + +static int +simple_amp_probe(device_t dev) +{ *** 133 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Jun 11 19:06:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A53C1662F31; Fri, 11 Jun 2021 19:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1r1X3MSTz4Ymr; Fri, 11 Jun 2021 19:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C36C2847A; Fri, 11 Jun 2021 19:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BJ6uK3010322; Fri, 11 Jun 2021 19:06:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BJ6uOG010321; Fri, 11 Jun 2021 19:06:56 GMT (envelope-from git) Date: Fri, 11 Jun 2021 19:06:56 GMT Message-Id: <202106111906.15BJ6uOG010321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cb25a9455802 - main - arm64: allwinner: Add i2s and codec support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb25a9455802de29a3609f34bef9e94af842b890 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 19:06:56 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cb25a9455802de29a3609f34bef9e94af842b890 commit cb25a9455802de29a3609f34bef9e94af842b890 Author: Oleksandr Tymoshenko AuthorDate: 2021-05-13 19:10:38 +0000 Commit: Emmanuel Vadot CommitDate: 2021-06-11 19:06:08 +0000 arm64: allwinner: Add i2s and codec support Differential Revision: https://reviews.freebsd.org/D27830 --- sys/arm/allwinner/a33_codec.c | 417 +++++++++++++++ sys/arm/allwinner/a64/sun50i_a64_acodec.c | 488 ++++++++++++++++++ sys/arm/allwinner/aw_i2s.c | 813 ++++++++++++++++++++++++++++++ sys/arm64/conf/GENERIC | 7 +- sys/conf/files.arm64 | 3 + 5 files changed, 1726 insertions(+), 2 deletions(-) diff --git a/sys/arm/allwinner/a33_codec.c b/sys/arm/allwinner/a33_codec.c new file mode 100644 index 000000000000..2b3d5f6ef01c --- /dev/null +++ b/sys/arm/allwinner/a33_codec.c @@ -0,0 +1,417 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Oleksandr Tymoshenko + * Copyright (c) 2018 Jared McNeill + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "opt_snd.h" +#include +#include +#include "audio_dai_if.h" + +#define SYSCLK_CTL 0x00c +#define AIF1CLK_ENA (1 << 11) +#define AIF1CLK_SRC_MASK (3 << 8) +#define AIF1CLK_SRC_PLL (2 << 8) +#define SYSCLK_ENA (1 << 3) +#define SYSCLK_SRC (1 << 0) + +#define MOD_CLK_ENA 0x010 +#define MOD_RST_CTL 0x014 +#define MOD_AIF1 (1 << 15) +#define MOD_ADC (1 << 3) +#define MOD_DAC (1 << 2) + +#define SYS_SR_CTRL 0x018 +#define AIF1_FS_MASK (0xf << 12) +#define AIF_FS_48KHZ (8 << 12) + +#define AIF1CLK_CTRL 0x040 +#define AIF1_MSTR_MOD (1 << 15) +#define AIF1_BCLK_INV (1 << 14) +#define AIF1_LRCK_INV (1 << 13) +#define AIF1_BCLK_DIV_MASK (0xf << 9) +#define AIF1_BCLK_DIV_16 (6 << 9) +#define AIF1_LRCK_DIV_MASK (7 << 6) +#define AIF1_LRCK_DIV_16 (0 << 6) +#define AIF1_LRCK_DIV_64 (2 << 6) +#define AIF1_WORD_SIZ_MASK (3 << 4) +#define AIF1_WORD_SIZ_16 (1 << 4) +#define AIF1_DATA_FMT_MASK (3 << 2) +#define AIF1_DATA_FMT_I2S (0 << 2) +#define AIF1_DATA_FMT_LJ (1 << 2) +#define AIF1_DATA_FMT_RJ (2 << 2) +#define AIF1_DATA_FMT_DSP (3 << 2) + +#define AIF1_ADCDAT_CTRL 0x044 +#define AIF1_ADC0L_ENA (1 << 15) +#define AIF1_ADC0R_ENA (1 << 14) + +#define AIF1_DACDAT_CTRL 0x048 +#define AIF1_DAC0L_ENA (1 << 15) +#define AIF1_DAC0R_ENA (1 << 14) + +#define AIF1_MXR_SRC 0x04c +#define AIF1L_MXR_SRC_MASK (0xf << 12) +#define AIF1L_MXR_SRC_AIF1 (0x8 << 12) +#define AIF1L_MXR_SRC_ADC (0x2 << 12) +#define AIF1R_MXR_SRC_MASK (0xf << 8) +#define AIF1R_MXR_SRC_AIF1 (0x8 << 8) +#define AIF1R_MXR_SRC_ADC (0x2 << 8) + +#define ADC_DIG_CTRL 0x100 +#define ADC_DIG_CTRL_ENAD (1 << 15) + +#define HMIC_CTRL1 0x110 +#define HMIC_CTRL1_N_MASK (0xf << 8) +#define HMIC_CTRL1_N(n) (((n) & 0xf) << 8) +#define HMIC_CTRL1_JACK_IN_IRQ_EN (1 << 4) +#define HMIC_CTRL1_JACK_OUT_IRQ_EN (1 << 3) +#define HMIC_CTRL1_MIC_DET_IRQ_EN (1 << 0) + +#define HMIC_CTRL2 0x114 +#define HMIC_CTRL2_MDATA_THRES __BITS(12,8) + +#define HMIC_STS 0x118 +#define HMIC_STS_MIC_PRESENT (1 << 6) +#define HMIC_STS_JACK_DET_OIRQ (1 << 4) +#define HMIC_STS_JACK_DET_IIRQ (1 << 3) +#define HMIC_STS_MIC_DET_ST (1 << 0) + +#define DAC_DIG_CTRL 0x120 +#define DAC_DIG_CTRL_ENDA (1 << 15) + +#define DAC_MXR_SRC 0x130 +#define DACL_MXR_SRC_MASK (0xf << 12) +#define DACL_MXR_SRC_AIF1_DAC0L (0x8 << 12) +#define DACR_MXR_SRC_MASK (0xf << 8) +#define DACR_MXR_SRC_AIF1_DAC0R (0x8 << 8) + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun8i-a33-codec", 1}, + { NULL, 0 } +}; + +static struct resource_spec sun8i_codec_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +struct sun8i_codec_softc { + device_t dev; + struct resource *res[2]; + struct mtx mtx; + clk_t clk_gate; + clk_t clk_mod; + void * intrhand; +}; + +#define CODEC_LOCK(sc) mtx_lock(&(sc)->mtx) +#define CODEC_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define CODEC_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) +#define CODEC_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) + +static int sun8i_codec_probe(device_t dev); +static int sun8i_codec_attach(device_t dev); +static int sun8i_codec_detach(device_t dev); + +static int +sun8i_codec_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "Allwinner Codec"); + return (BUS_PROBE_DEFAULT); +} + +static int +sun8i_codec_attach(device_t dev) +{ + struct sun8i_codec_softc *sc; + int error; + uint32_t val; + struct gpiobus_pin *pa_pin; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + if (bus_alloc_resources(dev, sun8i_codec_spec, sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + error = ENXIO; + goto fail; + } + + error = clk_get_by_ofw_name(dev, 0, "mod", &sc->clk_mod); + if (error != 0) { + device_printf(dev, "cannot get \"mod\" clock\n"); + goto fail; + } + + error = clk_get_by_ofw_name(dev, 0, "bus", &sc->clk_gate); + if (error != 0) { + device_printf(dev, "cannot get \"bus\" clock\n"); + goto fail; + } + + error = clk_enable(sc->clk_gate); + if (error != 0) { + device_printf(dev, "cannot enable \"bus\" clock\n"); + goto fail; + } + + /* Enable clocks */ + val = CODEC_READ(sc, SYSCLK_CTL); + val |= AIF1CLK_ENA; + val &= ~AIF1CLK_SRC_MASK; + val |= AIF1CLK_SRC_PLL; + val |= SYSCLK_ENA; + val &= ~SYSCLK_SRC; + CODEC_WRITE(sc, SYSCLK_CTL, val); + CODEC_WRITE(sc, MOD_CLK_ENA, MOD_AIF1 | MOD_ADC | MOD_DAC); + CODEC_WRITE(sc, MOD_RST_CTL, MOD_AIF1 | MOD_ADC | MOD_DAC); + + /* Enable digital parts */ + CODEC_WRITE(sc, DAC_DIG_CTRL, DAC_DIG_CTRL_ENDA); + CODEC_WRITE(sc, ADC_DIG_CTRL, ADC_DIG_CTRL_ENAD); + + /* Set AIF1 to 48 kHz */ + val = CODEC_READ(sc, SYS_SR_CTRL); + val &= ~AIF1_FS_MASK; + val |= AIF_FS_48KHZ; + CODEC_WRITE(sc, SYS_SR_CTRL, val); + + /* Set AIF1 to 16-bit */ + val = CODEC_READ(sc, AIF1CLK_CTRL); + val &= ~AIF1_WORD_SIZ_MASK; + val |= AIF1_WORD_SIZ_16; + CODEC_WRITE(sc, AIF1CLK_CTRL, val); + + /* Enable AIF1 DAC timelot 0 */ + val = CODEC_READ(sc, AIF1_DACDAT_CTRL); + val |= AIF1_DAC0L_ENA; + val |= AIF1_DAC0R_ENA; + CODEC_WRITE(sc, AIF1_DACDAT_CTRL, val); + + /* Enable AIF1 ADC timelot 0 */ + val = CODEC_READ(sc, AIF1_ADCDAT_CTRL); + val |= AIF1_ADC0L_ENA; + val |= AIF1_ADC0R_ENA; + CODEC_WRITE(sc, AIF1_ADCDAT_CTRL, val); + + /* DAC mixer source select */ + val = CODEC_READ(sc, DAC_MXR_SRC); + val &= ~DACL_MXR_SRC_MASK; + val |= DACL_MXR_SRC_AIF1_DAC0L; + val &= ~DACR_MXR_SRC_MASK; + val |= DACR_MXR_SRC_AIF1_DAC0R; + CODEC_WRITE(sc, DAC_MXR_SRC, val); + + /* ADC mixer source select */ + val = CODEC_READ(sc, AIF1_MXR_SRC); + val &= ~AIF1L_MXR_SRC_MASK; + val |= AIF1L_MXR_SRC_ADC; + val &= ~AIF1R_MXR_SRC_MASK; + val |= AIF1R_MXR_SRC_ADC; + CODEC_WRITE(sc, AIF1_MXR_SRC, val); + + /* Enable PA power */ + /* Unmute PA */ + if (gpio_pin_get_by_ofw_property(dev, node, "allwinner,pa-gpios", + &pa_pin) == 0) { + error = gpio_pin_set_active(pa_pin, 1); + if (error != 0) + device_printf(dev, "failed to unmute PA\n"); + } + + OF_device_register_xref(OF_xref_from_node(node), dev); + + return (0); + +fail: + sun8i_codec_detach(dev); + return (error); +} + +static int +sun8i_codec_detach(device_t dev) +{ + struct sun8i_codec_softc *sc; + + sc = device_get_softc(dev); + + if (sc->clk_gate) + clk_release(sc->clk_gate); + + if (sc->clk_mod) + clk_release(sc->clk_mod); + + if (sc->intrhand != NULL) + bus_teardown_intr(sc->dev, sc->res[1], sc->intrhand); + + bus_release_resources(dev, sun8i_codec_spec, sc->res); + mtx_destroy(&sc->mtx); + + return (0); +} + +static int +sun8i_codec_dai_init(device_t dev, uint32_t format) +{ + struct sun8i_codec_softc *sc; + int fmt, pol, clk; + uint32_t val; + + sc = device_get_softc(dev); + + fmt = AUDIO_DAI_FORMAT_FORMAT(format); + pol = AUDIO_DAI_FORMAT_POLARITY(format); + clk = AUDIO_DAI_FORMAT_CLOCK(format); + + val = CODEC_READ(sc, AIF1CLK_CTRL); + + val &= ~AIF1_DATA_FMT_MASK; + switch (fmt) { + case AUDIO_DAI_FORMAT_I2S: + val |= AIF1_DATA_FMT_I2S; + break; + case AUDIO_DAI_FORMAT_RJ: + val |= AIF1_DATA_FMT_RJ; + break; + case AUDIO_DAI_FORMAT_LJ: + val |= AIF1_DATA_FMT_LJ; + break; + case AUDIO_DAI_FORMAT_DSPA: + case AUDIO_DAI_FORMAT_DSPB: + val |= AIF1_DATA_FMT_DSP; + break; + default: + return EINVAL; + } + + val &= ~(AIF1_BCLK_INV|AIF1_LRCK_INV); + /* Codec LRCK polarity is inverted (datasheet is wrong) */ + if (!AUDIO_DAI_POLARITY_INVERTED_FRAME(pol)) + val |= AIF1_LRCK_INV; + if (AUDIO_DAI_POLARITY_INVERTED_BCLK(pol)) + val |= AIF1_BCLK_INV; + + switch (clk) { + case AUDIO_DAI_CLOCK_CBM_CFM: + val &= ~AIF1_MSTR_MOD; /* codec is master */ + break; + case AUDIO_DAI_CLOCK_CBS_CFS: + val |= AIF1_MSTR_MOD; /* codec is slave */ + break; + default: + return EINVAL; + } + + val &= ~AIF1_LRCK_DIV_MASK; + val |= AIF1_LRCK_DIV_64; + + val &= ~AIF1_BCLK_DIV_MASK; + val |= AIF1_BCLK_DIV_16; + + CODEC_WRITE(sc, AIF1CLK_CTRL, val); + + return (0); +} + +static int +sun8i_codec_dai_trigger(device_t dev, int go, int pcm_dir) +{ + + return (0); +} + +static int +sun8i_codec_dai_setup_mixer(device_t dev, device_t pcmdev) +{ + struct sun8i_codec_softc *sc; + + sc = device_get_softc(dev); + /* Do nothing for now */ + + return (0); +} + + +static device_method_t sun8i_codec_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, sun8i_codec_probe), + DEVMETHOD(device_attach, sun8i_codec_attach), + DEVMETHOD(device_detach, sun8i_codec_detach), + + DEVMETHOD(audio_dai_init, sun8i_codec_dai_init), + DEVMETHOD(audio_dai_setup_mixer, sun8i_codec_dai_setup_mixer), + DEVMETHOD(audio_dai_trigger, sun8i_codec_dai_trigger), + + DEVMETHOD_END +}; + +static driver_t sun8i_codec_driver = { + "sun8icodec", + sun8i_codec_methods, + sizeof(struct sun8i_codec_softc), +}; + +static devclass_t sun8i_codec_devclass; + +DRIVER_MODULE(sun8i_codec, simplebus, sun8i_codec_driver, sun8i_codec_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); diff --git a/sys/arm/allwinner/a64/sun50i_a64_acodec.c b/sys/arm/allwinner/a64/sun50i_a64_acodec.c new file mode 100644 index 000000000000..10febf98abd8 --- /dev/null +++ b/sys/arm/allwinner/a64/sun50i_a64_acodec.c @@ -0,0 +1,488 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Oleksandr Tymoshenko + * Copyright (c) 2018 Jared McNeill + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "syscon_if.h" + +#include "opt_snd.h" +#include +#include +#include "audio_dai_if.h" +#include "mixer_if.h" + +#define A64_PR_CFG 0x00 +#define A64_AC_PR_RST (1 << 28) +#define A64_AC_PR_RW (1 << 24) +#define A64_AC_PR_ADDR_MASK (0x1f << 16) +#define A64_AC_PR_ADDR(n) (((n) & 0x1f) << 16) +#define A64_ACDA_PR_WDAT_MASK (0xff << 8) +#define A64_ACDA_PR_WDAT(n) (((n) & 0xff) << 8) +#define A64_ACDA_PR_RDAT(n) ((n) & 0xff) + +#define A64_HP_CTRL 0x00 +#define A64_HPPA_EN (1 << 6) +#define A64_HPVOL_MASK 0x3f +#define A64_HPVOL(n) ((n) & 0x3f) +#define A64_OL_MIX_CTRL 0x01 +#define A64_LMIXMUTE_LDAC (1 << 1) +#define A64_OR_MIX_CTRL 0x02 +#define A64_RMIXMUTE_RDAC (1 << 1) +#define A64_LINEOUT_CTRL0 0x05 +#define A64_LINEOUT_LEFT_EN (1 << 7) +#define A64_LINEOUT_RIGHT_EN (1 << 6) +#define A64_LINEOUT_EN (A64_LINEOUT_LEFT_EN|A64_LINEOUT_RIGHT_EN) +#define A64_LINEOUT_CTRL1 0x06 +#define A64_LINEOUT_VOL __BITS(4,0) +#define A64_MIC1_CTRL 0x07 +#define A64_MIC1G __BITS(6,4) +#define A64_MIC1AMPEN (1 << 3) +#define A64_MIC1BOOST __BITS(2,0) +#define A64_MIC2_CTRL 0x08 +#define A64_MIC2_SEL (1 << 7) +#define A64_MIC2G_MASK (7 << 4) +#define A64_MIC2G(n) (((n) & 7) << 4) +#define A64_MIC2AMPEN (1 << 3) +#define A64_MIC2BOOST_MASK (7 << 0) +#define A64_MIC2BOOST(n) (((n) & 7) << 0) +#define A64_LINEIN_CTRL 0x09 +#define A64_LINEING __BITS(6,4) +#define A64_MIX_DAC_CTRL 0x0a +#define A64_DACAREN (1 << 7) +#define A64_DACALEN (1 << 6) +#define A64_RMIXEN (1 << 5) +#define A64_LMIXEN (1 << 4) +#define A64_RHPPAMUTE (1 << 3) +#define A64_LHPPAMUTE (1 << 2) +#define A64_RHPIS (1 << 1) +#define A64_LHPIS (1 << 0) +#define A64_L_ADCMIX_SRC 0x0b +#define A64_R_ADCMIX_SRC 0x0c +#define A64_ADCMIX_SRC_MIC1 (1 << 6) +#define A64_ADCMIX_SRC_MIC2 (1 << 5) +#define A64_ADCMIX_SRC_LINEIN (1 << 2) +#define A64_ADCMIX_SRC_OMIXER (1 << 1) +#define A64_ADC_CTRL 0x0d +#define A64_ADCREN (1 << 7) +#define A64_ADCLEN (1 << 6) +#define A64_ADCG __BITS(2,0) +#define A64_JACK_MIC_CTRL 0x1d +#define A64_JACKDETEN (1 << 7) +#define A64_INNERRESEN (1 << 6) +#define A64_HMICBIASEN (1 << 5) +#define A64_AUTOPLEN (1 << 1) + +#define A64CODEC_MIXER_DEVS ((1 << SOUND_MIXER_VOLUME) | \ + (1 << SOUND_MIXER_MIC)) + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun50i-a64-codec-analog", 1}, + { NULL, 0 } +}; + +struct a64codec_softc { + device_t dev; + struct resource *res; + struct mtx mtx; + u_int regaddr; /* address for the sysctl */ +}; + +#define A64CODEC_LOCK(sc) mtx_lock(&(sc)->mtx) +#define A64CODEC_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define A64CODEC_READ(sc, reg) bus_read_4((sc)->res, (reg)) +#define A64CODEC_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) + +static int a64codec_probe(device_t dev); +static int a64codec_attach(device_t dev); +static int a64codec_detach(device_t dev); + +static u_int +a64_acodec_pr_read(struct a64codec_softc *sc, u_int addr) +{ + uint32_t val; + + /* Read current value */ + val = A64CODEC_READ(sc, A64_PR_CFG); + + /* De-assert reset */ + val |= A64_AC_PR_RST; + A64CODEC_WRITE(sc, A64_PR_CFG, val); + + /* Read mode */ + val &= ~A64_AC_PR_RW; + A64CODEC_WRITE(sc, A64_PR_CFG, val); + + /* Set address */ + val &= ~A64_AC_PR_ADDR_MASK; + val |= A64_AC_PR_ADDR(addr); + A64CODEC_WRITE(sc, A64_PR_CFG, val); + + /* Read data */ + val = A64CODEC_READ(sc, A64_PR_CFG); + return A64_ACDA_PR_RDAT(val); +} + +static void +a64_acodec_pr_write(struct a64codec_softc *sc, u_int addr, u_int data) +{ + uint32_t val; + + /* Read current value */ + val = A64CODEC_READ(sc, A64_PR_CFG); + + /* De-assert reset */ + val |= A64_AC_PR_RST; + A64CODEC_WRITE(sc, A64_PR_CFG, val); + + /* Set address */ + val &= ~A64_AC_PR_ADDR_MASK; + val |= A64_AC_PR_ADDR(addr); + A64CODEC_WRITE(sc, A64_PR_CFG, val); + + /* Write data */ + val &= ~A64_ACDA_PR_WDAT_MASK; + val |= A64_ACDA_PR_WDAT(data); + A64CODEC_WRITE(sc, A64_PR_CFG, val); + + /* Write mode */ + val |= A64_AC_PR_RW; + A64CODEC_WRITE(sc, A64_PR_CFG, val); + + /* Clear write mode */ + val &= ~A64_AC_PR_RW; + A64CODEC_WRITE(sc, A64_PR_CFG, val); +} + +static void +a64_acodec_pr_set_clear(struct a64codec_softc *sc, u_int addr, u_int set, u_int clr) +{ + u_int old, new; + + old = a64_acodec_pr_read(sc, addr); + new = set | (old & ~clr); + a64_acodec_pr_write(sc, addr, new); +} + +static int +a64codec_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "Allwinner A64 Analog Codec"); + return (BUS_PROBE_DEFAULT); +} + +static int +a64codec_attach(device_t dev) +{ + struct a64codec_softc *sc; + int error, rid; + phandle_t node; + regulator_t reg; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->res) { + device_printf(dev, "cannot allocate resource for device\n"); + error = ENXIO; + goto fail; + } + + if (regulator_get_by_ofw_property(dev, 0, "cpvdd-supply", ®) == 0) { + error = regulator_enable(reg); + if (error != 0) { + device_printf(dev, "cannot enable PHY regulator\n"); + goto fail; + } + } + + /* Right & Left Headphone PA enable */ + a64_acodec_pr_set_clear(sc, A64_HP_CTRL, + A64_HPPA_EN, 0); + + /* Microphone BIAS enable */ + a64_acodec_pr_set_clear(sc, A64_JACK_MIC_CTRL, + A64_HMICBIASEN | A64_INNERRESEN, 0); + + /* Unmute DAC to output mixer */ + a64_acodec_pr_set_clear(sc, A64_OL_MIX_CTRL, + A64_LMIXMUTE_LDAC, 0); + a64_acodec_pr_set_clear(sc, A64_OR_MIX_CTRL, + A64_RMIXMUTE_RDAC, 0); + + /* For now we work only with headphones */ + a64_acodec_pr_set_clear(sc, A64_LINEOUT_CTRL0, + 0, A64_LINEOUT_EN); + a64_acodec_pr_set_clear(sc, A64_HP_CTRL, + A64_HPPA_EN, 0); + + u_int val = a64_acodec_pr_read(sc, A64_HP_CTRL); + val &= ~(0x3f); + val |= 0x25; + a64_acodec_pr_write(sc, A64_HP_CTRL, val); + + a64_acodec_pr_set_clear(sc, A64_MIC2_CTRL, + A64_MIC2AMPEN | A64_MIC2_SEL | A64_MIC2G(0x3) | A64_MIC2BOOST(0x4), + A64_MIC2G_MASK | A64_MIC2BOOST_MASK); + + a64_acodec_pr_write(sc, A64_L_ADCMIX_SRC, + A64_ADCMIX_SRC_MIC2); + a64_acodec_pr_write(sc, A64_R_ADCMIX_SRC, + A64_ADCMIX_SRC_MIC2); + + /* Max out MIC2 gain */ + val = a64_acodec_pr_read(sc, A64_MIC2_CTRL); + val &= ~(0x7); + val |= (0x7); + val &= ~(7 << 4); + val |= (7 << 4); + a64_acodec_pr_write(sc, A64_MIC2_CTRL, val); + + node = ofw_bus_get_node(dev); + OF_device_register_xref(OF_xref_from_node(node), dev); + + return (0); + +fail: + a64codec_detach(dev); + return (error); +} + +static int +a64codec_detach(device_t dev) +{ + struct a64codec_softc *sc; + + sc = device_get_softc(dev); + + if (sc->res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); + mtx_destroy(&sc->mtx); + + return (0); +} + +static int +a64codec_mixer_init(struct snd_mixer *m) +{ + + mix_setdevs(m, A64CODEC_MIXER_DEVS); + + return (0); +} + +static int +a64codec_mixer_uninit(struct snd_mixer *m) +{ + + return (0); +} + +static int +a64codec_mixer_reinit(struct snd_mixer *m) +{ + + return (0); +} + +static int +a64codec_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) +{ + struct a64codec_softc *sc; + struct mtx *mixer_lock; + uint8_t do_unlock; + u_int val; + + sc = device_get_softc(mix_getdevinfo(m)); + mixer_lock = mixer_get_lock(m); + + if (mtx_owned(mixer_lock)) { + do_unlock = 0; + } else { + do_unlock = 1; + mtx_lock(mixer_lock); + } + + right = left; + + A64CODEC_LOCK(sc); + switch(dev) { + case SOUND_MIXER_VOLUME: + val = a64_acodec_pr_read(sc, A64_HP_CTRL); + val &= ~(A64_HPVOL_MASK); + val |= A64_HPVOL(left * 63 / 100); + a64_acodec_pr_write(sc, A64_HP_CTRL, val); + break; + + case SOUND_MIXER_MIC: + val = a64_acodec_pr_read(sc, A64_MIC2_CTRL); + val &= ~(A64_MIC2BOOST_MASK); + val |= A64_MIC2BOOST(left * 7 / 100); + a64_acodec_pr_write(sc, A64_MIC2_CTRL, val); + break; + default: + break; + } + A64CODEC_UNLOCK(sc); + + if (do_unlock) { + mtx_unlock(mixer_lock); + } + + return (left | (right << 8)); +} + +static unsigned +a64codec_mixer_setrecsrc(struct snd_mixer *m, unsigned src) +{ + + return (0); +} + +static kobj_method_t a64codec_mixer_methods[] = { + KOBJMETHOD(mixer_init, a64codec_mixer_init), + KOBJMETHOD(mixer_uninit, a64codec_mixer_uninit), + KOBJMETHOD(mixer_reinit, a64codec_mixer_reinit), + KOBJMETHOD(mixer_set, a64codec_mixer_set), + KOBJMETHOD(mixer_setrecsrc, a64codec_mixer_setrecsrc), + KOBJMETHOD_END +}; + +MIXER_DECLARE(a64codec_mixer); + +static int +a64codec_dai_init(device_t dev, uint32_t format) +{ + + return (0); +} + +static int +a64codec_dai_trigger(device_t dev, int go, int pcm_dir) +{ + struct a64codec_softc *sc = device_get_softc(dev); + + if ((pcm_dir != PCMDIR_PLAY) && (pcm_dir != PCMDIR_REC)) + return (EINVAL); + + switch (go) { + case PCMTRIG_START: + if (pcm_dir == PCMDIR_PLAY) { + /* Enable DAC analog l/r channels, HP PA, and output mixer */ + a64_acodec_pr_set_clear(sc, A64_MIX_DAC_CTRL, + A64_DACAREN | A64_DACALEN | A64_RMIXEN | A64_LMIXEN | + A64_RHPPAMUTE | A64_LHPPAMUTE, 0); + } + else if (pcm_dir == PCMDIR_REC) { + /* Enable ADC analog l/r channels */ + a64_acodec_pr_set_clear(sc, A64_ADC_CTRL, + A64_ADCREN | A64_ADCLEN, 0); + } + break; + + case PCMTRIG_STOP: + case PCMTRIG_ABORT: + if (pcm_dir == PCMDIR_PLAY) { + /* Disable DAC analog l/r channels, HP PA, and output mixer */ + a64_acodec_pr_set_clear(sc, A64_MIX_DAC_CTRL, + 0, A64_DACAREN | A64_DACALEN | A64_RMIXEN | A64_LMIXEN | + A64_RHPPAMUTE | A64_LHPPAMUTE); + } + else if (pcm_dir == PCMDIR_REC) { + /* Disable ADC analog l/r channels */ + a64_acodec_pr_set_clear(sc, A64_ADC_CTRL, + 0, A64_ADCREN | A64_ADCLEN); + } + break; + } + + return (0); +} + +static int +a64codec_dai_setup_mixer(device_t dev, device_t pcmdev) +{ + + mixer_init(pcmdev, &a64codec_mixer_class, dev); + + return (0); +} + +static device_method_t a64codec_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, a64codec_probe), + DEVMETHOD(device_attach, a64codec_attach), + DEVMETHOD(device_detach, a64codec_detach), + + DEVMETHOD(audio_dai_init, a64codec_dai_init), + DEVMETHOD(audio_dai_setup_mixer, a64codec_dai_setup_mixer), + DEVMETHOD(audio_dai_trigger, a64codec_dai_trigger), + + DEVMETHOD_END +}; + +static driver_t a64codec_driver = { + "a64codec", + a64codec_methods, + sizeof(struct a64codec_softc), +}; + +static devclass_t a64codec_devclass; + +DRIVER_MODULE(a64codec, simplebus, a64codec_driver, a64codec_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); diff --git a/sys/arm/allwinner/aw_i2s.c b/sys/arm/allwinner/aw_i2s.c new file mode 100644 index 000000000000..013e88a548a8 --- /dev/null +++ b/sys/arm/allwinner/aw_i2s.c @@ -0,0 +1,813 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Oleksandr Tymoshenko + * Copyright (c) 2018 Jared McNeill + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include *** 805 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Jun 11 19:38:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A476B663649; Fri, 11 Jun 2021 19:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1rkC2yMPz4bX5; Fri, 11 Jun 2021 19:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49EF428B41; Fri, 11 Jun 2021 19:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BJchws050920; Fri, 11 Jun 2021 19:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BJchmR050919; Fri, 11 Jun 2021 19:38:43 GMT (envelope-from git) Date: Fri, 11 Jun 2021 19:38:43 GMT Message-Id: <202106111938.15BJchmR050919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ab30bb8270fa - main - an: Deprecate the driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab30bb8270fa99503a0f204543a9ac3e3c7fa04d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 19:38:43 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ab30bb8270fa99503a0f204543a9ac3e3c7fa04d commit ab30bb8270fa99503a0f204543a9ac3e3c7fa04d Author: Emmanuel Vadot AuthorDate: 2021-06-07 16:45:58 +0000 Commit: Emmanuel Vadot CommitDate: 2021-06-11 19:17:34 +0000 an: Deprecate the driver Last an(4) devices have been End Of Life and End Of Sale in 2007. Time to remove this driver. Differential Revision: https://reviews.freebsd.org/D30678 Reviewed by: imp (earlier version), adrian (earlier version) MFC after: 3 days Sponsored by: Diablotin Systems --- share/man/man4/an.4 | 5 +++++ sys/dev/an/if_an.c | 1 + 2 files changed, 6 insertions(+) diff --git a/share/man/man4/an.4 b/share/man/man4/an.4 index aaa761a36b4d..1d624c0ae108 100644 --- a/share/man/man4/an.4 +++ b/share/man/man4/an.4 @@ -130,6 +130,11 @@ The .Nm device driver first appeared in .Fx 4.0 . +.Pp +The +.Nm +device driver was removed in +.Fx 14.0 . .Sh AUTHORS The .Nm diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 205514bf0765..3a4db28f3eac 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -661,6 +661,7 @@ an_attach(struct an_softc *sc, int flags) int i, nrate, mword; u_int8_t r; + gone_in(14, "EOL/EOS in 2007"); ifp = sc->an_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(sc->an_dev, "can not if_alloc()\n"); From owner-dev-commits-src-all@freebsd.org Fri Jun 11 19:38:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 980E9663B81; Fri, 11 Jun 2021 19:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1rkD3mVbz4blS; Fri, 11 Jun 2021 19:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69C2E285F5; Fri, 11 Jun 2021 19:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BJcisk050944; Fri, 11 Jun 2021 19:38:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BJciAC050943; Fri, 11 Jun 2021 19:38:44 GMT (envelope-from git) Date: Fri, 11 Jun 2021 19:38:44 GMT Message-Id: <202106111938.15BJciAC050943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 663b174b5b53 - main - an: Remove driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 663b174b5b5387948bfa94131a08f6259d2926cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 19:38:44 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=663b174b5b5387948bfa94131a08f6259d2926cc commit 663b174b5b5387948bfa94131a08f6259d2926cc Author: Emmanuel Vadot AuthorDate: 2021-06-07 16:48:00 +0000 Commit: Emmanuel Vadot CommitDate: 2021-06-11 19:18:04 +0000 an: Remove driver Last an(4) devices have been End Of Life and End Of Sale in 2007. Time to remove this driver. Differential Revision: https://reviews.freebsd.org/D30679 Reviewed by: imp (earlier version), emaste (earlier version) Sponsored by: Diablotin Systems --- ObsoleteFiles.inc | 5 + include/Makefile | 2 +- share/man/man4/an.4 | 142 -- sys/conf/files | 3 - sys/dev/an/if_aironet_ieee.h | 798 --------- sys/dev/an/if_an.c | 3820 ------------------------------------------ sys/dev/an/if_an_isa.c | 154 -- sys/dev/an/if_an_pci.c | 280 ---- sys/dev/an/if_anreg.h | 547 ------ sys/modules/Makefile | 2 - sys/modules/an/Makefile | 9 - 11 files changed, 6 insertions(+), 5756 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 7bc4f435f869..1b4c291a0c51 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20210607: remove an(4) +OLD_FILES+=usr/include/dev/an/if_aironet_ieee.h +OLD_FILES+=usr/include/dev/an/if_anreg.h +OLD_FILES+=usr/share/man/man4/an.4.gz + # 20210426: remove unused libexec/rc.d/addswap OLD_FILES+=etc/rc.d/addswap diff --git a/include/Makefile b/include/Makefile index b444184ab8c6..f5c0fc598b0c 100644 --- a/include/Makefile +++ b/include/Makefile @@ -41,7 +41,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ LDIRS= geom net net80211 netgraph netinet netinet6 \ netipsec netsmb nfs nfsclient nfsserver sys vm -LSUBDIRS= dev/acpica dev/agp dev/an dev/ciss dev/filemon dev/firewire \ +LSUBDIRS= dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ diff --git a/share/man/man4/an.4 b/share/man/man4/an.4 deleted file mode 100644 index 1d624c0ae108..000000000000 --- a/share/man/man4/an.4 +++ /dev/null @@ -1,142 +0,0 @@ -.\" Copyright (c) 1997, 1998, 1999 -.\" Bill Paul . 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Bill Paul. -.\" 4. Neither the name of the author nor the names of any co-contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -.\" THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd July 16, 2005 -.Dt AN 4 -.Os -.Sh NAME -.Nm an -.Nd "Aironet Communications 4500/4800 wireless network adapter driver" -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device an" -.Cd "device wlan" -.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 -if_an_load="YES" -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for Aironet Communications 4500 and 4800 -wireless network adapters and variants, including the following: -.Pp -.Bl -bullet -compact -offset indent -.It -Aironet Communications 4500 and 4800 series -.It -Cisco Aironet 340 and 350 series -.El -.Pp -Support for these devices include the ISA and PCI -varieties. -The Aironet 4500 series adapters operate at 1 and 2Mbps while -the Aironet 4800 series and Cisco adapters can operate at 1, 2, 5.5 and 11Mbps. -The ISA and PCI -devices are all based on the same core PCMCIA hardware -and all have the same programming interface. -The ISA and PCI cards appear to the -host as normal ISA and PCI devices. -.Pp -ISA cards can either be configured to use ISA Plug and Play -or to use a particular I/O address and IRQ -by properly setting the DIP switches on the board. -(The default -switch setting is for Plug and Play.) -The -.Nm -driver has Plug and Play support and will work in either configuration, -however when using a hard-wired I/O address and IRQ, the driver -configuration and the NIC's switch settings must agree. -PCI cards -require no switch settings of any kind and will be automatically -probed and attached. -.Pp -All host/device interaction with the Aironet cards is via programmed I/O. -The Aironet devices support 802.11 and 802.3 frames, power management, -BSS (infrastructure) and IBSS (ad-hoc) operation modes. -The -.Nm -driver encapsulates all IP and ARP traffic as 802.11 frames, however -it can receive either 802.11 or 802.3 frames. -Transmit speed is -selectable between 1Mbps, 2Mbps, 5.5Mbps, 11Mbps or -"auto" (the NIC automatically chooses the best speed). -.Pp -By default, the -.Nm -driver configures the Aironet card for infrastructure operation. -.Pp -For more information on configuring this device, see -.Xr ifconfig 8 . -.Sh DIAGNOSTICS -.Bl -diag -.It "an%d: init failed" -The Aironet card failed to become ready after an initialization command was -issued. -.It "an%d: failed to allocate %d bytes on NIC" -The driver was unable to allocate memory for transmit frames in the -NIC's on-board RAM. -.It "an%d: device timeout" -The Aironet card failed to generate an interrupt to acknowledge a transmit -command. -.El -.Sh SEE ALSO -.Xr altq 4 , -.Xr arp 4 , -.Xr miibus 4 , -.Xr netintro 4 , -.Xr wlan 4 , -.Xr ancontrol 8 , -.Xr ifconfig 8 -.Sh HISTORY -The -.Nm -device driver first appeared in -.Fx 4.0 . -.Pp -The -.Nm -device driver was removed in -.Fx 14.0 . -.Sh AUTHORS -The -.Nm -driver was written by -.An Bill Paul Aq Mt wpaul@ee.columbia.edu . diff --git a/sys/conf/files b/sys/conf/files index d7e35b5f6c21..2b37d7f4e83e 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -916,9 +916,6 @@ dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr dev/amr/amr_linux.c optional amr compat_linux dev/amr/amr_pci.c optional amr pci -dev/an/if_an.c optional an -dev/an/if_an_isa.c optional an isa -dev/an/if_an_pci.c optional an pci # dev/ata/ata_if.m optional ata | atacore dev/ata/ata-all.c optional ata | atacore diff --git a/sys/dev/an/if_aironet_ieee.h b/sys/dev/an/if_aironet_ieee.h deleted file mode 100644 index beb8a9c3a3be..000000000000 --- a/sys/dev/an/if_aironet_ieee.h +++ /dev/null @@ -1,798 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1997, 1998, 1999 - * Bill Paul . 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD - * 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 _IF_AIRONET_IEEE_H -#define _IF_AIRONET_IEEE_H - -/* - * This header defines a simple command interface to the FreeBSD - * Aironet driver (an) driver, which is used to set certain - * device-specific parameters which can't be easily managed through - * ifconfig(8). No, sysctl(2) is not the answer. I said a _simple_ - * interface, didn't I. - */ - -#ifndef SIOCSAIRONET -#define SIOCSAIRONET SIOCSIFGENERIC -#endif - -#ifndef SIOCGAIRONET -#define SIOCGAIRONET SIOCGIFGENERIC -#endif - -/* - * This is a make-predend RID value used only by the driver - * to allow the user to set the speed. - */ -#define AN_RID_TX_SPEED 0x1234 - -/* - * Technically I don't think there's a limit to a record - * length. The largest record is the one that contains the CIS - * data, which is 240 words long, so 256 should be a safe - * value. - */ -#define AN_MAX_DATALEN 4096 - -struct an_req { - u_int16_t an_len; - u_int16_t an_type; - u_int16_t an_val[AN_MAX_DATALEN]; -}; - -/* - * Private LTV records (interpreted only by the driver). This is - * a minor kludge to allow reading the interface statistics from - * the driver. - */ -#define AN_RID_IFACE_STATS 0x0100 -#define AN_RID_MGMT_XMIT 0x0200 -#ifdef ANCACHE -#define AN_RID_ZERO_CACHE 0x0300 -#define AN_RID_READ_CACHE 0x0400 -#endif - -#define AN_FCTL_VERS 0x0002 -#define AN_FCTL_FTYPE 0x000C -#define AN_FCTL_STYPE 0x00F0 -#define AN_FCTL_TODS 0x0100 -#define AN_FCTL_FROMDS 0x0200 -#define AN_FCTL_MOREFRAGS 0x0400 -#define AN_FCTL_RETRY 0x0800 -#define AN_FCTL_PM 0x1000 -#define AN_FCTL_MOREDATA 0x2000 -#define AN_FCTL_WEP 0x4000 -#define AN_FCTL_ORDER 0x8000 - -#define AN_FTYPE_MGMT 0x0000 -#define AN_FTYPE_CTL 0x0004 -#define AN_FTYPE_DATA 0x0008 - -#define AN_STYPE_MGMT_ASREQ 0x0000 /* association request */ -#define AN_STYPE_MGMT_ASRESP 0x0010 /* association response */ -#define AN_STYPE_MGMT_REASREQ 0x0020 /* reassociation request */ -#define AN_STYPE_MGMT_REASRESP 0x0030 /* reassociation response */ -#define AN_STYPE_MGMT_PROBEREQ 0x0040 /* probe request */ -#define AN_STYPE_MGMT_PROBERESP 0x0050 /* probe response */ -#define AN_STYPE_MGMT_BEACON 0x0080 /* beacon */ -#define AN_STYPE_MGMT_ATIM 0x0090 /* announcement traffic ind msg */ -#define AN_STYPE_MGMT_DISAS 0x00A0 /* disassociation */ -#define AN_STYPE_MGMT_AUTH 0x00B0 /* authentication */ -#define AN_STYPE_MGMT_DEAUTH 0x00C0 /* deauthentication */ - -/* - * Aironet IEEE signal strength cache - * - * driver keeps cache of last - * MAXANCACHE packets to arrive including signal strength info. - * daemons may read this via ioctl - * - * Each entry in the wi_sigcache has a unique macsrc. - */ -#ifdef ANCACHE -#define MAXANCACHE 10 - -struct an_sigcache { - char macsrc[6]; /* unique MAC address for entry */ - int ipsrc; /* ip address associated with packet */ - int signal; /* signal strength of the packet */ - int noise; /* noise value */ - int quality; /* quality of the packet */ -}; -#endif - -/* - * The card provides an 8-bit signal strength value (RSSI), which can - * be converted to a dBm power value (or a percent) using a table in - * the card's firmware (when available). The tables are slightly - * different in individual cards, even of the same model. If the - * table is not available, the mapping can be approximated by dBm = - * RSSI - 100. This approximation can be seen by plotting a few - * tables, and also matches some info on the Intersil web site (I - * think they make the RF front end for the cards. However, the linux - * driver uses the approximation dBm = RSSI/2 - 95. I think that is - * just wrong. - */ - -struct an_rssi_entry { - u_int8_t an_rss_pct; - u_int8_t an_rss_dbm; -}; - -struct an_ltv_key { - u_int16_t an_len; - u_int16_t an_type; - u_int16_t kindex; - u_int8_t mac[6]; - u_int16_t klen; - u_int8_t key[16]; /* 128-bit keys */ -}; - -struct an_ltv_stats { - u_int16_t an_fudge; - u_int16_t an_len; /* 0x00 */ - u_int16_t an_type; /* 0xXX */ - u_int16_t an_spacer; /* 0x02 */ - u_int32_t an_rx_overruns; /* 0x04 */ - u_int32_t an_rx_plcp_csum_errs; /* 0x08 */ - u_int32_t an_rx_plcp_format_errs; /* 0x0C */ - u_int32_t an_rx_plcp_len_errs; /* 0x10 */ - u_int32_t an_rx_mac_crc_errs; /* 0x14 */ - u_int32_t an_rx_mac_crc_ok; /* 0x18 */ - u_int32_t an_rx_wep_errs; /* 0x1C */ - u_int32_t an_rx_wep_ok; /* 0x20 */ - u_int32_t an_retry_long; /* 0x24 */ - u_int32_t an_retry_short; /* 0x28 */ - u_int32_t an_retry_max; /* 0x2C */ - u_int32_t an_no_ack; /* 0x30 */ - u_int32_t an_no_cts; /* 0x34 */ - u_int32_t an_rx_ack_ok; /* 0x38 */ - u_int32_t an_rx_cts_ok; /* 0x3C */ - u_int32_t an_tx_ack_ok; /* 0x40 */ - u_int32_t an_tx_rts_ok; /* 0x44 */ - u_int32_t an_tx_cts_ok; /* 0x48 */ - u_int32_t an_tx_lmac_mcasts; /* 0x4C */ - u_int32_t an_tx_lmac_bcasts; /* 0x50 */ - u_int32_t an_tx_lmac_ucast_frags; /* 0x54 */ - u_int32_t an_tx_lmac_ucasts; /* 0x58 */ - u_int32_t an_tx_beacons; /* 0x5C */ - u_int32_t an_rx_beacons; /* 0x60 */ - u_int32_t an_tx_single_cols; /* 0x64 */ - u_int32_t an_tx_multi_cols; /* 0x68 */ - u_int32_t an_tx_defers_no; /* 0x6C */ - u_int32_t an_tx_defers_prot; /* 0x70 */ - u_int32_t an_tx_defers_energy; /* 0x74 */ - u_int32_t an_rx_dups; /* 0x78 */ - u_int32_t an_rx_partial; /* 0x7C */ - u_int32_t an_tx_too_old; /* 0x80 */ - u_int32_t an_rx_too_old; /* 0x84 */ - u_int32_t an_lostsync_max_retries;/* 0x88 */ - u_int32_t an_lostsync_missed_beacons;/* 0x8C */ - u_int32_t an_lostsync_arl_exceeded;/*0x90 */ - u_int32_t an_lostsync_deauthed; /* 0x94 */ - u_int32_t an_lostsync_disassociated;/*0x98 */ - u_int32_t an_lostsync_tsf_timing; /* 0x9C */ - u_int32_t an_tx_host_mcasts; /* 0xA0 */ - u_int32_t an_tx_host_bcasts; /* 0xA4 */ - u_int32_t an_tx_host_ucasts; /* 0xA8 */ - u_int32_t an_tx_host_failed; /* 0xAC */ - u_int32_t an_rx_host_mcasts; /* 0xB0 */ - u_int32_t an_rx_host_bcasts; /* 0xB4 */ - u_int32_t an_rx_host_ucasts; /* 0xB8 */ - u_int32_t an_rx_host_discarded; /* 0xBC */ - u_int32_t an_tx_hmac_mcasts; /* 0xC0 */ - u_int32_t an_tx_hmac_bcasts; /* 0xC4 */ - u_int32_t an_tx_hmac_ucasts; /* 0xC8 */ - u_int32_t an_tx_hmac_failed; /* 0xCC */ - u_int32_t an_rx_hmac_mcasts; /* 0xD0 */ - u_int32_t an_rx_hmac_bcasts; /* 0xD4 */ - u_int32_t an_rx_hmac_ucasts; /* 0xD8 */ - u_int32_t an_rx_hmac_discarded; /* 0xDC */ - u_int32_t an_tx_hmac_accepted; /* 0xE0 */ - u_int32_t an_ssid_mismatches; /* 0xE4 */ - u_int32_t an_ap_mismatches; /* 0xE8 */ - u_int32_t an_rates_mismatches; /* 0xEC */ - u_int32_t an_auth_rejects; /* 0xF0 */ - u_int32_t an_auth_timeouts; /* 0xF4 */ - u_int32_t an_assoc_rejects; /* 0xF8 */ - u_int32_t an_assoc_timeouts; /* 0xFC */ - u_int32_t an_reason_outside_table;/* 0x100 */ - u_int32_t an_reason1; /* 0x104 */ - u_int32_t an_reason2; /* 0x108 */ - u_int32_t an_reason3; /* 0x10C */ - u_int32_t an_reason4; /* 0x110 */ - u_int32_t an_reason5; /* 0x114 */ - u_int32_t an_reason6; /* 0x118 */ - u_int32_t an_reason7; /* 0x11C */ - u_int32_t an_reason8; /* 0x120 */ - u_int32_t an_reason9; /* 0x124 */ - u_int32_t an_reason10; /* 0x128 */ - u_int32_t an_reason11; /* 0x12C */ - u_int32_t an_reason12; /* 0x130 */ - u_int32_t an_reason13; /* 0x134 */ - u_int32_t an_reason14; /* 0x138 */ - u_int32_t an_reason15; /* 0x13C */ - u_int32_t an_reason16; /* 0x140 */ - u_int32_t an_reason17; /* 0x144 */ - u_int32_t an_reason18; /* 0x148 */ - u_int32_t an_reason19; /* 0x14C */ - u_int32_t an_rx_mgmt_pkts; /* 0x150 */ - u_int32_t an_tx_mgmt_pkts; /* 0x154 */ - u_int32_t an_rx_refresh_pkts; /* 0x158 */ - u_int32_t an_tx_refresh_pkts; /* 0x15C */ - u_int32_t an_rx_poll_pkts; /* 0x160 */ - u_int32_t an_tx_poll_pkts; /* 0x164 */ - u_int32_t an_host_retries; /* 0x168 */ - u_int32_t an_lostsync_hostreq; /* 0x16C */ - u_int32_t an_host_tx_bytes; /* 0x170 */ - u_int32_t an_host_rx_bytes; /* 0x174 */ - u_int32_t an_uptime_usecs; /* 0x178 */ - u_int32_t an_uptime_secs; /* 0x17C */ - u_int32_t an_lostsync_better_ap; /* 0x180 */ - u_int32_t an_rsvd[15]; -}; - -/* - * General configuration information. - */ -struct an_ltv_genconfig { - /* General configuration. */ - u_int16_t an_len; /* 0x00 */ - u_int16_t an_type; /* XXXX */ - u_int16_t an_opmode; /* 0x02 */ - u_int16_t an_rxmode; /* 0x04 */ - u_int16_t an_fragthresh; /* 0x06 */ - u_int16_t an_rtsthresh; /* 0x08 */ - u_int8_t an_macaddr[6]; /* 0x0A */ - u_int8_t an_rates[8]; /* 0x10 */ - u_int16_t an_shortretry_limit; /* 0x18 */ - u_int16_t an_longretry_limit; /* 0x1A */ - u_int16_t an_tx_msdu_lifetime; /* 0x1C */ - u_int16_t an_rx_msdu_lifetime; /* 0x1E */ - u_int16_t an_stationary; /* 0x20 */ - u_int16_t an_ordering; /* 0x22 */ - u_int16_t an_devtype; /* 0x24 */ - u_int16_t an_rsvd0[5]; /* 0x26 */ - /* Scanning associating. */ - u_int16_t an_scanmode; /* 0x30 */ - u_int16_t an_probedelay; /* 0x32 */ - u_int16_t an_probe_energy_timeout;/* 0x34 */ - u_int16_t an_probe_response_timeout;/*0x36 */ - u_int16_t an_beacon_listen_timeout;/*0x38 */ - u_int16_t an_ibss_join_net_timeout;/*0x3A */ - u_int16_t an_auth_timeout; /* 0x3C */ - u_int16_t an_authtype; /* 0x3E */ - u_int16_t an_assoc_timeout; /* 0x40 */ - u_int16_t an_specified_ap_timeout;/* 0x42 */ - u_int16_t an_offline_scan_interval;/*0x44 */ - u_int16_t an_offline_scan_duration;/*0x46 */ - u_int16_t an_link_loss_delay; /* 0x48 */ - u_int16_t an_max_beacon_lost_time;/* 0x4A */ - u_int16_t an_refresh_interval; /* 0x4C */ - u_int16_t an_rsvd1; /* 0x4E */ - /* Power save operation */ - u_int16_t an_psave_mode; /* 0x50 */ - u_int16_t an_sleep_for_dtims; /* 0x52 */ - u_int16_t an_listen_interval; /* 0x54 */ - u_int16_t an_fast_listen_interval;/* 0x56 */ - u_int16_t an_listen_decay; /* 0x58 */ - u_int16_t an_fast_listen_decay; /* 0x5A */ - u_int16_t an_rsvd2[2]; /* 0x5C */ - /* Ad-hoc (or AP) operation. */ - u_int16_t an_beacon_period; /* 0x60 */ - u_int16_t an_atim_duration; /* 0x62 */ - u_int16_t an_rsvd3; /* 0x64 */ - u_int16_t an_ds_channel; /* 0x66 */ - u_int16_t an_rsvd4; /* 0x68 */ - u_int16_t an_dtim_period; /* 0x6A */ - u_int16_t an_rsvd5[2]; /* 0x6C */ - /* Radio operation. */ - u_int16_t an_radiotype; /* 0x70 */ - u_int16_t an_diversity; /* 0x72 */ - u_int16_t an_tx_power; /* 0x74 */ - u_int16_t an_rss_thresh; /* 0x76 */ - u_int16_t an_modulation_type; /* 0x78 */ - u_int16_t an_short_preamble; /* 0x7A */ - u_int16_t an_home_product; /* 0x7C */ - u_int16_t an_rsvd6; /* 0x7E */ - /* Aironet extensions. */ - u_int8_t an_nodename[16]; /* 0x80 */ - u_int16_t an_arl_thresh; /* 0x90 */ - u_int16_t an_arl_decay; /* 0x92 */ - u_int16_t an_arl_delay; /* 0x94 */ - u_int8_t an_rsvd7; /* 0x96 */ - u_int8_t an_rsvd8; /* 0x97 */ - u_int8_t an_magic_packet_action; /* 0x98 */ - u_int8_t an_magic_packet_ctl; /* 0x99 */ - u_int16_t an_rsvd9; - u_int16_t an_spare[19]; -}; - -#define AN_OPMODE_IBSS_ADHOC 0x0000 -#define AN_OPMODE_INFRASTRUCTURE_STATION 0x0001 -#define AN_OPMODE_AP 0x0002 -#define AN_OPMODE_AP_REPEATER 0x0003 -#define AN_OPMODE_UNMODIFIED_PAYLOAD 0x0100 -#define AN_OPMODE_AIRONET_EXTENSIONS 0x0200 -#define AN_OPMODE_AP_EXTENSIONS 0x0400 - -#define AN_RXMODE_BC_MC_ADDR 0x0000 -#define AN_RXMODE_BC_ADDR 0x0001 -#define AN_RXMODE_ADDR 0x0002 -#define AN_RXMODE_80211_MONITOR_CURBSS 0x0003 -#define AN_RXMODE_80211_MONITOR_ANYBSS 0x0004 -#define AN_RXMODE_LAN_MONITOR_CURBSS 0x0005 -#define AN_RXMODE_NO_8023_HEADER 0x0100 -#define AN_RXMODE_NORMALIZED_RSSI 0x0200 - -#define AN_RATE_1MBPS 0x0002 -#define AN_RATE_2MBPS 0x0004 -#define AN_RATE_5_5MBPS 0x000B -#define AN_RATE_11MBPS 0x0016 - -#define AN_DEVTYPE_PC4500 0x0065 -#define AN_DEVTYPE_PC4800 0x006D - -#define AN_SCANMODE_ACTIVE 0x0000 -#define AN_SCANMODE_PASSIVE 0x0001 -#define AN_SCANMODE_AIRONET_ACTIVE 0x0002 - -#define AN_AUTHTYPE_NONE 0x0000 -#define AN_AUTHTYPE_OPEN 0x0001 -#define AN_AUTHTYPE_SHAREDKEY 0x0002 -#define AN_AUTHTYPE_MASK 0x00ff -#define AN_AUTHTYPE_ENABLE 0x0100 -#define AN_AUTHTYPE_PRIVACY_IN_USE 0x0100 -#define AN_AUTHTYPE_ALLOW_UNENCRYPTED 0x0200 -#define AN_AUTHTYPE_LEAP 0x1000 - -#define AN_PSAVE_NONE 0x0000 -#define AN_PSAVE_CAM 0x0001 -#define AN_PSAVE_PSP 0x0002 -#define AN_PSAVE_PSP_CAM 0x0003 - -#define AN_RADIOTYPE_80211_FH 0x0001 -#define AN_RADIOTYPE_80211_DS 0x0002 -#define AN_RADIOTYPE_LM2000_DS 0x0004 - -#define AN_DIVERSITY_FACTORY_DEFAULT 0x0000 -#define AN_DIVERSITY_ANTENNA_1_ONLY 0x0001 -#define AN_DIVERSITY_ANTENNA_2_ONLY 0x0002 -#define AN_DIVERSITY_ANTENNA_1_AND_2 0x0003 - -#define AN_TXPOWER_FACTORY_DEFAULT 0x0000 -#define AN_TXPOWER_50MW 50 -#define AN_TXPOWER_100MW 100 -#define AN_TXPOWER_250MW 250 - -#define AN_HOME_NETWORK 0x0001 -#define AN_HOME_INSTALL_AP 0x0002 - -/* - * Valid SSID list. You can specify up to three SSIDs denoting - * the service sets that you want to join. The first SSID always - * defaults to "tsunami" which is a handy way to detect the - * card. - */ - -struct an_ltv_ssidlist { - u_int16_t an_len; - u_int16_t an_type; - u_int16_t an_ssid1_len; - char an_ssid1[32]; - u_int16_t an_ssid2_len; - char an_ssid2[32]; - u_int16_t an_ssid3_len; - char an_ssid3[32]; -}; - -struct an_ltv_ssid_entry{ - u_int16_t an_len; - char an_ssid[32]; -}; - -#define MAX_SSIDS 25 -struct an_ltv_ssidlist_new { - u_int16_t an_len; - u_int16_t an_type; - struct an_ltv_ssid_entry an_entry[MAX_SSIDS]; -}; - -/* - * Valid AP list. - */ -struct an_ltv_aplist { - u_int16_t an_len; - u_int16_t an_type; - u_int8_t an_ap1[8]; - u_int8_t an_ap2[8]; - u_int8_t an_ap3[8]; - u_int8_t an_ap4[8]; -}; - -/* - * Driver name. - */ -struct an_ltv_drvname { - u_int16_t an_len; - u_int16_t an_type; - u_int8_t an_drvname[16]; -}; - -/* - * Frame encapsulation. - */ -struct an_rid_encap { - u_int16_t an_len; - u_int16_t an_type; - u_int16_t an_ethertype_default; - u_int16_t an_action_default; - u_int16_t an_ethertype0; - u_int16_t an_action0; - u_int16_t an_ethertype1; - u_int16_t an_action1; - u_int16_t an_ethertype2; - u_int16_t an_action2; - u_int16_t an_ethertype3; - u_int16_t an_action3; - u_int16_t an_ethertype4; - u_int16_t an_action4; - u_int16_t an_ethertype5; - u_int16_t an_action5; - u_int16_t an_ethertype6; - u_int16_t an_action6; -}; - -#define AN_ENCAP_ACTION_RX 0x0001 -#define AN_ENCAP_ACTION_TX 0x0002 - -#define AN_RXENCAP_NONE 0x0000 -#define AN_RXENCAP_RFC1024 0x0001 - -#define AN_TXENCAP_RFC1024 0x0000 -#define AN_TXENCAP_80211 0x0002 - -/* - * Card capabilities (read only). - */ -struct an_ltv_caps { - u_int16_t an_len; /* 0x00 */ - u_int16_t an_type; /* XXXX */ - u_int8_t an_oui[3]; /* 0x02 */ - u_int8_t an_rsvd0; /* 0x05 */ - u_int16_t an_prodnum; /* 0x06 */ - u_int8_t an_manufname[32]; /* 0x08 */ - u_int8_t an_prodname[16]; /* 0x28 */ - u_int8_t an_prodvers[8]; /* 0x38 */ - u_int8_t an_oemaddr[6]; /* 0x40 */ - u_int8_t an_aironetaddr[6]; /* 0x46 */ - u_int16_t an_radiotype; /* 0x4C */ - u_int16_t an_regdomain; /* 0x4E */ - u_int8_t an_callid[6]; /* 0x50 */ - u_int8_t an_rates[8]; /* 0x56 */ - u_int8_t an_rx_diversity; /* 0x5E */ - u_int8_t an_tx_diversity; /* 0x5F */ - u_int16_t an_tx_powerlevels[8]; /* 0x60 */ - u_int16_t an_hwrev; /* 0x70 */ - u_int16_t an_hwcaps; /* 0x72 */ - u_int16_t an_temprange; /* 0x74 */ - u_int16_t an_fwrev; /* 0x76 */ - u_int16_t an_fwsubrev; /* 0x78 */ - u_int16_t an_ifacerev; /* 0x7A */ - u_int16_t an_softcaps; /* 0x7C */ - u_int16_t an_bootblockrev; /* 0x7E */ - u_int16_t an_req_hw_support; /* 0x80 */ - u_int16_t an_unknown[31]; /* 0x82 */ -}; - -/* - * Access point (read only) - */ -struct an_ltv_apinfo { - u_int16_t an_len; - u_int16_t an_type; - u_int16_t an_tim_addr; - u_int16_t an_airo_addr; -}; - -/* - * Radio info (read only). - */ -struct an_ltv_radioinfo { - u_int16_t an_len; - u_int16_t an_type; - /* ??? */ -}; - -/* - * RSSI map. If available in the card's firmware, this can be used to - * convert the 8-bit RSSI values from the card into dBm. - */ -struct an_ltv_rssi_map { - u_int16_t an_len; - u_int16_t an_type; - struct an_rssi_entry an_entries[256]; -}; - -/* - * Status (read only). Note: the manual claims this RID is 108 bytes - * long (0x6A is the last datum, which is 2 bytes long) however when - * this RID is read from the NIC, it returns a length of 110. To be - * on the safe side, this structure is padded with an extra 16-bit - * word. (There is a misprint in the manual which says the macaddr - * field is 8 bytes long.) - * - * Also, the channel_set and current_channel fields appear to be - * reversed. Either that, or the hop_period field is unused. - */ -struct an_ltv_status { - u_int16_t an_len; /* 0x00 */ - u_int16_t an_type; /* 0xXX */ - u_int8_t an_macaddr[6]; /* 0x02 */ - u_int16_t an_opmode; /* 0x08 */ - u_int16_t an_errcode; /* 0x0A */ - u_int16_t an_signal_quality; /* 0x0C */ - u_int16_t an_ssidlen; /* 0x0E */ - u_int8_t an_ssid[32]; /* 0x10 */ - u_int8_t an_ap_name[16]; /* 0x30 */ - u_int8_t an_cur_bssid[6]; /* 0x40 */ - u_int8_t an_prev_bssid1[6]; /* 0x46 */ - u_int8_t an_prev_bssid2[6]; /* 0x4C */ - u_int8_t an_prev_bssid3[6]; /* 0x52 */ - u_int16_t an_beacon_period; /* 0x58 */ - u_int16_t an_dtim_period; /* 0x5A */ - u_int16_t an_atim_duration; /* 0x5C */ - u_int16_t an_hop_period; /* 0x5E */ - u_int16_t an_cur_channel; /* 0x62 */ - u_int16_t an_channel_set; /* 0x60 */ - u_int16_t an_hops_to_backbone; /* 0x64 */ - u_int16_t an_ap_total_load; /* 0x66 */ - u_int16_t an_our_generated_load; /* 0x68 */ - u_int16_t an_accumulated_arl; /* 0x6A */ - u_int16_t an_cur_signal_quality; /* 0x6C */ - u_int16_t an_current_tx_rate; /* 0x6E */ - u_int16_t an_ap_device; /* 0x70 */ - u_int16_t an_normalized_strength; /* 0x72 */ - u_int16_t an_short_pre_in_use; /* 0x74 */ - u_int8_t an_ap_ip_addr[4]; /* 0x76 */ - u_int8_t an_noise_prev_sec_pc; /* 0x7A */ - u_int8_t an_noise_prev_sec_db; /* 0x7B */ - u_int8_t an_avg_noise_prev_min_pc; /* 0x7C */ - u_int8_t an_avg_noise_prev_min_db; /* 0x7D */ - u_int8_t an_max_noise_prev_min_pc; /* 0x7E */ - u_int8_t an_max_noise_prev_min_db; /* 0x7F */ - u_int16_t an_spare[18]; -}; - -#define AN_STATUS_OPMODE_CONFIGURED 0x0001 -#define AN_STATUS_OPMODE_MAC_ENABLED 0x0002 -#define AN_STATUS_OPMODE_RX_ENABLED 0x0004 -#define AN_STATUS_OPMODE_IN_SYNC 0x0010 -#define AN_STATUS_OPMODE_ASSOCIATED 0x0020 -#define AN_STATUS_OPMODE_LEAP 0x0040 -#define AN_STATUS_OPMODE_ERROR 0x8000 - -/* - * WEP Key - */ -struct an_ltv_wepkey { - u_int16_t an_len; /* 0x00 */ - u_int16_t an_type; /* 0xXX */ - u_int16_t an_key_index; /* 0x02 */ - u_int8_t an_mac_addr[6]; /* 0x04 */ - u_int16_t an_key_len; /* 0x0A */ - u_int8_t an_key[13]; /* 0x0C */ -}; - -/* - * Receive frame structure. - */ -struct an_rxframe { - u_int32_t an_rx_time; /* 0x00 */ - u_int16_t an_rx_status; /* 0x04 */ - u_int16_t an_rx_payload_len; /* 0x06 */ - u_int8_t an_rsvd0; /* 0x08 */ - u_int8_t an_rx_signal_strength; /* 0x09 */ - u_int8_t an_rx_rate; /* 0x0A */ - u_int8_t an_rx_chan; /* 0x0B */ - u_int8_t an_rx_assoc_cnt; /* 0x0C */ - u_int8_t an_rsvd1[3]; /* 0x0D */ - u_int8_t an_plcp_hdr[4]; /* 0x10 */ - u_int16_t an_frame_ctl; /* 0x14 */ - u_int16_t an_duration; /* 0x16 */ - u_int8_t an_addr1[6]; /* 0x18 */ - u_int8_t an_addr2[6]; /* 0x1E */ - u_int8_t an_addr3[6]; /* 0x24 */ - u_int16_t an_seq_ctl; /* 0x2A */ - u_int8_t an_addr4[6]; /* 0x2C */ - u_int8_t an_gaplen; /* 0x32 */ -} __packed; - -/* Do not modify this unless you are modifying LEAP itself */ -#define LEAP_USERNAME_MAX 32 -#define LEAP_PASSWORD_MAX 32 - -/* - * LEAP Username - */ -struct an_ltv_leap_username { - u_int16_t an_len; /* 0x00 */ - u_int16_t an_type; /* 0xXX */ - u_int16_t an_username_len; /* 0x02 */ - u_int8_t an_username[LEAP_USERNAME_MAX]; /* 0x04 */ -}; - -/* - * LEAP Password - */ -struct an_ltv_leap_password { - u_int16_t an_len; /* 0x00 */ - u_int16_t an_type; /* 0xXX */ - u_int16_t an_password_len; /* 0x02 */ - u_int8_t an_password[LEAP_PASSWORD_MAX]; /* 0x04 */ -}; - -/* - * These are all the LTV record types that we can read or write - * from the Aironet. Not all of them are temendously useful, but I - * list as many as I know about here for completeness. - */ - -/* - * Configuration (read/write) - */ -#define AN_RID_GENCONFIG 0xFF10 /* General configuration info */ -#define AN_RID_SSIDLIST 0xFF11 /* Valid SSID list */ -#define AN_RID_APLIST 0xFF12 /* Valid AP list */ -#define AN_RID_DRVNAME 0xFF13 /* ID name of this node for diag */ -#define AN_RID_ENCAPPROTO 0xFF14 /* Payload encapsulation type */ -#define AN_RID_WEP_TEMP 0xFF15 /* Temporary Key */ -#define AN_RID_WEP_PERM 0xFF16 /* Perminant Key */ -#define AN_RID_ACTUALCFG 0xFF20 /* Current configuration settings */ - -/* - * Reporting (read only) - */ -#define AN_RID_CAPABILITIES 0xFF00 /* PC 4500/4800 capabilities */ -#define AN_RID_AP_INFO 0xFF01 /* Access point info */ -#define AN_RID_RADIO_INFO 0xFF02 /* Radio info */ -#define AN_RID_RSSI_MAP 0xFF04 /* RSSI <-> dBm table */ -#define AN_RID_STATUS 0xFF50 /* Current status info */ -#define AN_RID_BEACONS_HST 0xFF51 -#define AN_RID_BUSY_HST 0xFF52 -#define AN_RID_RETRIES_HST 0xFF53 - -/* - * Statistics - */ -#define AN_RID_16BITS_CUM 0xFF60 /* Cumulative 16-bit stats counters */ -#define AN_RID_16BITS_DELTA 0xFF61 /* 16-bit stats (since last clear) */ -#define AN_RID_16BITS_DELTACLR 0xFF62 /* 16-bit stats, clear on read */ -#define AN_RID_32BITS_CUM 0xFF68 /* Cumulative 32-bit stats counters */ -#define AN_RID_32BITS_DELTA 0xFF69 /* 32-bit stats (since last clear) */ -#define AN_RID_32BITS_DELTACLR 0xFF6A /* 32-bit stats, clear on read */ - -/* - * LEAP - */ - -#define AN_RID_LEAPUSERNAME 0xFF23 /* Username */ -#define AN_RID_LEAPPASSWORD 0xFF24 /* Password */ - -/* - * OTHER Unknonwn for now - */ - -#define AN_RID_MOD 0xFF17 -#define AN_RID_OPTIONS 0xFF18 -#define AN_RID_FACTORY_CONFIG 0xFF18 - -/* - * FreeBSD fake RID - */ - -#define AN_RID_MONITOR_MODE 0x0001 /* Set monitor mode for driver */ -#define AN_MONITOR 1 -#define AN_MONITOR_ANY_BSS 2 -#define AN_MONITOR_INCLUDE_BEACON 4 -#define AN_MONITOR_AIRONET_HEADER 8 - -#define DLT_AIRONET_HEADER 120 /* Has been allocated at tcpdump.org */ - -/* - * from the Linux driver from Cisco ... no copyright header. - * Removed duplicated information that already existed in the FreeBSD driver - * provides emulation of the Cisco extensions to the Linux Aironet driver. - */ - -/* - * Ioctl constants to be used in airo_ioctl.command - */ - -#define AIROGCAP 0 /* Capability rid */ -#define AIROGCFG 1 /* USED A LOT */ -#define AIROGSLIST 2 /* System ID list */ -#define AIROGVLIST 3 /* List of specified AP's */ -#define AIROGDRVNAM 4 /* NOTUSED */ -#define AIROGEHTENC 5 /* NOTUSED */ -#define AIROGWEPKTMP 6 -#define AIROGWEPKNV 7 -#define AIROGSTAT 8 -#define AIROGSTATSC32 9 -#define AIROGSTATSD32 10 - -/* - * Leave gap of 40 commands after AIROGSTATSD32 *** 4900 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Jun 11 19:38:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05787663C0C; Fri, 11 Jun 2021 19:38:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1rkF6d01z4bZR; Fri, 11 Jun 2021 19:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E3E7289A7; Fri, 11 Jun 2021 19:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BJcjdc050968; Fri, 11 Jun 2021 19:38:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BJcjOY050967; Fri, 11 Jun 2021 19:38:45 GMT (envelope-from git) Date: Fri, 11 Jun 2021 19:38:45 GMT Message-Id: <202106111938.15BJcjOY050967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: d865da5edf7f - main - ancontrol: Remove an(4) utility MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d865da5edf7f77315ddecfd1b10a5b72ecf5af12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 19:38:46 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d865da5edf7f77315ddecfd1b10a5b72ecf5af12 commit d865da5edf7f77315ddecfd1b10a5b72ecf5af12 Author: Emmanuel Vadot AuthorDate: 2021-06-07 16:48:57 +0000 Commit: Emmanuel Vadot CommitDate: 2021-06-11 19:18:21 +0000 ancontrol: Remove an(4) utility Last an(4) devices have been End Of Life and End Of Sale in 2007. Time to remove this driver. Differential Revision: https://reviews.freebsd.org/D30680 Reviewed by: imp (earlier version), emaste (earlier version) Sponsored by: Diablotin Systems --- ObsoleteFiles.inc | 4 + usr.sbin/Makefile | 1 - usr.sbin/ancontrol/Makefile | 11 - usr.sbin/ancontrol/Makefile.depend | 19 - usr.sbin/ancontrol/ancontrol.8 | 553 ----------- usr.sbin/ancontrol/ancontrol.c | 1781 ------------------------------------ 6 files changed, 4 insertions(+), 2365 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1b4c291a0c51..f61441307a06 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20210607: remove ancontrol(8) related programs +OLD_FILES+=usr/sbin/ancontrol +OLD_FILES+=usr/share/man/man8/ancontrol.8.gz + # 20210607: remove an(4) OLD_FILES+=usr/include/dev/an/if_aironet_ieee.h OLD_FILES+=usr/include/dev/an/if_anreg.h diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index ae568746119a..12285ad1d1fd 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -208,7 +208,6 @@ SUBDIR.${MK_USB}+= usbdump SUBDIR.${MK_UTMPX}+= ac SUBDIR.${MK_UTMPX}+= lastlogin SUBDIR.${MK_UTMPX}+= utx -SUBDIR.${MK_WIRELESS}+= ancontrol SUBDIR.${MK_WIRELESS}+= wlandebug SUBDIR.${MK_WIRELESS}+= wpa diff --git a/usr.sbin/ancontrol/Makefile b/usr.sbin/ancontrol/Makefile deleted file mode 100644 index 61dd02bf8481..000000000000 --- a/usr.sbin/ancontrol/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $FreeBSD$ - -PROG= ancontrol -MAN= ancontrol.8 - -WARNS?= 3 -CFLAGS+= -DANCACHE -I${SRCTOP}/sys - -LIBADD= md - -.include diff --git a/usr.sbin/ancontrol/Makefile.depend b/usr.sbin/ancontrol/Makefile.depend deleted file mode 100644 index 9dfb51c0b371..000000000000 --- a/usr.sbin/ancontrol/Makefile.depend +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/arpa \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libmd \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.sbin/ancontrol/ancontrol.8 b/usr.sbin/ancontrol/ancontrol.8 deleted file mode 100644 index 25fa5aefa061..000000000000 --- a/usr.sbin/ancontrol/ancontrol.8 +++ /dev/null @@ -1,553 +0,0 @@ -.\" Copyright (c) 1997, 1998, 1999 -.\" Bill Paul 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Bill Paul. -.\" 4. Neither the name of the author nor the names of any co-contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD -.\" 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 September 10, 1999 -.Dt ANCONTROL 8 -.Os -.Sh NAME -.Nm ancontrol -.Nd configure Aironet 4500/4800 devices -.Sh SYNOPSIS -.Nm -.Fl i Ar iface Fl A -.Nm -.Fl i Ar iface Fl N -.Nm -.Fl i Ar iface Fl S -.Nm -.Fl i Ar iface Fl I -.Nm -.Fl i Ar iface Fl T -.Nm -.Fl i Ar iface Fl C -.Nm -.Fl i Ar iface Fl Q -.Nm -.Fl i Ar iface Fl Z -.Nm -.Fl i Ar iface Fl R -.Nm -.Fl i Ar iface Fl t Cm 0 Ns - Ns Cm 4 -.Nm -.Fl i Ar iface Fl s Cm 0 Ns - Ns Cm 3 -.Nm -.Fl i Ar iface -.Op Fl v Cm 1 Ns - Ns Cm 4 -.Fl a Ar AP -.Nm -.Fl i Ar iface Fl b Ar beacon_period -.Nm -.Fl i Ar iface -.Op Fl v Cm 0 | 1 -.Fl d Cm 0 Ns - Ns Cm 3 -.Nm -.Fl i Ar iface Fl e Cm 0 Ns - Ns Cm 4 -.Nm -.Fl i Ar iface -.Op Fl v Cm 0 Ns - Ns Cm 8 -.Fl k Ar key -.Nm -.Fl i Ar iface -.Fl K Cm 0 Ns - Ns Cm 2 -.Nm -.Fl i Ar iface -.Fl W Cm 0 Ns - Ns Cm 2 -.Nm -.Fl i Ar iface -.Fl L Ar user_name -.Nm -.Fl i Ar iface Fl j Ar netjoin_timeout -.Nm -.Fl i Ar iface Fl l Ar station_name -.Nm -.Fl i Ar iface Fl m Ar mac_address -.Nm -.Fl i Ar iface -.Op Fl v Cm 1 Ns - Ns Cm 3 -.Fl n Ar SSID -.Nm -.Fl i Ar iface Fl o Cm 0 | 1 -.Nm -.Fl i Ar iface Fl p Ar tx_power -.Nm -.Fl i Ar iface Fl c Ar frequency -.Nm -.Fl i Ar iface Fl f Ar fragmentation_threshold -.Nm -.Fl i Ar iface Fl r Ar RTS_threshold -.Nm -.Fl i Ar iface Fl M Cm 0 Ns - Ns Cm 15 -.Nm -.Fl h -.Sh DESCRIPTION -The -.Nm -utility controls the operation of Aironet wireless networking -devices via the -.Xr an 4 -driver. -Most of the parameters that can be changed relate to the -IEEE 802.11 protocol which the Aironet cards implement. -This includes such things as -the station name, whether the station is operating in ad-hoc (point -to point) or infrastructure mode, and the network name of a service -set to join. -The -.Nm -utility can also be used to view the current NIC status, configuration -and to dump out the values of the card's statistics counters. -.Pp -The -.Ar iface -argument given to -.Nm -should be the logical interface name associated with the Aironet -device -.Li ( an0 , an1 , -etc.). -If one is not specified the device -.Dq Li an0 -will be assumed. -.Pp -The -.Nm -utility is not designed to support the combination of arguments from different -.Sx SYNOPSIS -lines in a single -.Nm -invocation, and such combinations are not recommended. -.Sh OPTIONS -The options are as follows: -.Bl -tag -width indent -.It Fl i Ar iface Fl A -Display the preferred access point list. -The AP list can be used by -stations to specify the MAC address of access points with which it -wishes to associate. -If no AP list is specified (the default) then -the station will associate with the first access point that it finds -which serves the SSID(s) specified in the SSID list. -The AP list can -be modified with the -.Fl a -option. -.It Fl i Ar iface Fl N -Display the SSID list. -This is a list of service set IDs (i.e., network names) -with which the station wishes to associate. -There may be up to three SSIDs -in the list: the station will go through the list in ascending order and -associate with the first matching SSID that it finds. -.It Fl i Ar iface Fl S -Display NIC status information. -This includes the current operating -status, current BSSID, SSID, channel, beacon period and currently -associated access point. -The operating mode indicates the state of -the NIC, MAC status and receiver status. -When the -.Qq Li synced -keyword -appears, it means the NIC has successfully associated with an access -point, associated with an ad-hoc -.Dq master -station, or become a -.Dq master -itself. -The beacon period can be anything between 20 and 976 milliseconds. -The default is 100. -.It Fl i Ar iface Fl I -Display NIC capability information. -This shows the device type, -frequency, speed and power level capabilities and firmware revision levels. -.It Fl i Ar iface Fl T -Display the NIC's internal statistics counters. -.It Fl i Ar iface Fl C -Display current NIC configuration. -This shows the current operation mode, -receive mode, MAC address, power save settings, various timing settings, -channel selection, diversity, transmit power and transmit speed. -.It Fl i Ar iface Fl Q -Display the cached signal strength information maintained by the -.Xr an 4 -driver. -The driver retains information about signal strength and -noise level for packets received from different hosts. -The signal strength and noise level values are displayed in units of dBms by -default. -The -.Va hw.an.an_cache_mode -.Xr sysctl 8 -variable can be set to -.Cm raw , dbm -or -.Cm per . -.It Fl i Ar iface Fl Z -Clear the signal strength cache maintained internally by the -.Xr an 4 -driver. -.It Fl i Ar iface Fl R -Display RSSI map that converts from the RSSI index to percent and dBm. -.It Fl i Ar iface Fl t Cm 0 Ns - Ns Cm 4 -Select transmit speed. -The available settings are as follows: -.Bl -column ".Em TX rate" -offset indent -.Em "TX rate NIC speed" -.It Cm 0 Ta "Auto -- NIC selects optimal speed" -.It Cm 1 Ta "1Mbps fixed" -.It Cm 2 Ta "2Mbps fixed" -.It Cm 3 Ta "5.5Mbps fixed" -.It Cm 4 Ta "11Mbps fixed" -.El -.Pp -Note that the 5.5 and 11Mbps settings are only supported on the 4800 -series adapters: the 4500 series adapters have a maximum speed of 2Mbps. -.It Fl i Ar iface Fl s Cm 0 Ns - Ns Cm 3 -Set power save mode. -Valid selections are as follows: -.Bl -column ".Em Selection" -offset indent -.Em "Selection Power save mode" -.It Cm 0 Ta "None - power save disabled" -.It Cm 1 Ta "Constantly awake mode (CAM)" -.It Cm 2 Ta "Power Save Polling (PSP)" -.It Cm 3 Ta "Fast Power Save Polling (PSP-CAM)" -.El -.Pp -Note that for IBSS (ad-hoc) mode, only PSP mode is supported, and only -if the ATIM window is non-zero. -.It Fl i Ar iface Oo Fl v Cm 1 Ns - Ns Cm 4 Oc Fl a Ar AP -Set preferred access point. -The -.Ar AP -is specified as a MAC address consisting of 6 hexadecimal values -separated by colons. -By default, the -.Fl a -option only sets the first entry in the AP list. -The -.Fl v -modifier can be used to specify exactly which AP list entry is to be -modified. -If the -.Fl v -flag is not used, the first AP list entry will be changed. -.It Fl i Ar iface Fl b Ar beacon_period -Set the ad-hoc mode beacon period. -The -.Ar beacon_period -is specified in milliseconds. -The default is 100ms. -.It Fl i Ar iface Oo Fl v Cm 0 | 1 Oc Fl d Cm 0 Ns - Ns Cm 3 -Select the antenna diversity. -Aironet devices can be configured with up -to two antennas, and transmit and receive diversity can be configured -accordingly. -Valid selections are as follows: -.Bl -column ".Em Selection" -offset indent -.Em "Selection Diversity" -.It Cm 0 Ta "Select factory default diversity" -.It Cm 1 Ta "Antenna 1 only" -.It Cm 2 Ta "Antenna 2 only" -.It Cm 3 Ta "Antenna 1 and 2" -.El -.Pp -The receive and transmit diversity can be set independently. -The user -must specify which diversity setting is to be modified by using the -.Fl v -option: selection -.Cm 0 -sets the receive diversity and -.Cm 1 -sets the transmit diversity. -.It Fl i Ar iface Fl e Cm 0 Ns - Ns Cm 4 -Set the transmit WEP key to use. -Note that until this command is issued, the device will use the -last key programmed. -The transmit key is stored in NVRAM. -Currently -set transmit key can be checked via -.Fl C -option. -Selection -.Cm 4 -sets the card in -.Dq "Home Network Mode" -and uses the home key. -.It Fl i Ar iface Oo Fl v Cm 0 Ns - Ns Cm 8 Oc Fl k Ar key -Set a WEP key. -For 40 bit prefix 10 hex character with 0x. -For 128 bit prefix 26 hex character with 0x. -Use -.Qq -as the key to erase the key. -Supports 4 keys; even numbers are for permanent keys -and odd number are for temporary keys. -For example, -.Fl v Cm 1 -sets the first temporary key. -(A -.Dq permanent -key is stored in NVRAM; a -.Dq temporary -key is not.) -Note that the device will use the most recently-programmed key by default. -Currently set keys can be checked via -.Fl C -option, only the sizes of the -keys are returned. -The value of -.Cm 8 -is for the home key. -Note that the value for the home key can be read back from firmware. -.It Fl i Ar iface Fl K Cm 0 Ns - Ns Cm 2 -Set authorization type. -Use -.Cm 0 -for none, -.Cm 1 -for -.Dq Open , -.Cm 2 -for -.Dq "Shared Key" . -.It Fl i Ar iface Fl W Cm 0 Ns - Ns Cm 2 -Enable WEP. -Use -.Cm 0 -for no WEP, -.Cm 1 -to enable full WEP, -.Cm 2 -for mixed cell. -.It Fl i Ar iface Fl L Ar user_name -Enable LEAP and query for password. -It will check to see if it has authenticated for up to 60s. -To disable LEAP, set WEP mode. -.It Fl i Ar iface Fl j Ar netjoin_timeout -Set the ad-hoc network join timeout. -When a station is first activated -in ad-hoc mode, it will search out a -.Dq master -station with the desired -SSID and associate with it. -If the station is unable to locate another -station with the same SSID after a suitable timeout, it sets itself up -as the -.Dq master -so that other stations may associate with it. -This -timeout defaults to 10000 milliseconds (10 seconds) but may be changed -with this option. -The timeout should be specified in milliseconds. -.It Fl i Ar iface Fl l Ar station_name -Set the station name used internally by the NIC. -The -.Ar station_name -can be any text string up to 16 characters in length. -The default name -is set by the driver to -.Dq Li FreeBSD . -.It Fl i Ar iface Fl m Ar mac_address -Set the station address for the specified interface. -The -.Ar mac_address -is specified as a series of six hexadecimal values separated by colons, -e.g.: -.Li 00:60:1d:12:34:56 . -This programs the new address into the card -and updates the interface as well. -.It Fl i Ar iface Oo Fl v Cm 1 Ns - Ns Cm 3 Oc Fl n Ar SSID -Set the desired SSID (network name). -There are three SSIDs which allows -the NIC to work with access points at several locations without needing -to be reconfigured. -The NIC checks each SSID in sequence when searching -for a match. -The SSID to be changed can be specified with the -.Fl v -modifier option. -If the -.Fl v -flag is not used, the first SSID in the list is set. -.It Fl i Ar iface Fl o Cm 0 | 1 -Set the operating mode of the Aironet interface. -Valid selections are -.Cm 0 -for ad-hoc mode and -.Cm 1 -for infrastructure mode. -The default driver setting is for infrastructure -mode. -.It Fl i Ar iface Fl p Ar tx_power -Set the transmit power level in milliwatts. -Valid power settings -vary depending on the actual NIC and can be viewed by dumping the -device capabilities with the -.Fl I -flag. -Typical values are 1, 5, 20, 50 and 100mW. -Selecting 0 sets -the factory default. -.It Fl i Ar iface Fl c Ar frequency -Set the radio frequency of a given interface. -The -.Ar frequency -should be specified as a channel ID as shown in the table below. -The -list of available frequencies is dependent on radio regulations specified -by regional authorities. -Recognized regulatory authorities include -the FCC (United States), ETSI (Europe), France and Japan. -Frequencies -in the table are specified in MHz. -.Bl -column ".Em Channel ID" ".Em FCC" ".Em ETSI" ".Em France" ".Em Japan" -offset indent -.Em "Channel ID FCC ETSI France Japan" -.It Cm 1 Ta 2412 Ta 2412 Ta - Ta - -.It Cm 2 Ta 2417 Ta 2417 Ta - Ta - -.It Cm 3 Ta 2422 Ta 2422 Ta - Ta - -.It Cm 4 Ta 2427 Ta 2427 Ta - Ta - -.It Cm 5 Ta 2432 Ta 2432 Ta - Ta - -.It Cm 6 Ta 2437 Ta 2437 Ta - Ta - -.It Cm 7 Ta 2442 Ta 2442 Ta - Ta - -.It Cm 8 Ta 2447 Ta 2447 Ta - Ta - -.It Cm 9 Ta 2452 Ta 2452 Ta - Ta - -.It Cm 10 Ta 2457 Ta 2457 Ta 2457 Ta - -.It Cm 11 Ta 2462 Ta 2462 Ta 2462 Ta - -.It Cm 12 Ta - Ta 2467 Ta 2467 Ta - -.It Cm 13 Ta - Ta 2472 Ta 2472 Ta - -.It Cm 14 Ta - Ta - Ta - Ta 2484 -.El -.Pp -If an illegal channel is specified, the -NIC will revert to its default channel. -For NICs sold in the United States -and Europe, the default channel is 3. -For NICs sold in France, the default -channel is 11. -For NICs sold in Japan, the only available channel is 14. -Note that two stations must be set to the same channel in order to -communicate. -.It Fl i Ar iface Fl f Ar fragmentation_threshold -Set the fragmentation threshold in bytes. -This threshold controls the -point at which outgoing packets will be split into multiple fragments. -If a single fragment is not sent successfully, only that fragment will -need to be retransmitted instead of the whole packet. -The fragmentation -threshold can be anything from 64 to 2312 bytes. -The default is 2312. -.It Fl i Ar iface Fl r Ar RTS_threshold -Set the RTS/CTS threshold for a given interface. -This controls the -number of bytes used for the RTS/CTS handshake boundary. -The -.Ar RTS_threshold -can be any value between 0 and 2312. -The default is 2312. -.It Fl i Ar iface Fl M Cm 0 Ns - Ns Cm 15 -Set monitor mode via bit mask, meaning: -.Pp -.Bl -tag -width indent -offset indent -compact -.It Em Bit -.Em Meaning -.It 0 -to not dump 802.11 packet. -.It 1 -to enable 802.11 monitor. -.It 2 -to monitor any SSID. -.It 4 -to not skip beacons, monitor beacons produces a high system load. -.It 8 -to enable full Aironet header returned via BPF. -Note it appears that a SSID must be set. -.El -.It Fl h -Print a list of available options and sample usage. -.El -.Sh SECURITY NOTES -WEP -.Pq Dq "wired equivalent privacy" -is based on the RC4 algorithm, -using a 24 bit initialization vector. -.Pp -RC4 is supposedly vulnerable to certain known plaintext attacks, -especially with 40 bit keys. -So the security of WEP in part depends on how much known plaintext -is transmitted. -.Pp -Because of this, although counter-intuitive, using -.Dq "shared key" -authentication (which involves sending known plaintext) is less -secure than using -.Dq open -authentication when WEP is enabled. -.Pp -Devices may alternate among all of the configured WEP keys when -transmitting packets. -Therefore, all configured keys (up to four) must agree. -.Sh EXAMPLES -.Bd -literal -offset indent -ancontrol -i an0 -v 0 -k 0x12345678901234567890123456 -ancontrol -i an0 -K 2 -ancontrol -i an0 -W 1 -ancontrol -i an0 -e 0 -.Ed -.Pp -Sets a WEP key 0, enables -.Dq "Shared Key" -authentication, enables full WEP -and uses transmit key 0. -.Sh SEE ALSO -.Xr an 4 , -.Xr ifconfig 8 -.Sh HISTORY -The -.Nm -utility first appeared in -.Fx 4.0 . -.Sh AUTHORS -The -.Nm -utility was written by -.An Bill Paul Aq Mt wpaul@ee.columbia.edu . -.Sh BUGS -The statistics counters do not seem to show the amount of transmit -and received frames as increasing. -This is likely due to the fact that -the -.Xr an 4 -driver uses unmodified packet mode instead of letting the NIC perform -802.11/ethernet encapsulation itself. -.Pp -Setting the channel does not seem to have any effect. diff --git a/usr.sbin/ancontrol/ancontrol.c b/usr.sbin/ancontrol/ancontrol.c deleted file mode 100644 index 6d76f0770f4a..000000000000 --- a/usr.sbin/ancontrol/ancontrol.c +++ /dev/null @@ -1,1781 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright 1997, 1998, 1999 - * Bill Paul . 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD - * 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. - */ - -#if 0 -#ifndef lint -static const char copyright[] = "@(#) Copyright (c) 1997, 1998, 1999\ - Bill Paul. All rights reserved."; -#endif -#endif -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -static int an_getval(const char *, struct an_req *); -static void an_setval(const char *, struct an_req *); -static void an_printwords(const u_int16_t *, int); -static void an_printspeeds(const u_int8_t *, int); -static void an_printbool(int); -static void an_printhex(const char *, int); -static void an_printstr(char *, int); -static void an_dumpstatus(const char *); -static void an_dumpstats(const char *); -static void an_dumpconfig(const char *); -static void an_dumpcaps(const char *); -static void an_dumpssid(const char *); -static void an_dumpap(const char *); -static void an_setconfig(const char *, int, void *); -static void an_setssid(const char *, int, void *); -static void an_setap(const char *, int, void *); -static void an_setspeed(const char *, int, void *); -static void an_readkeyinfo(const char *); -#ifdef ANCACHE -static void an_zerocache(const char *); -static void an_readcache(const char *); -#endif -static int an_hex2int(char); -static void an_str2key(const char *, struct an_ltv_key *); -static void an_setkeys(const char *, const char *, int); -static void an_enable_tx_key(const char *, const char *); -static void an_enable_leap_mode(const char *, const char *); -static void an_dumprssimap(const char *); -static void usage(const char *); - -#define ACT_DUMPSTATS 1 -#define ACT_DUMPCONFIG 2 -#define ACT_DUMPSTATUS 3 -#define ACT_DUMPCAPS 4 -#define ACT_DUMPSSID 5 -#define ACT_DUMPAP 6 - -#define ACT_SET_OPMODE 7 -#define ACT_SET_SSID 8 -#define ACT_SET_FREQ 11 -#define ACT_SET_AP1 12 -#define ACT_SET_AP2 13 -#define ACT_SET_AP3 14 -#define ACT_SET_AP4 15 -#define ACT_SET_DRIVERNAME 16 -#define ACT_SET_SCANMODE 17 -#define ACT_SET_TXRATE 18 -#define ACT_SET_RTS_THRESH 19 -#define ACT_SET_PWRSAVE 20 -#define ACT_SET_DIVERSITY_RX 21 -#define ACT_SET_DIVERSITY_TX 22 -#define ACT_SET_RTS_RETRYLIM 23 -#define ACT_SET_WAKE_DURATION 24 -#define ACT_SET_BEACON_PERIOD 25 -#define ACT_SET_TXPWR 26 -#define ACT_SET_FRAG_THRESH 27 -#define ACT_SET_NETJOIN 28 -#define ACT_SET_MYNAME 29 -#define ACT_SET_MAC 30 - -#define ACT_DUMPCACHE 31 -#define ACT_ZEROCACHE 32 - -#define ACT_ENABLE_WEP 33 -#define ACT_SET_KEY_TYPE 34 -#define ACT_SET_KEYS 35 -#define ACT_ENABLE_TX_KEY 36 -#define ACT_SET_MONITOR_MODE 37 -#define ACT_SET_LEAP_MODE 38 - -#define ACT_DUMPRSSIMAP 39 - -static int -an_getval(const char *iface, struct an_req *areq) -{ - struct ifreq ifr; - int s, okay = 1; - - bzero(&ifr, sizeof(ifr)); - - strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)); - ifr.ifr_data = (caddr_t)areq; - - s = socket(AF_INET, SOCK_DGRAM, 0); - - if (s == -1) - err(1, "socket"); - - if (ioctl(s, SIOCGAIRONET, &ifr) == -1) { - okay = 0; - err(1, "SIOCGAIRONET"); - } - - close(s); - - return (okay); -} - -static void -an_setval(const char *iface, struct an_req *areq) -{ - struct ifreq ifr; - int s; - - bzero(&ifr, sizeof(ifr)); - - strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)); - ifr.ifr_data = (caddr_t)areq; - - s = socket(AF_INET, SOCK_DGRAM, 0); - - if (s == -1) - err(1, "socket"); - - if (ioctl(s, SIOCSAIRONET, &ifr) == -1) - err(1, "SIOCSAIRONET"); - - close(s); - - return; -} - -static void -an_printstr(char *str, int len) -{ - int i; - - for (i = 0; i < len - 1; i++) { - if (str[i] == '\0') - str[i] = ' '; - } - - printf("[ %.*s ]", len, str); -} - -static void -an_printwords(const u_int16_t *w, int len) -{ - int i; - - printf("[ "); - for (i = 0; i < len; i++) - printf("%u ", w[i]); - printf("]"); -} - -static void -an_printspeeds(const u_int8_t *w, int len) -{ - int i; - - printf("[ "); - for (i = 0; i < len && w[i]; i++) - printf("%2.1fMbps ", w[i] * 0.500); - printf("]"); -} - -static void -an_printbool(int val) -{ - if (val) - printf("[ On ]"); - else - printf("[ Off ]"); -} - -static void -an_printhex(const char *ptr, int len) -{ - int i; - - printf("[ "); - for (i = 0; i < len; i++) { - printf("%02x", ptr[i] & 0xFF); - if (i < (len - 1)) - printf(":"); - } - - printf(" ]"); -} - - - -static void -an_dumpstatus(const char *iface) -{ - struct an_ltv_status *sts; - struct an_req areq; - struct an_ltv_rssi_map an_rssimap; - int rssimap_valid = 0; - - /* - * Try to get RSSI to percent and dBM table - */ - - an_rssimap.an_len = sizeof(an_rssimap); - an_rssimap.an_type = AN_RID_RSSI_MAP; - rssimap_valid = an_getval(iface, (struct an_req*)&an_rssimap); - - if (rssimap_valid) - printf("RSSI table:\t\t[ present ]\n"); - else - printf("RSSI table:\t\t[ not available ]\n"); - - areq.an_len = sizeof(areq); - areq.an_type = AN_RID_STATUS; - - an_getval(iface, &areq); - - sts = (struct an_ltv_status *)&areq; - - printf("MAC address:\t\t"); - an_printhex((char *)&sts->an_macaddr, ETHER_ADDR_LEN); - printf("\nOperating mode:\t\t[ "); - if (sts->an_opmode & AN_STATUS_OPMODE_CONFIGURED) - printf("configured "); - if (sts->an_opmode & AN_STATUS_OPMODE_MAC_ENABLED) - printf("MAC ON "); - if (sts->an_opmode & AN_STATUS_OPMODE_RX_ENABLED) - printf("RX ON "); - if (sts->an_opmode & AN_STATUS_OPMODE_IN_SYNC) - printf("synced "); - if (sts->an_opmode & AN_STATUS_OPMODE_ASSOCIATED) - printf("associated "); - if (sts->an_opmode & AN_STATUS_OPMODE_LEAP) - printf("LEAP "); - if (sts->an_opmode & AN_STATUS_OPMODE_ERROR) - printf("error "); - printf("]\n"); - printf("Error code:\t\t"); - an_printhex((char *)&sts->an_errcode, 1); - if (rssimap_valid) - printf("\nSignal strength:\t[ %u%% ]", - an_rssimap.an_entries[ - sts->an_normalized_strength].an_rss_pct); - else - printf("\nSignal strength:\t[ %u%% ]", - sts->an_normalized_strength); - printf("\nAverage Noise:\t\t[ %u%% ]", sts->an_avg_noise_prev_min_pc); - if (rssimap_valid) - printf("\nSignal quality:\t\t[ %u%% ]", - an_rssimap.an_entries[ - sts->an_cur_signal_quality].an_rss_pct); - else - printf("\nSignal quality:\t\t[ %u ]", - sts->an_cur_signal_quality); - printf("\nMax Noise:\t\t[ %u%% ]", sts->an_max_noise_prev_min_pc); - /* - * XXX: This uses the old definition of the rate field (units of - * 500kbps). Technically the new definition is that this field - * contains arbitrary values, but no devices which need this - * support exist and the IEEE seems to intend to use the old - * definition until they get something big so we'll keep using - * it as well because this will work with new cards with - * rate <= 63.5Mbps. - */ - printf("\nCurrent TX rate:\t[ %u%s ]", sts->an_current_tx_rate / 2, - (sts->an_current_tx_rate % 2) ? ".5" : ""); - printf("\nCurrent SSID:\t\t"); - an_printstr((char *)&sts->an_ssid, sts->an_ssidlen); - printf("\nCurrent AP name:\t"); - an_printstr((char *)&sts->an_ap_name, 16); - printf("\nCurrent BSSID:\t\t"); *** 1455 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Jun 11 19:54:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE8D266394B; Fri, 11 Jun 2021 19:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1s4F6QdGz4clY; Fri, 11 Jun 2021 19:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C106C28E90; Fri, 11 Jun 2021 19:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BJsLHv076517; Fri, 11 Jun 2021 19:54:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BJsLGW076516; Fri, 11 Jun 2021 19:54:21 GMT (envelope-from git) Date: Fri, 11 Jun 2021 19:54:21 GMT Message-Id: <202106111954.15BJsLGW076516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6f4c1456b51d - main - bsdinstall: Allow automation in jails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f4c1456b51dc35c03b2c02cc06e8b4308779855 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 19:54:22 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6f4c1456b51dc35c03b2c02cc06e8b4308779855 commit 6f4c1456b51dc35c03b2c02cc06e8b4308779855 Author: eoli3n AuthorDate: 2021-06-07 20:49:02 +0000 Commit: Warner Losh CommitDate: 2021-06-11 19:53:17 +0000 bsdinstall: Allow automation in jails Set SCRIPT=/path/to/script env var to be able to automate bsdinstall to a jail. Pull Request: https://github.com/freebsd/freebsd-src/pull/473 Reviewed by: allanjude --- usr.sbin/bsdinstall/scripts/jail | 58 +++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail index ecfbb78357d9..d9b5c8eb3cb4 100755 --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -52,11 +52,16 @@ error() { fi } - rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC mkdir -p $1 || error "mkdir failed for $1" +if [ -n "$SCRIPT" ] +then + split -a 2 -p '^#!.*' "$SCRIPT" $TMPDIR/bsdinstall-installscript- + . $TMPDIR/bsdinstall-installscript-aa +fi + test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR if [ ! -f $BSDINSTALL_DISTDIR/MANIFEST -a -z "$BSDINSTALL_DISTSITE" ]; then @@ -69,20 +74,23 @@ if [ ! -f $BSDINSTALL_DISTDIR/MANIFEST -a -z "$BSDINSTALL_DISTSITE" ]; then fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error "Could not download $BSDINSTALL_DISTSITE/MANIFEST" fi -export DISTRIBUTIONS="base.txz" +: ${DISTRIBUTIONS="base.txz"}; export DISTRIBUTIONS if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then DISTMENU=`cut -f 4,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base` - exec 3>&1 - EXTRA_DISTS=$(echo $DISTMENU | xargs dialog \ - --backtitle "FreeBSD Installer" \ - --title "Distribution Select" --nocancel --separate-output \ - --checklist "Choose optional system components to install:" \ - 0 0 0 \ - 2>&1 1>&3) - for dist in $EXTRA_DISTS; do - export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" - done + if [ ! "$nonInteractive" == "YES" ] + then + exec 3>&1 + EXTRA_DISTS=$(echo $DISTMENU | xargs dialog \ + --backtitle "FreeBSD Installer" \ + --title "Distribution Select" --nocancel --separate-output \ + --checklist "Choose optional system components to install:" \ + 0 0 0 \ + 2>&1 1>&3) + for dist in $EXTRA_DISTS; do + export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" + done + fi fi FETCH_DISTRIBUTIONS="" @@ -108,20 +116,38 @@ fi bsdinstall checksum || error "Distribution checksum failed" bsdinstall distextract || error "Distribution extract failed" -bsdinstall rootpass || error "Could not set root password" + +if [ ! "$nonInteractive" == "YES" ] +then + bsdinstall rootpass || error "Could not set root password" +fi trap true SIGINT # This section is optional + +if [ ! "$nonInteractive" == "YES" ] +then bsdinstall services -dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ - "Would you like to add users to the installed system now?" 0 0 && \ - bsdinstall adduser + dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ + "Would you like to add users to the installed system now?" 0 0 && \ + bsdinstall adduser +fi trap error SIGINT # SIGINT is bad again bsdinstall config || error "Failed to save config" cp /etc/resolv.conf $1/etc cp /etc/localtime $1/etc +# Run post-install script +if [ -f $TMPDIR/bsdinstall-installscript-ab ]; then + cp $TMPDIR/bsdinstall-installscript-ab $BSDINSTALL_CHROOT/tmp/installscript + chmod a+x $BSDINSTALL_CHROOT/tmp/installscript + mount -t devfs devfs "$BSDINSTALL_CHROOT/dev" + chroot $BSDINSTALL_CHROOT /tmp/installscript $@ 2>&1 + umount "$BSDINSTALL_CHROOT/dev" + rm $BSDINSTALL_CHROOT/tmp/installscript +fi + bsdinstall entropy f_dprintf "Installation Completed at %s" "$(date)" From owner-dev-commits-src-all@freebsd.org Fri Jun 11 19:59:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A822663FE4; Fri, 11 Jun 2021 19:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1sBd33xPz4cWq; Fri, 11 Jun 2021 19:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5158C28E91; Fri, 11 Jun 2021 19:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BJxrQQ077010; Fri, 11 Jun 2021 19:59:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BJxrvo077009; Fri, 11 Jun 2021 19:59:53 GMT (envelope-from git) Date: Fri, 11 Jun 2021 19:59:53 GMT Message-Id: <202106111959.15BJxrvo077009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b0e54e61b390 - main - Change "compiled" to "assembled" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0e54e61b390330a183e47fc62260ee3dcb39d09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 19:59:53 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b0e54e61b390330a183e47fc62260ee3dcb39d09 commit b0e54e61b390330a183e47fc62260ee3dcb39d09 Author: Warner Losh AuthorDate: 2021-06-11 19:58:51 +0000 Commit: Warner Losh CommitDate: 2021-06-11 19:58:51 +0000 Change "compiled" to "assembled" Assembly files are assembled, not compiled. Submitted by: github user gAlfonso-bit Pull Request: https://github.com/freebsd/freebsd-src/pull/474 Sponsored by: Netflix --- sys/dev/hyperv/vmbus/i386/vmbus_vector.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S index d119cfdc5b12..b1ffe89cd55d 100644 --- a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S +++ b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S @@ -36,7 +36,7 @@ * This is the Hyper-V vmbus channel direct callback interrupt. * Only used when it is running on Hyper-V. * - * Note that this file is not compiled directly, it is included into + * Note that this file is not assembled directly, it is included into * i386/exception.s. */ .text From owner-dev-commits-src-all@freebsd.org Fri Jun 11 20:30:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3E62664350; Fri, 11 Jun 2021 20:30:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1stH4Cjxz4fT5; Fri, 11 Jun 2021 20:30:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7931329615; Fri, 11 Jun 2021 20:30:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BKUl7X026012; Fri, 11 Jun 2021 20:30:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BKUlMd026011; Fri, 11 Jun 2021 20:30:47 GMT (envelope-from git) Date: Fri, 11 Jun 2021 20:30:47 GMT Message-Id: <202106112030.15BKUlMd026011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 768787bee30d - main - mtk: Initialize mask correctly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 768787bee30dd86f5060f1083745955e2cbcf28f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 20:30:47 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=768787bee30dd86f5060f1083745955e2cbcf28f commit 768787bee30dd86f5060f1083745955e2cbcf28f Author: Priit Trees AuthorDate: 2021-06-11 20:12:08 +0000 Commit: Warner Losh CommitDate: 2021-06-11 20:12:08 +0000 mtk: Initialize mask correctly. Initialization of mask is missing. Fixes a compile issue. Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/459 --- sys/mips/mediatek/mtk_clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/mips/mediatek/mtk_clock.c b/sys/mips/mediatek/mtk_clock.c index 83433fbd8ff9..915207b755af 100644 --- a/sys/mips/mediatek/mtk_clock.c +++ b/sys/mips/mediatek/mtk_clock.c @@ -123,6 +123,8 @@ mtk_clock_get_info(device_t dev, int index, struct fdt_clock_info *info) if (index < 0 || index > 31 || info == NULL) return (EINVAL); + mask = (1u << index); + if (mtk_sysctl_get(SYSCTL_CLKCFG1) & mask) info->flags = FDT_CIFLAG_RUNNING; else From owner-dev-commits-src-all@freebsd.org Fri Jun 11 20:30:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DF2466480A; Fri, 11 Jun 2021 20:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1stJ5XMpz4fTD; Fri, 11 Jun 2021 20:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A22182951D; Fri, 11 Jun 2021 20:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BKUmgI026043; Fri, 11 Jun 2021 20:30:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BKUmu8026042; Fri, 11 Jun 2021 20:30:48 GMT (envelope-from git) Date: Fri, 11 Jun 2021 20:30:48 GMT Message-Id: <202106112030.15BKUmu8026042@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7700494d9603 - main - mtk: Add printing of CPU model MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7700494d9603605fba5d1e402b3c8c0234d942b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 20:30:49 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7700494d9603605fba5d1e402b3c8c0234d942b1 commit 7700494d9603605fba5d1e402b3c8c0234d942b1 Author: Warner Losh AuthorDate: 2021-06-11 20:13:31 +0000 Commit: Warner Losh CommitDate: 2021-06-11 20:28:54 +0000 mtk: Add printing of CPU model Add the line that's in other foo_machdep.c file where the CPU model is reported. This was part of github pull request 459, but in a different way. The rest of that pull request was either committed or not relevant. I did it in a more correct way. Submitted by: Priit Trees Sponsored by: Netflix --- sys/mips/mediatek/mtk_machdep.c | 1 + sys/mips/mediatek/mtk_soc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/mips/mediatek/mtk_machdep.c b/sys/mips/mediatek/mtk_machdep.c index bfffaee634bd..e4406eacf6a5 100644 --- a/sys/mips/mediatek/mtk_machdep.c +++ b/sys/mips/mediatek/mtk_machdep.c @@ -258,6 +258,7 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, printf("FDT DTB at: 0x%08x\n", (uint32_t)dtbp); + printf("CPU model: %s\n", cpu_model); printf("CPU clock: %4dMHz\n", mtk_soc_get_cpuclk()/(1000*1000)); printf("Timer clock: %4dMHz\n", timer_clk/(1000*1000)); printf("UART clock: %4dMHz\n\n", mtk_soc_get_uartclk()/(1000*1000)); diff --git a/sys/mips/mediatek/mtk_soc.c b/sys/mips/mediatek/mtk_soc.c index 9fd307a92a67..96ce0bc0f12f 100644 --- a/sys/mips/mediatek/mtk_soc.c +++ b/sys/mips/mediatek/mtk_soc.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-dev-commits-src-all@freebsd.org Fri Jun 11 20:40:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD6BA664863; Fri, 11 Jun 2021 20:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1t5X5j4Mz4gZ0; Fri, 11 Jun 2021 20:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A92492978B; Fri, 11 Jun 2021 20:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BKeWRs039113; Fri, 11 Jun 2021 20:40:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BKeWR4039112; Fri, 11 Jun 2021 20:40:32 GMT (envelope-from git) Date: Fri, 11 Jun 2021 20:40:32 GMT Message-Id: <202106112040.15BKeWR4039112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: cd7de223769a - main - Remove an manpage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd7de223769a5e7d3e27fe8b6d034ed9b041f8b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 20:40:32 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cd7de223769a5e7d3e27fe8b6d034ed9b041f8b0 commit cd7de223769a5e7d3e27fe8b6d034ed9b041f8b0 Author: Warner Losh AuthorDate: 2021-06-11 20:40:13 +0000 Commit: Warner Losh CommitDate: 2021-06-11 20:40:13 +0000 Remove an manpage --- share/man/man4/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 88414801888f..5051470edc71 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -47,7 +47,6 @@ MAN= aac.4 \ ${_amdtemp.4} \ ${_bxe.4} \ amr.4 \ - an.4 \ ${_aout.4} \ ${_apic.4} \ arcmsr.4 \ @@ -618,7 +617,6 @@ MLINKS+=altera_sdcard.4 altera_sdcardc.4 MLINKS+=altq.4 ALTQ.4 MLINKS+=ath.4 if_ath.4 MLINKS+=ath_pci.4 if_ath_pci.4 -MLINKS+=an.4 if_an.4 MLINKS+=aue.4 if_aue.4 MLINKS+=axe.4 if_axe.4 MLINKS+=bce.4 if_bce.4 From owner-dev-commits-src-all@freebsd.org Fri Jun 11 21:59:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A8E16654D0; Fri, 11 Jun 2021 21:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1vrf11tlz4krD; Fri, 11 Jun 2021 21:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06E872A75E; Fri, 11 Jun 2021 21:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BLxTAr037383; Fri, 11 Jun 2021 21:59:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BLxTBR037382; Fri, 11 Jun 2021 21:59:29 GMT (envelope-from git) Date: Fri, 11 Jun 2021 21:59:29 GMT Message-Id: <202106112159.15BLxTBR037382@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e290182bcf38 - main - Remove 'make update'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e290182bcf3895ca659dff111bca6a077c4708b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 21:59:30 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e290182bcf3895ca659dff111bca6a077c4708b1 commit e290182bcf3895ca659dff111bca6a077c4708b1 Author: John Baldwin AuthorDate: 2021-06-11 21:56:28 +0000 Commit: John Baldwin CommitDate: 2021-06-11 21:56:28 +0000 Remove 'make update'. In the CVS days this used be a wrapper around either CVS or CVSup and used to support updating src, doc, and ports checkouts. With the move to subversion this only supported updating src and was itself a wrapper around 'svn update'. With Git, users are probably better off using appropriate Git commands directly to update without needing an explicit make target as a wrapper. Reviewed by: bcr, imp, emaste Differential Revision: https://reviews.freebsd.org/D30736 --- Makefile | 3 +-- Makefile.inc1 | 27 --------------------------- share/man/man5/make.conf.5 | 25 +------------------------ 3 files changed, 2 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index 3b37b7e1f669..711854f4693c 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,6 @@ # kernel-toolchain - Builds the subset of world necessary to build a kernel # kernel-toolchains - Build kernel-toolchain for all universe targets. # doxygen - Build API documentation of the kernel, needs doxygen. -# update - Convenient way to update your source tree(s). # checkworld - Run test suite on installed world. # check-old - List obsolete directories/files/libraries. # check-old-dirs - List obsolete directories. @@ -155,7 +154,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries maninstall \ - obj objlink showconfig tags toolchain update \ + obj objlink showconfig tags toolchain \ makeman sysent \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _build-metadata _cross-tools _includes _libraries \ diff --git a/Makefile.inc1 b/Makefile.inc1 index d72e0ca56beb..b06c269b6489 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -11,9 +11,7 @@ # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel -# -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_ROOT install without using root privilege -# -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list @@ -491,17 +489,6 @@ BUILDENV_SHELL?=/bin/sh .endif .if !defined(_MKSHOWCONFIG) -.if !defined(SVN_CMD) || empty(SVN_CMD) -. for _P in /usr/bin /usr/local/bin -. for _S in svn svnlite -. if exists(${_P}/${_S}) -SVN_CMD= ${_P}/${_S} -. endif -. endfor -. endfor -.export SVN_CMD -.endif -SVNFLAGS?= -r HEAD .if !defined(VCS_REVISION) || empty(VCS_REVISION) .if !defined(SVNVERSION_CMD) || empty(SVNVERSION_CMD) . for _D in ${PATH:S,:, ,g} @@ -2113,20 +2100,6 @@ doxygen: .PHONY fi ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all -# -# update -# -# Update the source tree(s), by running svn/svnup to update to the -# latest copy. -# -update: .PHONY -.if defined(SVN_UPDATE) - @echo "--------------------------------------------------------------" - @echo ">>> Updating ${.CURDIR} using Subversion" - @echo "--------------------------------------------------------------" - @(cd ${.CURDIR}; ${SVN_CMD} update ${SVNFLAGS}) -.endif - # # ------------------------------------------------------------------------ # diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index 3dffdf7b402c..b8bb71ddc165 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2020 +.Dd June 11, 2021 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -229,29 +229,6 @@ Setting this variable will prevent CPU specific compiler flags from being automatically added to .Va CFLAGS during compile time. -.It Va NO_DOCUPDATE -.Pq Vt bool -Set this to not update the doc tree during -.Dq Li "make update" . -.It Va NO_PORTSUPDATE -.Pq Vt bool -Set this to not update the ports tree during -.Dq Li "make update" . -.It Va SVN_UPDATE -.Pq Vt bool -Set this to use -.Xr svn 1 -or -.Xr svnlite 1 -to update your -.Pa src -tree with -.Dq Li "make update" . -Note that you can set -.Va SVN -to the full path of a -.Xr svn 1 -binary. .El .Ss "BUILDING THE KERNEL" The following list provides a name and short description for variables From owner-dev-commits-src-all@freebsd.org Fri Jun 11 21:59:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 416FB66546D; Fri, 11 Jun 2021 21:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1vrr1QYMz4kts; Fri, 11 Jun 2021 21:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19AE52A819; Fri, 11 Jun 2021 21:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BLxeV8037414; Fri, 11 Jun 2021 21:59:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BLxVYG037406; Fri, 11 Jun 2021 21:59:31 GMT (envelope-from git) Date: Fri, 11 Jun 2021 21:59:31 GMT Message-Id: <202106112159.15BLxVYG037406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0333fad1b7e0 - main - Remove svnlite. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0333fad1b7e042eea0fe8348c6fde8ee55538d63 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 21:59:40 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0333fad1b7e042eea0fe8348c6fde8ee55538d63 commit 0333fad1b7e042eea0fe8348c6fde8ee55538d63 Author: John Baldwin AuthorDate: 2021-06-11 21:56:41 +0000 Commit: John Baldwin CommitDate: 2021-06-11 21:56:41 +0000 Remove svnlite. Reviewed by: bcr, imp, emaste Differential Revision: https://reviews.freebsd.org/D30737 --- Makefile.inc1 | 1 - ObsoleteFiles.inc | 25 + contrib/apr-util/CHANGES | 83 - contrib/apr-util/CMakeLists.txt | 355 - contrib/apr-util/LICENSE | 459 - contrib/apr-util/Makefile.in | 123 - contrib/apr-util/Makefile.win | 384 - contrib/apr-util/NOTICE | 14 - contrib/apr-util/NWGNUmakefile | 310 - contrib/apr-util/README | 111 - contrib/apr-util/README.FREETDS | 11 - contrib/apr-util/README.cmake | 139 - contrib/apr-util/apr-util.pc.in | 13 - contrib/apr-util/apr-util.spec | 200 - contrib/apr-util/aprutil.dsw | 443 - contrib/apr-util/apu-config.in | 221 - contrib/apr-util/buckets/apr_brigade.c | 736 - contrib/apr-util/buckets/apr_buckets.c | 46 - contrib/apr-util/buckets/apr_buckets_alloc.c | 234 - contrib/apr-util/buckets/apr_buckets_eos.c | 54 - contrib/apr-util/buckets/apr_buckets_file.c | 242 - contrib/apr-util/buckets/apr_buckets_flush.c | 54 - contrib/apr-util/buckets/apr_buckets_heap.c | 96 - contrib/apr-util/buckets/apr_buckets_mmap.c | 144 - contrib/apr-util/buckets/apr_buckets_pipe.c | 119 - contrib/apr-util/buckets/apr_buckets_pool.c | 142 - contrib/apr-util/buckets/apr_buckets_refcount.c | 64 - contrib/apr-util/buckets/apr_buckets_simple.c | 137 - contrib/apr-util/buckets/apr_buckets_socket.c | 114 - contrib/apr-util/build-outputs.mk | 152 - contrib/apr-util/build.conf | 104 - contrib/apr-util/buildconf | 118 - contrib/apr-util/config.layout | 232 - contrib/apr-util/configure | 25340 --------------- contrib/apr-util/configure.in | 344 - contrib/apr-util/crypto/apr_crypto.c | 608 - contrib/apr-util/crypto/apr_crypto_commoncrypto.c | 906 - contrib/apr-util/crypto/apr_crypto_nss.c | 1097 - contrib/apr-util/crypto/apr_crypto_openssl.c | 973 - contrib/apr-util/crypto/apr_md4.c | 404 - contrib/apr-util/crypto/apr_md5.c | 666 - contrib/apr-util/crypto/apr_passwd.c | 200 - contrib/apr-util/crypto/apr_sha1.c | 368 - contrib/apr-util/crypto/apr_siphash.c | 196 - contrib/apr-util/crypto/crypt_blowfish.c | 902 - contrib/apr-util/crypto/crypt_blowfish.h | 27 - contrib/apr-util/crypto/getuuid.c | 208 - contrib/apr-util/crypto/uuid.c | 130 - contrib/apr-util/dbd/NWGNUdbdmysql | 295 - contrib/apr-util/dbd/NWGNUdbdpgsql | 301 - contrib/apr-util/dbd/NWGNUdbdsqli2 | 296 - contrib/apr-util/dbd/NWGNUdbdsqli3 | 298 - contrib/apr-util/dbd/NWGNUmakefile | 259 - contrib/apr-util/dbd/apr_dbd.c | 573 - contrib/apr-util/dbd/apr_dbd_mysql.c | 1305 - contrib/apr-util/dbd/apr_dbd_odbc.c | 1750 - contrib/apr-util/dbd/apr_dbd_oracle.c | 2220 -- contrib/apr-util/dbd/apr_dbd_pgsql.c | 1315 - contrib/apr-util/dbd/apr_dbd_sqlite2.c | 566 - contrib/apr-util/dbd/apr_dbd_sqlite3.c | 914 - contrib/apr-util/dbd/unsupported/NWGNUdbdfreetds | 296 - contrib/apr-util/dbd/unsupported/apr_dbd_freetds.c | 809 - contrib/apr-util/dbm/NWGNUdbmdb | 299 - contrib/apr-util/dbm/NWGNUdbmgdbm | 298 - contrib/apr-util/dbm/NWGNUmakefile | 251 - contrib/apr-util/dbm/apr_dbm.c | 307 - contrib/apr-util/dbm/apr_dbm_berkeleydb.c | 404 - contrib/apr-util/dbm/apr_dbm_gdbm.c | 255 - contrib/apr-util/dbm/apr_dbm_ndbm.c | 238 - contrib/apr-util/dbm/apr_dbm_sdbm.c | 223 - contrib/apr-util/dbm/sdbm/sdbm.c | 584 - contrib/apr-util/dbm/sdbm/sdbm_hash.c | 63 - contrib/apr-util/dbm/sdbm/sdbm_lock.c | 79 - contrib/apr-util/dbm/sdbm/sdbm_pair.c | 320 - contrib/apr-util/dbm/sdbm/sdbm_pair.h | 40 - contrib/apr-util/dbm/sdbm/sdbm_private.h | 84 - contrib/apr-util/dbm/sdbm/sdbm_tune.h | 40 - contrib/apr-util/docs/doxygen.conf | 32 - contrib/apr-util/encoding/apr_base64.c | 268 - contrib/apr-util/export_vars.sh.in | 13 - contrib/apr-util/hooks/apr_hooks.c | 414 - contrib/apr-util/include/apr_anylock.h | 128 - contrib/apr-util/include/apr_base64.h | 113 - contrib/apr-util/include/apr_buckets.h | 1598 - contrib/apr-util/include/apr_crypto.h | 507 - contrib/apr-util/include/apr_date.h | 106 - contrib/apr-util/include/apr_dbd.h | 549 - contrib/apr-util/include/apr_dbm.h | 227 - contrib/apr-util/include/apr_hooks.h | 358 - contrib/apr-util/include/apr_ldap.h.in | 197 - contrib/apr-util/include/apr_ldap.hnw | 158 - contrib/apr-util/include/apr_ldap.hw | 197 - contrib/apr-util/include/apr_ldap.hwc | 197 - contrib/apr-util/include/apr_ldap_init.h | 165 - contrib/apr-util/include/apr_ldap_option.h | 254 - contrib/apr-util/include/apr_ldap_rebind.h | 98 - contrib/apr-util/include/apr_ldap_url.h | 120 - contrib/apr-util/include/apr_md4.h | 135 - contrib/apr-util/include/apr_md5.h | 176 - contrib/apr-util/include/apr_memcache.h | 444 - contrib/apr-util/include/apr_optional.h | 92 - contrib/apr-util/include/apr_optional_hooks.h | 117 - contrib/apr-util/include/apr_queue.h | 138 - contrib/apr-util/include/apr_redis.h | 459 - contrib/apr-util/include/apr_reslist.h | 183 - contrib/apr-util/include/apr_rmm.h | 137 - contrib/apr-util/include/apr_sdbm.h | 176 - contrib/apr-util/include/apr_sha1.h | 121 - contrib/apr-util/include/apr_siphash.h | 148 - contrib/apr-util/include/apr_strmatch.h | 81 - contrib/apr-util/include/apr_thread_pool.h | 299 - contrib/apr-util/include/apr_uri.h | 178 - contrib/apr-util/include/apr_uuid.h | 76 - contrib/apr-util/include/apr_xlate.h | 163 - contrib/apr-util/include/apr_xml.h | 358 - contrib/apr-util/include/apu.h.in | 128 - contrib/apr-util/include/apu.hnw | 124 - contrib/apr-util/include/apu.hw | 146 - contrib/apr-util/include/apu.hwc | 145 - contrib/apr-util/include/apu_errno.h | 173 - contrib/apr-util/include/apu_version.h | 139 - contrib/apr-util/include/apu_want.h.in | 51 - contrib/apr-util/include/apu_want.hnw | 52 - contrib/apr-util/include/apu_want.hw | 52 - .../apr-util/include/private/apr_crypto_internal.h | 297 - .../apr-util/include/private/apr_dbd_internal.h | 365 - contrib/apr-util/include/private/apr_dbd_odbc_v2.h | 119 - contrib/apr-util/include/private/apr_dbm_private.h | 121 - contrib/apr-util/include/private/apu_config.h.in | 183 - contrib/apr-util/include/private/apu_config.hnw | 53 - contrib/apr-util/include/private/apu_config.hw | 52 - contrib/apr-util/include/private/apu_internal.h | 73 - .../apr-util/include/private/apu_select_dbm.h.in | 28 - contrib/apr-util/include/private/apu_select_dbm.hw | 28 - contrib/apr-util/ldap/NWGNUmakefile | 263 - contrib/apr-util/ldap/apr_ldap_init.c | 235 - contrib/apr-util/ldap/apr_ldap_option.c | 652 - contrib/apr-util/ldap/apr_ldap_rebind.c | 377 - contrib/apr-util/ldap/apr_ldap_stub.c | 145 - contrib/apr-util/ldap/apr_ldap_url.c | 694 - contrib/apr-util/libaprutil.rc | 69 - contrib/apr-util/memcache/apr_memcache.c | 1724 - contrib/apr-util/misc/apr_date.c | 637 - contrib/apr-util/misc/apr_queue.c | 398 - contrib/apr-util/misc/apr_reslist.c | 473 - contrib/apr-util/misc/apr_rmm.c | 457 - contrib/apr-util/misc/apr_thread_pool.c | 956 - contrib/apr-util/misc/apu_dso.c | 209 - contrib/apr-util/misc/apu_version.c | 37 - contrib/apr-util/redis/apr_redis.c | 1548 - contrib/apr-util/renames_pending | 2 - contrib/apr-util/strmatch/apr_strmatch.c | 118 - contrib/apr-util/test/Makefile.in | 90 - contrib/apr-util/test/Makefile.win | 171 - contrib/apr-util/test/NWGNUaputest | 282 - contrib/apr-util/test/NWGNUmakefile | 258 - contrib/apr-util/test/abts.c | 423 - contrib/apr-util/test/abts.h | 101 - contrib/apr-util/test/abts_tests.h | 48 - contrib/apr-util/test/data/billion-laughs.xml | 36 - contrib/apr-util/test/dbd.c | 407 - contrib/apr-util/test/nw_misc.c | 23 - contrib/apr-util/test/test_apu.h | 100 - contrib/apr-util/test/testall.dsw | 513 - contrib/apr-util/test/testbuckets.c | 535 - contrib/apr-util/test/testcrypto.c | 1545 - contrib/apr-util/test/testdate.c | 202 - contrib/apr-util/test/testdbd.c | 245 - contrib/apr-util/test/testdbm.c | 221 - contrib/apr-util/test/testldap.c | 250 - contrib/apr-util/test/testmd4.c | 119 - contrib/apr-util/test/testmd5.c | 103 - contrib/apr-util/test/testmemcache.c | 626 - contrib/apr-util/test/testpass.c | 217 - contrib/apr-util/test/testqueue.c | 135 - contrib/apr-util/test/testredis.c | 552 - contrib/apr-util/test/testreslist.c | 272 - contrib/apr-util/test/testrmm.c | 191 - contrib/apr-util/test/testsiphash.c | 148 - contrib/apr-util/test/teststrmatch.c | 92 - contrib/apr-util/test/testuri.c | 331 - contrib/apr-util/test/testutil.c | 60 - contrib/apr-util/test/testutil.h | 73 - contrib/apr-util/test/testuuid.c | 56 - contrib/apr-util/test/testxlate.c | 134 - contrib/apr-util/test/testxml.c | 205 - contrib/apr-util/uri/apr_uri.c | 962 - contrib/apr-util/xlate/xlate.c | 458 - contrib/apr-util/xml/NWGNUmakefile | 259 - contrib/apr-util/xml/apr_xml.c | 1078 - contrib/apr/CHANGES | 82 - contrib/apr/CMakeLists.txt | 431 - contrib/apr/LICENSE | 341 - contrib/apr/Makefile.in | 150 - contrib/apr/Makefile.win | 171 - contrib/apr/NOTICE | 15 - contrib/apr/NWGNUmakefile | 434 - contrib/apr/README | 167 - contrib/apr/README.cmake | 112 - contrib/apr/apr-config.in | 251 - contrib/apr/apr.dep | 1916 -- contrib/apr/apr.dsp | 831 - contrib/apr/apr.dsw | 101 - contrib/apr/apr.mak | 1380 - contrib/apr/apr.pc.in | 11 - contrib/apr/apr.spec | 100 - contrib/apr/atomic/unix/builtins.c | 81 - contrib/apr/atomic/unix/builtins64.c | 64 - contrib/apr/atomic/unix/ia32.c | 131 - contrib/apr/atomic/unix/mutex.c | 206 - contrib/apr/atomic/unix/mutex64.c | 178 - contrib/apr/atomic/unix/ppc.c | 211 - contrib/apr/atomic/unix/s390.c | 159 - contrib/apr/atomic/unix/solaris.c | 83 - contrib/apr/build-outputs.mk | 328 - contrib/apr/build.conf | 29 - contrib/apr/buildconf | 136 - contrib/apr/config.layout | 232 - contrib/apr/configure | 32465 ------------------- contrib/apr/configure.in | 3020 -- contrib/apr/docs/APRDesign.html | 399 - contrib/apr/docs/canonical_filenames.html | 156 - contrib/apr/docs/doxygen.conf | 38 - contrib/apr/docs/incomplete_types | 84 - contrib/apr/docs/non_apr_programs | 47 - contrib/apr/docs/pool-design.html | 96 - contrib/apr/docs/win32_builds.html | 57 - contrib/apr/dso/unix/dso.c | 251 - contrib/apr/emacs-mode | 15 - contrib/apr/encoding/apr_encode.c | 1419 - contrib/apr/encoding/apr_escape.c | 1214 - contrib/apr/file_io/unix/buffer.c | 60 - contrib/apr/file_io/unix/copy.c | 119 - contrib/apr/file_io/unix/dir.c | 373 - contrib/apr/file_io/unix/fileacc.c | 119 - contrib/apr/file_io/unix/filedup.c | 181 - contrib/apr/file_io/unix/filepath.c | 314 - contrib/apr/file_io/unix/filepath_util.c | 111 - contrib/apr/file_io/unix/filestat.c | 339 - contrib/apr/file_io/unix/flock.c | 120 - contrib/apr/file_io/unix/fullrw.c | 111 - contrib/apr/file_io/unix/mktemp.c | 223 - contrib/apr/file_io/unix/open.c | 417 - contrib/apr/file_io/unix/pipe.c | 292 - contrib/apr/file_io/unix/readwrite.c | 528 - contrib/apr/file_io/unix/seek.c | 136 - contrib/apr/file_io/unix/tempdir.c | 129 - contrib/apr/helpers/apr_rename.pl | 106 - contrib/apr/include/apr.h.in | 656 - contrib/apr/include/apr.hnw | 445 - contrib/apr/include/apr.hw | 667 - contrib/apr/include/apr.hwc | 664 - contrib/apr/include/apr_allocator.h | 179 - contrib/apr/include/apr_atomic.h | 207 - contrib/apr/include/apr_cstr.h | 292 - contrib/apr/include/apr_dso.h | 94 - contrib/apr/include/apr_encode.h | 569 - contrib/apr/include/apr_env.h | 67 - contrib/apr/include/apr_errno.h | 1342 - contrib/apr/include/apr_escape.h | 431 - contrib/apr/include/apr_file_info.h | 428 - contrib/apr/include/apr_file_io.h | 1005 - contrib/apr/include/apr_fnmatch.h | 153 - contrib/apr/include/apr_general.h | 244 - contrib/apr/include/apr_getopt.h | 160 - contrib/apr/include/apr_global_mutex.h | 195 - contrib/apr/include/apr_hash.h | 283 - contrib/apr/include/apr_inherit.h | 51 - contrib/apr/include/apr_lib.h | 241 - contrib/apr/include/apr_mmap.h | 171 - contrib/apr/include/apr_network_io.h | 951 - contrib/apr/include/apr_perms_set.h | 65 - contrib/apr/include/apr_poll.h | 446 - contrib/apr/include/apr_pools.h | 815 - contrib/apr/include/apr_portable.h | 549 - contrib/apr/include/apr_proc_mutex.h | 192 - contrib/apr/include/apr_random.h | 153 - contrib/apr/include/apr_ring.h | 513 - contrib/apr/include/apr_shm.h | 229 - contrib/apr/include/apr_signal.h | 109 - contrib/apr/include/apr_skiplist.h | 381 - contrib/apr/include/apr_strings.h | 380 - contrib/apr/include/apr_support.h | 57 - contrib/apr/include/apr_tables.h | 507 - contrib/apr/include/apr_thread_cond.h | 139 - contrib/apr/include/apr_thread_mutex.h | 123 - contrib/apr/include/apr_thread_proc.h | 846 - contrib/apr/include/apr_thread_rwlock.h | 129 - contrib/apr/include/apr_time.h | 237 - contrib/apr/include/apr_user.h | 158 - contrib/apr/include/apr_version.h | 164 - contrib/apr/include/apr_want.h | 124 - contrib/apr/include/arch/apr_private_common.h | 41 - contrib/apr/include/arch/unix/apr_arch_atomic.h | 53 - contrib/apr/include/arch/unix/apr_arch_dso.h | 63 - contrib/apr/include/arch/unix/apr_arch_file_io.h | 174 - .../apr/include/arch/unix/apr_arch_global_mutex.h | 37 - contrib/apr/include/arch/unix/apr_arch_inherit.h | 64 - .../apr/include/arch/unix/apr_arch_internal_time.h | 24 - contrib/apr/include/arch/unix/apr_arch_misc.h | 67 - contrib/apr/include/arch/unix/apr_arch_networkio.h | 145 - .../apr/include/arch/unix/apr_arch_poll_private.h | 189 - .../apr/include/arch/unix/apr_arch_proc_mutex.h | 121 - contrib/apr/include/arch/unix/apr_arch_shm.h | 74 - .../apr/include/arch/unix/apr_arch_thread_cond.h | 42 - .../apr/include/arch/unix/apr_arch_thread_mutex.h | 42 - .../apr/include/arch/unix/apr_arch_thread_rwlock.h | 49 - .../apr/include/arch/unix/apr_arch_threadproc.h | 119 - contrib/apr/include/arch/unix/apr_private.h.in | 1075 - contrib/apr/include/private/apr_encode_private.h | 84 - contrib/apr/libapr.dep | 1920 -- contrib/apr/libapr.dsp | 868 - contrib/apr/libapr.mak | 1609 - contrib/apr/libapr.rc | 64 - contrib/apr/locks/unix/global_mutex.c | 245 - contrib/apr/locks/unix/proc_mutex.c | 1695 - contrib/apr/locks/unix/thread_cond.c | 145 - contrib/apr/locks/unix/thread_mutex.c | 334 - contrib/apr/locks/unix/thread_rwlock.c | 181 - contrib/apr/memory/unix/apr_pools.c | 2932 -- contrib/apr/misc/unix/charset.c | 83 - contrib/apr/misc/unix/env.c | 88 - contrib/apr/misc/unix/errorcodes.c | 443 - contrib/apr/misc/unix/getopt.c | 309 - contrib/apr/misc/unix/otherchild.c | 221 - contrib/apr/misc/unix/rand.c | 302 - contrib/apr/misc/unix/randbyte_os2.inc | 123 - contrib/apr/misc/unix/start.c | 89 - contrib/apr/misc/unix/version.c | 35 - contrib/apr/mmap/unix/common.c | 43 - contrib/apr/mmap/unix/mmap.c | 172 - contrib/apr/network_io/unix/inet_ntop.c | 243 - contrib/apr/network_io/unix/inet_pton.c | 240 - contrib/apr/network_io/unix/multicast.c | 313 - contrib/apr/network_io/unix/sendrecv.c | 1110 - contrib/apr/network_io/unix/sockaddr.c | 1284 - contrib/apr/network_io/unix/socket_util.c | 75 - contrib/apr/network_io/unix/sockets.c | 572 - contrib/apr/network_io/unix/sockopt.c | 465 - contrib/apr/passwd/apr_getpass.c | 256 - contrib/apr/poll/unix/epoll.c | 490 - contrib/apr/poll/unix/kqueue.c | 505 - contrib/apr/poll/unix/poll.c | 460 - contrib/apr/poll/unix/pollcb.c | 224 - contrib/apr/poll/unix/pollset.c | 247 - contrib/apr/poll/unix/port.c | 594 - contrib/apr/poll/unix/select.c | 449 - contrib/apr/poll/unix/wakeup.c | 151 - contrib/apr/poll/unix/z_asio.c | 782 - contrib/apr/random/unix/apr_random.c | 88 - contrib/apr/random/unix/sha2.c | 528 - contrib/apr/random/unix/sha2.h | 59 - contrib/apr/random/unix/sha2_glue.c | 49 - contrib/apr/shmem/unix/shm.c | 731 - contrib/apr/strings/apr_cpystrn.c | 315 - contrib/apr/strings/apr_cstr.c | 403 - contrib/apr/strings/apr_fnmatch.c | 482 - contrib/apr/strings/apr_snprintf.c | 1407 - contrib/apr/strings/apr_strings.c | 467 - contrib/apr/strings/apr_strnatcmp.c | 149 - contrib/apr/strings/apr_strtok.c | 56 - contrib/apr/support/unix/waitio.c | 123 - contrib/apr/tables/apr_hash.c | 552 - contrib/apr/tables/apr_skiplist.c | 852 - contrib/apr/tables/apr_tables.c | 1300 - contrib/apr/threadproc/unix/proc.c | 739 - contrib/apr/threadproc/unix/procsup.c | 104 - contrib/apr/threadproc/unix/signals.c | 481 - contrib/apr/threadproc/unix/thread.c | 334 - contrib/apr/threadproc/unix/threadpriv.c | 129 - contrib/apr/time/unix/time.c | 349 - contrib/apr/time/unix/timestr.c | 153 - contrib/apr/tools/gen_test_char.c | 131 - contrib/apr/user/unix/groupinfo.c | 87 - contrib/apr/user/unix/userinfo.c | 146 - contrib/serf/CHANGES | 310 - contrib/serf/LICENSE | 201 - contrib/serf/NOTICE | 7 - contrib/serf/README | 92 - contrib/serf/SConstruct | 505 - contrib/serf/STATUS | 19 - contrib/serf/auth/auth.c | 490 - contrib/serf/auth/auth.h | 130 - contrib/serf/auth/auth_basic.c | 182 - contrib/serf/auth/auth_digest.c | 562 - contrib/serf/auth/auth_spnego.c | 662 - contrib/serf/auth/auth_spnego.h | 121 - contrib/serf/auth/auth_spnego_gss.c | 231 - contrib/serf/auth/auth_spnego_sspi.c | 303 - contrib/serf/buckets/aggregate_buckets.c | 493 - contrib/serf/buckets/allocator.c | 439 - contrib/serf/buckets/barrier_buckets.c | 102 - contrib/serf/buckets/buckets.c | 645 - contrib/serf/buckets/bwtp_buckets.c | 601 - contrib/serf/buckets/chunk_buckets.c | 240 - contrib/serf/buckets/dechunk_buckets.c | 204 - contrib/serf/buckets/deflate_buckets.c | 408 - contrib/serf/buckets/file_buckets.c | 122 - contrib/serf/buckets/headers_buckets.c | 461 - contrib/serf/buckets/iovec_buckets.c | 174 - contrib/serf/buckets/limit_buckets.c | 132 - contrib/serf/buckets/mmap_buckets.c | 145 - contrib/serf/buckets/request_buckets.c | 242 - contrib/serf/buckets/response_body_buckets.c | 140 - contrib/serf/buckets/response_buckets.c | 503 - contrib/serf/buckets/simple_buckets.c | 164 - contrib/serf/buckets/socket_buckets.c | 130 - contrib/serf/buckets/ssl_buckets.c | 1988 -- contrib/serf/build/check.py | 67 - contrib/serf/build/gen_def.py | 78 - contrib/serf/build/serf.pc.in | 13 - contrib/serf/context.c | 390 - contrib/serf/design-guide.txt | 152 - contrib/serf/incoming.c | 181 - contrib/serf/outgoing.c | 1754 - contrib/serf/serf.h | 1122 - contrib/serf/serf_bucket_types.h | 693 - contrib/serf/serf_bucket_util.h | 299 - contrib/serf/serf_private.h | 470 - contrib/serf/ssltunnel.c | 200 - contrib/subversion/.editorconfig | 20 - contrib/subversion/.ycm_extra_conf.py | 88 - contrib/subversion/BUGS | 2 - contrib/subversion/CHANGES | 7314 ----- contrib/subversion/COMMITTERS | 246 - contrib/subversion/INSTALL | 1470 - contrib/subversion/LICENSE | 446 - contrib/subversion/Makefile.in | 1044 - contrib/subversion/NOTICE | 34 - contrib/subversion/README | 84 - contrib/subversion/aclocal.m4 | 61 - contrib/subversion/autogen.sh | 247 - contrib/subversion/build-outputs.mk | 3630 --- contrib/subversion/build.conf | 1767 - contrib/subversion/configure | 30335 ----------------- contrib/subversion/configure.ac | 1686 - contrib/subversion/doc/README | 28 - contrib/subversion/doc/doxygen.conf | 1488 - .../doc/programmer/WritingChangeLogs.txt | 220 - .../subversion/doc/user/cvs-crossover-guide.html | 906 - contrib/subversion/doc/user/lj_article.txt | 323 - .../subversion/doc/user/svn-best-practices.html | 318 - contrib/subversion/gen-make.opts | 2 - contrib/subversion/gen-make.py | 329 - contrib/subversion/get-deps.sh | 176 - .../subversion/subversion/include/mod_authz_svn.h | 61 - .../subversion/subversion/include/mod_dav_svn.h | 132 - .../subversion/subversion/include/private/README | 4 - .../subversion/include/private/ra_svn_sasl.h | 80 - .../include/private/ra_svn_wrapped_sasl.h | 131 - .../subversion/include/private/svn_adler32.h | 52 - .../subversion/include/private/svn_atomic.h | 158 - .../subversion/include/private/svn_auth_private.h | 267 - .../subversion/include/private/svn_branch.h | 679 - .../subversion/include/private/svn_branch_compat.h | 273 - .../subversion/include/private/svn_branch_impl.h | 197 - .../subversion/include/private/svn_branch_nested.h | 216 - .../subversion/include/private/svn_branch_repos.h | 104 - .../subversion/include/private/svn_cache.h | 580 - .../subversion/include/private/svn_cert.h | 68 - .../subversion/include/private/svn_client_mtcc.h | 237 - .../include/private/svn_client_private.h | 542 - .../subversion/include/private/svn_client_shelf.h | 498 - .../subversion/include/private/svn_client_shelf2.h | 467 - .../include/private/svn_cmdline_private.h | 285 - .../include/private/svn_config_private.h | 129 - .../subversion/include/private/svn_dav_protocol.h | 68 - .../subversion/include/private/svn_debug.h | 107 - .../subversion/include/private/svn_delta_private.h | 134 - .../subversion/include/private/svn_dep_compat.h | 211 - .../subversion/include/private/svn_diff_private.h | 155 - .../subversion/include/private/svn_diff_tree.h | 373 - .../include/private/svn_dirent_uri_private.h | 53 - .../subversion/include/private/svn_doxygen.h | 32 - .../subversion/include/private/svn_editor.h | 1135 - .../subversion/include/private/svn_element.h | 399 - .../subversion/include/private/svn_eol_private.h | 93 - .../subversion/include/private/svn_error_private.h | 54 - .../subversion/include/private/svn_fs_fs_private.h | 371 - .../subversion/include/private/svn_fs_private.h | 222 - .../subversion/include/private/svn_fs_util.h | 251 - .../subversion/include/private/svn_fspath.h | 175 - .../subversion/include/private/svn_io_private.h | 182 - .../subversion/include/private/svn_log.h | 271 - .../subversion/include/private/svn_magic.h | 57 - .../include/private/svn_mergeinfo_private.h | 294 - .../subversion/include/private/svn_mutex.h | 122 - .../subversion/include/private/svn_object_pool.h | 119 - .../subversion/include/private/svn_opt_private.h | 152 - .../subversion/include/private/svn_packed_data.h | 260 - .../subversion/include/private/svn_ra_private.h | 315 - .../include/private/svn_ra_svn_private.h | 1060 - .../subversion/include/private/svn_repos_private.h | 397 - .../subversion/include/private/svn_skel.h | 236 - .../subversion/include/private/svn_sorts_private.h | 230 - .../subversion/include/private/svn_sqlite.h | 571 - .../include/private/svn_string_private.h | 336 - .../subversion/include/private/svn_subr_private.h | 753 - .../include/private/svn_temp_serializer.h | 223 - .../subversion/include/private/svn_token.h | 98 - .../subversion/include/private/svn_utf_private.h | 295 - .../subversion/include/private/svn_wc_private.h | 2135 -- contrib/subversion/subversion/include/svn_auth.h | 1327 - contrib/subversion/subversion/include/svn_base64.h | 138 - .../subversion/include/svn_cache_config.h | 95 - .../subversion/subversion/include/svn_checksum.h | 301 - contrib/subversion/subversion/include/svn_client.h | 7835 ----- .../subversion/subversion/include/svn_cmdline.h | 420 - contrib/subversion/subversion/include/svn_compat.h | 116 - contrib/subversion/subversion/include/svn_config.h | 915 - contrib/subversion/subversion/include/svn_ctype.h | 196 - contrib/subversion/subversion/include/svn_dav.h | 433 - contrib/subversion/subversion/include/svn_delta.h | 1578 - contrib/subversion/subversion/include/svn_diff.h | 1377 - .../subversion/subversion/include/svn_dirent_uri.h | 927 - contrib/subversion/subversion/include/svn_dso.h | 99 - contrib/subversion/subversion/include/svn_error.h | 703 - .../subversion/include/svn_error_codes.h | 1805 -- contrib/subversion/subversion/include/svn_fs.h | 3560 -- contrib/subversion/subversion/include/svn_hash.h | 289 - contrib/subversion/subversion/include/svn_io.h | 2644 -- contrib/subversion/subversion/include/svn_iter.h | 139 - contrib/subversion/subversion/include/svn_md5.h | 91 - .../subversion/subversion/include/svn_mergeinfo.h | 641 - contrib/subversion/subversion/include/svn_nls.h | 56 - contrib/subversion/subversion/include/svn_opt.h | 877 - .../subversion/subversion/include/svn_opt_impl.h | 86 - contrib/subversion/subversion/include/svn_path.h | 736 - contrib/subversion/subversion/include/svn_pools.h | 114 - contrib/subversion/subversion/include/svn_props.h | 748 - .../subversion/subversion/include/svn_quoprint.h | 77 - contrib/subversion/subversion/include/svn_ra.h | 2657 -- contrib/subversion/subversion/include/svn_ra_svn.h | 737 - contrib/subversion/subversion/include/svn_repos.h | 4403 --- contrib/subversion/subversion/include/svn_sorts.h | 147 - contrib/subversion/subversion/include/svn_string.h | 693 - contrib/subversion/subversion/include/svn_subst.h | 708 - contrib/subversion/subversion/include/svn_time.h | 101 - contrib/subversion/subversion/include/svn_types.h | 1284 - .../subversion/subversion/include/svn_types_impl.h | 157 - contrib/subversion/subversion/include/svn_user.h | 59 - contrib/subversion/subversion/include/svn_utf.h | 252 - .../subversion/subversion/include/svn_version.h | 452 - contrib/subversion/subversion/include/svn_wc.h | 8470 ----- contrib/subversion/subversion/include/svn_x509.h | 201 - contrib/subversion/subversion/include/svn_xml.h | 389 - .../libsvn_auth_gnome_keyring/gnome_keyring.c | 551 - .../libsvn_auth_gnome_keyring.pc.in | 12 - .../subversion/libsvn_auth_gnome_keyring/version.c | 35 - .../subversion/libsvn_auth_kwallet/kwallet.cpp | 471 - .../libsvn_auth_kwallet/libsvn_auth_kwallet.pc.in | 12 - .../subversion/libsvn_auth_kwallet/version.c | 35 - contrib/subversion/subversion/libsvn_client/add.c | 1282 - .../subversion/subversion/libsvn_client/blame.c | 984 - contrib/subversion/subversion/libsvn_client/cat.c | 337 - .../subversion/libsvn_client/changelist.c | 144 - .../subversion/subversion/libsvn_client/checkout.c | 229 - .../subversion/subversion/libsvn_client/cleanup.c | 265 - .../subversion/subversion/libsvn_client/client.h | 1243 - .../subversion/subversion/libsvn_client/cmdline.c | 372 - .../subversion/subversion/libsvn_client/commit.c | 1088 - .../subversion/libsvn_client/commit_util.c | 2088 -- .../subversion/libsvn_client/compat_providers.c | 140 - .../subversion/libsvn_client/conflicts.c | 13527 -------- contrib/subversion/subversion/libsvn_client/copy.c | 3488 -- contrib/subversion/subversion/libsvn_client/ctx.c | 135 - .../subversion/subversion/libsvn_client/delete.c | 604 - .../subversion/libsvn_client/deprecated.c | 3263 -- contrib/subversion/subversion/libsvn_client/diff.c | 2948 -- .../subversion/libsvn_client/diff_local.c | 741 - .../subversion/libsvn_client/diff_summarize.c | 301 - .../subversion/subversion/libsvn_client/export.c | 1591 - .../subversion/libsvn_client/externals.c | 1281 - .../subversion/subversion/libsvn_client/import.c | 1041 - contrib/subversion/subversion/libsvn_client/info.c | 490 - .../subversion/subversion/libsvn_client/iprops.c | 272 - .../subversion/subversion/libsvn_client/layout.c | 289 - .../subversion/libsvn_client/libsvn_client.pc.in | 12 - contrib/subversion/subversion/libsvn_client/list.c | 585 - .../subversion/libsvn_client/locking_commands.c | 649 - contrib/subversion/subversion/libsvn_client/log.c | 950 - .../subversion/subversion/libsvn_client/merge.c | 12946 -------- .../subversion/libsvn_client/merge_elements.c | 248 - .../subversion/libsvn_client/mergeinfo.c | 2325 -- .../subversion/libsvn_client/mergeinfo.h | 412 - contrib/subversion/subversion/libsvn_client/mtcc.c | 1487 - .../subversion/subversion/libsvn_client/patch.c | 3784 --- .../subversion/libsvn_client/prop_commands.c | 1573 - contrib/subversion/subversion/libsvn_client/ra.c | 1200 - .../subversion/subversion/libsvn_client/relocate.c | 248 - .../subversion/libsvn_client/repos_diff.c | 1406 - .../subversion/subversion/libsvn_client/resolved.c | 147 - .../subversion/subversion/libsvn_client/revert.c | 209 - .../subversion/libsvn_client/revisions.c | 197 - .../subversion/subversion/libsvn_client/shelf.c | 1274 - .../subversion/subversion/libsvn_client/shelf2.c | 2124 -- .../subversion/subversion/libsvn_client/status.c | 856 - .../subversion/subversion/libsvn_client/switch.c | 485 - .../subversion/subversion/libsvn_client/update.c | 831 - .../subversion/subversion/libsvn_client/upgrade.c | 415 - contrib/subversion/subversion/libsvn_client/url.c | 63 - contrib/subversion/subversion/libsvn_client/util.c | 471 - .../subversion/subversion/libsvn_client/version.c | 33 - .../subversion/libsvn_client/wc_editor.c | 655 - .../subversion/subversion/libsvn_delta/branch.c | 1699 - .../subversion/libsvn_delta/branch_compat.c | 2072 -- .../subversion/libsvn_delta/branch_migrate.c | 366 - .../subversion/libsvn_delta/branch_nested.c | 660 - .../subversion/libsvn_delta/branch_repos.c | 132 - .../subversion/subversion/libsvn_delta/cancel.c | 399 - .../subversion/subversion/libsvn_delta/compat.c | 2037 -- .../subversion/libsvn_delta/compose_delta.c | 839 - .../subversion/libsvn_delta/debug_editor.c | 501 - .../subversion/libsvn_delta/default_editor.c | 189 - contrib/subversion/subversion/libsvn_delta/delta.h | 96 - .../subversion/libsvn_delta/deprecated.c | 121 - .../subversion/libsvn_delta/depth_filter_editor.c | 485 - .../subversion/subversion/libsvn_delta/editor.c | 895 - .../subversion/subversion/libsvn_delta/element.c | 469 - .../subversion/libsvn_delta/libsvn_delta.pc.in | 12 - .../subversion/libsvn_delta/path_driver.c | 358 - .../subversion/subversion/libsvn_delta/svndiff.c | 1101 - .../subversion/libsvn_delta/text_delta.c | 994 - .../subversion/subversion/libsvn_delta/version.c | 33 - .../subversion/subversion/libsvn_delta/xdelta.c | 496 - .../subversion/libsvn_diff/binary_diff.c | 281 - .../subversion/subversion/libsvn_diff/deprecated.c | 464 - contrib/subversion/subversion/libsvn_diff/diff.c | 199 - contrib/subversion/subversion/libsvn_diff/diff.h | 227 - contrib/subversion/subversion/libsvn_diff/diff3.c | 532 - contrib/subversion/subversion/libsvn_diff/diff4.c | 314 - .../subversion/subversion/libsvn_diff/diff_file.c | 2492 -- .../subversion/libsvn_diff/diff_memory.c | 1129 - .../subversion/subversion/libsvn_diff/diff_tree.c | 1658 - contrib/subversion/subversion/libsvn_diff/lcs.c | 375 - .../subversion/libsvn_diff/libsvn_diff.pc.in | 12 - .../subversion/subversion/libsvn_diff/parse-diff.c | 2379 -- contrib/subversion/subversion/libsvn_diff/token.c | 198 - contrib/subversion/subversion/libsvn_diff/util.c | 623 - contrib/subversion/subversion/libsvn_fs/access.c | 98 - .../subversion/subversion/libsvn_fs/deprecated.c | 247 - contrib/subversion/subversion/libsvn_fs/editor.c | 838 - .../subversion/subversion/libsvn_fs/fs-loader.c | 2262 -- .../subversion/subversion/libsvn_fs/fs-loader.h | 602 - .../subversion/libsvn_fs/libsvn_fs.pc.in | 12 - .../subversion/libsvn_fs_base/bdb/bdb-err.c | 106 - .../subversion/libsvn_fs_base/bdb/bdb-err.h | 115 - .../subversion/libsvn_fs_base/bdb/bdb_compat.c | 34 - .../subversion/libsvn_fs_base/bdb/bdb_compat.h | 135 - .../subversion/libsvn_fs_base/bdb/changes-table.c | 482 - .../subversion/libsvn_fs_base/bdb/changes-table.h | 94 - .../libsvn_fs_base/bdb/checksum-reps-table.c | 208 - .../libsvn_fs_base/bdb/checksum-reps-table.h | 89 - .../subversion/libsvn_fs_base/bdb/copies-table.c | 210 - .../subversion/libsvn_fs_base/bdb/copies-table.h | 93 - .../subversion/subversion/libsvn_fs_base/bdb/dbt.c | 170 - .../subversion/subversion/libsvn_fs_base/bdb/dbt.h | 120 - .../subversion/subversion/libsvn_fs_base/bdb/env.c | 719 - .../subversion/subversion/libsvn_fs_base/bdb/env.h | 159 - .../libsvn_fs_base/bdb/lock-tokens-table.c | 157 - .../libsvn_fs_base/bdb/lock-tokens-table.h | 96 - .../subversion/libsvn_fs_base/bdb/locks-table.c | 328 - .../subversion/libsvn_fs_base/bdb/locks-table.h | 110 - .../libsvn_fs_base/bdb/miscellaneous-table.c | 135 - .../libsvn_fs_base/bdb/miscellaneous-table.h | 71 - .../libsvn_fs_base/bdb/node-origins-table.c | 145 - .../libsvn_fs_base/bdb/node-origins-table.h | 76 - .../subversion/libsvn_fs_base/bdb/nodes-table.c | 259 - .../subversion/libsvn_fs_base/bdb/nodes-table.h | 121 - .../subversion/libsvn_fs_base/bdb/reps-table.c | 204 - .../subversion/libsvn_fs_base/bdb/reps-table.h | 94 - .../subversion/libsvn_fs_base/bdb/rev-table.c | 224 - .../subversion/libsvn_fs_base/bdb/rev-table.h | 85 - .../subversion/libsvn_fs_base/bdb/strings-table.c | 541 - .../subversion/libsvn_fs_base/bdb/strings-table.h | 143 - .../subversion/libsvn_fs_base/bdb/txn-table.c | 325 - .../subversion/libsvn_fs_base/bdb/txn-table.h | 100 - .../subversion/libsvn_fs_base/bdb/uuids-table.c | 149 - .../subversion/libsvn_fs_base/bdb/uuids-table.h | 69 - contrib/subversion/subversion/libsvn_fs_base/dag.c | 1771 - contrib/subversion/subversion/libsvn_fs_base/dag.h | 587 - contrib/subversion/subversion/libsvn_fs_base/err.c | 177 - contrib/subversion/subversion/libsvn_fs_base/err.h | 98 - contrib/subversion/subversion/libsvn_fs_base/fs.c | 1547 - contrib/subversion/subversion/libsvn_fs_base/fs.h | 361 - .../subversion/subversion/libsvn_fs_base/fs_init.h | 33 - contrib/subversion/subversion/libsvn_fs_base/id.c | 209 - contrib/subversion/subversion/libsvn_fs_base/id.h | 81 - .../subversion/subversion/libsvn_fs_base/key-gen.c | 119 - .../subversion/subversion/libsvn_fs_base/key-gen.h | 93 - .../subversion/libsvn_fs_base/libsvn_fs_base.pc.in | 12 - .../subversion/subversion/libsvn_fs_base/lock.c | 670 - .../subversion/subversion/libsvn_fs_base/lock.h | 127 - .../subversion/libsvn_fs_base/node-rev.c | 126 - .../subversion/libsvn_fs_base/node-rev.h | 101 - .../subversion/libsvn_fs_base/notes/TODO | 137 - .../subversion/libsvn_fs_base/notes/fs-history | 270 - .../subversion/libsvn_fs_base/notes/structure | 1086 - .../subversion/libsvn_fs_base/reps-strings.c | 1618 - .../subversion/libsvn_fs_base/reps-strings.h | 176 - .../subversion/libsvn_fs_base/revs-txns.c | 1102 - .../subversion/libsvn_fs_base/revs-txns.h | 235 - .../subversion/subversion/libsvn_fs_base/trail.c | 292 - .../subversion/subversion/libsvn_fs_base/trail.h | 239 - .../subversion/subversion/libsvn_fs_base/tree.c | 5605 ---- .../subversion/subversion/libsvn_fs_base/tree.h | 99 - .../subversion/libsvn_fs_base/util/fs_skels.c | 1515 - .../subversion/libsvn_fs_base/util/fs_skels.h | 177 - .../subversion/subversion/libsvn_fs_base/uuid.c | 116 - .../subversion/subversion/libsvn_fs_base/uuid.h | 49 - .../subversion/libsvn_fs_fs/cached_data.c | 3806 --- .../subversion/libsvn_fs_fs/cached_data.h | 191 - .../subversion/subversion/libsvn_fs_fs/caching.c | 899 - contrib/subversion/subversion/libsvn_fs_fs/dag.c | 1428 - contrib/subversion/subversion/libsvn_fs_fs/dag.h | 589 - .../subversion/libsvn_fs_fs/dump-index.c | 90 - contrib/subversion/subversion/libsvn_fs_fs/fs.c | 710 - contrib/subversion/subversion/libsvn_fs_fs/fs.h | 705 - contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c | 2515 -- contrib/subversion/subversion/libsvn_fs_fs/fs_fs.h | 378 - .../subversion/subversion/libsvn_fs_fs/fs_init.h | 32 - .../subversion/subversion/libsvn_fs_fs/hotcopy.c | 1100 - .../subversion/subversion/libsvn_fs_fs/hotcopy.h | 47 - contrib/subversion/subversion/libsvn_fs_fs/id.c | 646 - contrib/subversion/subversion/libsvn_fs_fs/id.h | 163 - contrib/subversion/subversion/libsvn_fs_fs/index.c | 3471 -- contrib/subversion/subversion/libsvn_fs_fs/index.h | 356 - .../subversion/libsvn_fs_fs/libsvn_fs_fs.pc.in | 12 - .../subversion/libsvn_fs_fs/load-index.c | 174 - contrib/subversion/subversion/libsvn_fs_fs/lock.c | 1367 - contrib/subversion/subversion/libsvn_fs_fs/lock.h | 110 - .../subversion/subversion/libsvn_fs_fs/low_level.c | 1330 - .../subversion/subversion/libsvn_fs_fs/low_level.h | 235 - contrib/subversion/subversion/libsvn_fs_fs/pack.c | 2168 -- contrib/subversion/subversion/libsvn_fs_fs/pack.h | 70 - .../subversion/subversion/libsvn_fs_fs/recovery.c | 513 - .../subversion/subversion/libsvn_fs_fs/recovery.h | 36 - .../subversion/libsvn_fs_fs/rep-cache-db.h | 106 - .../subversion/libsvn_fs_fs/rep-cache-db.sql | 95 - .../subversion/subversion/libsvn_fs_fs/rep-cache.c | 423 - .../subversion/subversion/libsvn_fs_fs/rep-cache.h | 107 - .../subversion/subversion/libsvn_fs_fs/rev_file.c | 307 - .../subversion/subversion/libsvn_fs_fs/rev_file.h | 145 - .../subversion/subversion/libsvn_fs_fs/revprops.c | 1579 - .../subversion/subversion/libsvn_fs_fs/revprops.h | 180 - contrib/subversion/subversion/libsvn_fs_fs/stats.c | 1492 - .../subversion/subversion/libsvn_fs_fs/structure | 771 - .../subversion/libsvn_fs_fs/structure-indexes | 354 - .../subversion/libsvn_fs_fs/temp_serializer.c | 1429 - .../subversion/libsvn_fs_fs/temp_serializer.h | 427 - .../subversion/libsvn_fs_fs/transaction.c | 4235 --- .../subversion/libsvn_fs_fs/transaction.h | 294 - contrib/subversion/subversion/libsvn_fs_fs/tree.c | 4882 --- contrib/subversion/subversion/libsvn_fs_fs/tree.h | 111 - contrib/subversion/subversion/libsvn_fs_fs/util.c | 681 - contrib/subversion/subversion/libsvn_fs_fs/util.h | 403 - .../subversion/subversion/libsvn_fs_fs/verify.c | 923 - .../subversion/subversion/libsvn_fs_fs/verify.h | 42 - .../subversion/subversion/libsvn_fs_util/fs-util.c | 349 - .../subversion/libsvn_fs_util/libsvn_fs_util.pc.in | 12 - contrib/subversion/subversion/libsvn_fs_x/TODO | 270 - .../subversion/libsvn_fs_x/batch_fsync.c | 588 - .../subversion/libsvn_fs_x/batch_fsync.h | 92 - .../subversion/libsvn_fs_x/cached_data.c | 3536 -- .../subversion/libsvn_fs_x/cached_data.h | 203 - .../subversion/subversion/libsvn_fs_x/caching.c | 682 - .../subversion/subversion/libsvn_fs_x/changes.c | 535 - .../subversion/subversion/libsvn_fs_x/changes.h | 148 - contrib/subversion/subversion/libsvn_fs_x/dag.c | 1083 - contrib/subversion/subversion/libsvn_fs_x/dag.h | 540 - .../subversion/subversion/libsvn_fs_x/dag_cache.c | 1103 - .../subversion/subversion/libsvn_fs_x/dag_cache.h | 174 - contrib/subversion/subversion/libsvn_fs_x/fs.c | 674 - contrib/subversion/subversion/libsvn_fs_x/fs.h | 575 - contrib/subversion/subversion/libsvn_fs_x/fs_id.c | 319 - contrib/subversion/subversion/libsvn_fs_x/fs_id.h | 62 - .../subversion/subversion/libsvn_fs_x/fs_init.h | 33 - contrib/subversion/subversion/libsvn_fs_x/fs_x.c | 1295 - contrib/subversion/subversion/libsvn_fs_x/fs_x.h | 220 - .../subversion/subversion/libsvn_fs_x/hotcopy.c | 792 - .../subversion/subversion/libsvn_fs_x/hotcopy.h | 48 - contrib/subversion/subversion/libsvn_fs_x/id.c | 198 - contrib/subversion/subversion/libsvn_fs_x/id.h | 135 - contrib/subversion/subversion/libsvn_fs_x/index.c | 3933 --- contrib/subversion/subversion/libsvn_fs_x/index.h | 433 - .../subversion/libsvn_fs_x/libsvn_fs_x.pc.in | 12 - contrib/subversion/subversion/libsvn_fs_x/lock.c | 1388 - contrib/subversion/subversion/libsvn_fs_x/lock.h | 116 - .../subversion/subversion/libsvn_fs_x/low_level.c | 1244 - .../subversion/subversion/libsvn_fs_x/low_level.h | 236 - .../subversion/subversion/libsvn_fs_x/noderevs.c | 913 - .../subversion/subversion/libsvn_fs_x/noderevs.h | 142 - contrib/subversion/subversion/libsvn_fs_x/pack.c | 2277 -- contrib/subversion/subversion/libsvn_fs_x/pack.h | 60 - .../subversion/subversion/libsvn_fs_x/recovery.c | 351 - .../subversion/subversion/libsvn_fs_x/recovery.h | 37 - .../subversion/libsvn_fs_x/rep-cache-db.h | 92 - .../subversion/libsvn_fs_x/rep-cache-db.sql | 70 - .../subversion/subversion/libsvn_fs_x/rep-cache.c | 440 - .../subversion/subversion/libsvn_fs_x/rep-cache.h | 110 - contrib/subversion/subversion/libsvn_fs_x/reps.c | 949 - contrib/subversion/subversion/libsvn_fs_x/reps.h | 190 - .../subversion/subversion/libsvn_fs_x/rev_file.c | 539 - .../subversion/subversion/libsvn_fs_x/rev_file.h | 200 - .../subversion/subversion/libsvn_fs_x/revprops.c | 1685 - .../subversion/subversion/libsvn_fs_x/revprops.h | 128 - .../subversion/libsvn_fs_x/string_table.c | 906 - .../subversion/libsvn_fs_x/string_table.h | 133 - .../subversion/subversion/libsvn_fs_x/structure | 336 - .../subversion/libsvn_fs_x/temp_serializer.c | 1185 - .../subversion/libsvn_fs_x/temp_serializer.h | 313 - .../subversion/libsvn_fs_x/transaction.c | 4207 --- .../subversion/libsvn_fs_x/transaction.h | 315 - contrib/subversion/subversion/libsvn_fs_x/tree.c | 3502 -- contrib/subversion/subversion/libsvn_fs_x/tree.h | 117 - contrib/subversion/subversion/libsvn_fs_x/util.c | 733 - contrib/subversion/subversion/libsvn_fs_x/util.h | 460 - contrib/subversion/subversion/libsvn_fs_x/verify.c | 850 - contrib/subversion/subversion/libsvn_fs_x/verify.h | 43 - contrib/subversion/subversion/libsvn_ra/compat.c | 954 - .../subversion/libsvn_ra/debug_reporter.c | 151 - .../subversion/libsvn_ra/debug_reporter.h | 49 - .../subversion/subversion/libsvn_ra/deprecated.c | 522 - .../subversion/subversion/libsvn_ra/deprecated.h | 60 - contrib/subversion/subversion/libsvn_ra/editor.c | 339 - .../subversion/libsvn_ra/libsvn_ra.pc.in | 12 - .../subversion/subversion/libsvn_ra/ra_loader.c | 1601 - .../subversion/subversion/libsvn_ra/ra_loader.h | 601 - contrib/subversion/subversion/libsvn_ra/util.c | 280 - .../subversion/libsvn_ra/wrapper_template.h | 514 - .../libsvn_ra_local/libsvn_ra_local.pc.in | 12 - .../subversion/libsvn_ra_local/ra_local.h | 102 - .../subversion/libsvn_ra_local/ra_plugin.c | 1971 -- .../subversion/libsvn_ra_local/split_url.c | 105 - .../subversion/subversion/libsvn_ra_serf/blame.c | 399 - .../subversion/libsvn_ra_serf/blncache.c | 179 - .../subversion/libsvn_ra_serf/blncache.h | 90 - .../subversion/subversion/libsvn_ra_serf/commit.c | 2534 -- .../subversion/libsvn_ra_serf/eagain_bucket.c | 127 - .../subversion/libsvn_ra_serf/get_deleted_rev.c | 178 - .../subversion/libsvn_ra_serf/get_file.c | 430 - .../subversion/libsvn_ra_serf/get_lock.c | 337 - .../subversion/subversion/libsvn_ra_serf/getdate.c | 171 - .../subversion/libsvn_ra_serf/getlocations.c | 200 - .../libsvn_ra_serf/getlocationsegments.c | 206 - .../subversion/libsvn_ra_serf/getlocks.c | 300 - .../subversion/libsvn_ra_serf/inherited_props.c | 442 - .../subversion/libsvn_ra_serf/libsvn_ra_serf.pc.in | 12 - .../subversion/subversion/libsvn_ra_serf/list.c | 288 - .../subversion/subversion/libsvn_ra_serf/lock.c | 685 - contrib/subversion/subversion/libsvn_ra_serf/log.c | 605 - .../subversion/subversion/libsvn_ra_serf/merge.c | 469 - .../subversion/libsvn_ra_serf/mergeinfo.c | 238 - .../subversion/libsvn_ra_serf/multistatus.c | 759 - .../subversion/subversion/libsvn_ra_serf/options.c | 799 - .../subversion/libsvn_ra_serf/property.c | 922 - .../subversion/subversion/libsvn_ra_serf/ra_serf.h | 1673 - .../subversion/subversion/libsvn_ra_serf/replay.c | 833 - .../subversion/libsvn_ra_serf/request_body.c | 232 - .../subversion/libsvn_ra_serf/sb_bucket.c | 190 - .../subversion/subversion/libsvn_ra_serf/serf.c | 1130 - .../subversion/subversion/libsvn_ra_serf/stat.c | 562 - .../subversion/libsvn_ra_serf/stream_bucket.c | 120 - .../subversion/subversion/libsvn_ra_serf/update.c | 2857 -- .../subversion/subversion/libsvn_ra_serf/util.c | 2154 -- .../subversion/libsvn_ra_serf/util_error.c | 101 - contrib/subversion/subversion/libsvn_ra_serf/xml.c | 1030 - .../subversion/subversion/libsvn_ra_svn/client.c | 3345 -- contrib/subversion/subversion/libsvn_ra_svn/cram.c | 221 - .../subversion/libsvn_ra_svn/cyrus_auth.c | 966 - .../subversion/libsvn_ra_svn/deprecated.c | 321 - .../subversion/subversion/libsvn_ra_svn/editorp.c | 1225 - .../subversion/libsvn_ra_svn/internal_auth.c | 121 - .../subversion/libsvn_ra_svn/libsvn_ra_svn.pc.in | 12 - .../subversion/subversion/libsvn_ra_svn/marshal.c | 3149 -- .../subversion/subversion/libsvn_ra_svn/protocol | 662 - .../subversion/subversion/libsvn_ra_svn/ra_svn.h | 283 - .../subversion/subversion/libsvn_ra_svn/streams.c | 232 - .../subversion/subversion/libsvn_ra_svn/version.c | 33 - .../subversion/libsvn_ra_svn/wrapped_sasl.c | 197 - contrib/subversion/subversion/libsvn_repos/authz.c | 1757 - contrib/subversion/subversion/libsvn_repos/authz.h | 375 - .../subversion/libsvn_repos/authz_info.c | 197 - .../subversion/libsvn_repos/authz_parse.c | 1518 - .../subversion/subversion/libsvn_repos/commit.c | 1443 - .../subversion/subversion/libsvn_repos/compat.c | 179 - .../subversion/libsvn_repos/config_file.c | 390 - .../subversion/libsvn_repos/config_file.h | 74 - .../subversion/libsvn_repos/config_pool.c | 148 - contrib/subversion/subversion/libsvn_repos/delta.c | 991 - .../subversion/libsvn_repos/deprecated.c | 1331 - contrib/subversion/subversion/libsvn_repos/dump.c | 2578 -- .../subversion/libsvn_repos/dump_editor.c | 1040 - .../subversion/subversion/libsvn_repos/fs-wrap.c | 1124 - contrib/subversion/subversion/libsvn_repos/hooks.c | 902 - .../subversion/libsvn_repos/libsvn_repos.pc.in | 12 - contrib/subversion/subversion/libsvn_repos/list.c | 340 - .../subversion/libsvn_repos/load-fs-vtable.c | 1537 - contrib/subversion/subversion/libsvn_repos/load.c | 834 - contrib/subversion/subversion/libsvn_repos/log.c | 2467 -- .../subversion/subversion/libsvn_repos/node_tree.c | 431 - .../subversion/subversion/libsvn_repos/notify.c | 44 - .../subversion/subversion/libsvn_repos/replay.c | 1573 - .../subversion/subversion/libsvn_repos/reporter.c | 1641 - contrib/subversion/subversion/libsvn_repos/repos.c | 2094 -- contrib/subversion/subversion/libsvn_repos/repos.h | 394 - .../subversion/subversion/libsvn_repos/rev_hunt.c | 1747 - .../subversion/subversion/libsvn_subr/adler32.c | 101 - .../subversion/subversion/libsvn_subr/apr_escape.c | 135 - contrib/subversion/subversion/libsvn_subr/atomic.c | 218 - contrib/subversion/subversion/libsvn_subr/auth.c | 914 - contrib/subversion/subversion/libsvn_subr/auth.h | 173 - contrib/subversion/subversion/libsvn_subr/base64.c | 573 - .../subversion/subversion/libsvn_subr/bit_array.c | 194 - .../subversion/libsvn_subr/cache-inprocess.c | 692 - .../subversion/libsvn_subr/cache-membuffer.c | 3480 -- .../subversion/libsvn_subr/cache-memcache.c | 596 - .../subversion/subversion/libsvn_subr/cache-null.c | 157 - contrib/subversion/subversion/libsvn_subr/cache.c | 319 - contrib/subversion/subversion/libsvn_subr/cache.h | 119 - .../subversion/libsvn_subr/cache_config.c | 181 - .../subversion/subversion/libsvn_subr/checksum.c | 856 - .../subversion/subversion/libsvn_subr/checksum.h | 74 - .../subversion/subversion/libsvn_subr/cmdline.c | 1890 -- contrib/subversion/subversion/libsvn_subr/compat.c | 169 - .../subversion/libsvn_subr/compress_lz4.c | 144 - .../subversion/libsvn_subr/compress_zlib.c | 201 - contrib/subversion/subversion/libsvn_subr/config.c | 1371 - .../subversion/libsvn_subr/config_auth.c | 272 - .../subversion/libsvn_subr/config_file.c | 1630 - .../subversion/libsvn_subr/config_impl.h | 165 - .../subversion/libsvn_subr/config_keys.inc | 77 - .../subversion/subversion/libsvn_subr/config_win.c | 283 - contrib/subversion/subversion/libsvn_subr/crypto.c | 705 - contrib/subversion/subversion/libsvn_subr/crypto.h | 141 - contrib/subversion/subversion/libsvn_subr/ctype.c | 336 - contrib/subversion/subversion/libsvn_subr/date.c | 393 - contrib/subversion/subversion/libsvn_subr/debug.c | 155 - .../subversion/subversion/libsvn_subr/deprecated.c | 2015 -- .../subversion/subversion/libsvn_subr/dirent_uri.c | 2854 -- .../subversion/subversion/libsvn_subr/dirent_uri.h | 40 - contrib/subversion/subversion/libsvn_subr/dso.c | 133 - contrib/subversion/subversion/libsvn_subr/encode.c | 107 - contrib/subversion/subversion/libsvn_subr/eol.c | 95 - contrib/subversion/subversion/libsvn_subr/error.c | 935 - .../subversion/libsvn_subr/errorcode.inc | 152 - contrib/subversion/subversion/libsvn_subr/fnv1a.c | 263 - contrib/subversion/subversion/libsvn_subr/fnv1a.h | 101 - .../subversion/subversion/libsvn_subr/genctype.py | 114 - .../subversion/subversion/libsvn_subr/gpg_agent.c | 738 - contrib/subversion/subversion/libsvn_subr/hash.c | 668 - .../subversion/libsvn_subr/internal_statements.h | 76 - .../subversion/libsvn_subr/internal_statements.sql | 47 - contrib/subversion/subversion/libsvn_subr/io.c | 5741 ---- contrib/subversion/subversion/libsvn_subr/iter.c | 171 - .../subversion/libsvn_subr/libsvn_subr.pc.in | 12 - contrib/subversion/subversion/libsvn_subr/lock.c | 60 - contrib/subversion/subversion/libsvn_subr/log.c | 429 - .../subversion/subversion/libsvn_subr/lz4/LICENSE | 24 - .../subversion/subversion/libsvn_subr/lz4/lz4.c | 1481 - .../subversion/libsvn_subr/lz4/lz4internal.h | 466 - .../subversion/libsvn_subr/macos_keychain.c | 264 - contrib/subversion/subversion/libsvn_subr/magic.c | 181 - contrib/subversion/subversion/libsvn_subr/md5.c | 58 - .../subversion/subversion/libsvn_subr/mergeinfo.c | 2636 -- contrib/subversion/subversion/libsvn_subr/mutex.c | 117 - contrib/subversion/subversion/libsvn_subr/nls.c | 103 - .../subversion/libsvn_subr/object_pool.c | 327 - contrib/subversion/subversion/libsvn_subr/opt.c | 1268 - contrib/subversion/subversion/libsvn_subr/opt.h | 54 - .../subversion/libsvn_subr/packed_data.c | 1106 - contrib/subversion/subversion/libsvn_subr/path.c | 1322 - *** 836198 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Jun 11 21:59:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63FFF665903; Fri, 11 Jun 2021 21:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1vrs2NsMz4kxN; Fri, 11 Jun 2021 21:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BB682A7AA; Fri, 11 Jun 2021 21:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BLxfXK037444; Fri, 11 Jun 2021 21:59:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BLxf70037443; Fri, 11 Jun 2021 21:59:41 GMT (envelope-from git) Date: Fri, 11 Jun 2021 21:59:41 GMT Message-Id: <202106112159.15BLxf70037443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2a279163b9ec - main - src.conf.5: Regen for svnlite removal. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a279163b9ec00d23033f11ff2d5c485e2f4da8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 21:59:41 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2a279163b9ec00d23033f11ff2d5c485e2f4da8f commit 2a279163b9ec00d23033f11ff2d5c485e2f4da8f Author: John Baldwin AuthorDate: 2021-06-11 21:57:51 +0000 Commit: John Baldwin CommitDate: 2021-06-11 21:57:51 +0000 src.conf.5: Regen for svnlite removal. Reviewed by: bcr, imp, emaste Differential Revision: https://reviews.freebsd.org/D30738 --- share/man/man5/src.conf.5 | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 0fe0df58144d..0bcadfb5751d 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 5, 2021 +.Dd June 11, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -395,10 +395,6 @@ When set, it enforces these options: .It .Va WITHOUT_PKGBOOTSTRAP .It -.Va WITHOUT_SVN -.It -.Va WITHOUT_SVNLITE -.It .Va WITHOUT_UNBOUND .It .Va WITHOUT_ZFS @@ -616,12 +612,6 @@ This includes the device tree compiler (dtc) and libfdt support library. Do not build .Xr file 1 and related programs. -When set, it enforces these options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_SVNLITE -.El .It Va WITHOUT_FINGER Do not build or install .Xr finger 1 @@ -1295,10 +1285,6 @@ When set, it enforces these options: .It .Va WITHOUT_PKGBOOTSTRAP .It -.Va WITHOUT_SVN -.It -.Va WITHOUT_SVNLITE -.It .Va WITHOUT_UNBOUND .It .Va WITHOUT_ZFS @@ -1503,15 +1489,6 @@ Check staged files are not stale. Neither build nor install .Lb libstats and dependent binaries. -.It Va WITH_SVN -Install -.Xr svnlite 1 -as -.Xr svn 1 . -.It Va WITH_SVNLITE -Build -.Xr svnlite 1 -and related programs. .It Va WITHOUT_SYSCONS Do not build .Xr syscons 4 From owner-dev-commits-src-all@freebsd.org Fri Jun 11 23:09:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFEB9666782; Fri, 11 Jun 2021 23:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1xPS4DFZz4qKq; Fri, 11 Jun 2021 23:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A82D2B53C; Fri, 11 Jun 2021 23:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15BN9WTp030593; Fri, 11 Jun 2021 23:09:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15BN9WcG030592; Fri, 11 Jun 2021 23:09:32 GMT (envelope-from git) Date: Fri, 11 Jun 2021 23:09:32 GMT Message-Id: <202106112309.15BN9WcG030592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Houchard Subject: git: 30b915d7b2d3 - main - an: Remove driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cognet X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30b915d7b2d372c20cb80fdc75032fd41d6e1161 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 23:09:32 -0000 The branch main has been updated by cognet: URL: https://cgit.FreeBSD.org/src/commit/?id=30b915d7b2d372c20cb80fdc75032fd41d6e1161 commit 30b915d7b2d372c20cb80fdc75032fd41d6e1161 Author: Olivier Houchard AuthorDate: 2021-06-11 23:08:54 +0000 Commit: Olivier Houchard CommitDate: 2021-06-11 23:08:54 +0000 an: Remove driver Now that an(4) is gone, remove it from GENERIC kernel config files. Reported by: flo --- sys/amd64/conf/GENERIC | 1 - sys/i386/conf/GENERIC | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 696d15698baf..2b49dd4726ec 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -307,7 +307,6 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm -device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 288968d84af1..7a3806312f03 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -269,7 +269,6 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm -device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support From owner-dev-commits-src-all@freebsd.org Fri Jun 11 23:50:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25949666755; Fri, 11 Jun 2021 23:50:05 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1yJD5BCqz4tN4; Fri, 11 Jun 2021 23:50:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:2862:40f8:5936:1a27]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 16E9A721E280B; Sat, 12 Jun 2021 01:49:55 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: c5a2d8c5f517 - main - sockstat: Use libcasper to capsicumize From: tuexen@freebsd.org In-Reply-To: <202106051237.155CbAbw089529@gitrepo.freebsd.org> Date: Sat, 12 Jun 2021 01:49:54 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1DCF3814-5659-4E29-A4DA-AA487C82BA32@freebsd.org> References: <202106051237.155CbAbw089529@gitrepo.freebsd.org> To: Ryan Moeller X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4G1yJD5BCqz4tN4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE]; local_wl_from(0.00)[freebsd.org] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 23:50:05 -0000 > On 5. Jun 2021, at 14:37, Ryan Moeller wrote: >=20 > The branch main has been updated by freqlabs: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc5a2d8c5f517b056bed2af64e6134481= 367773d4 >=20 > commit c5a2d8c5f517b056bed2af64e6134481367773d4 > Author: Ryan Moeller > AuthorDate: 2021-03-26 19:42:19 +0000 > Commit: Ryan Moeller > CommitDate: 2021-06-05 12:36:55 +0000 >=20 > sockstat: Use libcasper to capsicumize Hi Ryan, this breaks sockstat for me: tuexen@bsd14:~ % sockstat -P tcp Assertion failed: (chan !=3D NULL), function cap_xfer_nvlist, file = /usr/home/tuexen/freebsd-src/lib/libcasper/libcasper/libcasper.c, line = 304. Abort (core dumped) Best regards Michael >=20 > Drop rights we do not need. This has to be done after jail_attach. >=20 > Reviewed by: oshogbo > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D26958 From owner-dev-commits-src-all@freebsd.org Sat Jun 12 00:01:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91F41666C79; Sat, 12 Jun 2021 00:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1yYV3dyjz4vnJ; Sat, 12 Jun 2021 00:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 642372C398; Sat, 12 Jun 2021 00:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C01YGT007208; Sat, 12 Jun 2021 00:01:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C01Yb6007207; Sat, 12 Jun 2021 00:01:34 GMT (envelope-from git) Date: Sat, 12 Jun 2021 00:01:34 GMT Message-Id: <202106120001.15C01Yb6007207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: e1a907a25cfa - main - krpc: Acquire ref count of CLIENT for backchannel use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1a907a25cfa422c0d1acaf9f91352ada04f4bca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 00:01:34 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e1a907a25cfa422c0d1acaf9f91352ada04f4bca commit e1a907a25cfa422c0d1acaf9f91352ada04f4bca Author: Rick Macklem AuthorDate: 2021-06-11 23:57:14 +0000 Commit: Rick Macklem CommitDate: 2021-06-11 23:57:14 +0000 krpc: Acquire ref count of CLIENT for backchannel use Michael Dexter reported a crash in FreeNAS, where the first argument to clnt_bck_svccall() was no longer valid. This argument is a pointer to the callback CLIENT structure, which is free'd when the associated NFSv4 ClientID is free'd. This appears to have occurred because a callback reply was still in the socket receive queue when the CLIENT structure was free'd. This patch acquires a reference count on the CLIENT that is not CLNT_RELEASE()'d until the socket structure is destroyed. This should guarantee that the CLIENT structure is still valid when clnt_bck_svccall() is called. It also adds a check for closed or closing to clnt_bck_svccall() so that it will not process the callback RPC reply message after the ClientID is free'd. Comments by: mav MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30153 --- sys/fs/nfsserver/nfs_nfsdstate.c | 8 ++++---- sys/rpc/clnt_bck.c | 13 ++++++++++++- sys/rpc/svc.h | 5 +++++ sys/rpc/svc_vc.c | 4 ++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index c16d5b8afdc8..98f5e26d49bb 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -721,8 +721,8 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, cbprogram, NFSV4_CBVERS); if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); - nd->nd_xprt->xp_p2 = - clp->lc_req.nr_client->cl_private; + CLNT_ACQUIRE(clp->lc_req.nr_client); + nd->nd_xprt->xp_p2 = clp->lc_req.nr_client; /* Disable idle timeout. */ nd->nd_xprt->xp_idletimeout = 0; nsep->sess_cbsess.nfsess_xprt = nd->nd_xprt; @@ -6464,8 +6464,8 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) "backchannel\n"); savxprt = sep->sess_cbsess.nfsess_xprt; SVC_ACQUIRE(nd->nd_xprt); - nd->nd_xprt->xp_p2 = - clp->lc_req.nr_client->cl_private; + CLNT_ACQUIRE(clp->lc_req.nr_client); + nd->nd_xprt->xp_p2 = clp->lc_req.nr_client; /* Disable idle timeout. */ nd->nd_xprt->xp_idletimeout = 0; sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; diff --git a/sys/rpc/clnt_bck.c b/sys/rpc/clnt_bck.c index 29109720bce0..2414171bad37 100644 --- a/sys/rpc/clnt_bck.c +++ b/sys/rpc/clnt_bck.c @@ -566,15 +566,26 @@ clnt_bck_destroy(CLIENT *cl) /* * This call is done by the svc code when a backchannel RPC reply is * received. + * For the server end, where callback RPCs to the client are performed, + * xp_p2 points to the "CLIENT" and not the associated "struct ct_data" + * so that svc_vc_destroy() can CLNT_RELEASE() the reference count on it. */ void clnt_bck_svccall(void *arg, struct mbuf *mrep, uint32_t xid) { - struct ct_data *ct = (struct ct_data *)arg; + CLIENT *cl = (CLIENT *)arg; + struct ct_data *ct; struct ct_request *cr; int foundreq; + ct = (struct ct_data *)cl->cl_private; mtx_lock(&ct->ct_lock); + if (ct->ct_closing || ct->ct_closed) { + mtx_unlock(&ct->ct_lock); + m_freem(mrep); + return; + } + ct->ct_upcallrefs++; /* * See if we can match this reply to a request. diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h index dae654d4b08c..8a94d7058972 100644 --- a/sys/rpc/svc.h +++ b/sys/rpc/svc.h @@ -148,6 +148,11 @@ struct __rpc_svcthread; * reference count which tracks the number of currently assigned * worker threads plus one for the service pool's reference. * For NFSv4.1 sessions, a reference is also held for a backchannel. + * xp_p2 - Points to the CLIENT structure for the RPC server end + * (the client end for callbacks). + * Points to the private structure (cl_private) for the + * CLIENT structure for the RPC client end (the server + * end for callbacks). */ typedef struct __rpc_svcxprt { #ifdef _KERNEL diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 6cff3434364d..de1baa1417b1 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -500,6 +500,7 @@ static void svc_vc_destroy(SVCXPRT *xprt) { struct cf_conn *cd = (struct cf_conn *)xprt->xp_p1; + CLIENT *cl = (CLIENT *)xprt->xp_p2; SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); if (xprt->xp_upcallset) { @@ -509,6 +510,9 @@ svc_vc_destroy(SVCXPRT *xprt) } SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); + if (cl != NULL) + CLNT_RELEASE(cl); + svc_vc_destroy_common(xprt); if (cd->mreq) From owner-dev-commits-src-all@freebsd.org Sat Jun 12 00:41:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66EFC667BA1; Sat, 12 Jun 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zR52NSyz3DJg; Sat, 12 Jun 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A6742C9C8; Sat, 12 Jun 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C0f5IK057689; Sat, 12 Jun 2021 00:41:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C0f5WJ057688; Sat, 12 Jun 2021 00:41:05 GMT (envelope-from git) Date: Sat, 12 Jun 2021 00:41:05 GMT Message-Id: <202106120041.15C0f5WJ057688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 04456f711853 - stable/13 - linuxkpi: Add rom and romlen to struct pci_dev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04456f7118533676c50f29464b58e541f03757fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 00:41:05 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=04456f7118533676c50f29464b58e541f03757fe commit 04456f7118533676c50f29464b58e541f03757fe Author: Neel Chauhan AuthorDate: 2021-06-07 22:50:46 +0000 Commit: Neel Chauhan CommitDate: 2021-06-12 00:36:05 +0000 linuxkpi: Add rom and romlen to struct pci_dev Approved by: bz (src), hselasky (src) Differential Reivison: https://reviews.freebsd.org/D30686 (cherry picked from commit 096104e790fb182d230f25f169792cc610b8f41c) --- sys/compat/linuxkpi/common/include/linux/pci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 4c07edebc796..0cc467f4cc8f 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -243,6 +243,8 @@ struct pci_dev { uint32_t class; uint8_t revision; bool msi_enabled; + phys_addr_t rom; + size_t romlen; TAILQ_HEAD(, pci_mmio_region) mmio; }; From owner-dev-commits-src-all@freebsd.org Sat Jun 12 00:41:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EE4B667AF0; Sat, 12 Jun 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zR63Vpfz3DMR; Sat, 12 Jun 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C2E72CC0D; Sat, 12 Jun 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C0f6q6057713; Sat, 12 Jun 2021 00:41:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C0f6Vn057712; Sat, 12 Jun 2021 00:41:06 GMT (envelope-from git) Date: Sat, 12 Jun 2021 00:41:06 GMT Message-Id: <202106120041.15C0f6Vn057712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: df370b47a66f - stable/13 - linuxkpi: Add _RET_IP_ macro in kernel.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df370b47a66f27e195a26d0e983a64a3756823bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 00:41:06 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=df370b47a66f27e195a26d0e983a64a3756823bb commit df370b47a66f27e195a26d0e983a64a3756823bb Author: Neel Chauhan AuthorDate: 2021-06-09 21:34:58 +0000 Commit: Neel Chauhan CommitDate: 2021-06-12 00:41:08 +0000 linuxkpi: Add _RET_IP_ macro in kernel.h This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) Differential Revision: https://reviews.freebsd.org/D30707 (cherry picked from commit fee0d486ef34c6bd113ed743e33357ff626f2495) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index daef6216a151..6ee292940016 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -283,6 +283,8 @@ extern int linuxkpi_debug; #define u64_to_user_ptr(val) ((void *)(uintptr_t)(val)) +#define _RET_IP_ __builtin_return_address(0) + static inline unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base) { From owner-dev-commits-src-all@freebsd.org Sat Jun 12 00:41:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AE6E667EC9; Sat, 12 Jun 2021 00:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zR74jv9z3D7G; Sat, 12 Jun 2021 00:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 809052CC84; Sat, 12 Jun 2021 00:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C0f7rE057737; Sat, 12 Jun 2021 00:41:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C0f7Ep057736; Sat, 12 Jun 2021 00:41:07 GMT (envelope-from git) Date: Sat, 12 Jun 2021 00:41:07 GMT Message-Id: <202106120041.15C0f7Ep057736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 658f5eed38c3 - stable/13 - linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 658f5eed38c35f3f7d6695110b7dae8dc94d12c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 00:41:08 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=658f5eed38c35f3f7d6695110b7dae8dc94d12c7 commit 658f5eed38c35f3f7d6695110b7dae8dc94d12c7 Author: Neel Chauhan AuthorDate: 2021-06-09 21:38:52 +0000 Commit: Neel Chauhan CommitDate: 2021-06-12 00:41:11 +0000 linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock() In Linux, these are macros to locks in the kernel for scheduling purposes. But as with other macros in this header, we aren't doing anything with them so we are doing `do {} while (0)` for now. This is needed by the drm-kmod 5.7 update. Approved by: hselasky (src) Differential Revision: https://reviews.freebsd.org/D30710 (cherry picked from commit 8a1a42b2a7a428fb97fda9f19fd0d67a4eec7535) --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 5 +++++ sys/sys/param.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index a86157ba5924..e270224b0bde 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -77,6 +77,7 @@ lockdep_is_held(void *__m) #define might_lock(m) do { } while (0) #define might_lock_read(m) do { } while (0) +#define might_lock_nested(m, n) do { } while (0) #define lock_acquire(...) do { } while (0) #define lock_release(...) do { } while (0) @@ -85,4 +86,8 @@ lockdep_is_held(void *__m) #define mutex_acquire(...) do { } while (0) #define mutex_release(...) do { } while (0) +#define lockdep_pin_lock(l) do { } while (0) +#define lockdep_repin_lock(l,c) do { } while (0) +#define lockdep_unpin_lock(l,c) do { } while (0) + #endif /* _LINUX_LOCKDEP_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index f9b67ef94bc0..22b93e1d17fa 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300507 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300508 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:00:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D101F64011F; Sat, 12 Jun 2021 01:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zsk5dJFz3G4L; Sat, 12 Jun 2021 01:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9C3D2D00D; Sat, 12 Jun 2021 01:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C10gRK084686; Sat, 12 Jun 2021 01:00:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C10gg8084685; Sat, 12 Jun 2021 01:00:42 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:00:42 GMT Message-Id: <202106120100.15C10gg8084685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e8424e2947dd - main - bhyve: Register new kevents synchronously. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8424e2947dd8a0e1d3f08295432941b5c5aafb9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:00:42 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e8424e2947dd8a0e1d3f08295432941b5c5aafb9 commit e8424e2947dd8a0e1d3f08295432941b5c5aafb9 Author: John Baldwin AuthorDate: 2021-06-12 00:58:54 +0000 Commit: John Baldwin CommitDate: 2021-06-12 01:00:24 +0000 bhyve: Register new kevents synchronously. Change mevent_add*() to synchronously add the new kevent. This permits reporting event registration failures to the caller and avoids failing the registration of other, unrelated events queued up in the same batch. Reviewed by: grehan, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D30502 --- usr.sbin/bhyve/mevent.c | 96 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/usr.sbin/bhyve/mevent.c b/usr.sbin/bhyve/mevent.c index 2e9059837011..a394b7c5d69f 100644 --- a/usr.sbin/bhyve/mevent.c +++ b/usr.sbin/bhyve/mevent.c @@ -64,8 +64,10 @@ __FBSDID("$FreeBSD$"); #define MEVENT_MAX 64 static pthread_t mevent_tid; +static pthread_once_t mevent_once = PTHREAD_ONCE_INIT; static int mevent_timid = 43; static int mevent_pipefd[2]; +static int mfd; static pthread_mutex_t mevent_lmutex = PTHREAD_MUTEX_INITIALIZER; struct mevent { @@ -124,6 +126,26 @@ mevent_notify(void) } } +static void +mevent_init(void) +{ +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif + + mfd = kqueue(); + assert(mfd > 0); + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_KQUEUE); + if (caph_rights_limit(mfd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + LIST_INIT(&change_head); + LIST_INIT(&global_head); +} + static int mevent_kq_filter(struct mevent *mevp) { @@ -159,8 +181,24 @@ mevent_kq_fflags(struct mevent *mevp) return (0); } +static void +mevent_populate(struct mevent *mevp, struct kevent *kev) +{ + if (mevp->me_type == EVF_TIMER) { + kev->ident = mevp->me_timid; + kev->data = mevp->me_msecs; + } else { + kev->ident = mevp->me_fd; + kev->data = 0; + } + kev->filter = mevent_kq_filter(mevp); + kev->flags = mevent_kq_flags(mevp); + kev->fflags = mevent_kq_fflags(mevp); + kev->udata = mevp; +} + static int -mevent_build(int mfd, struct kevent *kev) +mevent_build(struct kevent *kev) { struct mevent *mevp, *tmpp; int i; @@ -177,17 +215,8 @@ mevent_build(int mfd, struct kevent *kev) */ close(mevp->me_fd); } else { - if (mevp->me_type == EVF_TIMER) { - kev[i].ident = mevp->me_timid; - kev[i].data = mevp->me_msecs; - } else { - kev[i].ident = mevp->me_fd; - kev[i].data = 0; - } - kev[i].filter = mevent_kq_filter(mevp); - kev[i].flags = mevent_kq_flags(mevp); - kev[i].fflags = mevent_kq_fflags(mevp); - kev[i].udata = mevp; + assert((mevp->me_state & EV_ADD) == 0); + mevent_populate(mevp, &kev[i]); i++; } @@ -197,12 +226,6 @@ mevent_build(int mfd, struct kevent *kev) if (mevp->me_state & EV_DELETE) { free(mevp); } else { - /* - * We need to add the event only once, so we can - * reset the EV_ADD bit after it has been propagated - * to the kevent() arguments the first time. - */ - mevp->me_state &= ~EV_ADD; LIST_INSERT_HEAD(&global_head, mevp, me_list); } @@ -234,7 +257,9 @@ mevent_add_state(int tfd, enum ev_type type, void (*func)(int, enum ev_type, void *), void *param, int state) { + struct kevent kev; struct mevent *lp, *mevp; + int ret; if (tfd < 0 || func == NULL) { return (NULL); @@ -242,6 +267,8 @@ mevent_add_state(int tfd, enum ev_type type, mevp = NULL; + pthread_once(&mevent_once, mevent_init); + mevent_qlock(); /* @@ -262,7 +289,7 @@ mevent_add_state(int tfd, enum ev_type type, } /* - * Allocate an entry, populate it, and add it to the change list. + * Allocate an entry and populate it. */ mevp = calloc(1, sizeof(struct mevent)); if (mevp == NULL) { @@ -277,11 +304,22 @@ mevent_add_state(int tfd, enum ev_type type, mevp->me_type = type; mevp->me_func = func; mevp->me_param = param; - - LIST_INSERT_HEAD(&change_head, mevp, me_list); - mevp->me_cq = 1; mevp->me_state = state; - mevent_notify(); + + /* + * Try to add the event. If this fails, report the failure to + * the caller. + */ + mevent_populate(mevp, &kev); + ret = kevent(mfd, &kev, 1, NULL, 0, NULL); + if (ret == -1) { + free(mevp); + mevp = NULL; + goto exit; + } + + mevp->me_state &= ~EV_ADD; + LIST_INSERT_HEAD(&global_head, mevp, me_list); exit: mevent_qunlock(); @@ -415,7 +453,6 @@ mevent_dispatch(void) struct kevent changelist[MEVENT_MAX]; struct kevent eventlist[MEVENT_MAX]; struct mevent *pipev; - int mfd; int numev; int ret; #ifndef WITHOUT_CAPSICUM @@ -425,14 +462,7 @@ mevent_dispatch(void) mevent_tid = pthread_self(); mevent_set_name(); - mfd = kqueue(); - assert(mfd > 0); - -#ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_KQUEUE); - if (caph_rights_limit(mfd, &rights) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); -#endif + pthread_once(&mevent_once, mevent_init); /* * Open the pipe that will be used for other threads to force @@ -466,7 +496,7 @@ mevent_dispatch(void) * to eliminate the extra syscall. Currently better for * debug. */ - numev = mevent_build(mfd, changelist); + numev = mevent_build(changelist); if (numev) { ret = kevent(mfd, changelist, numev, NULL, 0, NULL); if (ret == -1) { From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:00:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC3C8640121; Sat, 12 Jun 2021 01:00:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zsl6NQVz3FyV; Sat, 12 Jun 2021 01:00:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C17A82CFA3; Sat, 12 Jun 2021 01:00:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C10hG9084716; Sat, 12 Jun 2021 01:00:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C10hJl084715; Sat, 12 Jun 2021 01:00:43 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:00:43 GMT Message-Id: <202106120100.15C10hJl084715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 67d60dcce62c - main - bhyve: Add support for EVFILT_VNODE mevents. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67d60dcce62c08250dceedaf761cb48bc74c75a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:00:44 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=67d60dcce62c08250dceedaf761cb48bc74c75a4 commit 67d60dcce62c08250dceedaf761cb48bc74c75a4 Author: John Baldwin AuthorDate: 2021-06-12 00:59:13 +0000 Commit: John Baldwin CommitDate: 2021-06-12 01:00:24 +0000 bhyve: Add support for EVFILT_VNODE mevents. This allows registering an event to watch for changes to a file's attributes. This is a bit imperfect as it would be nice to have a way to determine if an fd can use EVFILT_VNODE successfully. mevent's current structure does not permit that and a failure to register a single kevent impacts several other kevents. Reviewed by: grehan, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D30503 --- usr.sbin/bhyve/mevent.c | 33 ++++++++++++++++++++++++++++----- usr.sbin/bhyve/mevent.h | 9 ++++++++- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/mevent.c b/usr.sbin/bhyve/mevent.c index a394b7c5d69f..0c5351cd31a9 100644 --- a/usr.sbin/bhyve/mevent.c +++ b/usr.sbin/bhyve/mevent.c @@ -80,6 +80,7 @@ struct mevent { int me_cq; int me_state; /* Desired kevent flags. */ int me_closefd; + int me_fflags; LIST_ENTRY(mevent) me_list; }; @@ -165,6 +166,9 @@ mevent_kq_filter(struct mevent *mevp) if (mevp->me_type == EVF_SIGNAL) retval = EVFILT_SIGNAL; + if (mevp->me_type == EVF_VNODE) + retval = EVFILT_VNODE; + return (retval); } @@ -177,8 +181,18 @@ mevent_kq_flags(struct mevent *mevp) static int mevent_kq_fflags(struct mevent *mevp) { - /* XXX nothing yet, perhaps EV_EOF for reads ? */ - return (0); + int retval; + + retval = 0; + + switch (mevp->me_type) { + case EVF_VNODE: + if ((mevp->me_fflags & EVFF_ATTRIB) != 0) + retval |= NOTE_ATTRIB; + break; + } + + return (retval); } static void @@ -255,7 +269,7 @@ mevent_handle(struct kevent *kev, int numev) static struct mevent * mevent_add_state(int tfd, enum ev_type type, void (*func)(int, enum ev_type, void *), void *param, - int state) + int state, int fflags) { struct kevent kev; struct mevent *lp, *mevp; @@ -305,6 +319,7 @@ mevent_add_state(int tfd, enum ev_type type, mevp->me_func = func; mevp->me_param = param; mevp->me_state = state; + mevp->me_fflags = fflags; /* * Try to add the event. If this fails, report the failure to @@ -332,7 +347,15 @@ mevent_add(int tfd, enum ev_type type, void (*func)(int, enum ev_type, void *), void *param) { - return (mevent_add_state(tfd, type, func, param, EV_ADD)); + return (mevent_add_state(tfd, type, func, param, EV_ADD, 0)); +} + +struct mevent * +mevent_add_flags(int tfd, enum ev_type type, int fflags, + void (*func)(int, enum ev_type, void *), void *param) +{ + + return (mevent_add_state(tfd, type, func, param, EV_ADD, fflags)); } struct mevent * @@ -340,7 +363,7 @@ mevent_add_disabled(int tfd, enum ev_type type, void (*func)(int, enum ev_type, void *), void *param) { - return (mevent_add_state(tfd, type, func, param, EV_ADD | EV_DISABLE)); + return (mevent_add_state(tfd, type, func, param, EV_ADD | EV_DISABLE, 0)); } static int diff --git a/usr.sbin/bhyve/mevent.h b/usr.sbin/bhyve/mevent.h index 503ec415a3b5..a26293867a09 100644 --- a/usr.sbin/bhyve/mevent.h +++ b/usr.sbin/bhyve/mevent.h @@ -35,14 +35,21 @@ enum ev_type { EVF_READ, EVF_WRITE, EVF_TIMER, - EVF_SIGNAL + EVF_SIGNAL, + EVF_VNODE, }; +/* Filter flags for EVF_VNODE */ +#define EVFF_ATTRIB 0x0001 + struct mevent; struct mevent *mevent_add(int fd, enum ev_type type, void (*func)(int, enum ev_type, void *), void *param); +struct mevent *mevent_add_flags(int fd, enum ev_type type, int fflags, + void (*func)(int, enum ev_type, void *), + void *param); struct mevent *mevent_add_disabled(int fd, enum ev_type type, void (*func)(int, enum ev_type, void *), void *param); From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:00:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 594AF64048B; Sat, 12 Jun 2021 01:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zsn0TZKz3G1j; Sat, 12 Jun 2021 01:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3E472CEA8; Sat, 12 Jun 2021 01:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C10ibW084741; Sat, 12 Jun 2021 01:00:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C10iFD084740; Sat, 12 Jun 2021 01:00:44 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:00:44 GMT Message-Id: <202106120100.15C10iFD084740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8794846a91c5 - main - bhyve: Add support for handling disk resize events to block_if. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8794846a91c5429c612ba939c61ebf8f1ff1a628 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:00:45 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8794846a91c5429c612ba939c61ebf8f1ff1a628 commit 8794846a91c5429c612ba939c61ebf8f1ff1a628 Author: John Baldwin AuthorDate: 2021-06-12 00:59:25 +0000 Commit: John Baldwin CommitDate: 2021-06-12 01:00:24 +0000 bhyve: Add support for handling disk resize events to block_if. Allow clients of blockif to register a resize callback handler. When a callback is registered, register an EVFILT_VNODE kevent watching the backing store for a change in the file's attributes. If the size has changed when the kevent fires, invoke the clients' callback. Currently resize detection is limited to backing stores that support EVFILT_VNODE kevents such as regular files. Reviewed by: grehan, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D30504 --- usr.sbin/bhyve/block_if.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++- usr.sbin/bhyve/block_if.h | 5 ++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c index ae09bc71d622..98c0f9f5f38b 100644 --- a/usr.sbin/bhyve/block_if.c +++ b/usr.sbin/bhyve/block_if.c @@ -115,6 +115,9 @@ struct blockif_ctxt { pthread_cond_t bc_cond; pthread_cond_t bc_paused_cond; pthread_cond_t bc_work_done_cond; + blockif_resize_cb *bc_resize_cb; + void *bc_resize_cb_arg; + struct mevent *bc_resize_event; /* Request elements and free/pending/busy queues */ TAILQ_HEAD(, blockif_elem) bc_freeq; @@ -532,7 +535,7 @@ blockif_open(nvlist_t *nvl, const char *ident) #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_FSYNC, CAP_IOCTL, CAP_READ, CAP_SEEK, - CAP_WRITE); + CAP_WRITE, CAP_FSTAT, CAP_EVENT); if (ro) cap_rights_clear(&rights, CAP_FSYNC, CAP_WRITE); @@ -643,6 +646,62 @@ err: return (NULL); } +static void +blockif_resized(int fd, enum ev_type type, void *arg) +{ + struct blockif_ctxt *bc; + struct stat sb; + + if (fstat(fd, &sb) != 0) + return; + + bc = arg; + pthread_mutex_lock(&bc->bc_mtx); + if (sb.st_size != bc->bc_size) { + bc->bc_size = sb.st_size; + bc->bc_resize_cb(bc, bc->bc_resize_cb_arg, bc->bc_size); + } + pthread_mutex_unlock(&bc->bc_mtx); +} + +int +blockif_register_resize_callback(struct blockif_ctxt *bc, blockif_resize_cb *cb, + void *cb_arg) +{ + struct stat sb; + int err; + + if (cb == NULL) + return (EINVAL); + + pthread_mutex_lock(&bc->bc_mtx); + if (bc->bc_resize_cb != NULL) { + err = EBUSY; + goto out; + } + + assert(bc->bc_closing == 0); + + if (fstat(bc->bc_fd, &sb) != 0) { + err = errno; + goto out; + } + + bc->bc_resize_event = mevent_add_flags(bc->bc_fd, EVF_VNODE, + EVFF_ATTRIB, blockif_resized, bc); + if (bc->bc_resize_event == NULL) { + err = ENXIO; + goto out; + } + + bc->bc_resize_cb = cb; + bc->bc_resize_cb_arg = cb_arg; +out: + pthread_mutex_unlock(&bc->bc_mtx); + + return (err); +} + static int blockif_request(struct blockif_ctxt *bc, struct blockif_req *breq, enum blockop op) @@ -796,6 +855,8 @@ blockif_close(struct blockif_ctxt *bc) */ pthread_mutex_lock(&bc->bc_mtx); bc->bc_closing = 1; + if (bc->bc_resize_event != NULL) + mevent_disable(bc->bc_resize_event); pthread_mutex_unlock(&bc->bc_mtx); pthread_cond_broadcast(&bc->bc_cond); for (i = 0; i < BLOCKIF_NUMTHR; i++) diff --git a/usr.sbin/bhyve/block_if.h b/usr.sbin/bhyve/block_if.h index 87ae4d169969..0407ff43cf94 100644 --- a/usr.sbin/bhyve/block_if.h +++ b/usr.sbin/bhyve/block_if.h @@ -63,8 +63,13 @@ struct blockif_req { }; struct blockif_ctxt; + +typedef void blockif_resize_cb(struct blockif_ctxt *, void *, size_t); + int blockif_legacy_config(nvlist_t *nvl, const char *opts); struct blockif_ctxt *blockif_open(nvlist_t *nvl, const char *ident); +int blockif_register_resize_callback(struct blockif_ctxt *bc, + blockif_resize_cb *cb, void *cb_arg); off_t blockif_size(struct blockif_ctxt *bc); void blockif_chs(struct blockif_ctxt *bc, uint16_t *c, uint8_t *h, uint8_t *s); From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:00:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BEC56403D7; Sat, 12 Jun 2021 01:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zsq1wTBz3G4j; Sat, 12 Jun 2021 01:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2989E2CFA4; Sat, 12 Jun 2021 01:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C10lrg084789; Sat, 12 Jun 2021 01:00:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C10lB2084788; Sat, 12 Jun 2021 01:00:47 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:00:47 GMT Message-Id: <202106120100.15C10lB2084788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2349cda44fea - main - bhyve vtblk: Inform guests of disk resize events. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2349cda44fea17c089b026e743ec8f03199019eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:00:47 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2349cda44fea17c089b026e743ec8f03199019eb commit 2349cda44fea17c089b026e743ec8f03199019eb Author: John Baldwin AuthorDate: 2021-06-12 00:59:46 +0000 Commit: John Baldwin CommitDate: 2021-06-12 01:00:25 +0000 bhyve vtblk: Inform guests of disk resize events. Register a resize callback with the blockif interface. When the callback fires, update the size of the disk and notify the guest via a configuration change interrupt. Reviewed by: grehan, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D30506 --- usr.sbin/bhyve/pci_virtio_block.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c index 8a172c54eda7..3718b2d7eff0 100644 --- a/usr.sbin/bhyve/pci_virtio_block.c +++ b/usr.sbin/bhyve/pci_virtio_block.c @@ -3,7 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. - * Copyright 2020 Joyent, Inc. + * Copyright 2020-2021 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -436,6 +436,18 @@ pci_vtblk_notify(void *vsc, struct vqueue_info *vq) pci_vtblk_proc(sc, vq); } +static void +pci_vtblk_resized(struct blockif_ctxt *bctxt, void *arg, size_t new_size) +{ + struct pci_vtblk_softc *sc; + + sc = arg; + + sc->vbsc_cfg.vbc_capacity = new_size / VTBLK_BSIZE; /* 512-byte units */ + vi_interrupt(&sc->vbsc_vs, VIRTIO_PCI_ISR_CONFIG, + sc->vbsc_vs.vs_msix_cfg_idx); +} + static int pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) { @@ -541,6 +553,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) return (1); } vi_set_io_bar(&sc->vbsc_vs, 0); + blockif_register_resize_callback(sc->bc, pci_vtblk_resized, sc); return (0); } From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:00:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A8426403CD; Sat, 12 Jun 2021 01:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1zsp10rGz3Fr2; Sat, 12 Jun 2021 01:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 039612CEA9; Sat, 12 Jun 2021 01:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C10jPh084765; Sat, 12 Jun 2021 01:00:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C10jDp084764; Sat, 12 Jun 2021 01:00:45 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:00:45 GMT Message-Id: <202106120100.15C10jDp084764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c06676bee3d2 - main - bhyve: Split out a lower-level helper for VirtIO interrupts. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c06676bee3d228ac18c5ed3604304e932eb84c1e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:00:46 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c06676bee3d228ac18c5ed3604304e932eb84c1e commit c06676bee3d228ac18c5ed3604304e932eb84c1e Author: John Baldwin AuthorDate: 2021-06-12 00:59:35 +0000 Commit: John Baldwin CommitDate: 2021-06-12 01:00:25 +0000 bhyve: Split out a lower-level helper for VirtIO interrupts. This allows device models to assert VirtIO interrupts for reasons other than publishing changes to a VirtIO ring such as configuration changes. Reviewed by: grehan, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D30505 --- usr.sbin/bhyve/virtio.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/virtio.h b/usr.sbin/bhyve/virtio.h index 4c7b9de83125..5731baa0dd0d 100644 --- a/usr.sbin/bhyve/virtio.h +++ b/usr.sbin/bhyve/virtio.h @@ -348,24 +348,35 @@ vq_has_descs(struct vqueue_info *vq) } /* - * Deliver an interrupt to guest on the given virtual queue - * (if possible, or a generic MSI interrupt if not using MSI-X). + * Deliver an interrupt to the guest for a specific MSI-X queue or + * event. */ static inline void -vq_interrupt(struct virtio_softc *vs, struct vqueue_info *vq) +vi_interrupt(struct virtio_softc *vs, uint8_t isr, uint16_t msix_idx) { if (pci_msix_enabled(vs->vs_pi)) - pci_generate_msix(vs->vs_pi, vq->vq_msix_idx); + pci_generate_msix(vs->vs_pi, msix_idx); else { VS_LOCK(vs); - vs->vs_isr |= VIRTIO_PCI_ISR_INTR; + vs->vs_isr |= isr; pci_generate_msi(vs->vs_pi, 0); pci_lintr_assert(vs->vs_pi); VS_UNLOCK(vs); } } +/* + * Deliver an interrupt to the guest on the given virtual queue (if + * possible, or a generic MSI interrupt if not using MSI-X). + */ +static inline void +vq_interrupt(struct virtio_softc *vs, struct vqueue_info *vq) +{ + + vi_interrupt(vs, VIRTIO_PCI_ISR_INTR, vq->vq_msix_idx); +} + static inline void vq_kick_enable(struct vqueue_info *vq) { From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:22:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 442C8640FB7; Sat, 12 Jun 2021 01:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G20Lr1762z3KYD; Sat, 12 Jun 2021 01:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F7542D784; Sat, 12 Jun 2021 01:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C1MRFm014952; Sat, 12 Jun 2021 01:22:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C1MRnE014951; Sat, 12 Jun 2021 01:22:27 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:22:27 GMT Message-Id: <202106120122.15C1MRnE014951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 624a723a955b - stable/13 - nfscl: Use hash lists to improve expected search performance for opens MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 624a723a955b66c2da379ae132ff5f44311a397a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:22:28 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=624a723a955b66c2da379ae132ff5f44311a397a commit 624a723a955b66c2da379ae132ff5f44311a397a Author: Rick Macklem AuthorDate: 2021-05-25 21:19:29 +0000 Commit: Rick Macklem CommitDate: 2021-06-12 01:19:13 +0000 nfscl: Use hash lists to improve expected search performance for opens A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. When searching for an open, usually for a match by file handle, a linear search of all opens is done. Commit 3f7e14ad9345 added a hash table of lists hashed on file handle for the opens. This patch uses the hash lists for searching for a matching open based of file handle instead of an exhaustive linear search of all opens. This change appears to be performance neutral for a small number of opens, but should improve expected performance for a large number of opens. This patch also moves any found match to the front of the hash list, to try and maintain the hash lists in recently used ordering (least recently used at the end of the list). This commit should not affect the high level semantics of open handling. (cherry picked from commit 724072ab1d588677a83a5a5011b5ad9ff5d56538) --- sys/fs/nfsclient/nfs_clstate.c | 89 ++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 33 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index a8eace2ffd0b..63c70ebcfdf5 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -100,8 +100,9 @@ int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; -static int nfscl_getopen(struct nfsclownerhead *, u_int8_t *, int, u_int8_t *, - u_int8_t *, u_int32_t, struct nfscllockowner **, struct nfsclopen **); +static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, + u_int8_t *, int, u_int8_t *, u_int8_t *, u_int32_t, + struct nfscllockowner **, struct nfsclopen **); static bool nfscl_checkown(struct nfsclowner *, struct nfsclopen *, uint8_t *, uint8_t *, struct nfscllockowner **, struct nfsclopen **, struct nfsclopen **); @@ -509,8 +510,8 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, void **lckpp) { struct nfsclclient *clp; - struct nfsclowner *owp; struct nfsclopen *op = NULL, *top; + struct nfsclopenhash *oph; struct nfscllockowner *lp; struct nfscldeleg *dp; struct nfsnode *np; @@ -587,8 +588,8 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, else nfscl_filllockowner(p->td_proc, own, F_POSIX); lp = NULL; - error = nfscl_getopen(&clp->nfsc_owner, nfhp, fhlen, own, own, - mode, &lp, &op); + error = nfscl_getopen(NULL, clp->nfsc_openhash, nfhp, fhlen, + own, own, mode, &lp, &op); if (error == 0 && lp != NULL && fords == 0) { /* Don't return a lock stateid for a DS. */ stateidp->seqid = @@ -607,22 +608,22 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, /* If not found, just look for any OpenOwner that will work. */ top = NULL; done = false; - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - if (op->nfso_fhlen == fhlen && - !NFSBCMP(op->nfso_fh, nfhp, fhlen)) { - if (top == NULL && (op->nfso_mode & - NFSV4OPEN_ACCESSWRITE) != 0 && - (mode & NFSV4OPEN_ACCESSREAD) != 0) - top = op; - if ((mode & op->nfso_mode) == mode) { - done = true; - break; - } + oph = NFSCLOPENHASH(clp, nfhp, fhlen); + LIST_FOREACH(op, oph, nfso_hash) { + if (op->nfso_fhlen == fhlen && + !NFSBCMP(op->nfso_fh, nfhp, fhlen)) { + if (top == NULL && (op->nfso_mode & + NFSV4OPEN_ACCESSWRITE) != 0 && + (mode & NFSV4OPEN_ACCESSREAD) != 0) + top = op; + if ((mode & op->nfso_mode) == mode) { + /* LRU order the hash list. */ + LIST_REMOVE(op, nfso_hash); + LIST_INSERT_HEAD(oph, op, nfso_hash); + done = true; + break; } } - if (done) - break; } if (!done) { NFSCL_DEBUG(2, "openmode top=%p\n", top); @@ -655,14 +656,17 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, * Search for a matching file, mode and, optionally, lockowner. */ static int -nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nfhp, int fhlen, - u_int8_t *openown, u_int8_t *lockown, u_int32_t mode, - struct nfscllockowner **lpp, struct nfsclopen **opp) +nfscl_getopen(struct nfsclownerhead *ohp, struct nfsclopenhash *ohashp, + u_int8_t *nfhp, int fhlen, u_int8_t *openown, u_int8_t *lockown, + u_int32_t mode, struct nfscllockowner **lpp, struct nfsclopen **opp) { struct nfsclowner *owp; struct nfsclopen *op, *rop, *rop2; + struct nfsclopenhash *oph; bool keep_looping; + KASSERT(ohp == NULL || ohashp == NULL, ("nfscl_getopen: " + "only one of ohp and ohashp can be set")); if (lpp != NULL) *lpp = NULL; /* @@ -679,19 +683,38 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nfhp, int fhlen, rop2 = NULL; keep_looping = true; /* Search the client list */ - LIST_FOREACH(owp, ohp, nfsow_list) { - /* and look for the correct open */ - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + if (ohashp == NULL) { + /* Search the local opens on the delegation. */ + LIST_FOREACH(owp, ohp, nfsow_list) { + /* and look for the correct open */ + LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + if (op->nfso_fhlen == fhlen && + !NFSBCMP(op->nfso_fh, nfhp, fhlen) + && (op->nfso_mode & mode) == mode) + keep_looping = nfscl_checkown(owp, op, openown, + lockown, lpp, &rop, &rop2); + if (!keep_looping) + break; + } + if (!keep_looping) + break; + } + } else { + /* Search for matching opens on the hash list. */ + oph = &ohashp[NFSCLOPENHASHFUNC(nfhp, fhlen)]; + LIST_FOREACH(op, oph, nfso_hash) { if (op->nfso_fhlen == fhlen && !NFSBCMP(op->nfso_fh, nfhp, fhlen) && (op->nfso_mode & mode) == mode) - keep_looping = nfscl_checkown(owp, op, openown, - lockown, lpp, &rop, &rop2); - if (!keep_looping) + keep_looping = nfscl_checkown(op->nfso_own, op, + openown, lockown, lpp, &rop, &rop2); + if (!keep_looping) { + /* LRU order the hash list. */ + LIST_REMOVE(op, nfso_hash); + LIST_INSERT_HEAD(oph, op, nfso_hash); break; + } } - if (!keep_looping) - break; } if (rop == NULL) rop = rop2; @@ -1090,10 +1113,10 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, } if (dp != NULL) { /* Now, find an open and maybe a lockowner. */ - ret = nfscl_getopen(&dp->nfsdl_owner, np->n_fhp->nfh_fh, + ret = nfscl_getopen(&dp->nfsdl_owner, NULL, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, openownp, ownp, mode, NULL, &op); if (ret) - ret = nfscl_getopen(&clp->nfsc_owner, + ret = nfscl_getopen(NULL, clp->nfsc_openhash, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, openownp, ownp, mode, NULL, &op); if (!ret) { @@ -1110,7 +1133,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, /* * Get the related Open and maybe lockowner. */ - error = nfscl_getopen(&clp->nfsc_owner, + error = nfscl_getopen(NULL, clp->nfsc_openhash, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, openownp, ownp, mode, &lp, &op); if (!error) From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:30:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FFE4640C96; Sat, 12 Jun 2021 01:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G20XM0X27z3LHs; Sat, 12 Jun 2021 01:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE39A2D461; Sat, 12 Jun 2021 01:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C1Ugex025577; Sat, 12 Jun 2021 01:30:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C1Ugpi025576; Sat, 12 Jun 2021 01:30:42 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:30:42 GMT Message-Id: <202106120130.15C1Ugpi025576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 972883b9e06e - stable/13 - nfscl: Use hash lists to improve expected search performance for opens MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 972883b9e06e32df319fea46e365ff7be498bc15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:30:43 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=972883b9e06e32df319fea46e365ff7be498bc15 commit 972883b9e06e32df319fea46e365ff7be498bc15 Author: Rick Macklem AuthorDate: 2021-05-28 02:08:36 +0000 Commit: Rick Macklem CommitDate: 2021-06-12 01:21:03 +0000 nfscl: Use hash lists to improve expected search performance for opens A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. When searching for an open, usually for a match by file handle, a linear search of all opens is done. Commit 3f7e14ad9345 added a hash table of lists hashed on file handle for the opens. This patch uses the hash lists for searching for a matching open based of file handle instead of an exhaustive linear search of all opens. This change appears to be performance neutral for a small number of opens, but should improve expected performance for a large number of opens. This commit should not affect the high level semantics of open handling. (cherry picked from commit 96b40b896772bbce5f93d62eaa640e1eb51b4a30) --- sys/fs/nfsclient/nfs_clstate.c | 165 +++++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 90 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 63c70ebcfdf5..5e4ac2ae9d4d 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -1229,7 +1229,6 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, struct nfscllockowner **lpp, int *dorpcp) { struct nfscllockowner *lp; - struct nfsclowner *owp; struct nfsclopen *op; struct nfscllock *nlop, *other_lop = NULL; struct nfscldeleg *dp; @@ -1291,24 +1290,21 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, */ lp = NULL; fnd = 0; - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + LIST_FOREACH(op, NFSCLOPENHASH(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len), nfso_hash) { if (op->nfso_fhlen == np->n_fhp->nfh_len && !NFSBCMP(op->nfso_fh, np->n_fhp->nfh_fh, op->nfso_fhlen)) { - LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { - if (lp->nfsl_inprog == NULL && - !NFSBCMP(lp->nfsl_owner, own, - NFSV4CL_LOCKNAMELEN)) { - fnd = 1; - break; + LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { + if (lp->nfsl_inprog == NULL && + !NFSBCMP(lp->nfsl_owner, own, + NFSV4CL_LOCKNAMELEN)) { + fnd = 1; + break; + } } - } - if (fnd) - break; } - } - if (fnd) - break; + if (fnd) + break; } if (lp != NULL) { @@ -1338,7 +1334,6 @@ void nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, void *id, int flags) { - struct nfsclowner *owp; struct nfsclopen *op; struct nfscllockowner *lp; struct nfsnode *np; @@ -1347,20 +1342,19 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, np = VTONFS(vp); nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + LIST_FOREACH(op, NFSCLOPENHASH(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len), nfso_hash) { if (op->nfso_fhlen == np->n_fhp->nfh_len && !NFSBCMP(op->nfso_fh, np->n_fhp->nfh_fh, op->nfso_fhlen)) { - LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { - if (lp->nfsl_inprog == p && - !NFSBCMP(lp->nfsl_owner, own, - NFSV4CL_LOCKNAMELEN)) { - lp->nfsl_inprog = NULL; - nfscl_lockunlock(&lp->nfsl_rwlock); + LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { + if (lp->nfsl_inprog == p && + !NFSBCMP(lp->nfsl_owner, own, + NFSV4CL_LOCKNAMELEN)) { + lp->nfsl_inprog = NULL; + nfscl_lockunlock(&lp->nfsl_rwlock); + } } - } } - } } nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); @@ -1376,7 +1370,6 @@ int nfscl_checkwritelocked(vnode_t vp, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { - struct nfsclowner *owp; struct nfscllockowner *lp; struct nfsclopen *op; struct nfsclclient *clp; @@ -1445,30 +1438,29 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, /* * Now, check state against the server. */ - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { + LIST_FOREACH(op, NFSCLOPENHASH(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len), nfso_hash) { if (op->nfso_fhlen == np->n_fhp->nfh_len && !NFSBCMP(op->nfso_fh, np->n_fhp->nfh_fh, op->nfso_fhlen)) { - LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { - if (!NFSBCMP(lp->nfsl_owner, own, - NFSV4CL_LOCKNAMELEN)) - break; - } - if (lp != NULL) { - LIST_FOREACH(lop, &lp->nfsl_lock, nfslo_list) { - if (lop->nfslo_first >= end) - break; - if (lop->nfslo_end <= off) - continue; - if (lop->nfslo_type == F_WRLCK) { - nfscl_clrelease(clp); - NFSUNLOCKCLSTATE(); - return (1); - } + LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { + if (!NFSBCMP(lp->nfsl_owner, own, + NFSV4CL_LOCKNAMELEN)) + break; + } + if (lp != NULL) { + LIST_FOREACH(lop, &lp->nfsl_lock, nfslo_list) { + if (lop->nfslo_first >= end) + break; + if (lop->nfslo_end <= off) + continue; + if (lop->nfslo_type == F_WRLCK) { + nfscl_clrelease(clp); + NFSUNLOCKCLSTATE(); + return (1); + } + } } - } } - } } nfscl_clrelease(clp); NFSUNLOCKCLSTATE(); @@ -3243,23 +3235,22 @@ nfscl_getclose(vnode_t vp, struct nfsclclient **clpp) } /* Now process the opens against the server. */ - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - if (op->nfso_fhlen == nfhp->nfh_len && - !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, - nfhp->nfh_len)) { - /* Found an open, decrement cnt if possible */ - if (notdecr && op->nfso_opencnt > 0) { - notdecr = 0; - op->nfso_opencnt--; - } - /* - * There are more opens, so just return. - */ - if (op->nfso_opencnt > 0) { - NFSUNLOCKCLSTATE(); - return (0); - } + LIST_FOREACH(op, NFSCLOPENHASH(clp, nfhp->nfh_fh, nfhp->nfh_len), + nfso_hash) { + if (op->nfso_fhlen == nfhp->nfh_len && + !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, + nfhp->nfh_len)) { + /* Found an open, decrement cnt if possible */ + if (notdecr && op->nfso_opencnt > 0) { + notdecr = 0; + op->nfso_opencnt--; + } + /* + * There are more opens, so just return. + */ + if (op->nfso_opencnt > 0) { + NFSUNLOCKCLSTATE(); + return (0); } } } @@ -3310,24 +3301,21 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) /* Now process the opens against the server. */ lookformore: - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - op = LIST_FIRST(&owp->nfsow_open); - while (op != NULL) { - if (op->nfso_fhlen == nfhp->nfh_len && - !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, - nfhp->nfh_len)) { - /* Found an open, close it. */ + LIST_FOREACH(op, NFSCLOPENHASH(clp, nfhp->nfh_fh, nfhp->nfh_len), + nfso_hash) { + if (op->nfso_fhlen == nfhp->nfh_len && + !NFSBCMP(op->nfso_fh, nfhp->nfh_fh, + nfhp->nfh_len)) { + /* Found an open, close it. */ #ifdef DIAGNOSTIC - KASSERT((op->nfso_opencnt == 0), - ("nfscl: bad open cnt on server (%d)", - op->nfso_opencnt)); + KASSERT((op->nfso_opencnt == 0), + ("nfscl: bad open cnt on server (%d)", + op->nfso_opencnt)); #endif - NFSUNLOCKCLSTATE(); - nfsrpc_doclose(VFSTONFS(vp->v_mount), op, p); - NFSLOCKCLSTATE(); - goto lookformore; - } - op = LIST_NEXT(op, nfso_list); + NFSUNLOCKCLSTATE(); + nfsrpc_doclose(VFSTONFS(vp->v_mount), op, p); + NFSLOCKCLSTATE(); + goto lookformore; } } NFSUNLOCKCLSTATE(); @@ -3956,7 +3944,6 @@ nfscl_localconflict(struct nfsclclient *clp, u_int8_t *fhp, int fhlen, struct nfscllock *nlop, u_int8_t *own, struct nfscldeleg *dp, struct nfscllock **lopp) { - struct nfsclowner *owp; struct nfsclopen *op; int ret; @@ -3965,15 +3952,13 @@ nfscl_localconflict(struct nfsclclient *clp, u_int8_t *fhp, int fhlen, if (ret) return (ret); } - LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - if (op->nfso_fhlen == fhlen && - !NFSBCMP(op->nfso_fh, fhp, fhlen)) { - ret = nfscl_checkconflict(&op->nfso_lock, nlop, - own, lopp); - if (ret) - return (ret); - } + LIST_FOREACH(op, NFSCLOPENHASH(clp, fhp, fhlen), nfso_hash) { + if (op->nfso_fhlen == fhlen && + !NFSBCMP(op->nfso_fh, fhp, fhlen)) { + ret = nfscl_checkconflict(&op->nfso_lock, nlop, + own, lopp); + if (ret) + return (ret); } } return (0); From owner-dev-commits-src-all@freebsd.org Sat Jun 12 01:56:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D766641641; Sat, 12 Jun 2021 01:56:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G215h3nkcz3M2D; Sat, 12 Jun 2021 01:56:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66B9B2DC47; Sat, 12 Jun 2021 01:56:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C1u8pi055754; Sat, 12 Jun 2021 01:56:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C1u8Vd055753; Sat, 12 Jun 2021 01:56:08 GMT (envelope-from git) Date: Sat, 12 Jun 2021 01:56:08 GMT Message-Id: <202106120156.15C1u8Vd055753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 40cc9a3a6b81 - main - param.h: Bump __FreeBSD_version to 1400022 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40cc9a3a6b81a65a03712dfd93bbed48552a97ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 01:56:08 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=40cc9a3a6b81a65a03712dfd93bbed48552a97ad commit 40cc9a3a6b81a65a03712dfd93bbed48552a97ad Author: Rick Macklem AuthorDate: 2021-06-12 01:53:02 +0000 Commit: Rick Macklem CommitDate: 2021-06-12 01:53:02 +0000 param.h: Bump __FreeBSD_version to 1400022 Commit e1a907a25cfa changed the internal KAPI between the krpc and nfsserver. As such, both modules must be rebuilt from sources. Bump __FreeBSD_version to 1400022. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index afcba3990b07..0f5413e2f56c 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400021 +#define __FreeBSD_version 1400022 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Sat Jun 12 02:02:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE10B64176B; Sat, 12 Jun 2021 02:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G21FD52YWz3MYK; Sat, 12 Jun 2021 02:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94BA72DD79; Sat, 12 Jun 2021 02:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C22eu6069337; Sat, 12 Jun 2021 02:02:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C22e81069336; Sat, 12 Jun 2021 02:02:40 GMT (envelope-from git) Date: Sat, 12 Jun 2021 02:02:40 GMT Message-Id: <202106120202.15C22e81069336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 5860696e69ec - main - UPDATING: Add entry for __FreeBSD_version bump to 1400022 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5860696e69ec6d08bbe553c4c376efba3511b962 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 02:02:40 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5860696e69ec6d08bbe553c4c376efba3511b962 commit 5860696e69ec6d08bbe553c4c376efba3511b962 Author: Rick Macklem AuthorDate: 2021-06-12 01:59:36 +0000 Commit: Rick Macklem CommitDate: 2021-06-12 01:59:36 +0000 UPDATING: Add entry for __FreeBSD_version bump to 1400022 --- UPDATING | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPDATING b/UPDATING index ed27ec0fb9c1..6206e658d524 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20210611: + Commit e1a907a25cfa changed the internal KAPI between the krpc + and nfsserver. As such, both modules must be rebuilt from + sources. Bump __FreeBSD_version to 1400022. + 20210608: The vendor/openzfs branch was renamed to vendor/openzfs/legacy to start tracking OpenZFS upstream more closely. Please see From owner-dev-commits-src-all@freebsd.org Sat Jun 12 06:36:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13B6564503D; Sat, 12 Jun 2021 06:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G27K267jYz3vV6; Sat, 12 Jun 2021 06:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7093191B; Sat, 12 Jun 2021 06:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C6aMcs027797; Sat, 12 Jun 2021 06:36:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C6aMAl027796; Sat, 12 Jun 2021 06:36:22 GMT (envelope-from git) Date: Sat, 12 Jun 2021 06:36:22 GMT Message-Id: <202106120636.15C6aMAl027796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oskar Holmlund Subject: git: dbaf4b653976 - main - arm: ti am335x ehrpwm remove sysctl interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbaf4b653976051a788f3ca7cced10064cd9cd5a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 06:36:23 -0000 The branch main has been updated by oh: URL: https://cgit.FreeBSD.org/src/commit/?id=dbaf4b653976051a788f3ca7cced10064cd9cd5a commit dbaf4b653976051a788f3ca7cced10064cd9cd5a Author: Oskar Holmlund AuthorDate: 2021-06-12 08:24:55 +0000 Commit: Oskar Holmlund CommitDate: 2021-06-12 08:24:55 +0000 arm: ti am335x ehrpwm remove sysctl interface To minimize the maintenance time of this driver when new features are added the legacy sysctl interface has to go. Approved by: manu (mentor) Reviewed by: Dr. Rolf Jansen (freebsd-rj_obsigna.com) Differential revision: https://reviews.freebsd.org/D29546 --- sys/arm/ti/am335x/am335x_ehrpwm.c | 224 +------------------------------------- 1 file changed, 3 insertions(+), 221 deletions(-) diff --git a/sys/arm/ti/am335x/am335x_ehrpwm.c b/sys/arm/ti/am335x/am335x_ehrpwm.c index 619fdae2bcdb..ef618c18cf46 100644 --- a/sys/arm/ti/am335x/am335x_ehrpwm.c +++ b/sys/arm/ti/am335x/am335x_ehrpwm.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -53,17 +52,6 @@ __FBSDID("$FreeBSD$"); * Enhanced resolution PWM driver. Many of the advanced featues of the hardware * are not supported by this driver. What is implemented here is simple * variable-duty-cycle PWM output. - * - * Note that this driver was historically configured using a set of sysctl - * variables/procs, and later gained support for the PWM(9) API. The sysctl - * code is still present to support existing apps, but that interface is - * considered deprecated. - * - * An important caveat is that the original sysctl interface and the new PWM API - * cannot both be used at once. If both interfaces are used to change - * configuration, it's quite likely you won't get the expected results. Also, - * reading the sysctl values after configuring via PWM will not return the right - * results. ******************************************************************************/ /* In ticks */ @@ -160,8 +148,6 @@ static device_probe_t am335x_ehrpwm_probe; static device_attach_t am335x_ehrpwm_attach; static device_detach_t am335x_ehrpwm_detach; -static int am335x_ehrpwm_clkdiv[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }; - struct ehrpwm_channel { u_int duty; /* on duration, in ns */ bool enabled; /* channel enabled? */ @@ -176,18 +162,6 @@ struct am335x_ehrpwm_softc { struct resource *sc_mem_res; int sc_mem_rid; - /* Things used for configuration via sysctl [deprecated]. */ - int sc_pwm_clkdiv; - int sc_pwm_freq; - struct sysctl_oid *sc_clkdiv_oid; - struct sysctl_oid *sc_freq_oid; - struct sysctl_oid *sc_period_oid; - struct sysctl_oid *sc_chanA_oid; - struct sysctl_oid *sc_chanB_oid; - uint32_t sc_pwm_period; - uint32_t sc_pwm_dutyA; - uint32_t sc_pwm_dutyB; - /* Things used for configuration via pwm(9) api. */ u_int sc_clkfreq; /* frequency in Hz */ u_int sc_clktick; /* duration in ns */ @@ -311,167 +285,6 @@ am335x_ehrpwm_cfg_period(struct am335x_ehrpwm_softc *sc, u_int period) return (true); } -static void -am335x_ehrpwm_freq(struct am335x_ehrpwm_softc *sc) -{ - int clkdiv; - - clkdiv = am335x_ehrpwm_clkdiv[sc->sc_pwm_clkdiv]; - sc->sc_pwm_freq = PWM_CLOCK / (1 * clkdiv) / sc->sc_pwm_period; -} - -static int -am335x_ehrpwm_sysctl_freq(SYSCTL_HANDLER_ARGS) -{ - int clkdiv, error, freq, i, period; - struct am335x_ehrpwm_softc *sc; - uint32_t reg; - - sc = (struct am335x_ehrpwm_softc *)arg1; - - PWM_LOCK(sc); - freq = sc->sc_pwm_freq; - PWM_UNLOCK(sc); - - error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); - if (error != 0 || req->newptr == NULL) - return (error); - - if (freq > PWM_CLOCK) - freq = PWM_CLOCK; - - PWM_LOCK(sc); - if (freq != sc->sc_pwm_freq) { - for (i = nitems(am335x_ehrpwm_clkdiv) - 1; i >= 0; i--) { - clkdiv = am335x_ehrpwm_clkdiv[i]; - period = PWM_CLOCK / clkdiv / freq; - if (period > USHRT_MAX) - break; - sc->sc_pwm_clkdiv = i; - sc->sc_pwm_period = period; - } - /* Reset the duty cycle settings. */ - sc->sc_pwm_dutyA = 0; - sc->sc_pwm_dutyB = 0; - EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); - EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); - /* Update the clkdiv settings. */ - reg = EPWM_READ2(sc, EPWM_TBCTL); - reg &= ~TBCTL_CLKDIV_MASK; - reg |= TBCTL_CLKDIV(sc->sc_pwm_clkdiv); - EPWM_WRITE2(sc, EPWM_TBCTL, reg); - /* Update the period settings. */ - EPWM_WRITE2(sc, EPWM_TBPRD, sc->sc_pwm_period - 1); - am335x_ehrpwm_freq(sc); - } - PWM_UNLOCK(sc); - - return (0); -} - -static int -am335x_ehrpwm_sysctl_clkdiv(SYSCTL_HANDLER_ARGS) -{ - int error, i, clkdiv; - struct am335x_ehrpwm_softc *sc; - uint32_t reg; - - sc = (struct am335x_ehrpwm_softc *)arg1; - - PWM_LOCK(sc); - clkdiv = am335x_ehrpwm_clkdiv[sc->sc_pwm_clkdiv]; - PWM_UNLOCK(sc); - - error = sysctl_handle_int(oidp, &clkdiv, sizeof(clkdiv), req); - if (error != 0 || req->newptr == NULL) - return (error); - - PWM_LOCK(sc); - if (clkdiv != am335x_ehrpwm_clkdiv[sc->sc_pwm_clkdiv]) { - for (i = 0; i < nitems(am335x_ehrpwm_clkdiv); i++) - if (clkdiv >= am335x_ehrpwm_clkdiv[i]) - sc->sc_pwm_clkdiv = i; - - reg = EPWM_READ2(sc, EPWM_TBCTL); - reg &= ~TBCTL_CLKDIV_MASK; - reg |= TBCTL_CLKDIV(sc->sc_pwm_clkdiv); - EPWM_WRITE2(sc, EPWM_TBCTL, reg); - am335x_ehrpwm_freq(sc); - } - PWM_UNLOCK(sc); - - return (0); -} - -static int -am335x_ehrpwm_sysctl_duty(SYSCTL_HANDLER_ARGS) -{ - struct am335x_ehrpwm_softc *sc = (struct am335x_ehrpwm_softc*)arg1; - int error; - uint32_t duty; - - if (oidp == sc->sc_chanA_oid) - duty = sc->sc_pwm_dutyA; - else - duty = sc->sc_pwm_dutyB; - error = sysctl_handle_int(oidp, &duty, 0, req); - - if (error != 0 || req->newptr == NULL) - return (error); - - if (duty > sc->sc_pwm_period) { - device_printf(sc->sc_dev, "Duty cycle can't be greater then period\n"); - return (EINVAL); - } - - PWM_LOCK(sc); - if (oidp == sc->sc_chanA_oid) { - sc->sc_pwm_dutyA = duty; - EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); - } - else { - sc->sc_pwm_dutyB = duty; - EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); - } - PWM_UNLOCK(sc); - - return (error); -} - -static int -am335x_ehrpwm_sysctl_period(SYSCTL_HANDLER_ARGS) -{ - struct am335x_ehrpwm_softc *sc = (struct am335x_ehrpwm_softc*)arg1; - int error; - uint32_t period; - - period = sc->sc_pwm_period; - error = sysctl_handle_int(oidp, &period, 0, req); - - if (error != 0 || req->newptr == NULL) - return (error); - - if (period < 1) - return (EINVAL); - - if (period > USHRT_MAX) - period = USHRT_MAX; - - PWM_LOCK(sc); - /* Reset the duty cycle settings. */ - sc->sc_pwm_dutyA = 0; - sc->sc_pwm_dutyB = 0; - EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); - EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); - /* Update the period settings. */ - sc->sc_pwm_period = period; - EPWM_WRITE2(sc, EPWM_TBPRD, period - 1); - am335x_ehrpwm_freq(sc); - PWM_UNLOCK(sc); - - return (error); -} - static int am335x_ehrpwm_channel_count(device_t dev, u_int *nchannel) { @@ -568,8 +381,6 @@ am335x_ehrpwm_attach(device_t dev) { struct am335x_ehrpwm_softc *sc; uint32_t reg; - struct sysctl_ctx_list *ctx; - struct sysctl_oid *tree; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -583,43 +394,14 @@ am335x_ehrpwm_attach(device_t dev) goto fail; } - /* Init sysctl interface */ - ctx = device_get_sysctl_ctx(sc->sc_dev); - tree = device_get_sysctl_tree(sc->sc_dev); - - sc->sc_clkdiv_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "clkdiv", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, - am335x_ehrpwm_sysctl_clkdiv, "I", "PWM clock prescaler"); - - sc->sc_freq_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "freq", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, - am335x_ehrpwm_sysctl_freq, "I", "PWM frequency"); - - sc->sc_period_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "period", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, - am335x_ehrpwm_sysctl_period, "I", "PWM period"); - - sc->sc_chanA_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "dutyA", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, - am335x_ehrpwm_sysctl_duty, "I", "Channel A duty cycles"); - - sc->sc_chanB_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "dutyB", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, - am335x_ehrpwm_sysctl_duty, "I", "Channel B duty cycles"); - /* CONFIGURE EPWM1 */ reg = EPWM_READ2(sc, EPWM_TBCTL); reg &= ~(TBCTL_CLKDIV_MASK | TBCTL_HSPCLKDIV_MASK); EPWM_WRITE2(sc, EPWM_TBCTL, reg); - sc->sc_pwm_period = DEFAULT_PWM_PERIOD; - sc->sc_pwm_dutyA = 0; - sc->sc_pwm_dutyB = 0; - am335x_ehrpwm_freq(sc); - - EPWM_WRITE2(sc, EPWM_TBPRD, sc->sc_pwm_period - 1); - EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); - EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); + EPWM_WRITE2(sc, EPWM_TBPRD, DEFAULT_PWM_PERIOD - 1); + EPWM_WRITE2(sc, EPWM_CMPA, 0); + EPWM_WRITE2(sc, EPWM_CMPB, 0); EPWM_WRITE2(sc, EPWM_AQCTLA, (AQCTL_ZRO_SET | AQCTL_CAU_CLEAR)); EPWM_WRITE2(sc, EPWM_AQCTLB, (AQCTL_ZRO_SET | AQCTL_CBU_CLEAR)); From owner-dev-commits-src-all@freebsd.org Sat Jun 12 07:04:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CF8D645A82; Sat, 12 Jun 2021 07:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G27x60pLlz3wDs; Sat, 12 Jun 2021 07:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 032EB1975; Sat, 12 Jun 2021 07:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C749GK067829; Sat, 12 Jun 2021 07:04:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C749aB067828; Sat, 12 Jun 2021 07:04:09 GMT (envelope-from git) Date: Sat, 12 Jun 2021 07:04:09 GMT Message-Id: <202106120704.15C749aB067828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oskar Holmlund Subject: git: e7424879e3f6 - main - arm: ti am335x ehrpwm add support for flags (PWM_POLARITY_INVERTED) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7424879e3f60f87f0dd99ef7345d9c48f1008fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 07:04:10 -0000 The branch main has been updated by oh: URL: https://cgit.FreeBSD.org/src/commit/?id=e7424879e3f60f87f0dd99ef7345d9c48f1008fa commit e7424879e3f60f87f0dd99ef7345d9c48f1008fa Author: Oskar Holmlund AuthorDate: 2021-06-12 08:54:31 +0000 Commit: Oskar Holmlund CommitDate: 2021-06-12 08:54:31 +0000 arm: ti am335x ehrpwm add support for flags (PWM_POLARITY_INVERTED) Add support for invert the polarity of the PWM signal. Cleanup and add comments in the initialization code. Add and fix register defines. Approved by: manu (mentor) Differential revision: https://reviews.freebsd.org/D29547 --- sys/arm/ti/am335x/am335x_ehrpwm.c | 118 +++++++++++++++++++++++++++++++++++--- 1 file changed, 110 insertions(+), 8 deletions(-) diff --git a/sys/arm/ti/am335x/am335x_ehrpwm.c b/sys/arm/ti/am335x/am335x_ehrpwm.c index ef618c18cf46..47a86aee8dcb 100644 --- a/sys/arm/ti/am335x/am335x_ehrpwm.c +++ b/sys/arm/ti/am335x/am335x_ehrpwm.c @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "pwmbus_if.h" #include "am335x_pwm.h" @@ -72,7 +74,12 @@ __FBSDID("$FreeBSD$"); bus_write_2((_sc)->sc_mem_res, reg, value) #define EPWM_TBCTL 0x00 -#define TBCTL_FREERUN (2 << 14) +/* see 15.2.2.11 for the first two, used in debug situations */ +#define TBCTL_FREERUN_STOP_NEXT_TBC_INCREMENT (0 << 14) +#define TBCTL_FREERUN_STOP_COMPLETE_CYCLE (1 << 14) +/* ignore suspend control signal */ +#define TBCTL_FREERUN (2 << 14) + #define TBCTL_PHDIR_UP (1 << 13) #define TBCTL_PHDIR_DOWN (0 << 13) #define TBCTL_CLKDIV(x) ((x) << 10) @@ -81,9 +88,9 @@ __FBSDID("$FreeBSD$"); #define TBCTL_HSPCLKDIV_MASK (3 << 7) #define TBCTL_SYNCOSEL_DISABLED (3 << 4) #define TBCTL_PRDLD_SHADOW (0 << 3) -#define TBCTL_PRDLD_IMMEDIATE (0 << 3) -#define TBCTL_PHSEN_ENABLED (1 << 2) +#define TBCTL_PRDLD_IMMEDIATE (1 << 3) #define TBCTL_PHSEN_DISABLED (0 << 2) +#define TBCTL_PHSEN_ENABLED (1 << 2) #define TBCTL_CTRMODE_MASK (3) #define TBCTL_CTRMODE_UP (0 << 0) #define TBCTL_CTRMODE_DOWN (1 << 0) @@ -136,8 +143,24 @@ __FBSDID("$FreeBSD$"); #define AQCSFRC(chan, hilo) ((hilo) << (2 * chan)) /* Trip-Zone module */ +#define EPWM_TZSEL 0x24 #define EPWM_TZCTL 0x28 #define EPWM_TZFLG 0x2C + +/* Dead band */ +#define EPWM_DBCTL 0x1E +#define DBCTL_MASK (3 << 0) +#define DBCTL_BYPASS 0 +#define DBCTL_RISING_EDGE 1 +#define DBCTL_FALLING_EDGE 2 +#define DBCTL_BOTH_EDGE 3 + +/* PWM-chopper */ +#define EPWM_PCCTL 0x3C +#define PCCTL_CHPEN_MASK (1 << 0) +#define PCCTL_CHPEN_DISABLE 0 +#define PCCTL_CHPEN_ENABLE 1 + /* High-Resolution PWM */ #define EPWM_HRCTL 0x40 #define HRCTL_DELMODE_BOTH 3 @@ -329,6 +352,60 @@ am335x_ehrpwm_channel_get_config(device_t dev, u_int channel, return (0); } +static int +am335x_ehrpwm_channel_set_flags(device_t dev, u_int channel, + uint32_t flags) +{ + struct am335x_ehrpwm_softc *sc; + + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + PWM_LOCK(sc); + if (flags & PWM_POLARITY_INVERTED) { + sc->sc_channels[channel].inverted = true; + /* Action-Qualifier 15.2.2.5 */ + if (channel == 0) + EPWM_WRITE2(sc, EPWM_AQCTLA, + (AQCTL_ZRO_CLEAR | AQCTL_CAU_SET)); + else + EPWM_WRITE2(sc, EPWM_AQCTLB, + (AQCTL_ZRO_CLEAR | AQCTL_CBU_SET)); + } else { + sc->sc_channels[channel].inverted = false; + if (channel == 0) + EPWM_WRITE2(sc, EPWM_AQCTLA, + (AQCTL_ZRO_SET | AQCTL_CAU_CLEAR)); + else + EPWM_WRITE2(sc, EPWM_AQCTLB, + (AQCTL_ZRO_SET | AQCTL_CBU_CLEAR)); + } + PWM_UNLOCK(sc); + + return (0); +} + +static int +am335x_ehrpwm_channel_get_flags(device_t dev, u_int channel, + uint32_t *flags) +{ + struct am335x_ehrpwm_softc *sc; + if (channel >= NUM_CHANNELS) + return (EINVAL); + + sc = device_get_softc(dev); + + if (sc->sc_channels[channel].inverted == true) + *flags = PWM_POLARITY_INVERTED; + else + *flags = 0; + + return (0); +} + + static int am335x_ehrpwm_channel_enable(device_t dev, u_int channel, bool enable) { @@ -380,7 +457,7 @@ static int am335x_ehrpwm_attach(device_t dev) { struct am335x_ehrpwm_softc *sc; - uint32_t reg; + uint16_t reg; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -394,7 +471,7 @@ am335x_ehrpwm_attach(device_t dev) goto fail; } - /* CONFIGURE EPWM1 */ + /* CONFIGURE EPWM */ reg = EPWM_READ2(sc, EPWM_TBCTL); reg &= ~(TBCTL_CLKDIV_MASK | TBCTL_HSPCLKDIV_MASK); EPWM_WRITE2(sc, EPWM_TBCTL, reg); @@ -403,17 +480,40 @@ am335x_ehrpwm_attach(device_t dev) EPWM_WRITE2(sc, EPWM_CMPA, 0); EPWM_WRITE2(sc, EPWM_CMPB, 0); + /* Action-Qualifier 15.2.2.5 */ EPWM_WRITE2(sc, EPWM_AQCTLA, (AQCTL_ZRO_SET | AQCTL_CAU_CLEAR)); EPWM_WRITE2(sc, EPWM_AQCTLB, (AQCTL_ZRO_SET | AQCTL_CBU_CLEAR)); + /* Dead band 15.2.2.6 */ + reg = EPWM_READ2(sc, EPWM_DBCTL); + reg &= ~DBCTL_MASK; + reg |= DBCTL_BYPASS; + EPWM_WRITE2(sc, EPWM_DBCTL, reg); + + /* PWM-chopper described in 15.2.2.7 */ + /* Acc. TRM used in pulse transformerbased gate drivers + * to control the power switching-elements + */ + reg = EPWM_READ2(sc, EPWM_PCCTL); + reg &= ~PCCTL_CHPEN_MASK; + reg |= PCCTL_CHPEN_DISABLE; + EPWM_WRITE2(sc, EPWM_PCCTL, PCCTL_CHPEN_DISABLE); + + /* Trip zone are described in 15.2.2.8. + * Essential its used to detect faults and can be configured + * to react on such faults.. + */ + /* disable TZn as one-shot / CVC trip source 15.2.4.18 */ + EPWM_WRITE2(sc, EPWM_TZSEL, 0x0); + /* reg described in 15.2.4.19 */ + EPWM_WRITE2(sc, EPWM_TZCTL, 0xf); + reg = EPWM_READ2(sc, EPWM_TZFLG); + /* START EPWM */ reg &= ~TBCTL_CTRMODE_MASK; reg |= TBCTL_CTRMODE_UP | TBCTL_FREERUN; EPWM_WRITE2(sc, EPWM_TBCTL, reg); - EPWM_WRITE2(sc, EPWM_TZCTL, 0xf); - reg = EPWM_READ2(sc, EPWM_TZFLG); - if ((sc->sc_busdev = device_add_child(dev, "pwmbus", -1)) == NULL) { device_printf(dev, "Cannot add child pwmbus\n"); // This driver can still do things even without the bus child. @@ -480,6 +580,8 @@ static device_method_t am335x_ehrpwm_methods[] = { DEVMETHOD(pwmbus_channel_count, am335x_ehrpwm_channel_count), DEVMETHOD(pwmbus_channel_config, am335x_ehrpwm_channel_config), DEVMETHOD(pwmbus_channel_get_config, am335x_ehrpwm_channel_get_config), + DEVMETHOD(pwmbus_channel_set_flags, am335x_ehrpwm_channel_set_flags), + DEVMETHOD(pwmbus_channel_get_flags, am335x_ehrpwm_channel_get_flags), DEVMETHOD(pwmbus_channel_enable, am335x_ehrpwm_channel_enable), DEVMETHOD(pwmbus_channel_is_enabled, am335x_ehrpwm_channel_is_enabled), From owner-dev-commits-src-all@freebsd.org Sat Jun 12 09:15:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7729C648085; Sat, 12 Jun 2021 09:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2BrQ2tVDz4Yj3; Sat, 12 Jun 2021 09:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B0043A62; Sat, 12 Jun 2021 09:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15C9FIS4039382; Sat, 12 Jun 2021 09:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15C9FIA3039381; Sat, 12 Jun 2021 09:15:18 GMT (envelope-from git) Date: Sat, 12 Jun 2021 09:15:18 GMT Message-Id: <202106120915.15C9FIA3039381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 345077ccd521 - main - Remove an(4) leftover from conf/NOTES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 345077ccd52193591a1bad91fef3583f7129345d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 09:15:18 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=345077ccd52193591a1bad91fef3583f7129345d commit 345077ccd52193591a1bad91fef3583f7129345d Author: Mateusz Guzik AuthorDate: 2021-06-12 08:48:41 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-12 08:58:11 +0000 Remove an(4) leftover from conf/NOTES Unbreaks LINT kernels. --- sys/conf/NOTES | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 0d9a64a88b0f..40063c09382f 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1821,8 +1821,6 @@ device tdkphy # TDK 89Q2120 device truephy # LSI TruePHY device xmphy # XaQti XMAC II -# an: Aironet 4500/4800 802.11 wireless adapters. Supports the PCMCIA, -# PCI and ISA varieties. # ae: Support for gigabit ethernet adapters based on the Attansic/Atheros # L2 PCI-Express FastEthernet controllers. # age: Support for gigabit ethernet adapters based on the Attansic/Atheros @@ -1928,10 +1926,6 @@ device xmphy # XaQti XMAC II # in Dell Latitude laptop docking stations. # Also supported: 3Com 3c980(C)-TX, 3Com 3cSOHO100-TX, 3Com 3c450-TX -# Order for ISA devices is important here - -device an - # PCI Ethernet NICs that use the common MII bus controller code. device ae # Attansic/Atheros L2 FastEthernet device age # Attansic/Atheros L1 Gigabit Ethernet From owner-dev-commits-src-all@freebsd.org Sat Jun 12 14:01:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8706C64C032; Sat, 12 Jun 2021 14:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KB83C69z4q7s; Sat, 12 Jun 2021 14:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5664F72F2; Sat, 12 Jun 2021 14:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE146H022185; Sat, 12 Jun 2021 14:01:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE14mp022184; Sat, 12 Jun 2021 14:01:04 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:04 GMT Message-Id: <202106121401.15CE14mp022184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 2c89a8c9aae2 - stable/13 - Clean up the style in the arm64 bus.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c89a8c9aae25a20882bf33c0f291fab692f307a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:04 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2c89a8c9aae25a20882bf33c0f291fab692f307a commit 2c89a8c9aae25a20882bf33c0f291fab692f307a Author: Andrew Turner AuthorDate: 2021-04-08 09:41:23 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:11 +0000 Clean up the style in the arm64 bus.h MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 5998328e55f8850718a6b48842823eb0a6524ae6) --- sys/arm64/include/bus.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/sys/arm64/include/bus.h b/sys/arm64/include/bus.h index 417b918f595f..5995aa0b4a79 100644 --- a/sys/arm64/include/bus.h +++ b/sys/arm64/include/bus.h @@ -79,12 +79,12 @@ #define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFFUL #define BUS_SPACE_MAXSIZE_40BIT 0xFFFFFFFFFFUL -#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFUL -#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFUL +#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFUL +#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFUL #define BUS_SPACE_MAP_CACHEABLE 0x01 #define BUS_SPACE_MAP_LINEAR 0x02 -#define BUS_SPACE_MAP_PREFETCHABLE 0x04 +#define BUS_SPACE_MAP_PREFETCHABLE 0x04 #define BUS_SPACE_UNRESTRICTED (~0) @@ -133,7 +133,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rm_8) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* read region */ void (*bs_rr_1) (void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); @@ -143,7 +143,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rr_8) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* write single */ void (*bs_w_1) (void *, bus_space_handle_t, bus_size_t, u_int8_t); @@ -163,7 +163,7 @@ struct bus_space { bus_size_t, const u_int32_t *, bus_size_t); void (*bs_wm_8) (void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t); - + /* write region */ void (*bs_wr_1) (void *, bus_space_handle_t, bus_size_t, const u_int8_t *, bus_size_t); @@ -219,7 +219,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rm_8_s) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* read region stream */ void (*bs_rr_1_s) (void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); @@ -229,7 +229,7 @@ struct bus_space { bus_size_t, u_int32_t *, bus_size_t); void (*bs_rr_8_s) (void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); - + /* write single stream */ void (*bs_w_1_s) (void *, bus_space_handle_t, bus_size_t, u_int8_t); @@ -249,7 +249,7 @@ struct bus_space { bus_size_t, const u_int32_t *, bus_size_t); void (*bs_wm_8_s) (void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t); - + /* write region stream */ void (*bs_wr_1_s) (void *, bus_space_handle_t, bus_size_t, const u_int8_t *, bus_size_t); @@ -259,6 +259,7 @@ struct bus_space { bus_size_t, const u_int32_t *, bus_size_t); void (*bs_wr_8_s) (void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t); + /* peek */ int (*bs_peek_1)(void *, bus_space_handle_t, bus_size_t , uint8_t *); @@ -268,6 +269,7 @@ struct bus_space { bus_size_t , uint32_t *); int (*bs_peek_8)(void *, bus_space_handle_t, bus_size_t , uint64_t *); + /* poke */ int (*bs_poke_1)(void *, bus_space_handle_t, bus_size_t, uint8_t); @@ -341,9 +343,9 @@ struct bus_space { #define bus_space_read_4(t, h, o) __bs_rs(4,(t),(h),(o)) #define bus_space_read_8(t, h, o) __bs_rs(8,(t),(h),(o)) -#define bus_space_read_stream_1(t, h, o) __bs_rs_s(1,(t), (h), (o)) -#define bus_space_read_stream_2(t, h, o) __bs_rs_s(2,(t), (h), (o)) -#define bus_space_read_stream_4(t, h, o) __bs_rs_s(4,(t), (h), (o)) +#define bus_space_read_stream_1(t, h, o) __bs_rs_s(1,(t), (h), (o)) +#define bus_space_read_stream_2(t, h, o) __bs_rs_s(2,(t), (h), (o)) +#define bus_space_read_stream_4(t, h, o) __bs_rs_s(4,(t), (h), (o)) #define bus_space_read_stream_8(t, h, o) __bs_rs_s(8,(t), (h), (o)) /* From owner-dev-commits-src-all@freebsd.org Sat Jun 12 14:01:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAD6964C034; Sat, 12 Jun 2021 14:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KB94T5hz4pmF; Sat, 12 Jun 2021 14:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8204971D3; Sat, 12 Jun 2021 14:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE15it022209; Sat, 12 Jun 2021 14:01:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE15Ts022208; Sat, 12 Jun 2021 14:01:05 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:05 GMT Message-Id: <202106121401.15CE15Ts022208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: a0dd2317e8f5 - stable/13 - Use if ... else when printing memory attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a0dd2317e8f5daf2e1e3b9cfdd4640a6996487fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:05 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a0dd2317e8f5daf2e1e3b9cfdd4640a6996487fc commit a0dd2317e8f5daf2e1e3b9cfdd4640a6996487fc Author: Andrew Turner AuthorDate: 2021-04-11 09:00:00 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:12 +0000 Use if ... else when printing memory attributes In vmstat there is a switch statement that converts these attributes to a string. As some values can be duplicate we have to hide these from userspace. Replace this switch statement with an if ... else macro that lets us repeat values without a compiler error. Reviewed by: kib MFC after: 2 weeks Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D29703 (cherry picked from commit 15221c552b3cabcbf26613246e855010b176805a) --- usr.bin/vmstat/vmstat.c | 54 +++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index aae3af8aeef8..403dc6e2a054 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1538,66 +1538,48 @@ display_object(struct kinfo_vmobject *kvo) xo_emit("{:inactive/%5ju} ", (uintmax_t)kvo->kvo_inactive); xo_emit("{:refcount/%3d} ", kvo->kvo_ref_count); xo_emit("{:shadowcount/%3d} ", kvo->kvo_shadow_count); - switch (kvo->kvo_memattr) { + +#define MEMATTR_STR(type, val) \ + if (kvo->kvo_memattr == (type)) { \ + str = (val); \ + } else #ifdef VM_MEMATTR_UNCACHEABLE - case VM_MEMATTR_UNCACHEABLE: - str = "UC"; - break; + MEMATTR_STR(VM_MEMATTR_UNCACHEABLE, "UC") #endif #ifdef VM_MEMATTR_WRITE_COMBINING - case VM_MEMATTR_WRITE_COMBINING: - str = "WC"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_COMBINING, "WC") #endif #ifdef VM_MEMATTR_WRITE_THROUGH - case VM_MEMATTR_WRITE_THROUGH: - str = "WT"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_THROUGH, "WT") #endif #ifdef VM_MEMATTR_WRITE_PROTECTED - case VM_MEMATTR_WRITE_PROTECTED: - str = "WP"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_PROTECTED, "WP") #endif #ifdef VM_MEMATTR_WRITE_BACK - case VM_MEMATTR_WRITE_BACK: - str = "WB"; - break; + MEMATTR_STR(VM_MEMATTR_WRITE_BACK, "WB") #endif #ifdef VM_MEMATTR_WEAK_UNCACHEABLE - case VM_MEMATTR_WEAK_UNCACHEABLE: - str = "UC-"; - break; + MEMATTR_STR(VM_MEMATTR_WEAK_UNCACHEABLE, "UC-") #endif #ifdef VM_MEMATTR_WB_WA - case VM_MEMATTR_WB_WA: - str = "WB"; - break; + MEMATTR_STR(VM_MEMATTR_WB_WA, "WB") #endif #ifdef VM_MEMATTR_NOCACHE - case VM_MEMATTR_NOCACHE: - str = "NC"; - break; + MEMATTR_STR(VM_MEMATTR_NOCACHE, "NC") #endif #ifdef VM_MEMATTR_DEVICE - case VM_MEMATTR_DEVICE: - str = "DEV"; - break; + MEMATTR_STR(VM_MEMATTR_DEVICE, "DEV") #endif #ifdef VM_MEMATTR_CACHEABLE - case VM_MEMATTR_CACHEABLE: - str = "C"; - break; + MEMATTR_STR(VM_MEMATTR_CACHEABLE, "C") #endif #ifdef VM_MEMATTR_PREFETCHABLE - case VM_MEMATTR_PREFETCHABLE: - str = "PRE"; - break; + MEMATTR_STR(VM_MEMATTR_PREFETCHABLE, "PRE") #endif - default: + { str = "??"; - break; } +#undef MEMATTR_STR xo_emit("{:attribute/%-3s} ", str); switch (kvo->kvo_type) { case KVME_TYPE_NONE: From owner-dev-commits-src-all@freebsd.org Sat Jun 12 14:01:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8F7964C10F; Sat, 12 Jun 2021 14:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBB5fcFz4q81; Sat, 12 Jun 2021 14:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A74427884; Sat, 12 Jun 2021 14:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE16aE022233; Sat, 12 Jun 2021 14:01:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE16Nv022232; Sat, 12 Jun 2021 14:01:06 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:06 GMT Message-Id: <202106121401.15CE16Nv022232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 48e4430ea5a1 - stable/13 - Implement bus_map_resource on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 48e4430ea5a1e82121a8fe486eb09986b9b62f0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:07 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=48e4430ea5a1e82121a8fe486eb09986b9b62f0f commit 48e4430ea5a1e82121a8fe486eb09986b9b62f0f Author: Andrew Turner AuthorDate: 2021-04-10 10:25:39 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:54 +0000 Implement bus_map_resource on arm64 This will allow us to allocate an unmapped memory resource, then later map it with a specific memory attribute. This is also needed for virtio with the modern PCI attachment. Reviewed by: kib (via D29723) Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D29694 (cherry picked from commit fe3822497726ab84a1e3753be41e43e4d51aab0b) --- sys/arm64/arm64/nexus.c | 77 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 924496ec7f52..cc28d87f002b 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -106,6 +106,8 @@ static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol); static struct resource_list *nexus_get_reslist(device_t, device_t); @@ -135,6 +137,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), @@ -344,10 +347,8 @@ static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + struct resource_map map; int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; if ((err = rman_activate_resource(r)) != 0) return (err); @@ -355,18 +356,21 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, /* * If this is a memory resource, map it into the kernel. */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); - err = bus_space_map(&memmap_bus, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); - return (err); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + err = nexus_map_resource(bus, child, type, r, NULL, + &map); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } + + rman_set_mapping(r, &map); } - rman_set_bustag(r, &memmap_bus); - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); - } else if (type == SYS_RES_IRQ) { + break; + case SYS_RES_IRQ: err = intr_activate_irq(child, r); if (err != 0) { rman_deactivate_resource(r); @@ -420,6 +424,51 @@ nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, return (rman_deactivate_resource(r)); } +static int +nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t end, length, start; + + /* Resources must be active to be mapped. */ + if ((rman_get_flags(r) & RF_ACTIVE) == 0) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + if (argsp != NULL) + bcopy(argsp, &args, imin(argsp->size, args.size)); + start = rman_get_start(r) + args.offset; + if (args.length == 0) + length = rman_get_size(r); + else + length = args.length; + end = start + length - 1; + if (start > rman_get_end(r) || start < rman_get_start(r)) + return (EINVAL); + if (end > rman_get_end(r) || end < start) + return (EINVAL); + + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + map->r_bustag = &memmap_bus; + map->r_size = length; + + /* + * The handle is the virtual address. + */ + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); +} + #ifdef FDT static device_method_t nexus_fdt_methods[] = { /* Device interface */ From owner-dev-commits-src-all@freebsd.org Sat Jun 12 14:01:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 115AB64BB58; Sat, 12 Jun 2021 14:01:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBC6WPWz4ppJ; Sat, 12 Jun 2021 14:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C84D376A1; Sat, 12 Jun 2021 14:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE17Gk022257; Sat, 12 Jun 2021 14:01:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE179T022256; Sat, 12 Jun 2021 14:01:07 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:07 GMT Message-Id: <202106121401.15CE179T022256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 3699da67bf4d - stable/13 - Use '.arch_extension crc' in the arm64 crc32 code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3699da67bf4de9a1efe69d498ff4ec896b650dc7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:08 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3699da67bf4de9a1efe69d498ff4ec896b650dc7 commit 3699da67bf4de9a1efe69d498ff4ec896b650dc7 Author: Andrew Turner AuthorDate: 2021-05-06 07:37:47 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:54 +0000 Use '.arch_extension crc' in the arm64 crc32 code We don't care about the base architecture here, just that the crc extension is enabled. Sponsored by: Innovate UK (cherry picked from commit 0ec3e991112d85a790ca3bbb4175652f37f4bd15) --- sys/libkern/arm64/crc32c_armv8.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/libkern/arm64/crc32c_armv8.S b/sys/libkern/arm64/crc32c_armv8.S index e5d0ff80d97b..6a1991262a33 100644 --- a/sys/libkern/arm64/crc32c_armv8.S +++ b/sys/libkern/arm64/crc32c_armv8.S @@ -27,7 +27,8 @@ #include __FBSDID("$FreeBSD$"); -.arch armv8-a+crc + +.arch_extension crc /* * uint32_t From owner-dev-commits-src-all@freebsd.org Sat Jun 12 14:01:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6616C64BCC6; Sat, 12 Jun 2021 14:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBG1h6Yz4ppS; Sat, 12 Jun 2021 14:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E938753B; Sat, 12 Jun 2021 14:01:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE19TC022311; Sat, 12 Jun 2021 14:01:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE19KX022308; Sat, 12 Jun 2021 14:01:09 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:09 GMT Message-Id: <202106121401.15CE19KX022308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: b96893a48979 - stable/13 - Clean up early arm64 pmap code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b96893a489796750b1515cc46c725928e023dfd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:10 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b96893a489796750b1515cc46c725928e023dfd2 commit b96893a489796750b1515cc46c725928e023dfd2 Author: Andrew Turner AuthorDate: 2021-05-20 06:52:15 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:55 +0000 Clean up early arm64 pmap code Early in the arm64 pmap code we need to translate between a virtual address and a physical address. Rather than manually walking the page table we can ask the hardware to do it for us. Reviewed by: kib, markj Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D30357 (cherry picked from commit e779604f1d4e5fd0cdf3a9d1bb756b168f97b39c) --- sys/arm64/arm64/locore.S | 6 ------ sys/arm64/arm64/pmap.c | 28 +++------------------------- sys/arm64/include/vmparam.h | 1 - 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index c62a2a5bd626..48dd794116cd 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -756,10 +756,6 @@ ENTRY(abort) b abort END(abort) - .align 3 -init_pt_va: - .quad pagetable /* XXX: Keep page tables VA */ - .section .init_pagetable, "aw", %nobits .align PAGE_SHIFT /* @@ -792,8 +788,6 @@ pagetable_end: el2_pagetable: .space PAGE_SIZE - .globl init_pt_va - .align 4 initstack: .space (PAGE_SIZE * KSTACK_PAGES) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index d4047fc84096..efe6bdd3d034 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -742,35 +742,13 @@ pmap_resident_count_dec(pmap_t pmap, int count) pmap->pm_stats.resident_count -= count; } -static pt_entry_t * -pmap_early_page_idx(vm_offset_t l1pt, vm_offset_t va, u_int *l1_slot, - u_int *l2_slot) -{ - pt_entry_t *l2; - pd_entry_t *l1; - - l1 = (pd_entry_t *)l1pt; - *l1_slot = (va >> L1_SHIFT) & Ln_ADDR_MASK; - - /* Check locore has used a table L1 map */ - KASSERT((l1[*l1_slot] & ATTR_DESCR_MASK) == L1_TABLE, - ("Invalid bootstrap L1 table")); - /* Find the address of the L2 table */ - l2 = (pt_entry_t *)init_pt_va; - *l2_slot = pmap_l2_index(va); - - return (l2); -} - static vm_paddr_t pmap_early_vtophys(vm_offset_t l1pt, vm_offset_t va) { - u_int l1_slot, l2_slot; - pt_entry_t *l2; - - l2 = pmap_early_page_idx(l1pt, va, &l1_slot, &l2_slot); + vm_paddr_t pa_page; - return ((l2[l2_slot] & ~ATTR_MASK) + (va & L2_OFFSET)); + pa_page = arm64_address_translate_s1e1r(va) & PAR_PA_MASK; + return (pa_page | (va & PAR_LOW_MASK)); } static vm_offset_t diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h index 4a90c7711e01..a42c68d52887 100644 --- a/sys/arm64/include/vmparam.h +++ b/sys/arm64/include/vmparam.h @@ -228,7 +228,6 @@ extern vm_paddr_t dmap_phys_base; extern vm_paddr_t dmap_phys_max; extern vm_offset_t dmap_max_addr; extern vm_offset_t vm_max_kernel_address; -extern vm_offset_t init_pt_va; #endif From owner-dev-commits-src-all@freebsd.org Sat Jun 12 14:01:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33C7264BB5B; Sat, 12 Jun 2021 14:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2KBF0dnFz4q8C; Sat, 12 Jun 2021 14:01:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF45372F6; Sat, 12 Jun 2021 14:01:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CE18OM022281; Sat, 12 Jun 2021 14:01:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CE18Eq022280; Sat, 12 Jun 2021 14:01:08 GMT (envelope-from git) Date: Sat, 12 Jun 2021 14:01:08 GMT Message-Id: <202106121401.15CE18Eq022280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: abb9d448b32d - stable/13 - Update the EFI timer to be called once a second MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: abb9d448b32dce5f80de68992315f0c71b6c8b81 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 14:01:09 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=abb9d448b32dce5f80de68992315f0c71b6c8b81 commit abb9d448b32dce5f80de68992315f0c71b6c8b81 Author: Andrew Turner AuthorDate: 2021-05-12 08:59:04 +0000 Commit: Andrew Turner CommitDate: 2021-06-12 01:21:55 +0000 Update the EFI timer to be called once a second There is no need to call it evert 10ms when we need 1s granularity. Update to update the time every second. Reviewed by: imp, manu, tsoome Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D30227 (cherry picked from commit 93f7be080f3ad0bd71190d87aa2043d714270206) --- stand/efi/libefi/time_event.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/efi/libefi/time_event.c b/stand/efi/libefi/time_event.c index f96f1d845f6a..f171bf997078 100644 --- a/stand/efi/libefi/time_event.c +++ b/stand/efi/libefi/time_event.c @@ -40,7 +40,7 @@ static void time_update(EFI_EVENT event, void *context) { - curtime += 10; + curtime++; } void @@ -50,8 +50,8 @@ efi_time_init(void) /* Create a timer event */ BS->CreateEvent(EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, time_update, 0, &time_event); - /* Use a 10ms timer */ - BS->SetTimer(time_event, TimerPeriodic, 100000); + /* Use a 1s timer */ + BS->SetTimer(time_event, TimerPeriodic, 10000000); } void @@ -68,7 +68,7 @@ time(time_t *tloc) { time_t t; - t = curtime / 1000; + t = curtime; if (tloc != NULL) *tloc = t; From owner-dev-commits-src-all@freebsd.org Sat Jun 12 17:35:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6784E64EA99; Sat, 12 Jun 2021 17:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2PxX29mtz3JBj; Sat, 12 Jun 2021 17:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DD3012824; Sat, 12 Jun 2021 17:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15CHZScJ003577; Sat, 12 Jun 2021 17:35:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15CHZS6O003576; Sat, 12 Jun 2021 17:35:28 GMT (envelope-from git) Date: Sat, 12 Jun 2021 17:35:28 GMT Message-Id: <202106121735.15CHZS6O003576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a3a907abbf60 - stable/13 - hyperv: register intr handler as usermode-mapped if loaded as module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3a907abbf60203278167db59d2c1efd97f239a1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 17:35:28 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a907abbf60203278167db59d2c1efd97f239a1 commit a3a907abbf60203278167db59d2c1efd97f239a1 Author: Konstantin Belousov AuthorDate: 2021-01-12 16:35:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-12 16:58:02 +0000 hyperv: register intr handler as usermode-mapped if loaded as module (cherry picked from commit fe7d7ac40881c9d01a54bf57fff71a3af199f237) --- sys/dev/hyperv/vmbus/vmbus.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index d3568494405e..929eff33e7c9 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include #include @@ -139,6 +143,7 @@ SYSCTL_INT(_hw_vmbus, OID_AUTO, pin_evttask, CTLFLAG_RDTUN, &vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU"); extern inthand_t IDTVEC(vmbus_isr), IDTVEC(vmbus_isr_pti); +#define VMBUS_ISR_ADDR trunc_page((uintptr_t)IDTVEC(vmbus_isr_pti)) uint32_t vmbus_current_version; @@ -980,6 +985,10 @@ vmbus_intr_setup(struct vmbus_softc *sc) vmbus_msg_task, sc); } +#if defined(__amd64__) && defined(KLD_MODULE) + pmap_pti_add_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE, true); +#endif + /* * All Hyper-V ISR required resources are setup, now let's find a * free IDT vector for Hyper-V ISR and set it up. @@ -987,6 +996,9 @@ vmbus_intr_setup(struct vmbus_softc *sc) sc->vmbus_idtvec = lapic_ipi_alloc(pti ? IDTVEC(vmbus_isr_pti) : IDTVEC(vmbus_isr)); if (sc->vmbus_idtvec < 0) { +#if defined(__amd64__) && defined(KLD_MODULE) + pmap_pti_remove_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE); +#endif device_printf(sc->vmbus_dev, "cannot find free IDT vector\n"); return ENXIO; } @@ -1007,6 +1019,10 @@ vmbus_intr_teardown(struct vmbus_softc *sc) sc->vmbus_idtvec = -1; } +#if defined(__amd64__) && defined(KLD_MODULE) + pmap_pti_remove_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE); +#endif + CPU_FOREACH(cpu) { if (VMBUS_PCPU_GET(sc, event_tq, cpu) != NULL) { taskqueue_free(VMBUS_PCPU_GET(sc, event_tq, cpu)); From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:38:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5F7B654004; Sun, 13 Jun 2021 01:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfR4ry2z4j36; Sun, 13 Jun 2021 01:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A01F187C5; Sun, 13 Jun 2021 01:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1c7XI038237; Sun, 13 Jun 2021 01:38:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1c7kP038236; Sun, 13 Jun 2021 01:38:07 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:07 GMT Message-Id: <202106130138.15D1c7kP038236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0379dc900e53 - stable/13 - kern_exec.c: Add execve_nosetid() helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0379dc900e5304d3915ca82110445f2bcc415fcb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0379dc900e5304d3915ca82110445f2bcc415fcb commit 0379dc900e5304d3915ca82110445f2bcc415fcb Author: Konstantin Belousov AuthorDate: 2021-01-14 13:36:15 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:32 +0000 kern_exec.c: Add execve_nosetid() helper (cherry picked from commit 19e6043a443ea51207786b85c8d62d070ec36005) --- sys/kern/kern_exec.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 3de6ac565db5..1df422dec08e 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -353,6 +353,16 @@ kern_execve(struct thread *td, struct image_args *args, struct mac *mac_p, return (do_execve(td, args, mac_p, oldvmspace)); } +static void +execve_nosetid(struct image_params *imgp) +{ + imgp->credential_setid = false; + if (imgp->newcred != NULL) { + crfree(imgp->newcred); + imgp->newcred = NULL; + } +} + /* * In-kernel implementation of execve(). All arguments are assumed to be * userspace pointers from the passed thread. @@ -639,11 +649,7 @@ interpret: vput(newtextvp); vm_object_deallocate(imgp->object); imgp->object = NULL; - imgp->credential_setid = false; - if (imgp->newcred != NULL) { - crfree(imgp->newcred); - imgp->newcred = NULL; - } + execve_nosetid(imgp); imgp->execpath = NULL; free(imgp->freepath, M_TEMP); imgp->freepath = NULL; From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:38:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 162216538F8; Sun, 13 Jun 2021 01:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfT73vgz4j7M; Sun, 13 Jun 2021 01:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D878018766; Sun, 13 Jun 2021 01:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1c9Wr038292; Sun, 13 Jun 2021 01:38:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1c9aZ038291; Sun, 13 Jun 2021 01:38:09 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:09 GMT Message-Id: <202106130138.15D1c9aZ038291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dc107fe1f939 - stable/13 - linuxolator: Add compat.linux.setid_allowed knob MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc107fe1f939c7d4c5575868202b4cd3edf3e846 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:10 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dc107fe1f939c7d4c5575868202b4cd3edf3e846 commit dc107fe1f939c7d4c5575868202b4cd3edf3e846 Author: Konstantin Belousov AuthorDate: 2021-01-14 13:51:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 linuxolator: Add compat.linux.setid_allowed knob PR: 21463 (cherry picked from commit 598f6fb49c9ca688029b79de0a44227ab79c608c) --- share/man/man4/linux.4 | 14 +++++++++++++- sys/amd64/linux/linux_sysvec.c | 1 + sys/amd64/linux32/linux32_sysvec.c | 1 + sys/arm64/linux/linux_sysvec.c | 1 + sys/compat/linux/linux_mib.c | 12 ++++++++++++ sys/compat/linux/linux_mib.h | 3 +++ sys/i386/linux/linux_sysvec.c | 2 ++ 7 files changed, 33 insertions(+), 1 deletion(-) diff --git a/share/man/man4/linux.4 b/share/man/man4/linux.4 index 23bc0c26f7f9..b2d36158c622 100644 --- a/share/man/man4/linux.4 +++ b/share/man/man4/linux.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2020 +.Dd May 6, 2021 .Dt LINUX 4 .Os .Sh NAME @@ -130,6 +130,18 @@ From a user perspective, this makes .Va SIGINFO work for Linux executables. Defaults to 0. +.It Va compat.linux.setid_allowed +Disable handling of set-user-ID and set-group-ID mode bits for the new +process image file when image is to be executed under Linux ABI. +When set, new Linux images always use credentials of the program +that issued +.Xr execve 2 +call, regardless of the image file mode. +.Pp +This might be reasonable or even required, because +.Fx +does not emulate Linux environment completely, and missed features +could become holes. .El .Sh FILES .Bl -tag -width /compat/linux/dev/shm -compact diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 252579a4809e..3766cea5e699 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -763,6 +763,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 3790d0fcb69c..2fd246086810 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -930,6 +930,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index e20e0fd32b91..7c88b0d9f2ea 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -441,6 +441,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c index cc4207f74a39..3a6627df9abd 100644 --- a/sys/compat/linux/linux_mib.c +++ b/sys/compat/linux/linux_mib.c @@ -99,6 +99,18 @@ int linux_use_emul_path = 1; SYSCTL_INT(_compat_linux, OID_AUTO, use_emul_path, CTLFLAG_RWTUN, &linux_use_emul_path, 0, "Use linux.compat.emul_path"); +static bool linux_setid_allowed = true; +SYSCTL_BOOL(_compat_linux, OID_AUTO, setid_allowed, CTLFLAG_RWTUN, + &linux_setid_allowed, 0, + "Allow setuid/setgid on execve of Linux binary"); + +bool +linux_setid_allowed_query(struct thread *td __unused, + struct image_params *imgp __unused) +{ + return (linux_setid_allowed); +} + static int linux_set_osname(struct thread *td, char *osname); static int linux_set_osrelease(struct thread *td, char *osrelease); static int linux_set_oss_version(struct thread *td, int oss_version); diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 0a1baec39826..49da02da44df 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -70,4 +70,7 @@ extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; extern bool linux_map_sched_prio; +struct image_params; +bool linux_setid_allowed_query(struct thread *td, struct image_params *imgp); + #endif /* _LINUX_MIB_H_ */ diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index ef845675aaa4..1c92dafa7dcc 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -871,6 +871,7 @@ struct sysentvec linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); @@ -908,6 +909,7 @@ struct sysentvec elf_linux_sysvec = { .sv_onexec = linux_on_exec, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, + .sv_setid_allowed = &linux_setid_allowed_query, }; static void From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:38:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5C1A6534DF; Sun, 13 Jun 2021 01:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfS5BDrz4j7J; Sun, 13 Jun 2021 01:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BCF3188FB; Sun, 13 Jun 2021 01:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1c8Go038267; Sun, 13 Jun 2021 01:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1c8iA038266; Sun, 13 Jun 2021 01:38:08 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:08 GMT Message-Id: <202106130138.15D1c8iA038266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ff59c9de3274 - stable/13 - sysent: allow ABI to disable setid on exec. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff59c9de3274134e3e517a7faf7b5fbedfc0bb7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff59c9de3274134e3e517a7faf7b5fbedfc0bb7f commit ff59c9de3274134e3e517a7faf7b5fbedfc0bb7f Author: Konstantin Belousov AuthorDate: 2021-01-14 13:38:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:32 +0000 sysent: allow ABI to disable setid on exec. (cherry picked from commit 2d423f7671fe452486932c8e41e7d3547afe82aa) --- sys/kern/kern_exec.c | 4 ++++ sys/sys/sysent.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 1df422dec08e..3413a5d024d4 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -774,6 +774,10 @@ interpret: signotify(td); } + if (imgp->sysent->sv_setid_allowed != NULL && + !(*imgp->sysent->sv_setid_allowed)(td, imgp)) + execve_nosetid(imgp); + /* * Implement image setuid/setgid installation. */ diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index e6db2ec3dfb1..4a707b41e020 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -148,6 +148,8 @@ struct sysentvec { void (*sv_onexec)(struct proc *, struct image_params *); void (*sv_onexit)(struct proc *); void (*sv_ontdexit)(struct thread *td); + bool (*sv_setid_allowed)(struct thread *td, + struct image_params *imgp); }; #define SV_ILP32 0x000100 /* 32-bit executable. */ From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:38:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AD02654080; Sun, 13 Jun 2021 01:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cfW0cGYz4j59; Sun, 13 Jun 2021 01:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D82EE18AA2; Sun, 13 Jun 2021 01:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1cAOM038316; Sun, 13 Jun 2021 01:38:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1cAAl038315; Sun, 13 Jun 2021 01:38:10 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:38:10 GMT Message-Id: <202106130138.15D1cAAl038315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: af3dce614155 - stable/13 - Change the return type of sv__setid_allowed from bool to int MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af3dce614155dd3264c7248e0fd082d2c214890a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:38:11 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=af3dce614155dd3264c7248e0fd082d2c214890a commit af3dce614155dd3264c7248e0fd082d2c214890a Author: Konstantin Belousov AuthorDate: 2021-06-06 20:38:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 Change the return type of sv__setid_allowed from bool to int (cherry picked from commit 62b8258a7e43f3c774f13eab758b2cfdf353073e) --- sys/compat/linux/linux_mib.c | 2 +- sys/compat/linux/linux_mib.h | 2 +- sys/sys/sysent.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c index 3a6627df9abd..13beba323787 100644 --- a/sys/compat/linux/linux_mib.c +++ b/sys/compat/linux/linux_mib.c @@ -104,7 +104,7 @@ SYSCTL_BOOL(_compat_linux, OID_AUTO, setid_allowed, CTLFLAG_RWTUN, &linux_setid_allowed, 0, "Allow setuid/setgid on execve of Linux binary"); -bool +int linux_setid_allowed_query(struct thread *td __unused, struct image_params *imgp __unused) { diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 49da02da44df..8f2b87e5f3a6 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -71,6 +71,6 @@ extern int linux_preserve_vstatus; extern bool linux_map_sched_prio; struct image_params; -bool linux_setid_allowed_query(struct thread *td, struct image_params *imgp); +int linux_setid_allowed_query(struct thread *td, struct image_params *imgp); #endif /* _LINUX_MIB_H_ */ diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 4a707b41e020..c2cbd77a92b9 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -148,7 +148,7 @@ struct sysentvec { void (*sv_onexec)(struct proc *, struct image_params *); void (*sv_onexit)(struct proc *); void (*sv_ontdexit)(struct thread *td); - bool (*sv_setid_allowed)(struct thread *td, + int (*sv_setid_allowed)(struct thread *td, struct image_params *imgp); }; From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78DAF6541D2; Sun, 13 Jun 2021 01:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpN2rF8z4jbQ; Sun, 13 Jun 2021 01:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 495C118CAA; Sun, 13 Jun 2021 01:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j0gH051802; Sun, 13 Jun 2021 01:45:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j0lc051801; Sun, 13 Jun 2021 01:45:00 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:00 GMT Message-Id: <202106130145.15D1j0lc051801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 11cfede1e62a - stable/13 - accounting: explicitly mark the exiting thread as doing accounting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11cfede1e62afa1ff00cf97107bc48ebe1561ecb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:00 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=11cfede1e62afa1ff00cf97107bc48ebe1561ecb commit 11cfede1e62afa1ff00cf97107bc48ebe1561ecb Author: Konstantin Belousov AuthorDate: 2021-05-13 23:48:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 accounting: explicitly mark the exiting thread as doing accounting (cherry picked from commit 9bb84c23e762e7d1b6154ef4afdcc80662692e76) --- sys/kern/kern_acct.c | 26 +++++--------------------- sys/kern/vfs_vnops.c | 3 ++- sys/sys/proc.h | 1 + 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 675113c6b2ba..4c1efada10da 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -141,7 +141,6 @@ static int acct_configured; static int acct_suspended; static struct vnode *acct_vp; static struct ucred *acct_cred; -static struct plimit *acct_limit; static int acct_flags; static struct sx acct_sx; @@ -206,7 +205,7 @@ int sys_acct(struct thread *td, struct acct_args *uap) { struct nameidata nd; - int error, flags, i, replacing; + int error, flags, replacing; error = priv_check(td, PRIV_ACCT); if (error) @@ -276,15 +275,6 @@ sys_acct(struct thread *td, struct acct_args *uap) return (error); } - /* - * Create our own plimit object without limits. It will be assigned - * to exiting processes. - */ - acct_limit = lim_alloc(); - for (i = 0; i < RLIM_NLIMITS; i++) - acct_limit->pl_rlimit[i].rlim_cur = - acct_limit->pl_rlimit[i].rlim_max = RLIM_INFINITY; - /* * Save the new accounting file vnode, and schedule the new * free space watcher. @@ -328,7 +318,6 @@ acct_disable(struct thread *td, int logging) sx_assert(&acct_sx, SX_XLOCKED); error = vn_close(acct_vp, acct_flags, acct_cred, td); crfree(acct_cred); - lim_free(acct_limit); acct_configured = 0; acct_vp = NULL; acct_cred = NULL; @@ -349,7 +338,6 @@ acct_process(struct thread *td) { struct acctv3 acct; struct timeval ut, st, tmp; - struct plimit *oldlim; struct proc *p; struct rusage ru; int t, ret; @@ -374,6 +362,7 @@ acct_process(struct thread *td) } p = td->td_proc; + td->td_pflags2 |= TDP2_ACCT; /* * Get process accounting information. @@ -426,20 +415,14 @@ acct_process(struct thread *td) /* (8) The boolean flags that tell how the process terminated, etc. */ acct.ac_flagx = p->p_acflag; + PROC_UNLOCK(p); + /* Setup ancillary structure fields. */ acct.ac_flagx |= ANVER; acct.ac_zero = 0; acct.ac_version = 3; acct.ac_len = acct.ac_len2 = sizeof(acct); - /* - * Eliminate rlimits (file size limit in particular). - */ - oldlim = p->p_limit; - p->p_limit = lim_hold(acct_limit); - PROC_UNLOCK(p); - lim_free(oldlim); - /* * Write the accounting information to the file. */ @@ -447,6 +430,7 @@ acct_process(struct thread *td) (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, acct_cred, NOCRED, NULL, td); sx_sunlock(&acct_sx); + td->td_pflags2 &= ~TDP2_ACCT; return (ret); } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 4ce4678f292f..8be30df40dc5 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2361,7 +2361,8 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, struct thread *td) { - if (vp->v_type != VREG || td == NULL) + if (vp->v_type != VREG || td == NULL || + (td->td_pflags2 & TDP2_ACCT) != 0) return (0); if ((uoff_t)uio->uio_offset + uio->uio_resid > lim_cur(td, RLIMIT_FSIZE)) { diff --git a/sys/sys/proc.h b/sys/sys/proc.h index b0fc13a449cb..b47af58c34be 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -527,6 +527,7 @@ do { \ #define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ #define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ +#define TDP2_ACCT 0x00000004 /* Doing accounting */ /* * Reasons that the current thread can not be run yet. From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCEBB6540DA; Sun, 13 Jun 2021 01:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpP3xgyz4jbS; Sun, 13 Jun 2021 01:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DDC118ACB; Sun, 13 Jun 2021 01:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j1W8051833; Sun, 13 Jun 2021 01:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j1GS051832; Sun, 13 Jun 2021 01:45:01 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:01 GMT Message-Id: <202106130145.15D1j1GS051832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 31df316c108b - stable/13 - ktrace: do not stop tracing other processes if our cannot write to this vnode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 31df316c108b073478f3b04eef422abd8011018b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:01 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=31df316c108b073478f3b04eef422abd8011018b commit 31df316c108b073478f3b04eef422abd8011018b Author: Konstantin Belousov AuthorDate: 2021-05-15 00:10:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: do not stop tracing other processes if our cannot write to this vnode (cherry picked from commit a6144f713cee8f522150b1398b225eedbf4cfef1) --- sys/kern/kern_ktrace.c | 53 ++++++++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index d0f7e0067064..26fba786e1e9 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1192,7 +1192,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) struct uio auio; struct iovec aiov[3]; struct mount *mp; - int datalen, buflen, vrele_count; + int datalen, buflen; int error; /* @@ -1266,44 +1266,29 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) } /* - * If error encountered, give up tracing on this vnode. We defer - * all the vrele()'s on the vnode until after we are finished walking - * the various lists to avoid needlessly holding locks. - * NB: at this point we still hold the vnode reference that must - * not go away as we need the valid vnode to compare with. Thus let - * vrele_count start at 1 and the reference will be freed - * by the loop at the end after our last use of vp. - */ - log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped\n", - error); - vrele_count = 1; - /* - * First, clear this vnode from being used by any processes in the - * system. - * XXX - If one process gets an EPERM writing to the vnode, should - * we really do this? Other processes might have suitable - * credentials for the operation. + * If error encountered, give up tracing on this vnode on this + * process. Other processes might still be suitable for + * writes to this vnode. */ + p = td->td_proc; + log(LOG_NOTICE, + "ktrace write failed, errno %d, tracing stopped for pid %d\n", + error, p->p_pid); cred = NULL; sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_tracevp == vp) { - mtx_lock(&ktrace_mtx); - ktr_freeproc(p, &cred, NULL); - mtx_unlock(&ktrace_mtx); - vrele_count++; - } - PROC_UNLOCK(p); - if (cred != NULL) { - crfree(cred); - cred = NULL; - } + PROC_LOCK(p); + mtx_lock(&ktrace_mtx); + if (p->p_tracevp == vp) + ktr_freeproc(p, &cred, NULL); + mtx_unlock(&ktrace_mtx); + PROC_UNLOCK(p); + if (cred != NULL) { + crfree(cred); + cred = NULL; } sx_sunlock(&allproc_lock); - - while (vrele_count-- > 0) - vrele(vp); + vrele(vp); + vrele(vp); } /* From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECB056540DC; Sun, 13 Jun 2021 01:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpQ59ffz4jMG; Sun, 13 Jun 2021 01:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8882E18ACC; Sun, 13 Jun 2021 01:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j2Ef051857; Sun, 13 Jun 2021 01:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j2nw051856; Sun, 13 Jun 2021 01:45:02 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:02 GMT Message-Id: <202106130145.15D1j2nw051856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ce0cef608e45 - stable/13 - ktrace: pack all ktrace parameters into allocated structure ktr_io_params MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ce0cef608e4531d9d8dffc3c15484d6cba3a2ee8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:03 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ce0cef608e4531d9d8dffc3c15484d6cba3a2ee8 commit ce0cef608e4531d9d8dffc3c15484d6cba3a2ee8 Author: Konstantin Belousov AuthorDate: 2021-05-14 23:22:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: pack all ktrace parameters into allocated structure ktr_io_params (cherry picked from commit 1762f674ccb571e6b03c009906dd1af3c6343f9b) --- sys/kern/kern_descrip.c | 6 +- sys/kern/kern_exec.c | 16 ++-- sys/kern/kern_ktrace.c | 234 ++++++++++++++++++++++++++++++------------------ sys/kern/kern_proc.c | 5 +- sys/sys/ktrace.h | 6 +- sys/sys/proc.h | 4 +- 6 files changed, 165 insertions(+), 106 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 585f2124eab1..36092c9acd42 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -79,9 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef KTRACE #include -#endif #include @@ -4384,9 +4382,7 @@ kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, PROC_LOCK_ASSERT(p, MA_OWNED); /* ktrace vnode */ - tracevp = p->p_tracevp; - if (tracevp != NULL) - vrefact(tracevp); + tracevp = ktr_get_tracevp(p, true); /* text vnode */ textvp = p->p_textvp; if (textvp != NULL) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 3413a5d024d4..2936e246f706 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -382,8 +382,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, struct pargs *oldargs = NULL, *newargs = NULL; struct sigacts *oldsigacts = NULL, *newsigacts = NULL; #ifdef KTRACE - struct vnode *tracevp = NULL; - struct ucred *tracecred = NULL; + struct ktr_io_params *kiop; #endif struct vnode *oldtextvp = NULL, *newtextvp; int credential_changing; @@ -399,6 +398,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, static const char fexecv_proc_title[] = "(fexecv)"; imgp = &image_params; + kiop = NULL; /* * Lock the process and set the P_INEXEC flag to indicate that @@ -788,11 +788,10 @@ interpret: * we do not regain any tracing during a possible block. */ setsugid(p); + kiop = NULL; #ifdef KTRACE - if (p->p_tracecred != NULL && - priv_check_cred(p->p_tracecred, PRIV_DEBUG_DIFFCRED)) - ktrprocexec(p, &tracecred, &tracevp); + kiop = ktrprocexec(p); #endif /* * Close any file descriptors 0..2 that reference procfs, @@ -947,12 +946,7 @@ exec_fail: */ if (oldtextvp != NULL) vrele(oldtextvp); -#ifdef KTRACE - if (tracevp != NULL) - vrele(tracevp); - if (tracecred != NULL) - crfree(tracecred); -#endif + ktr_io_params_free(kiop); pargs_drop(oldargs); pargs_drop(newargs); if (oldsigacts != NULL) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 26fba786e1e9..c923149ed129 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -145,20 +145,27 @@ static int print_message = 1; static struct mtx ktrace_mtx; static struct sx ktrace_sx; +struct ktr_io_params { + struct vnode *vp; + struct ucred *cr; + u_int refs; +}; + static void ktrace_init(void *dummy); static int sysctl_kern_ktrace_request_pool(SYSCTL_HANDLER_ARGS); static u_int ktrace_resize_pool(u_int oldsize, u_int newsize); static struct ktr_request *ktr_getrequest_entered(struct thread *td, int type); static struct ktr_request *ktr_getrequest(int type); static void ktr_submitrequest(struct thread *td, struct ktr_request *req); -static void ktr_freeproc(struct proc *p, struct ucred **uc, - struct vnode **vp); +static struct ktr_io_params *ktr_freeproc(struct proc *p); static void ktr_freerequest(struct ktr_request *req); static void ktr_freerequest_locked(struct ktr_request *req); static void ktr_writerequest(struct thread *td, struct ktr_request *req); static int ktrcanset(struct thread *,struct proc *); -static int ktrsetchildren(struct thread *,struct proc *,int,int,struct vnode *); -static int ktrops(struct thread *,struct proc *,int,int,struct vnode *); +static int ktrsetchildren(struct thread *, struct proc *, int, int, + struct ktr_io_params *); +static int ktrops(struct thread *, struct proc *, int, int, + struct ktr_io_params *); static void ktrprocctor_entered(struct thread *, struct proc *); /* @@ -421,28 +428,85 @@ ktr_freerequest_locked(struct ktr_request *req) STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list); } +static void +ktr_io_params_ref(struct ktr_io_params *kiop) +{ + mtx_assert(&ktrace_mtx, MA_OWNED); + kiop->refs++; +} + +static struct ktr_io_params * +ktr_io_params_rele(struct ktr_io_params *kiop) +{ + mtx_assert(&ktrace_mtx, MA_OWNED); + if (kiop == NULL) + return (NULL); + KASSERT(kiop->refs > 0, ("kiop ref == 0 %p", kiop)); + return (--(kiop->refs) == 0 ? kiop : NULL); +} + +void +ktr_io_params_free(struct ktr_io_params *kiop) +{ + if (kiop == NULL) + return; + + MPASS(kiop->refs == 0); + vn_close(kiop->vp, FWRITE, kiop->cr, curthread); + crfree(kiop->cr); + free(kiop, M_KTRACE); +} + +static struct ktr_io_params * +ktr_io_params_alloc(struct thread *td, struct vnode *vp) +{ + struct ktr_io_params *res; + + res = malloc(sizeof(struct ktr_io_params), M_KTRACE, M_WAITOK); + res->vp = vp; + res->cr = crhold(td->td_ucred); + res->refs = 1; + return (res); +} + /* * Disable tracing for a process and release all associated resources. * The caller is responsible for releasing a reference on the returned * vnode and credentials. */ -static void -ktr_freeproc(struct proc *p, struct ucred **uc, struct vnode **vp) +static struct ktr_io_params * +ktr_freeproc(struct proc *p) { + struct ktr_io_params *kiop; struct ktr_request *req; PROC_LOCK_ASSERT(p, MA_OWNED); mtx_assert(&ktrace_mtx, MA_OWNED); - *uc = p->p_tracecred; - p->p_tracecred = NULL; - if (vp != NULL) - *vp = p->p_tracevp; - p->p_tracevp = NULL; + kiop = ktr_io_params_rele(p->p_ktrioparms); + p->p_ktrioparms = NULL; p->p_traceflag = 0; while ((req = STAILQ_FIRST(&p->p_ktr)) != NULL) { STAILQ_REMOVE_HEAD(&p->p_ktr, ktr_list); ktr_freerequest_locked(req); } + return (kiop); +} + +struct vnode * +ktr_get_tracevp(struct proc *p, bool ref) +{ + struct vnode *vp; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + if (p->p_ktrioparms != NULL) { + vp = p->p_ktrioparms->vp; + if (ref) + vrefact(vp); + } else { + vp = NULL; + } + return (vp); } void @@ -501,14 +565,21 @@ ktrsysret(int code, int error, register_t retval) * * XXX: We toss any pending asynchronous records. */ -void -ktrprocexec(struct proc *p, struct ucred **uc, struct vnode **vp) +struct ktr_io_params * +ktrprocexec(struct proc *p) { + struct ktr_io_params *kiop; PROC_LOCK_ASSERT(p, MA_OWNED); + + kiop = p->p_ktrioparms; + if (kiop == NULL || priv_check_cred(kiop->cr, PRIV_DEBUG_DIFFCRED)) + return (NULL); + mtx_lock(&ktrace_mtx); - ktr_freeproc(p, uc, vp); + kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); + return (kiop); } /* @@ -520,8 +591,7 @@ ktrprocexit(struct thread *td) { struct ktr_request *req; struct proc *p; - struct ucred *cred; - struct vnode *vp; + struct ktr_io_params *kiop; p = td->td_proc; if (p->p_traceflag == 0) @@ -536,13 +606,10 @@ ktrprocexit(struct thread *td) sx_xunlock(&ktrace_sx); PROC_LOCK(p); mtx_lock(&ktrace_mtx); - ktr_freeproc(p, &cred, &vp); + kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); - if (vp != NULL) - vrele(vp); - if (cred != NULL) - crfree(cred); + ktr_io_params_free(kiop); ktrace_exit(td); } @@ -583,7 +650,7 @@ void ktrprocfork(struct proc *p1, struct proc *p2) { - MPASS(p2->p_tracevp == NULL); + MPASS(p2->p_ktrioparms == NULL); MPASS(p2->p_traceflag == 0); if (p1->p_traceflag == 0) @@ -593,12 +660,8 @@ ktrprocfork(struct proc *p1, struct proc *p2) mtx_lock(&ktrace_mtx); if (p1->p_traceflag & KTRFAC_INHERIT) { p2->p_traceflag = p1->p_traceflag; - if ((p2->p_tracevp = p1->p_tracevp) != NULL) { - VREF(p2->p_tracevp); - KASSERT(p1->p_tracecred != NULL, - ("ktrace vnode with no cred")); - p2->p_tracecred = crhold(p1->p_tracecred); - } + if ((p2->p_ktrioparms = p1->p_ktrioparms) != NULL) + p1->p_ktrioparms->refs++; } mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p1); @@ -934,7 +997,7 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) int nfound, ret = 0; int flags, error = 0; struct nameidata nd; - struct ucred *cred; + struct ktr_io_params *kiop, *old_kiop; /* * Need something to (un)trace. @@ -942,6 +1005,7 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) if (ops != KTROP_CLEARFILE && facs == 0) return (EINVAL); + kiop = NULL; ktrace_enter(td); if (ops != KTROP_CLEAR) { /* @@ -962,34 +1026,34 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) ktrace_exit(td); return (EACCES); } + kiop = ktr_io_params_alloc(td, vp); } /* * Clear all uses of the tracefile. */ if (ops == KTROP_CLEARFILE) { - int vrele_count; - - vrele_count = 0; +restart: sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { + old_kiop = NULL; PROC_LOCK(p); - if (p->p_tracevp == vp) { + if (p->p_ktrioparms != NULL && + p->p_ktrioparms->vp == vp) { if (ktrcanset(td, p)) { mtx_lock(&ktrace_mtx); - ktr_freeproc(p, &cred, NULL); + old_kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); - vrele_count++; - crfree(cred); } else error = EPERM; } PROC_UNLOCK(p); + if (old_kiop != NULL) { + sx_sunlock(&allproc_lock); + ktr_io_params_free(old_kiop); + goto restart; + } } sx_sunlock(&allproc_lock); - if (vrele_count > 0) { - while (vrele_count-- > 0) - vrele(vp); - } goto done; } /* @@ -1021,9 +1085,9 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) } nfound++; if (descend) - ret |= ktrsetchildren(td, p, ops, facs, vp); + ret |= ktrsetchildren(td, p, ops, facs, kiop); else - ret |= ktrops(td, p, ops, facs, vp); + ret |= ktrops(td, p, ops, facs, kiop); } if (nfound == 0) { sx_sunlock(&proctree_lock); @@ -1046,16 +1110,20 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) goto done; } if (descend) - ret |= ktrsetchildren(td, p, ops, facs, vp); + ret |= ktrsetchildren(td, p, ops, facs, kiop); else - ret |= ktrops(td, p, ops, facs, vp); + ret |= ktrops(td, p, ops, facs, kiop); } sx_sunlock(&proctree_lock); if (!ret) error = EPERM; done: - if (vp != NULL) - (void) vn_close(vp, FWRITE, td->td_ucred, td); + if (kiop != NULL) { + mtx_lock(&ktrace_mtx); + kiop = ktr_io_params_rele(kiop); + mtx_unlock(&ktrace_mtx); + ktr_io_params_free(kiop); + } ktrace_exit(td); return (error); #else /* !KTRACE */ @@ -1099,10 +1167,10 @@ sys_utrace(struct thread *td, struct utrace_args *uap) #ifdef KTRACE static int -ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp) +ktrops(struct thread *td, struct proc *p, int ops, int facs, + struct ktr_io_params *new_kiop) { - struct vnode *tracevp = NULL; - struct ucred *tracecred = NULL; + struct ktr_io_params *old_kiop; PROC_LOCK_ASSERT(p, MA_OWNED); if (!ktrcanset(td, p)) { @@ -1114,19 +1182,18 @@ ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp) PROC_UNLOCK(p); return (1); } + old_kiop = NULL; mtx_lock(&ktrace_mtx); if (ops == KTROP_SET) { - if (p->p_tracevp != vp) { - /* - * if trace file already in use, relinquish below - */ - tracevp = p->p_tracevp; - VREF(vp); - p->p_tracevp = vp; + if (p->p_ktrioparms != NULL && + p->p_ktrioparms->vp != new_kiop->vp) { + /* if trace file already in use, relinquish below */ + old_kiop = ktr_io_params_rele(p->p_ktrioparms); + p->p_ktrioparms = NULL; } - if (p->p_tracecred != td->td_ucred) { - tracecred = p->p_tracecred; - p->p_tracecred = crhold(td->td_ucred); + if (p->p_ktrioparms == NULL) { + p->p_ktrioparms = new_kiop; + ktr_io_params_ref(new_kiop); } p->p_traceflag |= facs; if (priv_check(td, PRIV_KTRACE) == 0) @@ -1135,23 +1202,20 @@ ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp) /* KTROP_CLEAR */ if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) /* no more tracing */ - ktr_freeproc(p, &tracecred, &tracevp); + old_kiop = ktr_freeproc(p); } mtx_unlock(&ktrace_mtx); if ((p->p_traceflag & KTRFAC_MASK) != 0) ktrprocctor_entered(td, p); PROC_UNLOCK(p); - if (tracevp != NULL) - vrele(tracevp); - if (tracecred != NULL) - crfree(tracecred); + ktr_io_params_free(old_kiop); return (1); } static int ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, - struct vnode *vp) + struct ktr_io_params *new_kiop) { struct proc *p; int ret = 0; @@ -1160,7 +1224,7 @@ ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, PROC_LOCK_ASSERT(p, MA_OWNED); sx_assert(&proctree_lock, SX_LOCKED); for (;;) { - ret |= ktrops(td, p, ops, facs, vp); + ret |= ktrops(td, p, ops, facs, new_kiop); /* * If this process has children, descend to them next, * otherwise do any siblings, and if done with this level, @@ -1185,6 +1249,7 @@ ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, static void ktr_writerequest(struct thread *td, struct ktr_request *req) { + struct ktr_io_params *kiop; struct ktr_header *kth; struct vnode *vp; struct proc *p; @@ -1195,6 +1260,8 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) int datalen, buflen; int error; + p = td->td_proc; + /* * We hold the vnode and credential for use in I/O in case ktrace is * disabled on the process as we write out the request. @@ -1203,20 +1270,22 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) * the vnode has been closed. */ mtx_lock(&ktrace_mtx); - vp = td->td_proc->p_tracevp; - cred = td->td_proc->p_tracecred; + + kiop = p->p_ktrioparms; /* - * If vp is NULL, the vp has been cleared out from under this - * request, so just drop it. Make sure the credential and vnode are - * in sync: we should have both or neither. + * If kiop is NULL, it has been cleared out from under this + * request, so just drop it. */ - if (vp == NULL) { - KASSERT(cred == NULL, ("ktr_writerequest: cred != NULL")); + if (kiop == NULL) { mtx_unlock(&ktrace_mtx); return; } - VREF(vp); + + vp = kiop->vp; + cred = kiop->cr; + + vrefact(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); crhold(cred); mtx_unlock(&ktrace_mtx); @@ -1260,7 +1329,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) VOP_UNLOCK(vp); vn_finished_write(mp); crfree(cred); - if (!error) { + if (error == 0) { vrele(vp); return; } @@ -1270,24 +1339,17 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) * process. Other processes might still be suitable for * writes to this vnode. */ - p = td->td_proc; log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped for pid %d\n", error, p->p_pid); - cred = NULL; - sx_slock(&allproc_lock); + PROC_LOCK(p); mtx_lock(&ktrace_mtx); - if (p->p_tracevp == vp) - ktr_freeproc(p, &cred, NULL); + if (p->p_ktrioparms != NULL && p->p_ktrioparms->vp == vp) + kiop = ktr_freeproc(p); mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); - if (cred != NULL) { - crfree(cred); - cred = NULL; - } - sx_sunlock(&allproc_lock); - vrele(vp); + ktr_io_params_free(kiop); vrele(vp); } diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 33f168836370..ec732e8db060 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -75,6 +75,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef KTRACE +#include +#endif #ifdef DDB #include @@ -1058,7 +1061,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) kp->ki_args = p->p_args; kp->ki_textvp = p->p_textvp; #ifdef KTRACE - kp->ki_tracep = p->p_tracevp; + kp->ki_tracep = ktr_get_tracevp(p, false); kp->ki_traceflag = p->p_traceflag; #endif kp->ki_fd = p->p_fd; diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index a0b02f7d3ac5..c4ab985722c0 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -265,6 +265,10 @@ struct ktr_struct_array { #define KTRFAC_DROP 0x20000000 /* last event was dropped */ #ifdef _KERNEL +struct ktr_io_params; + +struct vnode *ktr_get_tracevp(struct proc *, bool); +void ktr_io_params_free(struct ktr_io_params *); void ktrnamei(char *); void ktrcsw(int, int, const char *); void ktrpsig(int, sig_t, sigset_t *, int); @@ -275,7 +279,7 @@ void ktrsyscall(int, int narg, register_t args[]); void ktrsysctl(int *name, u_int namelen); void ktrsysret(int, int, register_t); void ktrprocctor(struct proc *); -void ktrprocexec(struct proc *, struct ucred **, struct vnode **); +struct ktr_io_params *ktrprocexec(struct proc *); void ktrprocexit(struct thread *); void ktrprocfork(struct proc *, struct proc *); void ktruserret(struct thread *); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index b47af58c34be..fb5714818163 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -650,8 +650,8 @@ struct proc { int p_profthreads; /* (c) Num threads in addupc_task. */ volatile int p_exitthreads; /* (j) Number of threads exiting */ int p_traceflag; /* (o) Kernel trace points. */ - struct vnode *p_tracevp; /* (c + o) Trace to vnode. */ - struct ucred *p_tracecred; /* (o) Credentials to trace with. */ + struct ktr_io_params *p_ktrioparms; /* (c + o) Params for ktrace. */ + void *p_pad0; struct vnode *p_textvp; /* (b) Vnode of executable. */ u_int p_lock; /* (c) Proclock (prevent swap) count. */ struct sigiolst p_sigiolst; /* (c) List of sigio sources. */ From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F259465444B; Sun, 13 Jun 2021 01:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpR6Db0z4jbc; Sun, 13 Jun 2021 01:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF75518C58; Sun, 13 Jun 2021 01:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j3K7051881; Sun, 13 Jun 2021 01:45:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j3rh051880; Sun, 13 Jun 2021 01:45:03 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:03 GMT Message-Id: <202106130145.15D1j3rh051880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 66200d321826 - stable/13 - ktrace: use the limit of the trace initiator for file size limit on writes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66200d32182612b90e3602877ff9a2deb867b252 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66200d32182612b90e3602877ff9a2deb867b252 commit 66200d32182612b90e3602877ff9a2deb867b252 Author: Konstantin Belousov AuthorDate: 2021-05-14 23:51:01 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: use the limit of the trace initiator for file size limit on writes (cherry picked from commit 02645b886bc62dfd8a998fd51d2e6c1bbca03ecb) --- sys/kern/kern_ktrace.c | 6 ++++++ sys/kern/vfs_vnops.c | 18 ++++++++++-------- sys/sys/proc.h | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index c923149ed129..d44f6b9ab994 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -148,6 +149,7 @@ static struct sx ktrace_sx; struct ktr_io_params { struct vnode *vp; struct ucred *cr; + off_t lim; u_int refs; }; @@ -465,6 +467,7 @@ ktr_io_params_alloc(struct thread *td, struct vnode *vp) res = malloc(sizeof(struct ktr_io_params), M_KTRACE, M_WAITOK); res->vp = vp; res->cr = crhold(td->td_ucred); + res->lim = lim_cur(td, RLIMIT_FSIZE); res->refs = 1; return (res); } @@ -1257,6 +1260,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) struct uio auio; struct iovec aiov[3]; struct mount *mp; + off_t lim; int datalen, buflen; int error; @@ -1284,6 +1288,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) vp = kiop->vp; cred = kiop->cr; + lim = kiop->lim; vrefact(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); @@ -1321,6 +1326,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + td->td_ktr_io_lim = lim; #ifdef MAC error = mac_vnode_check_write(cred, NOCRED, vp); if (error == 0) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 8be30df40dc5..fb94b1470a2d 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2360,18 +2360,20 @@ int vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, struct thread *td) { + off_t lim; if (vp->v_type != VREG || td == NULL || (td->td_pflags2 & TDP2_ACCT) != 0) return (0); - if ((uoff_t)uio->uio_offset + uio->uio_resid > - lim_cur(td, RLIMIT_FSIZE)) { - PROC_LOCK(td->td_proc); - kern_psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - return (0); + ktr_write = (td->td_pflags & TDP_INKTRACE) != 0; + lim = ktr_write ? td->td_ktr_io_lim : lim_cur(td, RLIMIT_FSIZE); + if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) + return (0); + + PROC_LOCK(td->td_proc); + kern_psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); + return (EFBIG); } int diff --git a/sys/sys/proc.h b/sys/sys/proc.h index fb5714818163..d4476ac8d410 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -377,6 +377,7 @@ struct thread { void *td_lkpi_task; /* LinuxKPI task struct pointer */ int td_pmcpend; void *td_coredump; /* (c) coredump request. */ + off_t td_ktr_io_lim; /* (k) limit for ktrace file size */ #ifdef EPOCH_TRACE SLIST_HEAD(, epoch_tracker) td_epochs; #endif From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57B70654239; Sun, 13 Jun 2021 01:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpT0Jw9z4jPq; Sun, 13 Jun 2021 01:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA05E187E6; Sun, 13 Jun 2021 01:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j4vD051905; Sun, 13 Jun 2021 01:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j4D1051904; Sun, 13 Jun 2021 01:45:04 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:04 GMT Message-Id: <202106130145.15D1j4D1051904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a34a4807c9f7 - stable/13 - ktrace: add a kern.ktrace.filesize_limit_signal knob MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a34a4807c9f7fa4001e4b4fa8bf319b08b51390f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:05 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a34a4807c9f7fa4001e4b4fa8bf319b08b51390f commit a34a4807c9f7fa4001e4b4fa8bf319b08b51390f Author: Konstantin Belousov AuthorDate: 2021-05-18 16:05:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 ktrace: add a kern.ktrace.filesize_limit_signal knob (cherry picked from commit ea2b64c2413355ac0d5fc6ff597342e9437a34d4) --- sys/kern/kern_ktrace.c | 10 ++++++++++ sys/kern/vfs_vnops.c | 10 +++++++--- sys/sys/ktrace.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index d44f6b9ab994..9568a752d820 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -142,6 +142,16 @@ u_int ktr_geniosize = PAGE_SIZE; SYSCTL_UINT(_kern_ktrace, OID_AUTO, genio_size, CTLFLAG_RWTUN, &ktr_geniosize, 0, "Maximum size of genio event payload"); +/* + * Allow to not to send signal to traced process, in which context the + * ktr record is written. The limit is applied from the process that + * set up ktrace, so killing the traced process is not completely fair. + */ +int ktr_filesize_limit_signal = 0; +SYSCTL_INT(_kern_ktrace, OID_AUTO, filesize_limit_signal, CTLFLAG_RWTUN, + &ktr_filesize_limit_signal, 0, + "Send SIGXFSZ to the traced process when the log size limit is exceeded"); + static int print_message = 1; static struct mtx ktrace_mtx; static struct sx ktrace_sx; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index fb94b1470a2d..9c3d261a25c4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2361,6 +2362,7 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, struct thread *td) { off_t lim; + bool ktr_write; if (vp->v_type != VREG || td == NULL || (td->td_pflags2 & TDP2_ACCT) != 0) @@ -2370,9 +2372,11 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) return (0); - PROC_LOCK(td->td_proc); - kern_psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); + if (!ktr_write || ktr_filesize_limit_signal) { + PROC_LOCK(td->td_proc); + kern_psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); + } return (EFBIG); } diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index c4ab985722c0..50030d002f97 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -299,6 +299,7 @@ void ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *, #define ktrstat_error(s, error) \ ktrstruct_error("stat", (s), sizeof(struct stat), error) extern u_int ktr_geniosize; +extern int ktr_filesize_limit_signal; #else #include From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C2AB6542DF; Sun, 13 Jun 2021 01:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpV1bXFz4jMR; Sun, 13 Jun 2021 01:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0CB318ACD; Sun, 13 Jun 2021 01:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j5wR051929; Sun, 13 Jun 2021 01:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j5Bh051928; Sun, 13 Jun 2021 01:45:05 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:05 GMT Message-Id: <202106130145.15D1j5Bh051928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cf852eda68a8 - stable/13 - libkvm: Fix build after removal of p_tracevp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cf852eda68a8f66c9f7ce0f0b9cecd1d58915685 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:06 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf852eda68a8f66c9f7ce0f0b9cecd1d58915685 commit cf852eda68a8f66c9f7ce0f0b9cecd1d58915685 Author: Konstantin Belousov AuthorDate: 2021-05-22 12:43:57 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 libkvm: Fix build after removal of p_tracevp (cherry picked from commit e67ef6ce667d42a235a70914159048e10039145d) --- lib/libkvm/kvm_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 63f7c2a8a824..aad2e0a672ed 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -218,7 +218,7 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p, /* kp->ki_kstack = proc.p_thread.td_kstack; XXXKSE */ kp->ki_args = proc.p_args; kp->ki_numthreads = proc.p_numthreads; - kp->ki_tracep = proc.p_tracevp; + kp->ki_tracep = NULL; /* XXXKIB do not expose ktr_io_params */ kp->ki_textvp = proc.p_textvp; kp->ki_fd = proc.p_fd; kp->ki_pd = proc.p_pd; From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EF446540E1; Sun, 13 Jun 2021 01:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpW27Cjz4jbv; Sun, 13 Jun 2021 01:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28D0918B41; Sun, 13 Jun 2021 01:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j7SH051959; Sun, 13 Jun 2021 01:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j7Wl051958; Sun, 13 Jun 2021 01:45:07 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:07 GMT Message-Id: <202106130145.15D1j7Wl051958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c1cbdaa22a33 - stable/13 - Fix tinderbox build after 1762f674ccb571e6 ktrace commit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c1cbdaa22a3377715afd271df4fb5acdeab4bead Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c1cbdaa22a3377715afd271df4fb5acdeab4bead commit c1cbdaa22a3377715afd271df4fb5acdeab4bead Author: Mateusz Guzik AuthorDate: 2021-05-22 19:37:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:33 +0000 Fix tinderbox build after 1762f674ccb571e6 ktrace commit. (cherry picked from commit 154f0ecc10abdd3c23d233bf85e292011a130583) --- sys/kern/kern_exec.c | 6 ++++-- sys/kern/vfs_vnops.c | 2 ++ sys/sys/ktrace.h | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2936e246f706..01ec7de5d3c1 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -398,7 +398,9 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, static const char fexecv_proc_title[] = "(fexecv)"; imgp = &image_params; +#ifdef KTRACE kiop = NULL; +#endif /* * Lock the process and set the P_INEXEC flag to indicate that @@ -788,8 +790,6 @@ interpret: * we do not regain any tracing during a possible block. */ setsugid(p); - kiop = NULL; - #ifdef KTRACE kiop = ktrprocexec(p); #endif @@ -946,7 +946,9 @@ exec_fail: */ if (oldtextvp != NULL) vrele(oldtextvp); +#ifdef KTRACE ktr_io_params_free(kiop); +#endif pargs_drop(oldargs); pargs_drop(newargs); if (oldsigacts != NULL) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 9c3d261a25c4..95b6821bdff5 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2372,11 +2372,13 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) return (0); +#ifdef KTRACE if (!ktr_write || ktr_filesize_limit_signal) { PROC_LOCK(td->td_proc); kern_psignal(td->td_proc, SIGXFSZ); PROC_UNLOCK(td->td_proc); } +#endif return (EFBIG); } diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index 50030d002f97..1fcac8e0cd26 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -267,7 +267,16 @@ struct ktr_struct_array { #ifdef _KERNEL struct ktr_io_params; +#ifdef KTRACE struct vnode *ktr_get_tracevp(struct proc *, bool); +#else +static inline struct vnode * +ktr_get_tracevp(struct proc *p, bool ref) +{ + + return (NULL); +} +#endif void ktr_io_params_free(struct ktr_io_params *); void ktrnamei(char *); void ktrcsw(int, int, const char *); From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 347B3653FEF; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpX6405z4jc3; Sun, 13 Jun 2021 01:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48A8B18CAB; Sun, 13 Jun 2021 01:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j8Cl051985; Sun, 13 Jun 2021 01:45:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j8XW051984; Sun, 13 Jun 2021 01:45:08 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:08 GMT Message-Id: <202106130145.15D1j8XW051984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e7d30206032a - stable/13 - Fix a braino in previous. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7d30206032aac1c9e9fe4f02b75cbdf61f44dfa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:09 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d30206032aac1c9e9fe4f02b75cbdf61f44dfa commit e7d30206032aac1c9e9fe4f02b75cbdf61f44dfa Author: Mateusz Guzik AuthorDate: 2021-05-22 19:48:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 Fix a braino in previous. (cherry picked from commit 48235c377f960050e9129aa847d7d73019561c82) --- sys/kern/vfs_vnops.c | 2 -- sys/sys/ktrace.h | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 95b6821bdff5..9c3d261a25c4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2372,13 +2372,11 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) return (0); -#ifdef KTRACE if (!ktr_write || ktr_filesize_limit_signal) { PROC_LOCK(td->td_proc); kern_psignal(td->td_proc, SIGXFSZ); PROC_UNLOCK(td->td_proc); } -#endif return (EFBIG); } diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index 1fcac8e0cd26..739f5a5d7ea0 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -308,8 +308,12 @@ void ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *, #define ktrstat_error(s, error) \ ktrstruct_error("stat", (s), sizeof(struct stat), error) extern u_int ktr_geniosize; +#ifdef KTRACE extern int ktr_filesize_limit_signal; #else +#define ktr_filesize_limit_signal 0 +#endif +#else #include From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC240654072; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpY48Hpz4jQ3; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 680AB18D85; Sun, 13 Jun 2021 01:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1j9eG052009; Sun, 13 Jun 2021 01:45:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1j9jM052008; Sun, 13 Jun 2021 01:45:09 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:09 GMT Message-Id: <202106130145.15D1j9jM052008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1fef441079c3 - stable/13 - Fix limit testing after 1762f674ccb571e6 ktrace commit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fef441079c38de177f3456e54f55931aebf2655 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:09 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1fef441079c38de177f3456e54f55931aebf2655 commit 1fef441079c38de177f3456e54f55931aebf2655 Author: Mateusz Guzik AuthorDate: 2021-05-22 20:12:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 Fix limit testing after 1762f674ccb571e6 ktrace commit. (cherry picked from commit e71d5c7331700504e58cf1a35dca529381723e02) --- sys/kern/vfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 9c3d261a25c4..cf6a1f715d83 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2369,7 +2369,7 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, return (0); ktr_write = (td->td_pflags & TDP_INKTRACE) != 0; lim = ktr_write ? td->td_ktr_io_lim : lim_cur(td, RLIMIT_FSIZE); - if ((uoff_t)uio->uio_offset + uio->uio_resid < lim) + if ((uoff_t)uio->uio_offset + uio->uio_resid <= lim) return (0); if (!ktr_write || ktr_filesize_limit_signal) { From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E3DB653FFB; Sun, 13 Jun 2021 01:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpc2W7Yz4jpy; Sun, 13 Jun 2021 01:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A83BC18ACF; Sun, 13 Jun 2021 01:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1jBhK052057; Sun, 13 Jun 2021 01:45:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1jB2q052056; Sun, 13 Jun 2021 01:45:11 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:11 GMT Message-Id: <202106130145.15D1jB2q052056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 35e0ffef8e07 - stable/13 - ktrace: Remove vrele() at the end of ktr_writerequest() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 35e0ffef8e07e95d6351bcb3677b181c56e9b317 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:12 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=35e0ffef8e07e95d6351bcb3677b181c56e9b317 commit 35e0ffef8e07e95d6351bcb3677b181c56e9b317 Author: Mark Johnston AuthorDate: 2021-05-23 17:20:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 ktrace: Remove vrele() at the end of ktr_writerequest() (cherry picked from commit 6f6cd1e8e8aa3a48b35598992f1b6c21003d35cd) --- sys/kern/kern_ktrace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index f8b2cf83e005..1b9e0942b702 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1366,7 +1366,6 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) PROC_UNLOCK(p); ktr_io_params_free(kiop1); ktr_io_params_free(kiop); - vrele(vp); } /* From owner-dev-commits-src-all@freebsd.org Sun Jun 13 01:45:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 690806540EF; Sun, 13 Jun 2021 01:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2cpZ4xS3z4jvC; Sun, 13 Jun 2021 01:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89C7918ACE; Sun, 13 Jun 2021 01:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D1jA8T052033; Sun, 13 Jun 2021 01:45:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D1jAvT052032; Sun, 13 Jun 2021 01:45:10 GMT (envelope-from git) Date: Sun, 13 Jun 2021 01:45:10 GMT Message-Id: <202106130145.15D1jAvT052032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cad10e50dce3 - stable/13 - ktrace: fix a race between writes and close MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cad10e50dce3732f4d664f8edf0c1d6818373239 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 01:45:11 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cad10e50dce3732f4d664f8edf0c1d6818373239 commit cad10e50dce3732f4d664f8edf0c1d6818373239 Author: Konstantin Belousov AuthorDate: 2021-05-22 12:40:00 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-13 01:22:34 +0000 ktrace: fix a race between writes and close (cherry picked from commit fc369a353b5b5e0f8046687fcbd78a7cd9ad1810) --- sys/kern/kern_ktrace.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 9568a752d820..f8b2cf83e005 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1262,7 +1262,7 @@ ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, static void ktr_writerequest(struct thread *td, struct ktr_request *req) { - struct ktr_io_params *kiop; + struct ktr_io_params *kiop, *kiop1; struct ktr_header *kth; struct vnode *vp; struct proc *p; @@ -1277,14 +1277,10 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) p = td->td_proc; /* - * We hold the vnode and credential for use in I/O in case ktrace is + * We reference the kiop for use in I/O in case ktrace is * disabled on the process as we write out the request. - * - * XXXRW: This is not ideal: we could end up performing a write after - * the vnode has been closed. */ mtx_lock(&ktrace_mtx); - kiop = p->p_ktrioparms; /* @@ -1296,13 +1292,12 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) return; } + ktr_io_params_ref(kiop); vp = kiop->vp; cred = kiop->cr; lim = kiop->lim; - vrefact(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); - crhold(cred); mtx_unlock(&ktrace_mtx); kth = &req->ktr_header; @@ -1344,9 +1339,11 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) error = VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, cred); VOP_UNLOCK(vp); vn_finished_write(mp); - crfree(cred); if (error == 0) { - vrele(vp); + mtx_lock(&ktrace_mtx); + kiop = ktr_io_params_rele(kiop); + mtx_unlock(&ktrace_mtx); + ktr_io_params_free(kiop); return; } @@ -1359,12 +1356,15 @@ ktr_writerequest(struct thread *td, struct ktr_request *req) "ktrace write failed, errno %d, tracing stopped for pid %d\n", error, p->p_pid); + kiop1 = NULL; PROC_LOCK(p); mtx_lock(&ktrace_mtx); if (p->p_ktrioparms != NULL && p->p_ktrioparms->vp == vp) - kiop = ktr_freeproc(p); + kiop1 = ktr_freeproc(p); + kiop = ktr_io_params_rele(kiop); mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); + ktr_io_params_free(kiop1); ktr_io_params_free(kiop); vrele(vp); } From owner-dev-commits-src-all@freebsd.org Sun Jun 13 02:12:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3038654ACE for ; Sun, 13 Jun 2021 02:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2dQY5wL7z4lBw; Sun, 13 Jun 2021 02:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B354019171; Sun, 13 Jun 2021 02:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D2CrUx092103; Sun, 13 Jun 2021 02:12:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D2CrIe092102; Sun, 13 Jun 2021 02:12:53 GMT (envelope-from git) Date: Sun, 13 Jun 2021 02:12:53 GMT Message-Id: <202106130212.15D2CrIe092102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 75b4cbf62590..afa7b3484556 - vendor/openzfs/master - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: afa7b3484556d3ae610a34582ce5ebd2c3e27bba X-Git-Oldrev: 75b4cbf62590c23fac3667537961a2a75fdc2cc3 X-Git-Newrev: afa7b3484556d3ae610a34582ce5ebd2c3e27bba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 02:12:53 -0000 The branch vendor/openzfs/master has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=75b4cbf62590..afa7b3484556 b828cf1d01d2 zed-functions.sh: zed_lock(): don't truncate lock e20c9330d7b6 zed.d/all-debug.sh: simplify 1fcfc21cd8cc zed.d/history_event-zfs-list-cacher.sh.in: parallelise, simplify 08cd0717359b Correct a flaw in the Python 3 version checking 88af959b2430 Fix minor shellcheck 0.7.2 warnings b0f3e8a6ebe1 man: use one Makefile, use OpenZFS for .Os 2badb3457ad3 Move properties, parameters, events, and concepts around manual sections 1b37cc1abee9 Consistentify miscellaneous style on remaining manpages 4b7ed6a286c3 zgenhostid.8: revisit d406a695c640 libefi: remove efi_auto_sense() 327c904615db lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 860051f1d1ef Added error for writing to /dev/ on Linux 371f88d96fe0 Remove pool io kstats (#12212) eec5ba113e1d dracut: 90zfs: respect zfs_force=1 on systemd systems ffdf019cb317 Re-embed multilist_t storage 9d639d879954 ZTS: Add zfs_clone_livelist_dedup.ksh to Makefile.am 1a345d645a53 Added uncompress requirement 3aa81a6635bf linux/libzutil: use ARRAY_SIZE instead of constant for search paths 0854d4c186f5 libzutil: add zfs_{base,dir}name() bf80fb53f59c linux/libzutil: zpool_open_func: don't dup name, extract untouchables 64dfdaba372f libzutil: import: filter out unsuitable files earlier feb04e66802e Forbid basename(3) and dirname(3) 10bcc4da6cec scripts/commitcheck.sh: fix false positive for signed commits afa7b3484556 Do not hash unlinked inodes From owner-dev-commits-src-all@freebsd.org Sun Jun 13 02:16:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87810654F82; Sun, 13 Jun 2021 02:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2dVg3Gpmz4l58; Sun, 13 Jun 2021 02:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 594FD19046; Sun, 13 Jun 2021 02:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D2GRpp092553; Sun, 13 Jun 2021 02:16:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D2GRB5092552; Sun, 13 Jun 2021 02:16:27 GMT (envelope-from git) Date: Sun, 13 Jun 2021 02:16:27 GMT Message-Id: <202106130216.15D2GRB5092552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: cfd6c9b99f49 - stable/13 - vfs: slightly rework vn_rlimit_fsize MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cfd6c9b99f49dd24860456742eecccabfc100326 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 02:16:27 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=cfd6c9b99f49dd24860456742eecccabfc100326 commit cfd6c9b99f49dd24860456742eecccabfc100326 Author: Mateusz Guzik AuthorDate: 2021-05-29 17:33:50 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-13 02:15:25 +0000 vfs: slightly rework vn_rlimit_fsize (cherry picked from commit 478c52f1e3654213c7d79096a2bc7f908e0b501d) --- sys/kern/vfs_vnops.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index cf6a1f715d83..fc5118e8aa24 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2364,12 +2364,25 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, off_t lim; bool ktr_write; - if (vp->v_type != VREG || td == NULL || - (td->td_pflags2 & TDP2_ACCT) != 0) + if (td == NULL) return (0); + + /* + * There are conditions where the limit is to be ignored. + * However, since it is almost never reached, check it first. + */ ktr_write = (td->td_pflags & TDP_INKTRACE) != 0; - lim = ktr_write ? td->td_ktr_io_lim : lim_cur(td, RLIMIT_FSIZE); - if ((uoff_t)uio->uio_offset + uio->uio_resid <= lim) + lim = lim_cur(td, RLIMIT_FSIZE); + if (__predict_false(ktr_write)) + lim = td->td_ktr_io_lim; + if (__predict_true((uoff_t)uio->uio_offset + uio->uio_resid <= lim)) + return (0); + + /* + * The limit is reached. + */ + if (vp->v_type != VREG || + (td->td_pflags2 & TDP2_ACCT) != 0) return (0); if (!ktr_write || ktr_filesize_limit_signal) { From owner-dev-commits-src-all@freebsd.org Sun Jun 13 02:45:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E000A655226; Sun, 13 Jun 2021 02:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2f7z5lVGz4mjw; Sun, 13 Jun 2021 02:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD31B193E3; Sun, 13 Jun 2021 02:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D2jJAl031932; Sun, 13 Jun 2021 02:45:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D2jJMH031931; Sun, 13 Jun 2021 02:45:19 GMT (envelope-from git) Date: Sun, 13 Jun 2021 02:45:19 GMT Message-Id: <202106130245.15D2jJMH031931@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 3ff01b231dfa - main - zfs: merge openzfs/zfs@afa7b3484 (master) into main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ff01b231dfa83d518854c63e7c9cd1debd1139e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 02:45:19 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=3ff01b231dfa83d518854c63e7c9cd1debd1139e commit 3ff01b231dfa83d518854c63e7c9cd1debd1139e Merge: 345077ccd521 afa7b3484556 Author: Martin Matuska AuthorDate: 2021-06-13 02:03:58 +0000 Commit: Martin Matuska CommitDate: 2021-06-13 02:38:47 +0000 zfs: merge openzfs/zfs@afa7b3484 (master) into main Notable upstream pull request merges: #12149: Multiple man-pages: Move to appropriate section #12158: Re-embed multilist_t storage #12191: Convert non-libzpool libraries to -fvisibility=hidden #12196: Unify manpage makefiles, move pages to better sexions, ... #12210: libzutil: import filtering optimisation #12212: Remove pool io kstats Obtained from: OpenZFS OpenZFS commit: afa7b3484556d3ae610a34582ce5ebd2c3e27bba ObsoleteFiles.inc | 10 + cddl/sbin/zfs/Makefile | 5 +- cddl/sbin/zpool/Makefile | 13 +- .../.github/workflows/zfs-tests-functional.yml | 3 +- .../openzfs/.github/workflows/zfs-tests-sanity.yml | 3 +- sys/contrib/openzfs/.github/workflows/zloop.yml | 4 +- sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c | 3 +- sys/contrib/openzfs/cmd/zed/zed.d/Makefile.am | 3 + sys/contrib/openzfs/cmd/zed/zed.d/all-debug.sh | 16 +- sys/contrib/openzfs/cmd/zed/zed.d/all-syslog.sh | 1 + .../zed/zed.d/history_event-zfs-list-cacher.sh.in | 19 +- sys/contrib/openzfs/cmd/zed/zed.d/zed-functions.sh | 2 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 38 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 6 +- .../ZFS-pool-latency-heatmaps-influxdb.json | 4 +- sys/contrib/openzfs/config/Rules.am | 3 + sys/contrib/openzfs/config/always-pyzfs.m4 | 15 + sys/contrib/openzfs/config/ax_python_devel.m4 | 33 +- sys/contrib/openzfs/configure.ac | 3 - .../openzfs/contrib/dracut/90zfs/.gitignore | 13 +- .../openzfs/contrib/dracut/90zfs/Makefile.am | 3 +- .../dracut/90zfs/import-opts-generator.sh.in | 5 + .../contrib/dracut/90zfs/module-setup.sh.in | 27 +- .../etc/systemd/system/zfs-import-cache.service.in | 2 +- .../etc/systemd/system/zfs-import-scan.service.in | 2 +- sys/contrib/openzfs/include/libnvpair.h | 37 +- sys/contrib/openzfs/include/libzfs_core.h | 130 +- sys/contrib/openzfs/include/libzfsbootenv.h | 20 +- sys/contrib/openzfs/include/libzutil.h | 3 + .../openzfs/include/os/freebsd/spl/sys/kstat.h | 4 - .../openzfs/include/os/linux/spl/sys/kstat.h | 4 - sys/contrib/openzfs/include/sys/arc_impl.h | 12 +- sys/contrib/openzfs/include/sys/avl.h | 36 +- sys/contrib/openzfs/include/sys/avl_impl.h | 5 +- sys/contrib/openzfs/include/sys/dmu_objset.h | 4 +- sys/contrib/openzfs/include/sys/efi_partition.h | 20 +- sys/contrib/openzfs/include/sys/metaslab_impl.h | 2 +- sys/contrib/openzfs/include/sys/multilist.h | 3 +- sys/contrib/openzfs/include/sys/nvpair.h | 443 ++- sys/contrib/openzfs/include/sys/spa.h | 1 - sys/contrib/openzfs/include/sys/zfs_context.h | 6 - sys/contrib/openzfs/include/thread_pool.h | 36 +- sys/contrib/openzfs/lib/libavl/Makefile.am | 1 + sys/contrib/openzfs/lib/libefi/Makefile.am | 1 + sys/contrib/openzfs/lib/libefi/rdwr_efi.c | 88 - sys/contrib/openzfs/lib/libnvpair/Makefile.am | 1 + sys/contrib/openzfs/lib/libnvpair/libnvpair.abi | 2468 ++++++------ sys/contrib/openzfs/lib/libshare/Makefile.am | 2 + sys/contrib/openzfs/lib/libshare/nfs.c | 2 +- sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c | 2 +- sys/contrib/openzfs/lib/libshare/os/linux/nfs.c | 2 +- sys/contrib/openzfs/lib/libspl/include/libshare.h | 14 +- sys/contrib/openzfs/lib/libspl/include/sys/kstat.h | 6 - sys/contrib/openzfs/lib/libtpool/Makefile.am | 2 + sys/contrib/openzfs/lib/libzfs/libzfs.abi | 183 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 1 + sys/contrib/openzfs/lib/libzfs_core/Makefile.am | 2 + .../openzfs/lib/libzfs_core/libzfs_core.abi | 3976 ++++++++++---------- sys/contrib/openzfs/lib/libzfsbootenv/Makefile.am | 2 + sys/contrib/openzfs/lib/libzpool/kernel.c | 48 +- sys/contrib/openzfs/lib/libzutil/Makefile.am | 1 + .../lib/libzutil/os/freebsd/zutil_import_os.c | 2 +- .../lib/libzutil/os/linux/zutil_import_os.c | 58 +- .../openzfs/lib/libzutil/zutil_device_path.c | 16 + sys/contrib/openzfs/lib/libzutil/zutil_import.c | 52 +- sys/contrib/openzfs/man/Makefile.am | 118 +- sys/contrib/openzfs/man/man1/Makefile.am | 12 - sys/contrib/openzfs/man/man1/arcstat.1 | 16 +- sys/contrib/openzfs/man/man1/cstyle.1 | 21 +- sys/contrib/openzfs/man/man1/raidz_test.1 | 28 +- sys/contrib/openzfs/man/man1/zhack.1 | 10 +- sys/contrib/openzfs/man/man1/ztest.1 | 2 +- .../{man5/spl-module-parameters.5 => man4/spl.4} | 5 +- .../{man5/zfs-module-parameters.5 => man4/zfs.4} | 7 +- sys/contrib/openzfs/man/man5/Makefile.am | 16 - sys/contrib/openzfs/man/man5/vdev_id.conf.5 | 38 +- sys/contrib/openzfs/man/man5/zfs-events.5 | 448 --- .../man/{man8/zfsconcepts.8 => man7/zfsconcepts.7} | 2 +- .../man/{man8/zfsprops.8 => man7/zfsprops.7} | 22 +- .../zpool-features.5 => man7/zpool-features.7} | 4 +- .../{man8/zpoolconcepts.8 => man7/zpoolconcepts.7} | 4 +- .../man/{man8/zpoolprops.8 => man7/zpoolprops.7} | 14 +- sys/contrib/openzfs/man/man8/Makefile.am | 102 - sys/contrib/openzfs/man/man8/fsck.zfs.8 | 8 +- sys/contrib/openzfs/man/man8/mount.zfs.8 | 2 +- sys/contrib/openzfs/man/man8/zed.8.in | 7 +- sys/contrib/openzfs/man/man8/zfs-bookmark.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-clone.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-create.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-jail.8 | 4 +- sys/contrib/openzfs/man/man8/zfs-list.8 | 8 +- sys/contrib/openzfs/man/man8/zfs-load-key.8 | 4 +- .../openzfs/man/man8/zfs-mount-generator.8.in | 4 +- sys/contrib/openzfs/man/man8/zfs-mount.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-receive.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 8 +- sys/contrib/openzfs/man/man8/zfs-set.8 | 12 +- sys/contrib/openzfs/man/man8/zfs-share.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-snapshot.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-upgrade.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-userspace.8 | 4 +- sys/contrib/openzfs/man/man8/zfs.8 | 10 +- sys/contrib/openzfs/man/man8/zgenhostid.8 | 62 +- sys/contrib/openzfs/man/man8/zpool-add.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-attach.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 14 +- sys/contrib/openzfs/man/man8/zpool-events.8 | 422 ++- sys/contrib/openzfs/man/man8/zpool-get.8 | 10 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-replace.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-split.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-sync.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-trim.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 12 +- sys/contrib/openzfs/man/man8/zpool.8 | 21 +- sys/contrib/openzfs/man/man8/zpool_influxdb.8 | 4 +- .../openzfs/module/os/freebsd/spl/spl_kstat.c | 62 - .../openzfs/module/os/linux/spl/spl-kstat.c | 66 - .../openzfs/module/os/linux/zfs/zfs_znode.c | 15 +- sys/contrib/openzfs/module/zfs/arc.c | 86 +- sys/contrib/openzfs/module/zfs/dbuf.c | 20 +- sys/contrib/openzfs/module/zfs/dmu_objset.c | 30 +- sys/contrib/openzfs/module/zfs/dnode.c | 2 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 3 +- sys/contrib/openzfs/module/zfs/dsl_pool.c | 3 +- sys/contrib/openzfs/module/zfs/metaslab.c | 24 +- sys/contrib/openzfs/module/zfs/multilist.c | 14 +- sys/contrib/openzfs/module/zfs/spa_stats.c | 50 - sys/contrib/openzfs/module/zfs/vdev_queue.c | 47 - sys/contrib/openzfs/rpm/generic/zfs-dkms.spec.in | 7 + sys/contrib/openzfs/rpm/generic/zfs-kmod.spec.in | 7 + sys/contrib/openzfs/rpm/generic/zfs.spec.in | 12 + sys/contrib/openzfs/scripts/commitcheck.sh | 12 +- sys/contrib/openzfs/scripts/make_gitrev.sh | 2 +- sys/contrib/openzfs/scripts/man-dates.sh | 2 +- sys/contrib/openzfs/scripts/zol2zfs-patch.sed | 2 +- .../functional/cli_root/zfs_destroy/Makefile.am | 1 + .../zfs-tests/tests/functional/ctime/Makefile.am | 2 + .../tests/zfs-tests/tests/functional/ctime/ctime.c | 13 +- .../tests/functional/l2arc/l2arc_mfuonly_pos.ksh | 2 +- sys/modules/zfs/zfs_config.h | 4 +- 145 files changed, 4822 insertions(+), 5129 deletions(-) diff --cc ObsoleteFiles.inc index df713cfd1fb0,000000000000..1e47821fe696 mode 100644,000000..100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@@ -1,15039 -1,0 +1,15049 @@@ +# +# $FreeBSD$ +# +# This file lists old files (OLD_FILES), libraries (OLD_LIBS) and +# directories (OLD_DIRS) which should get removed at an update. Recently +# removed entries first (with the date as a comment). Dynamic libraries are +# special cased (OLD_LIBS). Static libraries or the generic links to +# the dynamic libraries (lib*.so) should (if you don't know why to make an +# exception, make this a "must") be viewed as normal files (OLD_FILES). +# +# In case of a complete directory hierarchy the sorting is in depth first +# order. +# +# Files that are installed or removed depending on some build option +# are to be listed in /usr/src/tools/build/mk/OptionalObsoleteFiles.inc +# instead of in this file. +# +# Before you commit changes to this file please check if any entries in +# tools/build/mk/OptionalObsoleteFiles.inc can be removed. The following +# command tells which files are listed more than once regardless of some +# architecture specific conditionals, so you can not blindly trust the +# output: +# ( grep '+=' /usr/src/ObsoleteFiles.inc | sort -u ; \ +# grep '+=' /usr/src/tools/build/mk/OptionalObsoleteFiles.inc | sort -u) | \ +# sort | uniq -d +# +# To find regular duplicates not dependent on optional components, you can +# also use something that will not give you false positives, e.g.: +# for t in `make -V TARGETS universe`; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 TARGET=$t \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done +# +# For optional components, you can use the following to see if some entries +# in OptionalObsoleteFiles.inc have been obsoleted by ObsoleteFiles.inc +# for o in tools/build/options/WITH*; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 -D${o##*/} \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done + ++# 20210613: Rename OpenZFS manual pages ++OLD_FILES+=usr/share/man/man5/spl-module-parameters.5.gz ++OLD_FILES+=usr/share/man/man5/zfs-events.5.gz ++OLD_FILES+=usr/share/man/man5/zfs-module-parameters.5.gz ++OLD_FILES+=usr/share/man/man8/zfsconcepts.8 ++OLD_FILES+=usr/share/man/man8/zfsprops.8 ++OLD_FILES+=usr/share/man/man5/zpool-features.5.gz ++OLD_FILES+=usr/share/man/man8/zpoolconcepts.8 ++OLD_FILES+=usr/share/man/man8/zpoolprops.8 ++ +# 20210611: Remove svn and svnlite +OLD_FILES+=usr/bin/svn +OLD_FILES+=usr/bin/svnadmin +OLD_FILES+=usr/bin/svnbench +OLD_FILES+=usr/bin/svndumpfilter +OLD_FILES+=usr/bin/svnfsfs +OLD_FILES+=usr/bin/svnlite +OLD_FILES+=usr/bin/svnliteadmin +OLD_FILES+=usr/bin/svnlitebench +OLD_FILES+=usr/bin/svnlitedumpfilter +OLD_FILES+=usr/bin/svnlitefsfs +OLD_FILES+=usr/bin/svnlitelook +OLD_FILES+=usr/bin/svnlitemucc +OLD_FILES+=usr/bin/svnliterdump +OLD_FILES+=usr/bin/svnliteserve +OLD_FILES+=usr/bin/svnlitesync +OLD_FILES+=usr/bin/svnliteversion +OLD_FILES+=usr/bin/svnlook +OLD_FILES+=usr/bin/svnmucc +OLD_FILES+=usr/bin/svnrdump +OLD_FILES+=usr/bin/svnserve +OLD_FILES+=usr/bin/svnsync +OLD_FILES+=usr/bin/svnversion +OLD_FILES+=usr/share/man/man1/svnlite.1.gz + +# 20210607: remove ancontrol(8) related programs +OLD_FILES+=usr/sbin/ancontrol +OLD_FILES+=usr/share/man/man8/ancontrol.8.gz + +# 20210607: remove an(4) +OLD_FILES+=usr/include/dev/an/if_aironet_ieee.h +OLD_FILES+=usr/include/dev/an/if_anreg.h +OLD_FILES+=usr/share/man/man4/an.4.gz + +# 20210426: remove unused libexec/rc.d/addswap +OLD_FILES+=etc/rc.d/addswap + +# 20210413: Remove pfctlinput2 +OLD_FILES+=usr/share/man/man9/pfctlinput2.9.gz + +# 20210412: Remove kernel asymmetric crypto +OLD_FILES+=usr/share/man/man9/crypto_asym.9.gz +OLD_FILES+=usr/share/man/man9/crypto_kdispatch.9.gz +OLD_FILES+=usr/share/man/man9/crypto_kdone.9.gz +OLD_FILES+=usr/share/man/man9/crypto_kregister.9.gz +OLD_FILES+=usr/share/man/man9/CRYPTODEV_KPROCESS.9.gz + +# 20210410: remove unused libexec/rc.d/archdep +OLD_FILES+=etc/rc.d/archdep + +# 20210408: remove tcp_hostcache.h +OLD_FILES+=usr/include/netinet/tcp_hostcache.h + +# 20210403: remove kgmon(8) +OLD_FILES+=usr/sbin/kgmon +OLD_FILES+=usr/share/man/man8/kgmon.8.gz + +# 20210401: remove bt(4) man page +OLD_FILES+=usr/share/man/man4/bt.4.gz + +# 20210322: retire mn(4) sync serial driver +OLD_FILES+=usr/share/man/man4/if_mn.4.gz +OLD_FILES+=usr/share/man/man4/mn.4.gz + +# 20210318: remove the terminfo database +OLD_FILES+=usr/share/terminfo/1/1178 +OLD_FILES+=usr/share/terminfo/1/1730-lm +OLD_DIRS+=usr/share/terminfo/1 +OLD_FILES+=usr/share/terminfo/2/2621 +OLD_FILES+=usr/share/terminfo/2/2621-wl +OLD_FILES+=usr/share/terminfo/2/2621A +OLD_FILES+=usr/share/terminfo/2/2621a +OLD_DIRS+=usr/share/terminfo/2/ +OLD_FILES+=usr/share/terminfo/3/386at +OLD_FILES+=usr/share/terminfo/3/3b1 +OLD_DIRS+=usr/share/terminfo/3/ +OLD_FILES+=usr/share/terminfo/4/4025ex +OLD_FILES+=usr/share/terminfo/4/4027ex +OLD_FILES+=usr/share/terminfo/4/4410-w +OLD_DIRS+=usr/share/terminfo/4/ +OLD_FILES+=usr/share/terminfo/5/5051 +OLD_FILES+=usr/share/terminfo/5/5410-w +OLD_FILES+=usr/share/terminfo/5/5620 +OLD_FILES+=usr/share/terminfo/5/5630-24 +OLD_FILES+=usr/share/terminfo/5/5630DMD-24 +OLD_DIRS+=usr/share/terminfo/5/ +OLD_FILES+=usr/share/terminfo/6/6053 +OLD_FILES+=usr/share/terminfo/6/6053-dg +OLD_FILES+=usr/share/terminfo/6/605x +OLD_FILES+=usr/share/terminfo/6/605x-dg +OLD_FILES+=usr/share/terminfo/6/630-lm +OLD_FILES+=usr/share/terminfo/6/630MTG-24 +OLD_DIRS+=usr/share/terminfo/6/ +OLD_FILES+=usr/share/terminfo/7/730MTG-24 +OLD_FILES+=usr/share/terminfo/7/730MTG-41 +OLD_FILES+=usr/share/terminfo/7/730MTG-41r +OLD_FILES+=usr/share/terminfo/7/730MTGr +OLD_FILES+=usr/share/terminfo/7/730MTGr-24 +OLD_DIRS+=usr/share/terminfo/7/ +OLD_FILES+=usr/share/terminfo/8/8510 +OLD_DIRS+=usr/share/terminfo/8/ +OLD_FILES+=usr/share/terminfo/9/955-hb +OLD_FILES+=usr/share/terminfo/9/955-w +OLD_FILES+=usr/share/terminfo/9/9term +OLD_DIRS+=usr/share/terminfo/9/ +OLD_FILES+=usr/share/terminfo/A/Apple_Terminal +OLD_DIRS+=usr/share/terminfo/A/ +OLD_FILES+=usr/share/terminfo/E/Eterm +OLD_FILES+=usr/share/terminfo/E/Eterm-256color +OLD_FILES+=usr/share/terminfo/E/Eterm-88color +OLD_FILES+=usr/share/terminfo/E/Eterm-color +OLD_DIRS+=usr/share/terminfo/E/ +OLD_FILES+=usr/share/terminfo/L/LFT-PC850 +OLD_DIRS+=usr/share/terminfo/L/ +OLD_FILES+=usr/share/terminfo/M/MtxOrb +OLD_FILES+=usr/share/terminfo/M/MtxOrb162 +OLD_FILES+=usr/share/terminfo/M/MtxOrb204 +OLD_DIRS+=usr/share/terminfo/M/ +OLD_FILES+=usr/share/terminfo/N/NCR260VT300WPP +OLD_FILES+=usr/share/terminfo/N/NCRVT100WPP +OLD_DIRS+=usr/share/terminfo/N/ +OLD_FILES+=usr/share/terminfo/P/P12 +OLD_FILES+=usr/share/terminfo/P/P12-M +OLD_FILES+=usr/share/terminfo/P/P12-M-W +OLD_FILES+=usr/share/terminfo/P/P12-W +OLD_FILES+=usr/share/terminfo/P/P14 +OLD_FILES+=usr/share/terminfo/P/P14-M +OLD_FILES+=usr/share/terminfo/P/P14-M-W +OLD_FILES+=usr/share/terminfo/P/P14-W +OLD_FILES+=usr/share/terminfo/P/P4 +OLD_FILES+=usr/share/terminfo/P/P5 +OLD_FILES+=usr/share/terminfo/P/P7 +OLD_FILES+=usr/share/terminfo/P/P8 +OLD_FILES+=usr/share/terminfo/P/P8-W +OLD_FILES+=usr/share/terminfo/P/P9 +OLD_FILES+=usr/share/terminfo/P/P9-8 +OLD_FILES+=usr/share/terminfo/P/P9-8-W +OLD_FILES+=usr/share/terminfo/P/P9-W +OLD_DIRS+=usr/share/terminfo/P/ +OLD_FILES+=usr/share/terminfo/Q/Q306-8-pc +OLD_FILES+=usr/share/terminfo/Q/Q310-vip-H +OLD_FILES+=usr/share/terminfo/Q/Q310-vip-H-am +OLD_FILES+=usr/share/terminfo/Q/Q310-vip-Hw +OLD_FILES+=usr/share/terminfo/Q/Q310-vip-w +OLD_FILES+=usr/share/terminfo/Q/Q310-vip-w-am +OLD_DIRS+=usr/share/terminfo/Q/ +OLD_FILES+=usr/share/terminfo/X/X-hpterm +OLD_DIRS+=usr/share/terminfo/X/ +OLD_FILES+=usr/share/terminfo/a/a210 +OLD_FILES+=usr/share/terminfo/a/a80 +OLD_FILES+=usr/share/terminfo/a/a980 +OLD_FILES+=usr/share/terminfo/a/aa4080 +OLD_FILES+=usr/share/terminfo/a/aaa +OLD_FILES+=usr/share/terminfo/a/aaa+dec +OLD_FILES+=usr/share/terminfo/a/aaa+rv +OLD_FILES+=usr/share/terminfo/a/aaa+unk +OLD_FILES+=usr/share/terminfo/a/aaa-18 +OLD_FILES+=usr/share/terminfo/a/aaa-18-rv +OLD_FILES+=usr/share/terminfo/a/aaa-20 +OLD_FILES+=usr/share/terminfo/a/aaa-22 +OLD_FILES+=usr/share/terminfo/a/aaa-24 +OLD_FILES+=usr/share/terminfo/a/aaa-24-rv +OLD_FILES+=usr/share/terminfo/a/aaa-26 +OLD_FILES+=usr/share/terminfo/a/aaa-28 +OLD_FILES+=usr/share/terminfo/a/aaa-30 +OLD_FILES+=usr/share/terminfo/a/aaa-30-ctxt +OLD_FILES+=usr/share/terminfo/a/aaa-30-rv +OLD_FILES+=usr/share/terminfo/a/aaa-30-rv-ctxt +OLD_FILES+=usr/share/terminfo/a/aaa-30-s +OLD_FILES+=usr/share/terminfo/a/aaa-30-s-ctxt +OLD_FILES+=usr/share/terminfo/a/aaa-30-s-rv +OLD_FILES+=usr/share/terminfo/a/aaa-30-s-rv-ct +OLD_FILES+=usr/share/terminfo/a/aaa-36 +OLD_FILES+=usr/share/terminfo/a/aaa-36-rv +OLD_FILES+=usr/share/terminfo/a/aaa-40 +OLD_FILES+=usr/share/terminfo/a/aaa-40-rv +OLD_FILES+=usr/share/terminfo/a/aaa-48 +OLD_FILES+=usr/share/terminfo/a/aaa-48-rv +OLD_FILES+=usr/share/terminfo/a/aaa-60 +OLD_FILES+=usr/share/terminfo/a/aaa-60-dec-rv +OLD_FILES+=usr/share/terminfo/a/aaa-60-rv +OLD_FILES+=usr/share/terminfo/a/aaa-60-s +OLD_FILES+=usr/share/terminfo/a/aaa-60-s-rv +OLD_FILES+=usr/share/terminfo/a/aaa-ctxt +OLD_FILES+=usr/share/terminfo/a/aaa-db +OLD_FILES+=usr/share/terminfo/a/aaa-rv +OLD_FILES+=usr/share/terminfo/a/aaa-rv-ctxt +OLD_FILES+=usr/share/terminfo/a/aaa-rv-unk +OLD_FILES+=usr/share/terminfo/a/aaa-s +OLD_FILES+=usr/share/terminfo/a/aaa-s-ctxt +OLD_FILES+=usr/share/terminfo/a/aaa-s-rv +OLD_FILES+=usr/share/terminfo/a/aaa-s-rv-ctxt +OLD_FILES+=usr/share/terminfo/a/aaa-unk +OLD_FILES+=usr/share/terminfo/a/aas1901 +OLD_FILES+=usr/share/terminfo/a/abm80 +OLD_FILES+=usr/share/terminfo/a/abm85 +OLD_FILES+=usr/share/terminfo/a/abm85e +OLD_FILES+=usr/share/terminfo/a/abm85h +OLD_FILES+=usr/share/terminfo/a/abm85h-old +OLD_FILES+=usr/share/terminfo/a/absolute +OLD_FILES+=usr/share/terminfo/a/act4 +OLD_FILES+=usr/share/terminfo/a/act5 +OLD_FILES+=usr/share/terminfo/a/addrinfo +OLD_FILES+=usr/share/terminfo/a/adds200 +OLD_FILES+=usr/share/terminfo/a/adds980 +OLD_FILES+=usr/share/terminfo/a/addsviewpoint +OLD_FILES+=usr/share/terminfo/a/addsvp60 +OLD_FILES+=usr/share/terminfo/a/adm+sgr +OLD_FILES+=usr/share/terminfo/a/adm1 +OLD_FILES+=usr/share/terminfo/a/adm11 +OLD_FILES+=usr/share/terminfo/a/adm1178 +OLD_FILES+=usr/share/terminfo/a/adm12 +OLD_FILES+=usr/share/terminfo/a/adm1a +OLD_FILES+=usr/share/terminfo/a/adm2 +OLD_FILES+=usr/share/terminfo/a/adm20 +OLD_FILES+=usr/share/terminfo/a/adm21 +OLD_FILES+=usr/share/terminfo/a/adm22 +OLD_FILES+=usr/share/terminfo/a/adm3 +OLD_FILES+=usr/share/terminfo/a/adm31 +OLD_FILES+=usr/share/terminfo/a/adm31-old +OLD_FILES+=usr/share/terminfo/a/adm36 +OLD_FILES+=usr/share/terminfo/a/adm3a +OLD_FILES+=usr/share/terminfo/a/adm3a+ +OLD_FILES+=usr/share/terminfo/a/adm42 +OLD_FILES+=usr/share/terminfo/a/adm42-ns +OLD_FILES+=usr/share/terminfo/a/adm5 +OLD_FILES+=usr/share/terminfo/a/aepro +OLD_FILES+=usr/share/terminfo/a/aixterm +OLD_FILES+=usr/share/terminfo/a/aixterm-16color +OLD_FILES+=usr/share/terminfo/a/aixterm-m +OLD_FILES+=usr/share/terminfo/a/aixterm-m-old +OLD_FILES+=usr/share/terminfo/a/aj +OLD_FILES+=usr/share/terminfo/a/aj510 +OLD_FILES+=usr/share/terminfo/a/aj830 +OLD_FILES+=usr/share/terminfo/a/aj832 +OLD_FILES+=usr/share/terminfo/a/alacritty +OLD_FILES+=usr/share/terminfo/a/alacritty+common +OLD_FILES+=usr/share/terminfo/a/alacritty-direct +OLD_FILES+=usr/share/terminfo/a/alt2 +OLD_FILES+=usr/share/terminfo/a/alt3 +OLD_FILES+=usr/share/terminfo/a/alt4 +OLD_FILES+=usr/share/terminfo/a/alt5 +OLD_FILES+=usr/share/terminfo/a/alt7 +OLD_FILES+=usr/share/terminfo/a/alt7pc +OLD_FILES+=usr/share/terminfo/a/alto-h19 +OLD_FILES+=usr/share/terminfo/a/alto-heath +OLD_FILES+=usr/share/terminfo/a/altoh19 +OLD_FILES+=usr/share/terminfo/a/altoheath +OLD_FILES+=usr/share/terminfo/a/altos-2 +OLD_FILES+=usr/share/terminfo/a/altos-3 +OLD_FILES+=usr/share/terminfo/a/altos-4 +OLD_FILES+=usr/share/terminfo/a/altos-5 +OLD_FILES+=usr/share/terminfo/a/altos2 +OLD_FILES+=usr/share/terminfo/a/altos3 +OLD_FILES+=usr/share/terminfo/a/altos4 +OLD_FILES+=usr/share/terminfo/a/altos5 +OLD_FILES+=usr/share/terminfo/a/altos7 +OLD_FILES+=usr/share/terminfo/a/altos7pc +OLD_FILES+=usr/share/terminfo/a/ambas +OLD_FILES+=usr/share/terminfo/a/ambassador +OLD_FILES+=usr/share/terminfo/a/amiga +OLD_FILES+=usr/share/terminfo/a/amiga-8bit +OLD_FILES+=usr/share/terminfo/a/amiga-h +OLD_FILES+=usr/share/terminfo/a/amiga-vnc +OLD_FILES+=usr/share/terminfo/a/amp219 +OLD_FILES+=usr/share/terminfo/a/amp219w +OLD_FILES+=usr/share/terminfo/a/ampex-219 +OLD_FILES+=usr/share/terminfo/a/ampex-219w +OLD_FILES+=usr/share/terminfo/a/ampex-232 +OLD_FILES+=usr/share/terminfo/a/ampex175 +OLD_FILES+=usr/share/terminfo/a/ampex175-b +OLD_FILES+=usr/share/terminfo/a/ampex210 +OLD_FILES+=usr/share/terminfo/a/ampex219 +OLD_FILES+=usr/share/terminfo/a/ampex219w +OLD_FILES+=usr/share/terminfo/a/ampex232 +OLD_FILES+=usr/share/terminfo/a/ampex232w +OLD_FILES+=usr/share/terminfo/a/ampex80 +OLD_FILES+=usr/share/terminfo/a/annarbor4080 +OLD_FILES+=usr/share/terminfo/a/ansi +OLD_FILES+=usr/share/terminfo/a/ansi+arrows +OLD_FILES+=usr/share/terminfo/a/ansi+csr +OLD_FILES+=usr/share/terminfo/a/ansi+cup +OLD_FILES+=usr/share/terminfo/a/ansi+enq +OLD_FILES+=usr/share/terminfo/a/ansi+erase +OLD_FILES+=usr/share/terminfo/a/ansi+idc +OLD_FILES+=usr/share/terminfo/a/ansi+idc1 +OLD_FILES+=usr/share/terminfo/a/ansi+idl +OLD_FILES+=usr/share/terminfo/a/ansi+idl1 +OLD_FILES+=usr/share/terminfo/a/ansi+inittabs +OLD_FILES+=usr/share/terminfo/a/ansi+local +OLD_FILES+=usr/share/terminfo/a/ansi+local1 +OLD_FILES+=usr/share/terminfo/a/ansi+pp +OLD_FILES+=usr/share/terminfo/a/ansi+rca +OLD_FILES+=usr/share/terminfo/a/ansi+rep +OLD_FILES+=usr/share/terminfo/a/ansi+sgr +OLD_FILES+=usr/share/terminfo/a/ansi+sgrbold +OLD_FILES+=usr/share/terminfo/a/ansi+sgrdim +OLD_FILES+=usr/share/terminfo/a/ansi+sgrso +OLD_FILES+=usr/share/terminfo/a/ansi+sgrul +OLD_FILES+=usr/share/terminfo/a/ansi+tabs +OLD_FILES+=usr/share/terminfo/a/ansi-color-2-emx +OLD_FILES+=usr/share/terminfo/a/ansi-color-3-emx +OLD_FILES+=usr/share/terminfo/a/ansi-emx +OLD_FILES+=usr/share/terminfo/a/ansi-generic +OLD_FILES+=usr/share/terminfo/a/ansi-m +OLD_FILES+=usr/share/terminfo/a/ansi-mini +OLD_FILES+=usr/share/terminfo/a/ansi-mono +OLD_FILES+=usr/share/terminfo/a/ansi-mr +OLD_FILES+=usr/share/terminfo/a/ansi-mtabs +OLD_FILES+=usr/share/terminfo/a/ansi-nt +OLD_FILES+=usr/share/terminfo/a/ansi.sys +OLD_FILES+=usr/share/terminfo/a/ansi.sys-old +OLD_FILES+=usr/share/terminfo/a/ansi.sysk +OLD_FILES+=usr/share/terminfo/a/ansi43m +OLD_FILES+=usr/share/terminfo/a/ansi77 +OLD_FILES+=usr/share/terminfo/a/ansi80x25 +OLD_FILES+=usr/share/terminfo/a/ansi80x25-mono +OLD_FILES+=usr/share/terminfo/a/ansi80x25-raw +OLD_FILES+=usr/share/terminfo/a/ansi80x30 +OLD_FILES+=usr/share/terminfo/a/ansi80x30-mono +OLD_FILES+=usr/share/terminfo/a/ansi80x43 +OLD_FILES+=usr/share/terminfo/a/ansi80x43-mono +OLD_FILES+=usr/share/terminfo/a/ansi80x50 +OLD_FILES+=usr/share/terminfo/a/ansi80x50-mono +OLD_FILES+=usr/share/terminfo/a/ansi80x60 +OLD_FILES+=usr/share/terminfo/a/ansi80x60-mono +OLD_FILES+=usr/share/terminfo/a/ansil +OLD_FILES+=usr/share/terminfo/a/ansil-mono +OLD_FILES+=usr/share/terminfo/a/ansis +OLD_FILES+=usr/share/terminfo/a/ansis-mono +OLD_FILES+=usr/share/terminfo/a/ansisysk +OLD_FILES+=usr/share/terminfo/a/ansiterm +OLD_FILES+=usr/share/terminfo/a/ansiw +OLD_FILES+=usr/share/terminfo/a/ap-vm80 +OLD_FILES+=usr/share/terminfo/a/apl +OLD_FILES+=usr/share/terminfo/a/apollo +OLD_FILES+=usr/share/terminfo/a/apollo_15P +OLD_FILES+=usr/share/terminfo/a/apollo_19L +OLD_FILES+=usr/share/terminfo/a/apollo_color +OLD_FILES+=usr/share/terminfo/a/apple-80 +OLD_FILES+=usr/share/terminfo/a/apple-ae +OLD_FILES+=usr/share/terminfo/a/apple-soroc +OLD_FILES+=usr/share/terminfo/a/apple-uterm +OLD_FILES+=usr/share/terminfo/a/apple-uterm-vb +OLD_FILES+=usr/share/terminfo/a/apple-videx +OLD_FILES+=usr/share/terminfo/a/apple-videx2 +OLD_FILES+=usr/share/terminfo/a/apple-videx3 +OLD_FILES+=usr/share/terminfo/a/apple-vm80 +OLD_FILES+=usr/share/terminfo/a/apple2e +OLD_FILES+=usr/share/terminfo/a/apple2e-p +OLD_FILES+=usr/share/terminfo/a/apple80p +OLD_FILES+=usr/share/terminfo/a/appleII +OLD_FILES+=usr/share/terminfo/a/appleIIc +OLD_FILES+=usr/share/terminfo/a/appleIIe +OLD_FILES+=usr/share/terminfo/a/appleIIgs +OLD_FILES+=usr/share/terminfo/a/arm100 +OLD_FILES+=usr/share/terminfo/a/arm100-am +OLD_FILES+=usr/share/terminfo/a/arm100-w +OLD_FILES+=usr/share/terminfo/a/arm100-wam +OLD_FILES+=usr/share/terminfo/a/at +OLD_FILES+=usr/share/terminfo/a/at-color +OLD_FILES+=usr/share/terminfo/a/at-m +OLD_FILES+=usr/share/terminfo/a/at386 +OLD_FILES+=usr/share/terminfo/a/atari +OLD_FILES+=usr/share/terminfo/a/atari-color +OLD_FILES+=usr/share/terminfo/a/atari-m +OLD_FILES+=usr/share/terminfo/a/atari-old +OLD_FILES+=usr/share/terminfo/a/atari_st +OLD_FILES+=usr/share/terminfo/a/atari_st-color +OLD_FILES+=usr/share/terminfo/a/atarist-m +OLD_FILES+=usr/share/terminfo/a/aterm +OLD_FILES+=usr/share/terminfo/a/att2300 +OLD_FILES+=usr/share/terminfo/a/att2350 +OLD_FILES+=usr/share/terminfo/a/att4410 +OLD_FILES+=usr/share/terminfo/a/att4410-w +OLD_FILES+=usr/share/terminfo/a/att4410v1 +OLD_FILES+=usr/share/terminfo/a/att4410v1-w +OLD_FILES+=usr/share/terminfo/a/att4415 +OLD_FILES+=usr/share/terminfo/a/att4415+nl +OLD_FILES+=usr/share/terminfo/a/att4415-nl +OLD_FILES+=usr/share/terminfo/a/att4415-rv +OLD_FILES+=usr/share/terminfo/a/att4415-rv-nl +OLD_FILES+=usr/share/terminfo/a/att4415-w +OLD_FILES+=usr/share/terminfo/a/att4415-w-nl +OLD_FILES+=usr/share/terminfo/a/att4415-w-rv +OLD_FILES+=usr/share/terminfo/a/att4415-w-rv-n +OLD_FILES+=usr/share/terminfo/a/att4418 +OLD_FILES+=usr/share/terminfo/a/att4418-w +OLD_FILES+=usr/share/terminfo/a/att4420 +OLD_FILES+=usr/share/terminfo/a/att4424 +OLD_FILES+=usr/share/terminfo/a/att4424-1 +OLD_FILES+=usr/share/terminfo/a/att4424m +OLD_FILES+=usr/share/terminfo/a/att4425 +OLD_FILES+=usr/share/terminfo/a/att4425-nl +OLD_FILES+=usr/share/terminfo/a/att4425-w +OLD_FILES+=usr/share/terminfo/a/att4426 +OLD_FILES+=usr/share/terminfo/a/att500 +OLD_FILES+=usr/share/terminfo/a/att505 +OLD_FILES+=usr/share/terminfo/a/att505-24 +OLD_FILES+=usr/share/terminfo/a/att510a +OLD_FILES+=usr/share/terminfo/a/att510d +OLD_FILES+=usr/share/terminfo/a/att513 +OLD_FILES+=usr/share/terminfo/a/att5310 +OLD_FILES+=usr/share/terminfo/a/att5320 +OLD_FILES+=usr/share/terminfo/a/att5410 +OLD_FILES+=usr/share/terminfo/a/att5410-w +OLD_FILES+=usr/share/terminfo/a/att5410v1 +OLD_FILES+=usr/share/terminfo/a/att5410v1-w +OLD_FILES+=usr/share/terminfo/a/att5418 +OLD_FILES+=usr/share/terminfo/a/att5418-w +OLD_FILES+=usr/share/terminfo/a/att5420 +OLD_FILES+=usr/share/terminfo/a/att5420+nl +OLD_FILES+=usr/share/terminfo/a/att5420-nl +OLD_FILES+=usr/share/terminfo/a/att5420-rv +OLD_FILES+=usr/share/terminfo/a/att5420-rv-nl +OLD_FILES+=usr/share/terminfo/a/att5420-w +OLD_FILES+=usr/share/terminfo/a/att5420-w-nl +OLD_FILES+=usr/share/terminfo/a/att5420-w-rv +OLD_FILES+=usr/share/terminfo/a/att5420-w-rv-n +OLD_FILES+=usr/share/terminfo/a/att5420_2 +OLD_FILES+=usr/share/terminfo/a/att5420_2-w +OLD_FILES+=usr/share/terminfo/a/att5425 +OLD_FILES+=usr/share/terminfo/a/att5425-nl +OLD_FILES+=usr/share/terminfo/a/att5425-w +OLD_FILES+=usr/share/terminfo/a/att5430 +OLD_FILES+=usr/share/terminfo/a/att5620 +OLD_FILES+=usr/share/terminfo/a/att5620-1 +OLD_FILES+=usr/share/terminfo/a/att5620-24 +OLD_FILES+=usr/share/terminfo/a/att5620-34 +OLD_FILES+=usr/share/terminfo/a/att5620-s +OLD_FILES+=usr/share/terminfo/a/att605 +OLD_FILES+=usr/share/terminfo/a/att605-pc +OLD_FILES+=usr/share/terminfo/a/att605-w +OLD_FILES+=usr/share/terminfo/a/att610 +OLD_FILES+=usr/share/terminfo/a/att610+cvis +OLD_FILES+=usr/share/terminfo/a/att610+cvis0 +OLD_FILES+=usr/share/terminfo/a/att610-103k +OLD_FILES+=usr/share/terminfo/a/att610-103k-w +OLD_FILES+=usr/share/terminfo/a/att610-w +OLD_FILES+=usr/share/terminfo/a/att615 +OLD_FILES+=usr/share/terminfo/a/att615-103k +OLD_FILES+=usr/share/terminfo/a/att615-103k-w +OLD_FILES+=usr/share/terminfo/a/att615-w +OLD_FILES+=usr/share/terminfo/a/att620 +OLD_FILES+=usr/share/terminfo/a/att620-103k +OLD_FILES+=usr/share/terminfo/a/att620-103k-w +OLD_FILES+=usr/share/terminfo/a/att620-w +OLD_FILES+=usr/share/terminfo/a/att630 +OLD_FILES+=usr/share/terminfo/a/att630-24 +OLD_FILES+=usr/share/terminfo/a/att6386 +OLD_FILES+=usr/share/terminfo/a/att700 +OLD_FILES+=usr/share/terminfo/a/att730 +OLD_FILES+=usr/share/terminfo/a/att730-24 +OLD_FILES+=usr/share/terminfo/a/att730-41 +OLD_FILES+=usr/share/terminfo/a/att7300 +OLD_FILES+=usr/share/terminfo/a/att730r +OLD_FILES+=usr/share/terminfo/a/att730r-24 +OLD_FILES+=usr/share/terminfo/a/att730r-41 +OLD_FILES+=usr/share/terminfo/a/avatar +OLD_FILES+=usr/share/terminfo/a/avatar0 +OLD_FILES+=usr/share/terminfo/a/avatar0+ +OLD_FILES+=usr/share/terminfo/a/avatar1 +OLD_FILES+=usr/share/terminfo/a/avt +OLD_FILES+=usr/share/terminfo/a/avt+s +OLD_FILES+=usr/share/terminfo/a/avt-ns +OLD_FILES+=usr/share/terminfo/a/avt-rv +OLD_FILES+=usr/share/terminfo/a/avt-rv-ns +OLD_FILES+=usr/share/terminfo/a/avt-rv-s +OLD_FILES+=usr/share/terminfo/a/avt-s +OLD_FILES+=usr/share/terminfo/a/avt-w +OLD_FILES+=usr/share/terminfo/a/avt-w-ns +OLD_FILES+=usr/share/terminfo/a/avt-w-rv +OLD_FILES+=usr/share/terminfo/a/avt-w-rv-ns +OLD_FILES+=usr/share/terminfo/a/avt-w-rv-s +OLD_FILES+=usr/share/terminfo/a/avt-w-s +OLD_FILES+=usr/share/terminfo/a/aws +OLD_FILES+=usr/share/terminfo/a/awsc +OLD_DIRS+=usr/share/terminfo/a/ +OLD_FILES+=usr/share/terminfo/b/b-128 +OLD_FILES+=usr/share/terminfo/b/bantam +OLD_FILES+=usr/share/terminfo/b/basic4 +OLD_FILES+=usr/share/terminfo/b/basis +OLD_FILES+=usr/share/terminfo/b/bct510a +OLD_FILES+=usr/share/terminfo/b/bct510d +OLD_FILES+=usr/share/terminfo/b/beacon +OLD_FILES+=usr/share/terminfo/b/bee +OLD_FILES+=usr/share/terminfo/b/beehive +OLD_FILES+=usr/share/terminfo/b/beehive3 +OLD_FILES+=usr/share/terminfo/b/beehive4 +OLD_FILES+=usr/share/terminfo/b/beehiveIIIm +OLD_FILES+=usr/share/terminfo/b/beterm +OLD_FILES+=usr/share/terminfo/b/bg1.25 +OLD_FILES+=usr/share/terminfo/b/bg1.25nv +OLD_FILES+=usr/share/terminfo/b/bg1.25rv +OLD_FILES+=usr/share/terminfo/b/bg2.0 +OLD_FILES+=usr/share/terminfo/b/bg2.0nv +OLD_FILES+=usr/share/terminfo/b/bg2.0rv +OLD_FILES+=usr/share/terminfo/b/bg3.10 +OLD_FILES+=usr/share/terminfo/b/bg3.10nv +OLD_FILES+=usr/share/terminfo/b/bg3.10rv +OLD_FILES+=usr/share/terminfo/b/bh3m +OLD_FILES+=usr/share/terminfo/b/bh4 +OLD_FILES+=usr/share/terminfo/b/bitgraph +OLD_FILES+=usr/share/terminfo/b/blit +OLD_FILES+=usr/share/terminfo/b/bobcat +OLD_FILES+=usr/share/terminfo/b/bq300 +OLD_FILES+=usr/share/terminfo/b/bq300-8 +OLD_FILES+=usr/share/terminfo/b/bq300-8-pc +OLD_FILES+=usr/share/terminfo/b/bq300-8-pc-rv +OLD_FILES+=usr/share/terminfo/b/bq300-8-pc-w +OLD_FILES+=usr/share/terminfo/b/bq300-8-pc-w-rv +OLD_FILES+=usr/share/terminfo/b/bq300-8rv +OLD_FILES+=usr/share/terminfo/b/bq300-8w +OLD_FILES+=usr/share/terminfo/b/bq300-pc +OLD_FILES+=usr/share/terminfo/b/bq300-pc-rv +OLD_FILES+=usr/share/terminfo/b/bq300-pc-w +OLD_FILES+=usr/share/terminfo/b/bq300-pc-w-rv +OLD_FILES+=usr/share/terminfo/b/bq300-rv +OLD_FILES+=usr/share/terminfo/b/bq300-w +OLD_FILES+=usr/share/terminfo/b/bq300-w-8rv +OLD_FILES+=usr/share/terminfo/b/bq300-w-rv +OLD_FILES+=usr/share/terminfo/b/bsdos-pc +OLD_FILES+=usr/share/terminfo/b/bsdos-pc-m +OLD_FILES+=usr/share/terminfo/b/bsdos-pc-mono +OLD_FILES+=usr/share/terminfo/b/bsdos-pc-nobold +OLD_FILES+=usr/share/terminfo/b/bsdos-ppc +OLD_FILES+=usr/share/terminfo/b/bsdos-sparc +OLD_FILES+=usr/share/terminfo/b/bterm +OLD_DIRS+=usr/share/terminfo/b/ +OLD_FILES+=usr/share/terminfo/c/c100 +OLD_FILES+=usr/share/terminfo/c/c100-1p +OLD_FILES+=usr/share/terminfo/c/c100-4p +OLD_FILES+=usr/share/terminfo/c/c100-rv +OLD_FILES+=usr/share/terminfo/c/c100-rv-4p +OLD_FILES+=usr/share/terminfo/c/c104 +OLD_FILES+=usr/share/terminfo/c/c108 +OLD_FILES+=usr/share/terminfo/c/c108-4p +OLD_FILES+=usr/share/terminfo/c/c108-8p +OLD_FILES+=usr/share/terminfo/c/c108-rv +OLD_FILES+=usr/share/terminfo/c/c108-rv-4p +OLD_FILES+=usr/share/terminfo/c/c108-rv-8p +OLD_FILES+=usr/share/terminfo/c/c108-w +OLD_FILES+=usr/share/terminfo/c/c108-w-8p +OLD_FILES+=usr/share/terminfo/c/c300 +OLD_FILES+=usr/share/terminfo/c/c301 +OLD_FILES+=usr/share/terminfo/c/c321 +OLD_FILES+=usr/share/terminfo/c/ca22851 +OLD_FILES+=usr/share/terminfo/c/cad68-2 +OLD_FILES+=usr/share/terminfo/c/cad68-3 +OLD_FILES+=usr/share/terminfo/c/cbblit +OLD_FILES+=usr/share/terminfo/c/cbunix +OLD_FILES+=usr/share/terminfo/c/cci +OLD_FILES+=usr/share/terminfo/c/cci1 +OLD_FILES+=usr/share/terminfo/c/cdc456 +OLD_FILES+=usr/share/terminfo/c/cdc721 +OLD_FILES+=usr/share/terminfo/c/cdc721-esc +OLD_FILES+=usr/share/terminfo/c/cdc721ll +OLD_FILES+=usr/share/terminfo/c/cdc752 +OLD_FILES+=usr/share/terminfo/c/cdc756 +OLD_FILES+=usr/share/terminfo/c/cg7900 +OLD_FILES+=usr/share/terminfo/c/cgc2 +OLD_FILES+=usr/share/terminfo/c/cgc3 +OLD_FILES+=usr/share/terminfo/c/chromatics +OLD_FILES+=usr/share/terminfo/c/ci8510 +OLD_FILES+=usr/share/terminfo/c/cit-80 +OLD_FILES+=usr/share/terminfo/c/cit101 +OLD_FILES+=usr/share/terminfo/c/cit101e +OLD_FILES+=usr/share/terminfo/c/cit101e-132 +OLD_FILES+=usr/share/terminfo/c/cit101e-n +OLD_FILES+=usr/share/terminfo/c/cit101e-n132 +OLD_FILES+=usr/share/terminfo/c/cit101e-rv +OLD_FILES+=usr/share/terminfo/c/cit500 +OLD_FILES+=usr/share/terminfo/c/cit80 +OLD_FILES+=usr/share/terminfo/c/citc +OLD_FILES+=usr/share/terminfo/c/citoh +OLD_FILES+=usr/share/terminfo/c/citoh-6lpi +OLD_FILES+=usr/share/terminfo/c/citoh-8lpi +OLD_FILES+=usr/share/terminfo/c/citoh-comp +OLD_FILES+=usr/share/terminfo/c/citoh-elite +OLD_FILES+=usr/share/terminfo/c/citoh-pica +OLD_FILES+=usr/share/terminfo/c/citoh-prop +OLD_FILES+=usr/share/terminfo/c/citoh-ps +OLD_FILES+=usr/share/terminfo/c/coco3 +OLD_FILES+=usr/share/terminfo/c/coherent +OLD_FILES+=usr/share/terminfo/c/color_xterm +OLD_FILES+=usr/share/terminfo/c/colorscan +OLD_FILES+=usr/share/terminfo/c/commodore +OLD_FILES+=usr/share/terminfo/c/concept +OLD_FILES+=usr/share/terminfo/c/concept-avt +OLD_FILES+=usr/share/terminfo/c/concept100 +OLD_FILES+=usr/share/terminfo/c/concept100-rv +OLD_FILES+=usr/share/terminfo/c/concept108 +OLD_FILES+=usr/share/terminfo/c/concept108-4p +OLD_FILES+=usr/share/terminfo/c/concept108-8p +OLD_FILES+=usr/share/terminfo/c/concept108-w-8 +OLD_FILES+=usr/share/terminfo/c/concept108-w8p +OLD_FILES+=usr/share/terminfo/c/concept108rv4p +OLD_FILES+=usr/share/terminfo/c/cons25 +OLD_FILES+=usr/share/terminfo/c/cons25-debian +OLD_FILES+=usr/share/terminfo/c/cons25-iso-m +OLD_FILES+=usr/share/terminfo/c/cons25-iso8859 +OLD_FILES+=usr/share/terminfo/c/cons25-koi8-r +OLD_FILES+=usr/share/terminfo/c/cons25-koi8r-m +OLD_FILES+=usr/share/terminfo/c/cons25-m +OLD_FILES+=usr/share/terminfo/c/cons25l1 +OLD_FILES+=usr/share/terminfo/c/cons25l1-m +OLD_FILES+=usr/share/terminfo/c/cons25r +OLD_FILES+=usr/share/terminfo/c/cons25r-m +OLD_FILES+=usr/share/terminfo/c/cons25w +OLD_FILES+=usr/share/terminfo/c/cons30 +OLD_FILES+=usr/share/terminfo/c/cons30-m +OLD_FILES+=usr/share/terminfo/c/cons43 +OLD_FILES+=usr/share/terminfo/c/cons43-m +OLD_FILES+=usr/share/terminfo/c/cons50 +OLD_FILES+=usr/share/terminfo/c/cons50-iso-m +OLD_FILES+=usr/share/terminfo/c/cons50-iso8859 +OLD_FILES+=usr/share/terminfo/c/cons50-koi8r +OLD_FILES+=usr/share/terminfo/c/cons50-koi8r-m +OLD_FILES+=usr/share/terminfo/c/cons50-m +OLD_FILES+=usr/share/terminfo/c/cons50l1 +OLD_FILES+=usr/share/terminfo/c/cons50l1-m +OLD_FILES+=usr/share/terminfo/c/cons50r +OLD_FILES+=usr/share/terminfo/c/cons50r-m +OLD_FILES+=usr/share/terminfo/c/cons60 +OLD_FILES+=usr/share/terminfo/c/cons60-iso +OLD_FILES+=usr/share/terminfo/c/cons60-iso-m +OLD_FILES+=usr/share/terminfo/c/cons60-koi8r +OLD_FILES+=usr/share/terminfo/c/cons60-koi8r-m +OLD_FILES+=usr/share/terminfo/c/cons60-m +OLD_FILES+=usr/share/terminfo/c/cons60l1 +OLD_FILES+=usr/share/terminfo/c/cons60l1-m +OLD_FILES+=usr/share/terminfo/c/cons60r +OLD_FILES+=usr/share/terminfo/c/cons60r-m +OLD_FILES+=usr/share/terminfo/c/contel300 +OLD_FILES+=usr/share/terminfo/c/contel301 +OLD_FILES+=usr/share/terminfo/c/contel320 +OLD_FILES+=usr/share/terminfo/c/contel321 +OLD_FILES+=usr/share/terminfo/c/cops +OLD_FILES+=usr/share/terminfo/c/cops-10 +OLD_FILES+=usr/share/terminfo/c/cops10 +OLD_FILES+=usr/share/terminfo/c/crt +OLD_FILES+=usr/share/terminfo/c/crt-vt220 +OLD_FILES+=usr/share/terminfo/c/cs10 +OLD_FILES+=usr/share/terminfo/c/cs10-w +OLD_FILES+=usr/share/terminfo/c/ct82 +OLD_FILES+=usr/share/terminfo/c/ct8500 +OLD_FILES+=usr/share/terminfo/c/ctrm +OLD_FILES+=usr/share/terminfo/c/cx +OLD_FILES+=usr/share/terminfo/c/cx100 +OLD_FILES+=usr/share/terminfo/c/cyb110 +OLD_FILES+=usr/share/terminfo/c/cyb83 +OLD_FILES+=usr/share/terminfo/c/cygwin +OLD_FILES+=usr/share/terminfo/c/cygwinB19 +OLD_FILES+=usr/share/terminfo/c/cygwinDBG +OLD_DIRS+=usr/share/terminfo/c/ +OLD_FILES+=usr/share/terminfo/d/d132 +OLD_FILES+=usr/share/terminfo/d/d2 +OLD_FILES+=usr/share/terminfo/d/d2-dg +OLD_FILES+=usr/share/terminfo/d/d200 +OLD_FILES+=usr/share/terminfo/d/d200-dg +OLD_FILES+=usr/share/terminfo/d/d210 +OLD_FILES+=usr/share/terminfo/d/d210-dg +OLD_FILES+=usr/share/terminfo/d/d211 +OLD_FILES+=usr/share/terminfo/d/d211-7b +OLD_FILES+=usr/share/terminfo/d/d211-dg +OLD_FILES+=usr/share/terminfo/d/d214 +OLD_FILES+=usr/share/terminfo/d/d214-dg +OLD_FILES+=usr/share/terminfo/d/d215 +OLD_FILES+=usr/share/terminfo/d/d215-7b +OLD_FILES+=usr/share/terminfo/d/d215-dg +OLD_FILES+=usr/share/terminfo/d/d216+ +OLD_FILES+=usr/share/terminfo/d/d216+25 +OLD_FILES+=usr/share/terminfo/d/d216+dg +OLD_FILES+=usr/share/terminfo/d/d216-dg +OLD_FILES+=usr/share/terminfo/d/d216-unix +OLD_FILES+=usr/share/terminfo/d/d216-unix-25 +OLD_FILES+=usr/share/terminfo/d/d216e+ +OLD_FILES+=usr/share/terminfo/d/d216e+dg +OLD_FILES+=usr/share/terminfo/d/d216e-dg +OLD_FILES+=usr/share/terminfo/d/d216e-unix +OLD_FILES+=usr/share/terminfo/d/d217-dg +OLD_FILES+=usr/share/terminfo/d/d217-unix +OLD_FILES+=usr/share/terminfo/d/d217-unix-25 +OLD_FILES+=usr/share/terminfo/d/d220 +OLD_FILES+=usr/share/terminfo/d/d220-7b +OLD_FILES+=usr/share/terminfo/d/d220-dg +OLD_FILES+=usr/share/terminfo/d/d230 +OLD_FILES+=usr/share/terminfo/d/d230-dg +OLD_FILES+=usr/share/terminfo/d/d230c +OLD_FILES+=usr/share/terminfo/d/d230c-dg +OLD_FILES+=usr/share/terminfo/d/d400 +OLD_FILES+=usr/share/terminfo/d/d400-dg +OLD_FILES+=usr/share/terminfo/d/d410 +OLD_FILES+=usr/share/terminfo/d/d410-7b +OLD_FILES+=usr/share/terminfo/d/d410-7b-w +OLD_FILES+=usr/share/terminfo/d/d410-dg +OLD_FILES+=usr/share/terminfo/d/d410-w +OLD_FILES+=usr/share/terminfo/d/d411 +OLD_FILES+=usr/share/terminfo/d/d411-7b +OLD_FILES+=usr/share/terminfo/d/d411-7b-w +OLD_FILES+=usr/share/terminfo/d/d411-dg +OLD_FILES+=usr/share/terminfo/d/d411-w +OLD_FILES+=usr/share/terminfo/d/d412+ +OLD_FILES+=usr/share/terminfo/d/d412+25 +OLD_FILES+=usr/share/terminfo/d/d412+dg +OLD_FILES+=usr/share/terminfo/d/d412+s +OLD_FILES+=usr/share/terminfo/d/d412+sr +OLD_FILES+=usr/share/terminfo/d/d412+w +OLD_FILES+=usr/share/terminfo/d/d412-dg +OLD_FILES+=usr/share/terminfo/d/d412-unix +OLD_FILES+=usr/share/terminfo/d/d412-unix-25 +OLD_FILES+=usr/share/terminfo/d/d412-unix-s +OLD_FILES+=usr/share/terminfo/d/d412-unix-sr +OLD_FILES+=usr/share/terminfo/d/d412-unix-w +OLD_FILES+=usr/share/terminfo/d/d413-dg +OLD_FILES+=usr/share/terminfo/d/d413-unix +OLD_FILES+=usr/share/terminfo/d/d413-unix-25 +OLD_FILES+=usr/share/terminfo/d/d413-unix-s +OLD_FILES+=usr/share/terminfo/d/d413-unix-sr +OLD_FILES+=usr/share/terminfo/d/d413-unix-w +OLD_FILES+=usr/share/terminfo/d/d414-unix +OLD_FILES+=usr/share/terminfo/d/d414-unix-25 +OLD_FILES+=usr/share/terminfo/d/d414-unix-s +OLD_FILES+=usr/share/terminfo/d/d414-unix-sr +OLD_FILES+=usr/share/terminfo/d/d414-unix-w +OLD_FILES+=usr/share/terminfo/d/d430-dg +OLD_FILES+=usr/share/terminfo/d/d430-dg-ccc +OLD_FILES+=usr/share/terminfo/d/d430-unix +OLD_FILES+=usr/share/terminfo/d/d430-unix-25 +OLD_FILES+=usr/share/terminfo/d/d430-unix-25-ccc +OLD_FILES+=usr/share/terminfo/d/d430-unix-ccc +OLD_FILES+=usr/share/terminfo/d/d430-unix-s +OLD_FILES+=usr/share/terminfo/d/d430-unix-s-ccc +OLD_FILES+=usr/share/terminfo/d/d430-unix-sr +OLD_FILES+=usr/share/terminfo/d/d430-unix-sr-ccc +OLD_FILES+=usr/share/terminfo/d/d430-unix-w +OLD_FILES+=usr/share/terminfo/d/d430-unix-w-ccc +OLD_FILES+=usr/share/terminfo/d/d430c-dg +OLD_FILES+=usr/share/terminfo/d/d430c-dg-ccc +OLD_FILES+=usr/share/terminfo/d/d430c-unix +OLD_FILES+=usr/share/terminfo/d/d430c-unix-25 +OLD_FILES+=usr/share/terminfo/d/d430c-unix-25-ccc +OLD_FILES+=usr/share/terminfo/d/d430c-unix-ccc +OLD_FILES+=usr/share/terminfo/d/d430c-unix-s +OLD_FILES+=usr/share/terminfo/d/d430c-unix-s-ccc +OLD_FILES+=usr/share/terminfo/d/d430c-unix-sr +OLD_FILES+=usr/share/terminfo/d/d430c-unix-sr-ccc +OLD_FILES+=usr/share/terminfo/d/d430c-unix-w +OLD_FILES+=usr/share/terminfo/d/d430c-unix-w-ccc +OLD_FILES+=usr/share/terminfo/d/d450 +OLD_FILES+=usr/share/terminfo/d/d450-dg +OLD_FILES+=usr/share/terminfo/d/d460 +OLD_FILES+=usr/share/terminfo/d/d460-7b +OLD_FILES+=usr/share/terminfo/d/d460-7b-w +OLD_FILES+=usr/share/terminfo/d/d460-dg +OLD_FILES+=usr/share/terminfo/d/d460-w +OLD_FILES+=usr/share/terminfo/d/d461 +OLD_FILES+=usr/share/terminfo/d/d461-7b *** 15205 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sun Jun 13 02:46:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EDAD655614 for ; Sun, 13 Jun 2021 02:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2f9V2Fqtz4mvm; Sun, 13 Jun 2021 02:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35CA41966D; Sun, 13 Jun 2021 02:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D2kcpQ032432; Sun, 13 Jun 2021 02:46:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D2kcrD032431; Sun, 13 Jun 2021 02:46:38 GMT (envelope-from git) Date: Sun, 13 Jun 2021 02:46:38 GMT Message-Id: <202106130246.15D2kcrD032431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 7d9f3ef0ef5c..c3b60ededa6e - vendor/openzfs/zfs-2.1-release - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/zfs-2.1-release X-Git-Reftype: branch X-Git-Commit: c3b60ededa6e6ce36a457a54451ca153c4c630dc X-Git-Oldrev: 7d9f3ef0ef5c26424d6f1eab2c7d4dfa3e7f9950 X-Git-Newrev: c3b60ededa6e6ce36a457a54451ca153c4c630dc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 02:46:38 -0000 The branch vendor/openzfs/zfs-2.1-release has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=7d9f3ef0ef5c..c3b60ededa6e 019739b6e98b dracut/90/module-setup: mainly shellcheck cleanup d53a6969c106 i-t: rewrite hooks 59d91b4d10ba Fix SC2181 ("[ $?") outside tests/ e40ffed02171 Trim excess shellcheck annotations. Widen to all non-Korn scripts c1a64be6d40a zgenhostid: use argument path directly 263b3d64ab29 contrib/bash_completion.d: fix obvious shellcheck problems 1fc5f8cbfd19 d/zfsutils.zfs.init derivatives: shellcheck, fix header 045807092815 zstreamdump: replace with link to zstream 0382362ce06a etc/systemd/zfs-mount-generator: rewrite in C ec3b25825e64 etc/systemd/zfs-mount-generator: output tweaks 09c0a8fd1a3a Improve scrub maxinflight_bytes math. 85c43508f3cc Introduce write-mostly sums eb9d335009fb Don't direct to freenode in issue template c3c65e3cfb62 long options for ztest 8ed04625db25 zgenhostid.8: use single-line indent macro for single-line examples 68a310dc4533 ztest.1: modernise a0372059b117 arcstat.1: modernise 55b6d4a3d825 fsck.zfs.8: modernise 5d08b105a24b zpoolprops.8: fix spacing in ashift 5c7c2b1301e9 raidz_test.1: modernise f67a920a6d25 zinject.8: modernise 9d7c10388af7 zpool_influxdb.8: modernise ea034765b464 zhack.1: modernise f6ce80629834 vdev_id.8: modernise, note scsi topology 475ee3bc2bfd cstyle.1: modernise e1ae0c4b995f zed.8: modernise 01918aa3f4fc man: use Nm/Cm/Fl consistently a1b1007e95a4 vdev_id.conf.5: modernise 71f6e6480e66 zfs-events.5: modernise f2e890ddfa5a test-runner.1: modernise a61c5029078a Widen mancheck to all of man and test-runner dbfbc1e524f9 zstream: force-install zstreamdump link 90d00230058c i-t: let rootdelay= set $ZFS_INITRD_PRE_MOUNTROOT_SLEEP 2f5c39137a8c i-t: don't suggest zpool-import with altroot to /root d6f8f41c21b4 udev/rules.d: .gitignore: glob all rules 132240507d0a Turn shellcheck into a normal make target. Fix new files it caught 91bb2e91bd83 Turn checkbashisms into a make target a0c055cfd3a2 Remove iov_iter_advance() for iter_write 1fb18c4bdea7 FreeBSD boot code reminder after zpool upgrade cc9dae24040a Added another missed case to arc_summary3 6e01b47a2856 Quick fixes for two ZTS failures 2fe8060ceee0 spl-module-parameters.5: remove spl_kmem_cache_{expire,obj_per_slab_min} b1b1faf0f1e2 zfs-module-parameters.5: remove nonexistent parameters db9048741ba4 A couple of small style cleanups af80160f48ea Linux: Set spl_kmem_cache_slab_limit when page size !4K 13c9a41140f1 mancheck: accept lints, accept lint overrides c650ceb64d59 Lint most manpages e29869580964 Fix error check in nvlist_print_json_string d3dddbaa2081 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI 64e38df23780 Let zfs diff be more permissive 998035d534bf dracut: 90zfs: module-setup: try /lib*/libgcc_s.so*, relax /u/l/gcc path 2dde9202d9a6 dracut: 90zfs: zfs-load-key: don't load unencrypted bootfs' keylocation 11b165cc9bac Use %%/* instead of awk -F/ {print $1} to strip datasets b12a6d961cd5 i-t: don't try to import from empty cache b05ae1a82ab6 libzfs: write_inuse_diffs_one: format strerror() with "%s" e76373de7b73 More aggsum optimizations a377bde727cb Livelist logic should handle dedup blkptrs 2f23f0f94077 Force --enable-debug on FreeBSD if INVARIANTS is set d7e6f293da45 Modernise/fix/rewrite unlinted manpages 2c3d7283b46f libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat d6a0cecab142 zed-functions.sh: zed_lock(): don't truncate lock 27d3cc6cd323 zed.d/all-debug.sh: simplify 6ce97bb4a288 zed.d/history_event-zfs-list-cacher.sh.in: parallelise, simplify 1180d61152ff Fix minor shellcheck 0.7.2 warnings 0bef46e6d535 man: use one Makefile, use OpenZFS for .Os a444efb6d75b Move properties, parameters, events, and concepts around manual sections 14973b917c43 Consistentify miscellaneous style on remaining manpages 4e0fff2e02d0 zgenhostid.8: revisit 4cf3e48a3ba6 libzfs: format safety 2e158b0e0b0b Added error for writing to /dev/ on Linux efdfb14fc8c9 Remove pool io kstats 8dc540ae1601 dracut: 90zfs: respect zfs_force=1 on systemd systems 57196f8ae932 Re-embed multilist_t storage c3b60ededa6e Tag 2.1.0-rc7 From owner-dev-commits-src-all@freebsd.org Sun Jun 13 03:18:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A0E16558FC; Sun, 13 Jun 2021 03:18:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2fsk6xndz4pDh; Sun, 13 Jun 2021 03:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D529A19D40; Sun, 13 Jun 2021 03:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D3I2pn074098; Sun, 13 Jun 2021 03:18:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D3I2Gf074097; Sun, 13 Jun 2021 03:18:02 GMT (envelope-from git) Date: Sun, 13 Jun 2021 03:18:02 GMT Message-Id: <202106130318.15D3I2Gf074097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: eee7786f7523 - main - zfs: fix invalid entries in ObsoleteFiles.inc added in 3ff01b231 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eee7786f75238ad6a96ab95d8f2ca329a931e00f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 03:18:03 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=eee7786f75238ad6a96ab95d8f2ca329a931e00f commit eee7786f75238ad6a96ab95d8f2ca329a931e00f Author: Martin Matuska AuthorDate: 2021-06-13 03:17:15 +0000 Commit: Martin Matuska CommitDate: 2021-06-13 03:17:15 +0000 zfs: fix invalid entries in ObsoleteFiles.inc added in 3ff01b231 --- ObsoleteFiles.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1e47821fe696..be8c22346501 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -44,11 +44,11 @@ OLD_FILES+=usr/share/man/man5/spl-module-parameters.5.gz OLD_FILES+=usr/share/man/man5/zfs-events.5.gz OLD_FILES+=usr/share/man/man5/zfs-module-parameters.5.gz -OLD_FILES+=usr/share/man/man8/zfsconcepts.8 -OLD_FILES+=usr/share/man/man8/zfsprops.8 +OLD_FILES+=usr/share/man/man8/zfsconcepts.8.gz +OLD_FILES+=usr/share/man/man8/zfsprops.8.gz OLD_FILES+=usr/share/man/man5/zpool-features.5.gz -OLD_FILES+=usr/share/man/man8/zpoolconcepts.8 -OLD_FILES+=usr/share/man/man8/zpoolprops.8 +OLD_FILES+=usr/share/man/man8/zpoolconcepts.8.gz +OLD_FILES+=usr/share/man/man8/zpoolprops.8.gz # 20210611: Remove svn and svnlite OLD_FILES+=usr/bin/svn From owner-dev-commits-src-all@freebsd.org Sun Jun 13 03:46:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FC35655DBE; Sun, 13 Jun 2021 03:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2gV31SLBz4q1j; Sun, 13 Jun 2021 03:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A7F81A59E; Sun, 13 Jun 2021 03:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D3k3Eq012814; Sun, 13 Jun 2021 03:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D3k3Xh012813; Sun, 13 Jun 2021 03:46:03 GMT (envelope-from git) Date: Sun, 13 Jun 2021 03:46:03 GMT Message-Id: <202106130346.15D3k3Xh012813@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 44877c8db05b - main - zfs: change zstream -> zstreamdump link into a symlink MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44877c8db05b80e7c3034c692414d580671680d7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 03:46:03 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=44877c8db05b80e7c3034c692414d580671680d7 commit 44877c8db05b80e7c3034c692414d580671680d7 Author: Martin Matuska AuthorDate: 2021-06-13 03:17:15 +0000 Commit: Martin Matuska CommitDate: 2021-06-13 03:40:18 +0000 zfs: change zstream -> zstreamdump link into a symlink --- cddl/usr.bin/zstream/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/usr.bin/zstream/Makefile b/cddl/usr.bin/zstream/Makefile index ac3bfeb68cf4..cfcff71a813f 100644 --- a/cddl/usr.bin/zstream/Makefile +++ b/cddl/usr.bin/zstream/Makefile @@ -15,7 +15,7 @@ SRCS= \ zstream_redup.c \ zstream_token.c -LINKS= ${BINDIR}/zstream ${BINDIR}/zstreamdump +SYMLINKS= ${BINDIR}/zstream ${BINDIR}/zstreamdump WARNS?= 2 CFLAGS+= \ From owner-dev-commits-src-all@freebsd.org Sun Jun 13 03:47:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF206655D4C; Sun, 13 Jun 2021 03:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2gWD654cz4qJ0; Sun, 13 Jun 2021 03:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B93E61A52E; Sun, 13 Jun 2021 03:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D3l4kP012995; Sun, 13 Jun 2021 03:47:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D3l4b7012994; Sun, 13 Jun 2021 03:47:04 GMT (envelope-from git) Date: Sun, 13 Jun 2021 03:47:04 GMT Message-Id: <202106130347.15D3l4b7012994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: b0c251b0dea8 - stable/13 - zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b0c251b0dea8ab1476e42aa49a888b0d969020d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 03:47:05 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=b0c251b0dea8ab1476e42aa49a888b0d969020d2 commit b0c251b0dea8ab1476e42aa49a888b0d969020d2 Merge: cfd6c9b99f49 c3b60ededa6e Author: Martin Matuska AuthorDate: 2021-06-13 02:47:27 +0000 Commit: Martin Matuska CommitDate: 2021-06-13 03:43:03 +0000 zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13 Notable upstream pull request merges: #12015 Replace zstreamdump with zstream link #12046 Improve scrub maxinflight_bytes math. #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI #12072 Let zfs diff be more permissive #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat #12104 Reminder to update boot code after zpool upgrade #12114 Introduce write-mostly sums #12125 Modernise all (most) remaining .TH manpages #12145 More aggsum optimizations #12149 Multiple man-pages: Move to appropriate section #12158 Re-embed multilist_t storage #12177 Livelist logic should handle dedup blkptrs #12196 Unify manpage makefiles, move pages to better sexions, revisit some #12212 Remove pool io kstats Obtained from: OpenZFS OpenZFS commit: c3b60ededa6e6ce36a457a54451ca153c4c630dc OpenZFS tag: zfs-2.1.0-rc7 ObsoleteFiles.inc | 10 + cddl/sbin/zfs/Makefile | 5 +- cddl/sbin/zpool/Makefile | 13 +- cddl/usr.bin/Makefile | 2 - cddl/usr.bin/zstream/Makefile | 3 + cddl/usr.bin/zstreamdump/Makefile | 11 - cddl/usr.bin/zstreamdump/Makefile.depend | 25 - .../openzfs/.github/ISSUE_TEMPLATE/config.yml | 2 +- sys/contrib/openzfs/META | 2 +- sys/contrib/openzfs/Makefile.am | 48 +- sys/contrib/openzfs/cmd/Makefile.am | 8 +- sys/contrib/openzfs/cmd/arc_summary/arc_summary3 | 6 + sys/contrib/openzfs/cmd/fsck_zfs/Makefile.am | 1 + sys/contrib/openzfs/cmd/fsck_zfs/fsck.zfs.in | 6 +- sys/contrib/openzfs/cmd/vdev_id/Makefile.am | 2 + sys/contrib/openzfs/cmd/zdb/zdb.c | 117 +- sys/contrib/openzfs/cmd/zed/Makefile.am | 2 + sys/contrib/openzfs/cmd/zed/zed.d/Makefile.am | 4 + sys/contrib/openzfs/cmd/zed/zed.d/all-debug.sh | 16 +- sys/contrib/openzfs/cmd/zed/zed.d/all-syslog.sh | 1 + .../zed/zed.d/history_event-zfs-list-cacher.sh.in | 19 +- sys/contrib/openzfs/cmd/zed/zed.d/zed-functions.sh | 12 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 38 +- sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c | 16 +- sys/contrib/openzfs/cmd/zpool/Makefile.am | 1 + .../openzfs/cmd/zpool/os/freebsd/zpool_vdev_os.c | 15 + .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 5 + sys/contrib/openzfs/cmd/zpool/zpool.d/smart | 15 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 28 +- sys/contrib/openzfs/cmd/zpool/zpool_util.h | 1 + .../ZFS-pool-latency-heatmaps-influxdb.json | 4 +- sys/contrib/openzfs/cmd/zstream/Makefile.am | 3 + sys/contrib/openzfs/cmd/zstream/zstream.c | 5 + sys/contrib/openzfs/cmd/zstreamdump/Makefile.am | 1 - sys/contrib/openzfs/cmd/zstreamdump/zstreamdump | 3 - sys/contrib/openzfs/cmd/ztest/ztest.c | 273 +- sys/contrib/openzfs/cmd/zvol_wait/Makefile.am | 2 + sys/contrib/openzfs/cmd/zvol_wait/zvol_wait | 1 + sys/contrib/openzfs/config/Shellcheck.am | 22 + sys/contrib/openzfs/config/always-shellcheck.m4 | 10 + sys/contrib/openzfs/config/ax_python_devel.m4 | 3 +- sys/contrib/openzfs/config/kernel-percpu.m4 | 27 + sys/contrib/openzfs/config/zfs-build.m4 | 18 + sys/contrib/openzfs/configure.ac | 5 +- sys/contrib/openzfs/contrib/Makefile.am | 4 + .../openzfs/contrib/bash_completion.d/Makefile.am | 5 + .../openzfs/contrib/bash_completion.d/zfs.in | 76 +- sys/contrib/openzfs/contrib/bpftrace/Makefile.am | 4 + .../dracut/02zfsexpandknowledge/Makefile.am | 1 + .../dracut/02zfsexpandknowledge/module-setup.sh.in | 50 +- .../openzfs/contrib/dracut/90zfs/.gitignore | 13 +- .../openzfs/contrib/dracut/90zfs/Makefile.am | 7 +- .../dracut/90zfs/import-opts-generator.sh.in | 5 + .../contrib/dracut/90zfs/module-setup.sh.in | 44 +- .../openzfs/contrib/dracut/90zfs/mount-zfs.sh.in | 10 +- .../openzfs/contrib/dracut/90zfs/parse-zfs.sh.in | 3 +- .../contrib/dracut/90zfs/zfs-generator.sh.in | 1 + .../openzfs/contrib/dracut/90zfs/zfs-lib.sh.in | 10 +- .../contrib/dracut/90zfs/zfs-load-key.sh.in | 8 +- sys/contrib/openzfs/contrib/dracut/Makefile.am | 3 + sys/contrib/openzfs/contrib/initramfs/Makefile.am | 3 + .../openzfs/contrib/initramfs/hooks/Makefile.am | 1 + sys/contrib/openzfs/contrib/initramfs/hooks/zfs.in | 125 +- .../openzfs/contrib/initramfs/hooks/zfsunlock.in | 16 +- .../openzfs/contrib/initramfs/scripts/Makefile.am | 7 +- .../initramfs/scripts/local-top/Makefile.am | 2 + .../contrib/initramfs/scripts/local-top/zfs | 21 +- sys/contrib/openzfs/contrib/initramfs/scripts/zfs | 65 +- sys/contrib/openzfs/etc/Makefile.am | 4 + sys/contrib/openzfs/etc/default/Makefile.am | 4 + sys/contrib/openzfs/etc/init.d/Makefile.am | 3 + sys/contrib/openzfs/etc/init.d/zfs-import.in | 26 +- sys/contrib/openzfs/etc/init.d/zfs-mount.in | 49 +- sys/contrib/openzfs/etc/init.d/zfs-share.in | 6 +- sys/contrib/openzfs/etc/init.d/zfs-zed.in | 31 +- sys/contrib/openzfs/etc/systemd/Makefile.am | 3 + .../etc/systemd/system-generators/Makefile.am | 14 +- .../system-generators/zfs-mount-generator.c | 1083 +++++ .../system-generators/zfs-mount-generator.in | 474 --- .../etc/systemd/system/zfs-import-cache.service.in | 2 +- .../etc/systemd/system/zfs-import-scan.service.in | 2 +- sys/contrib/openzfs/etc/zfs/Makefile.am | 3 + sys/contrib/openzfs/etc/zfs/zfs-functions.in | 97 +- .../openzfs/include/os/freebsd/spl/sys/Makefile.am | 1 + .../openzfs/include/os/freebsd/spl/sys/kstat.h | 4 - .../openzfs/include/os/freebsd/spl/sys/wmsum.h | 72 + .../openzfs/include/os/linux/spl/sys/Makefile.am | 1 + .../openzfs/include/os/linux/spl/sys/atomic.h | 4 + .../openzfs/include/os/linux/spl/sys/kstat.h | 4 - .../openzfs/include/os/linux/spl/sys/wmsum.h | 76 + sys/contrib/openzfs/include/sys/aggsum.h | 7 +- sys/contrib/openzfs/include/sys/arc_impl.h | 12 +- sys/contrib/openzfs/include/sys/dataset_kstats.h | 20 +- sys/contrib/openzfs/include/sys/dmu_objset.h | 4 +- sys/contrib/openzfs/include/sys/metaslab_impl.h | 2 +- sys/contrib/openzfs/include/sys/multilist.h | 3 +- sys/contrib/openzfs/include/sys/spa.h | 1 - sys/contrib/openzfs/include/sys/zfs_context.h | 6 - sys/contrib/openzfs/include/sys/zfs_ioctl_impl.h | 1 + sys/contrib/openzfs/lib/libnvpair/libnvpair_json.c | 15 +- .../openzfs/lib/libspl/asm-generic/atomic.c | 13 + sys/contrib/openzfs/lib/libspl/include/atomic.h | 43 + .../openzfs/lib/libspl/include/sys/Makefile.am | 1 + sys/contrib/openzfs/lib/libspl/include/sys/kstat.h | 6 - sys/contrib/openzfs/lib/libspl/include/sys/wmsum.h | 68 + sys/contrib/openzfs/lib/libspl/os/freebsd/mnttab.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 26 +- sys/contrib/openzfs/lib/libzfs/libzfs_diff.c | 46 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 8 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 72 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 34 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 4 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 30 - sys/contrib/openzfs/man/Makefile.am | 118 +- sys/contrib/openzfs/man/man1/Makefile.am | 12 - sys/contrib/openzfs/man/man1/arcstat.1 | 652 +-- sys/contrib/openzfs/man/man1/cstyle.1 | 259 +- sys/contrib/openzfs/man/man1/raidz_test.1 | 153 +- sys/contrib/openzfs/man/man1/zhack.1 | 168 +- sys/contrib/openzfs/man/man1/ztest.1 | 327 +- sys/contrib/openzfs/man/man1/zvol_wait.1 | 37 +- sys/contrib/openzfs/man/man4/spl.4 | 195 + sys/contrib/openzfs/man/man4/zfs.4 | 2380 +++++++++++ sys/contrib/openzfs/man/man5/Makefile.am | 16 - .../openzfs/man/man5/spl-module-parameters.5 | 326 -- sys/contrib/openzfs/man/man5/vdev_id.conf.5 | 429 +- sys/contrib/openzfs/man/man5/zfs-events.5 | 965 ----- .../openzfs/man/man5/zfs-module-parameters.5 | 4354 -------------------- sys/contrib/openzfs/man/man5/zpool-features.5 | 1077 ----- .../man/{man8/zfsconcepts.8 => man7/zfsconcepts.7} | 66 +- .../man/{man8/zfsprops.8 => man7/zfsprops.7} | 730 ++-- sys/contrib/openzfs/man/man7/zpool-features.7 | 842 ++++ .../{man8/zpoolconcepts.8 => man7/zpoolconcepts.7} | 277 +- .../man/{man8/zpoolprops.8 => man7/zpoolprops.7} | 136 +- sys/contrib/openzfs/man/man8/Makefile.am | 102 - sys/contrib/openzfs/man/man8/fsck.zfs.8 | 100 +- sys/contrib/openzfs/man/man8/mount.zfs.8 | 6 +- sys/contrib/openzfs/man/man8/vdev_id.8 | 154 +- sys/contrib/openzfs/man/man8/zdb.8 | 126 +- sys/contrib/openzfs/man/man8/zed.8.in | 380 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 202 +- sys/contrib/openzfs/man/man8/zfs-bookmark.8 | 26 +- sys/contrib/openzfs/man/man8/zfs-clone.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-create.8 | 27 +- sys/contrib/openzfs/man/man8/zfs-destroy.8 | 20 +- sys/contrib/openzfs/man/man8/zfs-diff.8 | 63 +- sys/contrib/openzfs/man/man8/zfs-hold.8 | 24 +- sys/contrib/openzfs/man/man8/zfs-jail.8 | 112 +- sys/contrib/openzfs/man/man8/zfs-list.8 | 56 +- sys/contrib/openzfs/man/man8/zfs-load-key.8 | 180 +- .../openzfs/man/man8/zfs-mount-generator.8.in | 387 +- sys/contrib/openzfs/man/man8/zfs-mount.8 | 32 +- sys/contrib/openzfs/man/man8/zfs-program.8 | 416 +- sys/contrib/openzfs/man/man8/zfs-project.8 | 98 +- sys/contrib/openzfs/man/man8/zfs-promote.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-receive.8 | 125 +- sys/contrib/openzfs/man/man8/zfs-rename.8 | 5 +- sys/contrib/openzfs/man/man8/zfs-rollback.8 | 18 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 290 +- sys/contrib/openzfs/man/man8/zfs-set.8 | 98 +- sys/contrib/openzfs/man/man8/zfs-share.8 | 16 +- sys/contrib/openzfs/man/man8/zfs-snapshot.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-upgrade.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-userspace.8 | 84 +- sys/contrib/openzfs/man/man8/zfs-wait.8 | 27 +- sys/contrib/openzfs/man/man8/zfs.8 | 486 ++- sys/contrib/openzfs/man/man8/zfs_ids_to_path.8 | 23 +- sys/contrib/openzfs/man/man8/zgenhostid.8 | 75 +- sys/contrib/openzfs/man/man8/zinject.8 | 378 +- sys/contrib/openzfs/man/man8/zpool-add.8 | 49 +- sys/contrib/openzfs/man/man8/zpool-attach.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-checkpoint.8 | 40 +- sys/contrib/openzfs/man/man8/zpool-clear.8 | 24 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 144 +- sys/contrib/openzfs/man/man8/zpool-destroy.8 | 17 +- sys/contrib/openzfs/man/man8/zpool-detach.8 | 21 +- sys/contrib/openzfs/man/man8/zpool-events.8 | 452 +- sys/contrib/openzfs/man/man8/zpool-export.8 | 23 +- sys/contrib/openzfs/man/man8/zpool-get.8 | 52 +- sys/contrib/openzfs/man/man8/zpool-history.8 | 16 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 119 +- sys/contrib/openzfs/man/man8/zpool-initialize.8 | 28 +- sys/contrib/openzfs/man/man8/zpool-iostat.8 | 236 +- sys/contrib/openzfs/man/man8/zpool-labelclear.8 | 16 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 43 +- sys/contrib/openzfs/man/man8/zpool-offline.8 | 29 +- sys/contrib/openzfs/man/man8/zpool-reguid.8 | 15 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 20 +- sys/contrib/openzfs/man/man8/zpool-reopen.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-replace.8 | 44 +- sys/contrib/openzfs/man/man8/zpool-resilver.8 | 27 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 31 +- sys/contrib/openzfs/man/man8/zpool-split.8 | 52 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 54 +- sys/contrib/openzfs/man/man8/zpool-sync.8 | 28 +- sys/contrib/openzfs/man/man8/zpool-trim.8 | 51 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 35 +- sys/contrib/openzfs/man/man8/zpool-wait.8 | 54 +- sys/contrib/openzfs/man/man8/zpool.8 | 385 +- sys/contrib/openzfs/man/man8/zpool_influxdb.8 | 141 +- sys/contrib/openzfs/man/man8/zstream.8 | 26 +- sys/contrib/openzfs/man/man8/zstreamdump.8 | 59 +- .../openzfs/module/os/freebsd/spl/spl_kstat.c | 62 - .../openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c | 17 + .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 15 + .../openzfs/module/os/linux/spl/spl-kmem-cache.c | 11 +- .../openzfs/module/os/linux/spl/spl-kstat.c | 66 - .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 6 + sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 3 - sys/contrib/openzfs/module/zfs/aggsum.c | 125 +- sys/contrib/openzfs/module/zfs/arc.c | 163 +- sys/contrib/openzfs/module/zfs/dataset_kstats.c | 48 +- sys/contrib/openzfs/module/zfs/dbuf.c | 20 +- sys/contrib/openzfs/module/zfs/dmu_objset.c | 30 +- sys/contrib/openzfs/module/zfs/dnode.c | 2 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 3 +- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 65 +- sys/contrib/openzfs/module/zfs/dsl_pool.c | 3 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 40 +- sys/contrib/openzfs/module/zfs/metaslab.c | 24 +- sys/contrib/openzfs/module/zfs/multilist.c | 14 +- sys/contrib/openzfs/module/zfs/spa_stats.c | 50 - sys/contrib/openzfs/module/zfs/vdev_queue.c | 47 - sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 27 + sys/contrib/openzfs/rpm/generic/zfs.spec.in | 2 + sys/contrib/openzfs/scripts/Makefile.am | 17 +- sys/contrib/openzfs/scripts/commitcheck.sh | 4 +- sys/contrib/openzfs/scripts/dkms.mkconf | 12 +- sys/contrib/openzfs/scripts/dkms.postbuild | 7 +- sys/contrib/openzfs/scripts/kmodtool | 14 +- sys/contrib/openzfs/scripts/make_gitrev.sh | 6 +- sys/contrib/openzfs/scripts/man-dates.sh | 2 +- sys/contrib/openzfs/scripts/mancheck.sh | 43 + sys/contrib/openzfs/scripts/paxcheck.sh | 3 +- sys/contrib/openzfs/scripts/zfs-tests.sh | 1 - sys/contrib/openzfs/scripts/zfs.sh | 4 +- sys/contrib/openzfs/scripts/zimport.sh | 17 +- sys/contrib/openzfs/scripts/zloop.sh | 17 +- sys/contrib/openzfs/scripts/zol2zfs-patch.sed | 2 +- sys/contrib/openzfs/tests/Makefile.am | 5 + sys/contrib/openzfs/tests/runfiles/common.run | 4 +- .../openzfs/tests/test-runner/man/test-runner.1 | 598 ++- .../tests/functional/cli_root/zdb/zdb_checksum.ksh | 1 + .../functional/cli_root/zdb/zdb_objset_id.ksh | 1 + .../zfs_destroy/zfs_clone_livelist_dedup.ksh | 88 + .../zpool_events/zpool_events_duplicates.ksh | 3 +- .../tests/functional/l2arc/l2arc_mfuonly_pos.ksh | 2 +- .../zfs-tests/tests/perf/scripts/prefetch_io.sh | 42 +- sys/contrib/openzfs/udev/rules.d/.gitignore | 5 +- sys/modules/zfs/zfs_config.h | 4 +- 250 files changed, 11645 insertions(+), 13940 deletions(-) diff --cc ObsoleteFiles.inc index 761d5f61dadd,000000000000..6c7031842714 mode 100644,000000..100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@@ -1,12010 -1,0 +1,12020 @@@ +# +# $FreeBSD$ +# +# This file lists old files (OLD_FILES), libraries (OLD_LIBS) and +# directories (OLD_DIRS) which should get removed at an update. Recently +# removed entries first (with the date as a comment). Dynamic libraries are +# special cased (OLD_LIBS). Static libraries or the generic links to +# the dynamic libraries (lib*.so) should (if you don't know why to make an +# exception, make this a "must") be viewed as normal files (OLD_FILES). +# +# In case of a complete directory hierarchy the sorting is in depth first +# order. +# +# Before you commit changes to this file please check if any entries in +# tools/build/mk/OptionalObsoleteFiles.inc can be removed. The following +# command tells which files are listed more than once regardless of some +# architecture specific conditionals, so you can not blindly trust the +# output: +# ( grep '+=' /usr/src/ObsoleteFiles.inc | sort -u ; \ +# grep '+=' /usr/src/tools/build/mk/OptionalObsoleteFiles.inc | sort -u) | \ +# sort | uniq -d +# +# To find regular duplicates not dependent on optional components, you can +# also use something that will not give you false positives, e.g.: +# for t in `make -V TARGETS universe`; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 TARGET=$t \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done +# +# For optional components, you can use the following to see if some entries +# in OptionalObsoleteFiles.inc have been obsoleted by ObsoleteFiles.inc +# for o in tools/build/options/WITH*; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 -D${o##*/} \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done + ++# 20210613: Rename OpenZFS manual pages ++OLD_FILES+=usr/share/man/man5/spl-module-parameters.5.gz ++OLD_FILES+=usr/share/man/man5/zfs-events.5.gz ++OLD_FILES+=usr/share/man/man5/zfs-module-parameters.5.gz ++OLD_FILES+=usr/share/man/man8/zfsconcepts.8.gz ++OLD_FILES+=usr/share/man/man8/zfsprops.8.gz ++OLD_FILES+=usr/share/man/man5/zpool-features.5.gz ++OLD_FILES+=usr/share/man/man8/zpoolconcepts.8.gz ++OLD_FILES+=usr/share/man/man8/zpoolprops.8.gz ++ +# 20210413: Remove pfctlinput2 +OLD_FILES+=usr/share/man/man9/pfctlinput2.9.gz + +# 20210329: Remove kernel-only crypto headers from /usr/include +OLD_FILES+=usr/include/crypto/_cryptodev.h +OLD_FILES+=usr/include/crypto/cbc_mac.h +OLD_FILES+=usr/include/crypto/deflate.h +OLD_FILES+=usr/include/crypto/gfmult.h +OLD_FILES+=usr/include/crypto/gmac.h +OLD_FILES+=usr/include/crypto/rijndael.h +OLD_FILES+=usr/include/crypto/rmd160.h +OLD_FILES+=usr/include/crypto/xform.h +OLD_FILES+=usr/include/crypto/xform_auth.h +OLD_FILES+=usr/include/crypto/xform_comp.h +OLD_FILES+=usr/include/crypto/xform_enc.h +OLD_FILES+=usr/include/crypto/xform_poly1305.h + +# 20210204: bump shared libraries which link against ncurses +OLD_LIBS+=lib/libedit.so.7 +OLD_LIBS+=usr/lib/libdialog.so.8 +OLD_LIBS+=usr/lib/libdpv.so.1 +OLD_LIBS+=usr/lib/libform.so.5 +OLD_LIBS+=usr/lib/libformw.so.5 +OLD_LIBS+=usr/lib/libmenu.so.5 +OLD_LIBS+=usr/lib/libmenuw.so.5 +OLD_LIBS+=usr/lib/libpanel.so.5 +OLD_LIBS+=usr/lib/libpanelw.so.5 + +# 20210116: if_wl_wavelan.h removed +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/if_wl_wavelan.h +.endif + +# 20210108: retire cmx, ng_bt3c, wi drivers +OLD_FILES+=usr/include/dev/wi/if_wireg.h +OLD_FILES+=usr/include/dev/wi/if_wavelan_ieee.h +OLD_FILES+=usr/include/dev/wi/if_wivar.h +OLD_FILES+=usr/sbin/bt3cfw +OLD_FILES+=usr/share/man/man4/cmw.4.gz +OLD_FILES+=usr/share/man/man4/ng_bt3c.4.gz +OLD_FILES+=usr/share/man/man4/wi.4.gz +OLD_FILES+=usr/share/man/man8/bt3cfw.8.gz + +# 20210107: retire a.out support +OLD_DIRS+=usr/lib/aout +OLD_DIRS+=usr/lib/compat/aout + +# 20210105: remove non widechar version of ncurses +OLD_LIBS+=lib/libncurses.so.9 + +# 20210103: new clang import which bumps version from 11.0.0 to 11.0.1. +OLD_FILES+=usr/lib/clang/11.0.0/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/11.0.0/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/11.0.0/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/11.0.0/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/11.0.0/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/fuzzer +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/__clang_openmp_device_functions.h +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/complex +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/complex.h +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/math.h +OLD_FILES+=usr/lib/clang/11.0.0/include/openmp_wrappers/new +OLD_DIRS+=usr/lib/clang/11.0.0/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/11.0.0/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/11.0.0/include/profile +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/11.0.0/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/11.0.0/include/xray +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_math.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_hip_libdevice_declares.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_hip_math.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__clang_hip_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/11.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/11.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/amxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_bf16.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_cde.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_mve.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/11.0.0/include/arm_sve.h +OLD_FILES+=usr/lib/clang/11.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cet.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/11.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/11.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/11.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/11.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/11.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/serializeintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/tsxldtrkintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/wasm_simd128.h +OLD_FILES+=usr/lib/clang/11.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/11.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/11.0.0/include +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-powerpc64le.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/11.0.0/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/11.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/11.0.0/lib +OLD_DIRS+=usr/lib/clang/11.0.0 + +# 20201225: libregex removed +OLD_FILES+=usr/lib/libgnuregex.so +OLD_LIBS+=usr/lib/libgnuregex.so.5 +OLD_FILES+=usr/lib/libgnuregex_p.a +OLD_FILES+=usr/include/gnu/posix/regex.h +OLD_DIRS+=usr/include/gnu/posix +OLD_FILES+=usr/include/gnu/regex.h +OLD_DIRS+=usr/include/gnu +OLD_FILES+=usr/include/gnuregex.h + +# 20201225: gnugrep removed +OLD_FILES+=usr/bin/bsdgrep +OLD_FILES+=usr/bin/gnugrep +OLD_FILES+=usr/share/man/man1/bsdgrep.1.gz +OLD_FILES+=usr/share/man/man1/gnugrep.1.gz + +# 20201224: mk48txx(4) removed +OLD_FILES+=usr/share/man/man4/mk48txx.4.gz + +# 20201215: in-tree gdb removed +OLD_FILES+=usr/libexec/gdb +OLD_FILES+=usr/libexec/kgdb + +# 20201211: hme(4) removed +OLD_FILES+=usr/share/man/man4/hme.4.gz +OLD_FILES+=usr/share/man/man4/if_hme.4.gz + +# 20201124: ping6(8) was merged into ping(8) +OLD_FILES+=usr/lib/debug/sbin/ping6.debug +OLD_FILES+=usr/share/man/man8/ping6.8.gz +OLD_FILES+=usr/tests/sbin/ping6/Kyuafile +OLD_FILES+=usr/tests/sbin/ping6/ping6_c1_s8_t1.out +OLD_FILES+=usr/tests/sbin/ping6/ping6_test +OLD_DIRS+=usr/tests/sbin/ping6 + +# 20201025: Remove cal data files +OLD_FILES+=usr/share/calendar/calendar.all +OLD_FILES+=usr/share/calendar/calendar.australia +OLD_FILES+=usr/share/calendar/calendar.birthday +OLD_FILES+=usr/share/calendar/calendar.brazilian +OLD_FILES+=usr/share/calendar/calendar.christian +OLD_FILES+=usr/share/calendar/calendar.computer +OLD_FILES+=usr/share/calendar/calendar.croatian +OLD_FILES+=usr/share/calendar/calendar.dutch +OLD_FILES+=usr/share/calendar/calendar.french +OLD_FILES+=usr/share/calendar/calendar.german +OLD_FILES+=usr/share/calendar/calendar.history +OLD_FILES+=usr/share/calendar/calendar.holiday +OLD_FILES+=usr/share/calendar/calendar.hungarian +OLD_FILES+=usr/share/calendar/calendar.judaic +OLD_FILES+=usr/share/calendar/calendar.lotr +OLD_FILES+=usr/share/calendar/calendar.music +OLD_FILES+=usr/share/calendar/calendar.newzealand +OLD_FILES+=usr/share/calendar/calendar.russian +OLD_FILES+=usr/share/calendar/calendar.southafrica +OLD_FILES+=usr/share/calendar/calendar.ukrainian +OLD_FILES+=usr/share/calendar/calendar.usholiday +OLD_FILES+=usr/share/calendar/calendar.world +OLD_FILES+=usr/share/calendar/de_AT.ISO_8859-15/calendar.feiertag +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.feiertag +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.geschichte +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.kirche +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.literatur +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.musik +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.wissenschaft +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.fetes +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.french +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.jferies +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.proverbes +OLD_FILES+=usr/share/calendar/hr_HR.ISO8859-2/calendar.all +OLD_FILES+=usr/share/calendar/hr_HR.ISO8859-2/calendar.praznici +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.all +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.nevnapok +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.unnepek +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.commemorative +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.holidays +OLD_FILES+=usr/share/calendar/pt_BR.ISO8859-1/calendar.mcommemorative +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.all +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.commemorative +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.holidays +OLD_FILES+=usr/share/calendar/pt_BR.UTF-8/calendar.mcommemorative +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.all +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.common +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.holiday +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.military +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.orthodox +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.pagan +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.all +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.common +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.holiday +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.military +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.orthodox +OLD_FILES+=usr/share/calendar/ru_RU.UTF-8/calendar.pagan +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.all +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.holiday +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.misc +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.orthodox + +# 20201004: logo files renamed to type-agnostic gfx-*.lua +OLD_FILES+=boot/lua/logo-beastie.lua +OLD_FILES+=boot/lua/logo-beastiebw.lua +OLD_FILES+=boot/lua/logo-fbsdbw.lua +OLD_FILES+=boot/lua/logo-orb.lua +OLD_FILES+=boot/lua/logo-orbbw.lua + +# 20200825: merged OpenZFS support +OLD_LIBS+=lib/libzfs.so.3 +OLD_LIBS+=usr/lib32/libzfs.so.3 + +# 20200923: memfd_test moved to /usr/tests/sys/posixshm +OLD_FILES+=usr/tests/sys/kern/memfd_test + +# 20200910: remove vm_map_create(9) to sync with the code +OLD_FILES+=usr/share/man/man9/vm_map_create.9.gz + +# 20200820: Removal of the ufm driver. +OLD_FILES+=usr/share/man/man4/ufm.4.gz + +# 20200816: new clang import which bumps version from 10.0.1 to 11.0.0. +OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/10.0.1/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/10.0.1/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/fuzzer +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/__clang_openmp_math.h +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/__clang_openmp_math_declares.h +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/10.0.1/include/openmp_wrappers/math.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/10.0.1/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/10.0.1/include/profile +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/sanitizer +OLD_FILES+=usr/lib/clang/10.0.1/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/10.0.1/include/xray +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/10.0.1/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/10.0.1/include/adxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/altivec.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ammintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm64intr.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_acle.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_mve.h +OLD_FILES+=usr/lib/clang/10.0.1/include/arm_neon.h +OLD_FILES+=usr/lib/clang/10.0.1/include/armintr.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/avxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/cetintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/cpuid.h +OLD_FILES+=usr/lib/clang/10.0.1/include/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/htmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/immintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/module.modulemap +OLD_FILES+=usr/lib/clang/10.0.1/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/msa.h +OLD_FILES+=usr/lib/clang/10.0.1/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/10.0.1/include/opencl-c.h +OLD_FILES+=usr/lib/clang/10.0.1/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/s390intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/shaintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vadefs.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vecintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/x86intrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xopintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/10.0.1/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/10.0.1/include +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.stats_client-i386.a *** 12422 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sun Jun 13 04:21:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDEB4656888; Sun, 13 Jun 2021 04:21:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2hHW4YXBz4rT7; Sun, 13 Jun 2021 04:21:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84B601AD29; Sun, 13 Jun 2021 04:21:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D4Lx0I065152; Sun, 13 Jun 2021 04:21:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D4Lxt4065151; Sun, 13 Jun 2021 04:21:59 GMT (envelope-from git) Date: Sun, 13 Jun 2021 04:21:59 GMT Message-Id: <202106130421.15D4Lxt4065151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7cf9caf294ce - main - updating: note recent removals MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cf9caf294ce692b8c01b201fe00b65a8a413937 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 04:21:59 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7cf9caf294ce692b8c01b201fe00b65a8a413937 commit 7cf9caf294ce692b8c01b201fe00b65a8a413937 Author: Warner Losh AuthorDate: 2021-06-13 04:21:28 +0000 Commit: Warner Losh CommitDate: 2021-06-13 04:21:28 +0000 updating: note recent removals --- UPDATING | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPDATING b/UPDATING index 6206e658d524..8b4d4a4820f6 100644 --- a/UPDATING +++ b/UPDATING @@ -27,11 +27,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20210611: + svnlite has been removed from base. Should you need svn for any reason + please install the svn package or port. + 20210611: Commit e1a907a25cfa changed the internal KAPI between the krpc and nfsserver. As such, both modules must be rebuilt from sources. Bump __FreeBSD_version to 1400022. +20210610: + The an(4) driver has been removed from FreeBSD. + 20210608: The vendor/openzfs branch was renamed to vendor/openzfs/legacy to start tracking OpenZFS upstream more closely. Please see From owner-dev-commits-src-all@freebsd.org Sun Jun 13 04:28:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00E8B656A24; Sun, 13 Jun 2021 04:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2hQj6Ljsz4rrS; Sun, 13 Jun 2021 04:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C21461AD92; Sun, 13 Jun 2021 04:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D4SDaD066520; Sun, 13 Jun 2021 04:28:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D4SDtT066519; Sun, 13 Jun 2021 04:28:13 GMT (envelope-from git) Date: Sun, 13 Jun 2021 04:28:13 GMT Message-Id: <202106130428.15D4SDtT066519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f06fa6f88733 - main - syslogd: fix WITHOUT_INET builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f06fa6f88733d709a5f9dd3a27b1a08571e49e6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 04:28:14 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f06fa6f88733d709a5f9dd3a27b1a08571e49e6b commit f06fa6f88733d709a5f9dd3a27b1a08571e49e6b Author: Artem Khramov AuthorDate: 2021-06-12 17:21:13 +0000 Commit: Warner Losh CommitDate: 2021-06-13 04:25:35 +0000 syslogd: fix WITHOUT_INET builds Since 2d82b47 syslogd can't be built with `WITHOUT_INET` or `WITHOUT_INET6` build variables set, because `iovlist_truncate` is not defined but used. This change wraps the problematic `iovlist_truncate` call within ifdef directive. It's compiled out in this situation... Pull Request: https://github.com/freebsd/freebsd-src/pull/475 Reviewed by: imp@ (commit message slightly tweaked) --- usr.sbin/syslogd/syslogd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index d8a2c0a5680e..1837c41c4e8b 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1867,8 +1867,10 @@ fprintlog_write(struct filed *f, struct iovlist *il, int flags) dprintf("\n"); } +#if defined(INET) || defined(INET6) /* Truncate messages to maximum forward length. */ iovlist_truncate(il, MaxForwardLen); +#endif lsent = 0; for (r = f->fu_forw_addr; r; r = r->ai_next) { From owner-dev-commits-src-all@freebsd.org Sun Jun 13 08:31:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B6B4658DFA; Sun, 13 Jun 2021 08:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G2nq46G9Tz56Kd; Sun, 13 Jun 2021 08:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFD961DF23; Sun, 13 Jun 2021 08:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15D8VCDr093159; Sun, 13 Jun 2021 08:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15D8VCib093158; Sun, 13 Jun 2021 08:31:12 GMT (envelope-from git) Date: Sun, 13 Jun 2021 08:31:12 GMT Message-Id: <202106130831.15D8VCib093158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 8345c513c552 - main - sg: get rid of unused include. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8345c513c552f458e0d3993e2606c5e98bb79c8b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 08:31:13 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=8345c513c552f458e0d3993e2606c5e98bb79c8b commit 8345c513c552f458e0d3993e2606c5e98bb79c8b Author: Dmitry Chagin AuthorDate: 2021-06-13 08:30:49 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-13 08:30:49 +0000 sg: get rid of unused include. sg driver does not depends on the Linuxulator any more. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30750 MFC after: 2 weeks --- sys/cam/scsi/scsi_sg.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cam/scsi/scsi_sg.c b/sys/cam/scsi/scsi_sg.c index 8e3f0a27ab58..6b6e65a39f75 100644 --- a/sys/cam/scsi/scsi_sg.c +++ b/sys/cam/scsi/scsi_sg.c @@ -60,8 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - typedef enum { SG_FLAG_LOCKED = 0x01, SG_FLAG_INVALID = 0x02 From owner-dev-commits-src-all@freebsd.org Sun Jun 13 16:23:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E73365F18B; Sun, 13 Jun 2021 16:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G30JD3nv6z3tW5; Sun, 13 Jun 2021 16:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A6E423F7A; Sun, 13 Jun 2021 16:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DGNexU020443; Sun, 13 Jun 2021 16:23:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DGNeEZ020442; Sun, 13 Jun 2021 16:23:40 GMT (envelope-from git) Date: Sun, 13 Jun 2021 16:23:40 GMT Message-Id: <202106131623.15DGNeEZ020442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d21c884e52eb - main - USB/U3G: Added Panasonic CF-F9 GOBI 3G modem to U3G module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d21c884e52eb3b3978abc10ed79b9cd323266684 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 16:23:40 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d21c884e52eb3b3978abc10ed79b9cd323266684 commit d21c884e52eb3b3978abc10ed79b9cd323266684 Author: CeDeROM Tomasz CEDRO AuthorDate: 2021-06-13 16:08:42 +0000 Commit: Warner Losh CommitDate: 2021-06-13 16:23:01 +0000 USB/U3G: Added Panasonic CF-F9 GOBI 3G modem to U3G module. Add kernel support for the Panasonic GOBI 3g modem. Note: GOBI modems require QDL firmware to be uploaded with gobi_loader: https://github.com/cederom/gobi_loader. Signed-off-by: CeDeROM Tomasz CEDRO Pull Request: https://github.com/freebsd/freebsd-src/pull/115 Reviewed by: imp (split off kernel bits from original) --- sys/dev/usb/serial/u3g.c | 2 ++ sys/dev/usb/usbdevs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 8cc468dec880..22e4e8f6b2bb 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -397,6 +397,8 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(OPTION, GTMAXHSUPA, 0), U3G_DEV(OPTION, GTMAXHSUPAE, 0), U3G_DEV(OPTION, VODAFONEMC3G, 0), + U3G_DEV(PANASONIC, CFF9_3G_QDL, 0), + U3G_DEV(PANASONIC, CFF9_3G, 0), U3G_DEV(QISDA, H20_1, 0), U3G_DEV(QISDA, H20_2, 0), U3G_DEV(QISDA, H21_1, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 53e074d3fd61..1183b4e283e4 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -3636,6 +3636,8 @@ product PANASONIC KXLRW32AN 0x0d09 CD-R Drive KXL-RW32AN product PANASONIC KXLCB20AN 0x0d0a CD-R Drive KXL-CB20AN product PANASONIC KXLCB35AN 0x0d0e DVD-ROM & CD-R/RW product PANASONIC SDCAAE 0x1b00 MultiMediaCard +product PANASONIC CFF9_3G_QDL 0x250e ToughBook CF-F9 GOBI 3G Modem Loader +product PANASONIC CFF9_3G 0x250f ToughBook CF-F9 GOBI 3G Modem product PANASONIC TYTP50P6S 0x3900 TY-TP50P6-S 50in Touch Panel /* Papouch products */ From owner-dev-commits-src-all@freebsd.org Sun Jun 13 16:23:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C392B65EE58; Sun, 13 Jun 2021 16:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G30JF4xnDz3tY2; Sun, 13 Jun 2021 16:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D57F243F1; Sun, 13 Jun 2021 16:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DGNf3Y020467; Sun, 13 Jun 2021 16:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DGNfcx020466; Sun, 13 Jun 2021 16:23:41 GMT (envelope-from git) Date: Sun, 13 Jun 2021 16:23:41 GMT Message-Id: <202106131623.15DGNfcx020466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bb130ff39747 - main - u3g: Document Panasonic CF-F9 GOBI support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb130ff39747b94592cb26d71b7cb097b9a4ea6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 16:23:41 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bb130ff39747b94592cb26d71b7cb097b9a4ea6b commit bb130ff39747b94592cb26d71b7cb097b9a4ea6b Author: Warner Losh AuthorDate: 2021-06-13 16:14:54 +0000 Commit: Warner Losh CommitDate: 2021-06-13 16:23:01 +0000 u3g: Document Panasonic CF-F9 GOBI support Document that the u3g driver supports the Panasonic CF-F9 GOBI. Note that gobi_loader is needed and give URL for that. There is a separate review for during a related version into a port at D22938, but it seems stalled. I'll update the docs when it arrives in ports. Sponsored by: Netflix --- share/man/man4/u3g.4 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man4/u3g.4 b/share/man/man4/u3g.4 index 014a789cb57c..64c8b0a5015f 100644 --- a/share/man/man4/u3g.4 +++ b/share/man/man4/u3g.4 @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2018 +.Dd June 13, 2021 .Dt U3G 4 .Os .Sh NAME @@ -75,6 +75,8 @@ Huawei B190, E180v, E220 ('') Novatel U740, MC950D, X950D, etc. .It Sierra MC875U, MC8775U, etc. +.It +Panasonic CF-F9 GOBI .El .Pp (See @@ -147,3 +149,7 @@ Hardware for testing was provided by AnyWi Technologies, Leiden, NL. The automatic mode switch from disk mode to modem mode does not work unless the driver is either built into the kernel or loaded before the device is connected. +.Pp +The Panasonic CF-F9 requires the gobi loader available from +.Pa https://github.com/cederom/gobi_loader +and loading of the firmware before it will function. From owner-dev-commits-src-all@freebsd.org Sun Jun 13 19:15:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3544B643C7F; Sun, 13 Jun 2021 19:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G34705MqPz4bg0; Sun, 13 Jun 2021 19:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68032264DB; Sun, 13 Jun 2021 19:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DJFu16047329; Sun, 13 Jun 2021 19:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DJFuxW047328; Sun, 13 Jun 2021 19:15:56 GMT (envelope-from git) Date: Sun, 13 Jun 2021 19:15:56 GMT Message-Id: <202106131915.15DJFuxW047328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 2a8921c5d187 - stable/13 - pciconf: Use VM_MEMATTR_DEVICE on supported architectures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a8921c5d187a2c3f1b709cc77c839568ede0b8d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 19:15:57 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2a8921c5d187a2c3f1b709cc77c839568ede0b8d commit 2a8921c5d187a2c3f1b709cc77c839568ede0b8d Author: Marcin Wojtas AuthorDate: 2021-04-06 15:00:05 +0000 Commit: Andrew Turner CommitDate: 2021-06-13 15:49:36 +0000 pciconf: Use VM_MEMATTR_DEVICE on supported architectures Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE when mapping device registers in kernel. Do the same in pciconf. On armada8k SoC all reads from BARs mapped with hitherto attribute (VM_MEMATTR_UNCACHEABLE) return 0xff's. Submitted by: Kornel Duleba Reviewed by: kib Obtained from: Semihalf Sponsored by: Marvell Differential revision: https://reviews.freebsd.org/D29603 (cherry picked from commit 1c1ead9b94a1a731646327ec3b09e8f3acd577b8) --- usr.sbin/pciconf/pciconf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 817de6ec09ed..6b54687d7c79 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -1126,7 +1126,11 @@ dump_bar(const char *name, const char *reg, const char *bar_start, if (*reg == '\0' || *el != '\0') errx(1, "Invalid bar specification %s", reg); pbm.pbm_flags = 0; - pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; /* XXX */ +#ifdef VM_MEMATTR_DEVICE + pbm.pbm_memattr = VM_MEMATTR_DEVICE; +#else + pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; +#endif fd = open(_PATH_DEVPCI, O_RDWR, 0); if (fd < 0) From owner-dev-commits-src-all@freebsd.org Sun Jun 13 19:15:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD0C064384F; Sun, 13 Jun 2021 19:15:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G34714Nqyz4blk; Sun, 13 Jun 2021 19:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F79D264DC; Sun, 13 Jun 2021 19:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DJFv2g047353; Sun, 13 Jun 2021 19:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DJFvlI047352; Sun, 13 Jun 2021 19:15:57 GMT (envelope-from git) Date: Sun, 13 Jun 2021 19:15:57 GMT Message-Id: <202106131915.15DJFvlI047352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: ade8b810b02f - stable/13 - Create VM_MEMATTR_DEVICE on all architectures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ade8b810b02fd6f7ab9e68afa18e3d34c7a1c1a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 19:15:58 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ade8b810b02fd6f7ab9e68afa18e3d34c7a1c1a8 commit ade8b810b02fd6f7ab9e68afa18e3d34c7a1c1a8 Author: Andrew Turner AuthorDate: 2021-04-10 07:59:29 +0000 Commit: Andrew Turner CommitDate: 2021-06-13 15:49:36 +0000 Create VM_MEMATTR_DEVICE on all architectures This is intended to be used with memory mapped IO, e.g. from bus_space_map with no flags, or pmap_mapdev. Use this new memory type in the map request configured by resource_init_map_request, and in pciconf. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D29692 (cherry picked from commit 5d2d599d3f3494d813e51e1bcd1c9693eb9c098b) --- sys/amd64/include/vm.h | 1 + sys/i386/include/vm.h | 1 + sys/kern/subr_bus.c | 2 +- sys/mips/include/vm.h | 1 + sys/powerpc/include/vm.h | 2 ++ usr.sbin/pciconf/pciconf.c | 4 ---- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/amd64/include/vm.h b/sys/amd64/include/vm.h index 2e9c30da9936..fef7a53ca317 100644 --- a/sys/amd64/include/vm.h +++ b/sys/amd64/include/vm.h @@ -43,5 +43,6 @@ #define VM_MEMATTR_WEAK_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHED) #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK +#define VM_MEMATTR_DEVICE VM_MEMATTR_UNCACHEABLE #endif /* !_MACHINE_VM_H_ */ diff --git a/sys/i386/include/vm.h b/sys/i386/include/vm.h index 2e9c30da9936..fef7a53ca317 100644 --- a/sys/i386/include/vm.h +++ b/sys/i386/include/vm.h @@ -43,5 +43,6 @@ #define VM_MEMATTR_WEAK_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHED) #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK +#define VM_MEMATTR_DEVICE VM_MEMATTR_UNCACHEABLE #endif /* !_MACHINE_VM_H_ */ diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 6d5607337ef6..f0198a0e1fa3 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3117,7 +3117,7 @@ resource_init_map_request_impl(struct resource_map_request *args, size_t sz) { bzero(args, sz); args->size = sz; - args->memattr = VM_MEMATTR_UNCACHEABLE; + args->memattr = VM_MEMATTR_DEVICE; } /** diff --git a/sys/mips/include/vm.h b/sys/mips/include/vm.h index 06af199db17b..c759d8cfa61e 100644 --- a/sys/mips/include/vm.h +++ b/sys/mips/include/vm.h @@ -38,6 +38,7 @@ #define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)MIPS_CCA_UNCACHED) #define VM_MEMATTR_WRITE_BACK ((vm_memattr_t)MIPS_CCA_CACHED) #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK +#define VM_MEMATTR_DEVICE VM_MEMATTR_UNCACHEABLE #ifdef MIPS_CCA_WC #define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)MIPS_CCA_WC) #endif diff --git a/sys/powerpc/include/vm.h b/sys/powerpc/include/vm.h index 3af863509908..692bd8fc2d77 100644 --- a/sys/powerpc/include/vm.h +++ b/sys/powerpc/include/vm.h @@ -42,4 +42,6 @@ #define VM_MEMATTR_WRITE_THROUGH 0x10 #define VM_MEMATTR_PREFETCHABLE 0x20 +#define VM_MEMATTR_DEVICE VM_MEMATTR_DEFAULT + #endif /* !_MACHINE_VM_H_ */ diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 6b54687d7c79..ccc816d5986d 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -1126,11 +1126,7 @@ dump_bar(const char *name, const char *reg, const char *bar_start, if (*reg == '\0' || *el != '\0') errx(1, "Invalid bar specification %s", reg); pbm.pbm_flags = 0; -#ifdef VM_MEMATTR_DEVICE pbm.pbm_memattr = VM_MEMATTR_DEVICE; -#else - pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; -#endif fd = open(_PATH_DEVPCI, O_RDWR, 0); if (fd < 0) From owner-dev-commits-src-all@freebsd.org Sun Jun 13 20:02:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FD1365039D; Sun, 13 Jun 2021 20:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G35983LM2z4gl2; Sun, 13 Jun 2021 20:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC7926CE6; Sun, 13 Jun 2021 20:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DK2qLY014087; Sun, 13 Jun 2021 20:02:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DK2kET014079; Sun, 13 Jun 2021 20:02:46 GMT (envelope-from git) Date: Sun, 13 Jun 2021 20:02:46 GMT Message-Id: <202106132002.15DK2kET014079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: e8d8bef961a5 - main - Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8d8bef961a50d4dc22501cde4fb9fb0be1b2532 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 20:02:52 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e8d8bef961a50d4dc22501cde4fb9fb0be1b2532 commit e8d8bef961a50d4dc22501cde4fb9fb0be1b2532 Merge: bb130ff39747 b60736ec1405 Author: Dimitry Andric AuthorDate: 2021-06-13 19:31:46 +0000 Commit: Dimitry Andric CommitDate: 2021-06-13 19:37:19 +0000 Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the upstream release/12.x branch was created. PR: 255570 MFC after: 6 weeks ObsoleteFiles.inc | 284 ++ contrib/llvm-project/clang/include/clang-c/Index.h | 88 +- .../llvm-project/clang/include/clang-c/Rewrite.h | 63 + .../include/clang/APINotes/APINotesYAMLCompiler.h | 24 + .../clang/include/clang/APINotes/Types.h | 734 +++ .../clang/include/clang/ARCMigrate/FileRemapper.h | 8 + .../llvm-project/clang/include/clang/AST/APValue.h | 163 +- .../clang/include/clang/AST/ASTContext.h | 127 +- .../llvm-project/clang/include/clang/AST/ASTFwd.h | 6 +- .../clang/include/clang/AST/ASTImporter.h | 8 + .../clang/include/clang/AST/ASTNodeTraverser.h | 72 +- .../include/clang/AST/ASTStructuralEquivalence.h | 7 + .../clang/include/clang/AST/ASTTypeTraits.h | 74 +- .../clang/include/clang/AST/AbstractBasicReader.h | 34 + .../clang/include/clang/AST/AbstractBasicWriter.h | 35 + .../llvm-project/clang/include/clang/AST/Attr.h | 39 +- .../clang/include/clang/AST/CXXInheritance.h | 10 - .../clang/AST/CXXRecordDeclDefinitionBits.def | 7 + .../clang/include/clang/AST/CanonicalType.h | 4 +- .../clang/include/clang/AST/CommentLexer.h | 31 +- .../clang/include/clang/AST/ComputeDependence.h | 4 +- .../llvm-project/clang/include/clang/AST/Decl.h | 134 +- .../clang/include/clang/AST/DeclBase.h | 3 +- .../llvm-project/clang/include/clang/AST/DeclCXX.h | 96 +- .../clang/include/clang/AST/DeclObjC.h | 45 +- .../clang/include/clang/AST/DeclOpenMP.h | 246 +- .../clang/include/clang/AST/DeclTemplate.h | 117 +- .../clang/include/clang/AST/DeclarationName.h | 23 +- .../clang/include/clang/AST/DependenceFlags.h | 1 + .../clang/include/clang/AST/DependentDiagnostic.h | 10 +- .../llvm-project/clang/include/clang/AST/Expr.h | 402 +- .../llvm-project/clang/include/clang/AST/ExprCXX.h | 297 +- .../clang/include/clang/AST/ExprConcepts.h | 6 +- .../clang/include/clang/AST/ExprObjC.h | 4 +- .../clang/include/clang/AST/ExternalASTSource.h | 4 - .../clang/include/clang/AST/GlobalDecl.h | 1 + .../clang/include/clang/AST/IgnoreExpr.h | 161 + .../llvm-project/clang/include/clang/AST/Mangle.h | 17 +- .../clang/include/clang/AST/NestedNameSpecifier.h | 34 +- .../clang/include/clang/AST/OpenMPClause.h | 494 +- .../clang/include/clang/AST/OperationKinds.def | 11 +- .../clang/include/clang/AST/OptionalDiagnostic.h | 2 +- .../clang/include/clang/AST/ParentMap.h | 4 +- .../clang/include/clang/AST/ParentMapContext.h | 13 +- .../clang/include/clang/AST/PrettyPrinter.h | 40 +- .../clang/include/clang/AST/PropertiesBase.td | 308 ++ .../clang/include/clang/AST/RecordLayout.h | 65 +- .../clang/include/clang/AST/RecursiveASTVisitor.h | 56 +- .../clang/include/clang/AST/Redeclarable.h | 15 + .../llvm-project/clang/include/clang/AST/Stmt.h | 60 +- .../clang/include/clang/AST/StmtIterator.h | 9 +- .../clang/include/clang/AST/StmtOpenMP.h | 1653 +++--- .../clang/include/clang/AST/TemplateBase.h | 72 +- .../clang/include/clang/AST/TemplateName.h | 6 +- .../clang/include/clang/AST/TextNodeDumper.h | 3 + .../llvm-project/clang/include/clang/AST/Type.h | 163 +- .../llvm-project/clang/include/clang/AST/TypeLoc.h | 93 +- .../clang/include/clang/AST/TypeProperties.td | 12 +- .../include/clang/ASTMatchers/ASTMatchFinder.h | 4 + .../clang/include/clang/ASTMatchers/ASTMatchers.h | 574 ++- .../clang/ASTMatchers/ASTMatchersInternal.h | 996 ++-- .../include/clang/ASTMatchers/ASTMatchersMacros.h | 58 +- .../clang/ASTMatchers/Dynamic/VariantValue.h | 40 +- .../clang/Analysis/Analyses/CalledOnceCheck.h | 112 + .../include/clang/Analysis/Analyses/Dominators.h | 70 - .../clang/Analysis/Analyses/LiveVariables.h | 18 +- .../include/clang/Analysis/Analyses/ThreadSafety.h | 8 + .../clang/Analysis/Analyses/ThreadSafetyTIL.h | 4 +- .../clang/include/clang/Analysis/CallGraph.h | 4 +- .../clang/include/clang/Analysis/IssueHash.h | 49 + .../clang/include/clang/Analysis/PathDiagnostic.h | 39 + .../clang/include/clang/Basic/AddressSpaces.h | 2 + .../clang/include/clang/Basic/AlignedAllocation.h | 2 + .../llvm-project/clang/include/clang/Basic/Attr.td | 286 +- .../clang/include/clang/Basic/AttrDocs.td | 1102 +++- .../clang/include/clang/Basic/Builtins.def | 58 + .../clang/include/clang/Basic/BuiltinsAArch64.def | 11 + .../clang/include/clang/Basic/BuiltinsAMDGPU.def | 6 + .../clang/include/clang/Basic/BuiltinsBPF.def | 8 +- .../clang/include/clang/Basic/BuiltinsNVPTX.def | 2 +- .../clang/include/clang/Basic/BuiltinsPPC.def | 236 +- .../include/clang/Basic/BuiltinsWebAssembly.def | 136 +- .../clang/include/clang/Basic/BuiltinsX86.def | 51 +- .../clang/include/clang/Basic/BuiltinsX86_64.def | 11 + .../clang/include/clang/Basic/CodeGenOptions.def | 50 +- .../clang/include/clang/Basic/CodeGenOptions.h | 46 +- .../llvm-project/clang/include/clang/Basic/Cuda.h | 8 + .../clang/include/clang/Basic/DebugInfoOptions.h | 6 +- .../clang/include/clang/Basic/DeclNodes.td | 1 + .../clang/include/clang/Basic/Diagnostic.h | 408 +- .../clang/include/clang/Basic/Diagnostic.td | 10 + .../clang/include/clang/Basic/DiagnosticAST.h | 2 +- .../include/clang/Basic/DiagnosticASTKinds.td | 11 +- .../clang/include/clang/Basic/DiagnosticAnalysis.h | 2 +- .../clang/include/clang/Basic/DiagnosticComment.h | 2 +- .../include/clang/Basic/DiagnosticCommonKinds.td | 6 + .../clang/include/clang/Basic/DiagnosticCrossTU.h | 2 +- .../clang/include/clang/Basic/DiagnosticDriver.h | 2 +- .../include/clang/Basic/DiagnosticDriverKinds.td | 39 +- .../clang/include/clang/Basic/DiagnosticFrontend.h | 2 +- .../include/clang/Basic/DiagnosticFrontendKinds.td | 22 +- .../clang/include/clang/Basic/DiagnosticGroups.td | 46 +- .../clang/include/clang/Basic/DiagnosticIDs.h | 12 +- .../clang/include/clang/Basic/DiagnosticLex.h | 2 +- .../include/clang/Basic/DiagnosticLexKinds.td | 9 +- .../include/clang/Basic/DiagnosticOptions.def | 1 + .../clang/include/clang/Basic/DiagnosticOptions.h | 12 + .../clang/include/clang/Basic/DiagnosticParse.h | 2 +- .../include/clang/Basic/DiagnosticParseKinds.td | 86 +- .../include/clang/Basic/DiagnosticRefactoring.h | 2 +- .../clang/include/clang/Basic/DiagnosticSema.h | 2 +- .../include/clang/Basic/DiagnosticSemaKinds.td | 386 +- .../include/clang/Basic/DiagnosticSerialization.h | 2 +- .../clang/Basic/DiagnosticSerializationKinds.td | 19 +- .../clang/include/clang/Basic/DirectoryEntry.h | 298 ++ .../clang/include/clang/Basic/FPOptions.def | 4 +- .../clang/include/clang/Basic/Features.def | 3 + .../clang/include/clang/Basic/FileEntry.h | 406 ++ .../clang/include/clang/Basic/FileManager.h | 158 +- .../llvm-project/clang/include/clang/Basic/LLVM.h | 1 + .../clang/include/clang/Basic/LangOptions.def | 42 +- .../clang/include/clang/Basic/LangOptions.h | 165 +- .../clang/include/clang/Basic/LangStandard.h | 14 +- .../clang/include/clang/Basic/LangStandards.def | 14 + .../clang/include/clang/Basic/Module.h | 55 +- .../clang/include/clang/Basic/OpenCLExtensions.def | 142 +- .../clang/include/clang/Basic/OpenCLOptions.h | 213 +- .../clang/include/clang/Basic/OpenMPKinds.def | 20 +- .../clang/include/clang/Basic/OpenMPKinds.h | 23 +- .../clang/include/clang/Basic/OperatorKinds.h | 5 + .../clang/include/clang/Basic/PPCTypes.def | 38 + .../clang/include/clang/Basic/PartialDiagnostic.h | 277 +- .../clang/include/clang/Basic/ProfileList.h | 58 + .../clang/include/clang/Basic/Sanitizers.def | 4 +- .../clang/include/clang/Basic/SourceLocation.h | 31 + .../clang/include/clang/Basic/SourceManager.h | 1022 ++-- .../clang/include/clang/Basic/Specifiers.h | 34 +- .../clang/include/clang/Basic/TargetCXXABI.h | 25 +- .../clang/include/clang/Basic/TargetID.h | 56 + .../clang/include/clang/Basic/TargetInfo.h | 78 +- .../clang/include/clang/Basic/TargetOptions.h | 8 +- .../clang/include/clang/Basic/TokenKinds.def | 17 +- .../clang/include/clang/Basic/arm_mve.td | 12 +- .../clang/include/clang/Basic/arm_mve_defs.td | 8 +- .../clang/include/clang/Basic/arm_neon.td | 73 +- .../clang/include/clang/CodeGen/BackendUtil.h | 5 - .../clang/include/clang/CodeGen/CGFunctionInfo.h | 60 +- .../clang/include/clang/Driver/Compilation.h | 17 + .../clang/include/clang/Driver/Distro.h | 17 +- .../clang/include/clang/Driver/Driver.h | 4 +- .../llvm-project/clang/include/clang/Driver/Job.h | 29 +- .../clang/include/clang/Driver/Options.h | 8 +- .../clang/include/clang/Driver/Options.td | 3038 ++++++++---- .../clang/include/clang/Driver/SanitizerArgs.h | 5 +- .../clang/include/clang/Driver/ToolChain.h | 32 +- .../clang/include/clang/Driver/XRayArgs.h | 2 + .../clang/include/clang/Edit/EditedSource.h | 2 +- .../clang/include/clang/Format/Format.h | 1081 +++- .../clang/include/clang/Frontend/ASTUnit.h | 18 +- .../include/clang/Frontend/CompilerInstance.h | 68 +- .../include/clang/Frontend/CompilerInvocation.h | 22 +- .../clang/include/clang/Frontend/FrontendAction.h | 2 +- .../clang/include/clang/Frontend/FrontendActions.h | 2 + .../clang/include/clang/Frontend/FrontendOptions.h | 35 +- .../include/clang/Frontend/PrecompiledPreamble.h | 9 +- .../clang/include/clang/Frontend/Utils.h | 8 +- .../SerializablePathCollection.h | 129 + .../clang/include/clang/Lex/HeaderSearch.h | 34 + .../clang/include/clang/Lex/HeaderSearchOptions.h | 9 +- .../llvm-project/clang/include/clang/Lex/Lexer.h | 10 +- .../clang/include/clang/Lex/ModuleMap.h | 13 +- .../clang/include/clang/Lex/Preprocessor.h | 24 + ...cessorExcludedConditionalDirectiveSkipMapping.h | 3 +- .../clang/include/clang/Lex/PreprocessorOptions.h | 26 +- .../clang/include/clang/Parse/Parser.h | 70 +- .../include/clang/Sema/CodeCompleteConsumer.h | 3 - .../clang/include/clang/Sema/DeclSpec.h | 581 +-- .../clang/include/clang/Sema/DelayedDiagnostic.h | 19 +- .../clang/include/clang/Sema/Designator.h | 49 +- .../clang/include/clang/Sema/Initialization.h | 61 +- .../clang/Sema/MultiplexExternalSemaSource.h | 2 - .../clang/include/clang/Sema/Overload.h | 6 + .../clang/include/clang/Sema/Ownership.h | 23 +- .../clang/include/clang/Sema/ParsedAttr.h | 44 +- .../clang/include/clang/Sema/ScopeInfo.h | 15 +- .../llvm-project/clang/include/clang/Sema/Sema.h | 831 ++-- .../clang/include/clang/Sema/Template.h | 2 +- .../include/clang/Serialization/ASTBitCodes.h | 10 +- .../clang/include/clang/Serialization/ASTReader.h | 51 +- .../include/clang/Serialization/ASTRecordReader.h | 6 +- .../include/clang/Serialization/ASTRecordWriter.h | 15 +- .../clang/include/clang/Serialization/ASTWriter.h | 10 + .../clang/include/clang/Serialization/ModuleFile.h | 19 +- .../include/clang/Serialization/ModuleManager.h | 6 +- .../clang/StaticAnalyzer/Checkers/Checkers.td | 16 +- .../clang/StaticAnalyzer/Core/AnalyzerOptions.h | 34 +- .../Core/BugReporter/BugReporterVisitors.h | 5 +- .../include/clang/StaticAnalyzer/Core/IssueHash.h | 50 - .../StaticAnalyzer/Core/PathDiagnosticConsumers.h | 7 +- .../Core/PathSensitive/BasicValueFactory.h | 16 +- .../StaticAnalyzer/Core/PathSensitive/CallEvent.h | 56 +- .../Core/PathSensitive/CheckerContext.h | 20 + .../StaticAnalyzer/Core/PathSensitive/ExprEngine.h | 17 + .../Core/PathSensitive/RangedConstraintManager.h | 22 +- .../Core/PathSensitive/SMTConstraintManager.h | 3 +- .../StaticAnalyzer/Core/PathSensitive/SMTConv.h | 18 +- .../Core/PathSensitive/SValBuilder.h | 2 +- .../StaticAnalyzer/Core/PathSensitive/SVals.h | 14 +- .../StaticAnalyzer/Core/PathSensitive/SymExpr.h | 3 + .../Core/PathSensitive/SymbolManager.h | 12 +- .../clang/include/clang/Testing/TestClangConfig.h | 2 + .../include/clang/Tooling/CompilationDatabase.h | 22 +- .../clang/Tooling/Inclusions/HeaderIncludes.h | 2 - .../clang/Tooling/Inclusions/IncludeStyle.h | 21 +- .../clang/Tooling/{Core => Refactoring}/Lookup.h | 6 +- .../Tooling/Refactoring/RefactoringRuleContext.h | 2 +- .../Tooling/Refactoring/Rename/SymbolOccurrences.h | 13 +- .../clang/include/clang/Tooling/Syntax/BuildTree.h | 35 +- .../clang/include/clang/Tooling/Syntax/Nodes.h | 648 +-- .../clang/include/clang/Tooling/Syntax/Nodes.td | 296 ++ .../clang/include/clang/Tooling/Syntax/Syntax.td | 85 + .../clang/include/clang/Tooling/Syntax/Tokens.h | 12 +- .../clang/include/clang/Tooling/Syntax/Tree.h | 216 +- .../clang/include/clang/Tooling/Tooling.h | 11 - .../clang/Tooling/Transformer/MatchConsumer.h | 6 - .../clang/Tooling/Transformer/RangeSelector.h | 29 +- .../clang/Tooling/Transformer/RewriteRule.h | 290 +- .../include/clang/Tooling/Transformer/Stencil.h | 11 +- .../clang/include/clang/module.modulemap | 1 + .../clang/lib/APINotes/APINotesFormat.h | 255 + .../clang/lib/APINotes/APINotesTypes.cpp | 107 + .../clang/lib/APINotes/APINotesYAMLCompiler.cpp | 598 +++ .../llvm-project/clang/lib/ARCMigrate/ARCMT.cpp | 8 +- .../clang/lib/ARCMigrate/FileRemapper.cpp | 15 + .../llvm-project/clang/lib/ARCMigrate/ObjCMT.cpp | 39 +- .../clang/lib/ARCMigrate/TransGCAttrs.cpp | 22 +- .../clang/lib/ARCMigrate/TransProperties.cpp | 17 +- .../llvm-project/clang/lib/ARCMigrate/Transforms.h | 6 +- contrib/llvm-project/clang/lib/AST/APValue.cpp | 538 +- contrib/llvm-project/clang/lib/AST/ASTContext.cpp | 441 +- .../llvm-project/clang/lib/AST/ASTDiagnostic.cpp | 15 +- contrib/llvm-project/clang/lib/AST/ASTDumper.cpp | 8 +- contrib/llvm-project/clang/lib/AST/ASTImporter.cpp | 561 ++- .../clang/lib/AST/ASTImporterLookupTable.cpp | 14 + .../clang/lib/AST/ASTStructuralEquivalence.cpp | 496 +- .../llvm-project/clang/lib/AST/ASTTypeTraits.cpp | 58 +- contrib/llvm-project/clang/lib/AST/AttrImpl.cpp | 53 +- .../llvm-project/clang/lib/AST/CXXInheritance.cpp | 150 +- .../llvm-project/clang/lib/AST/CommentLexer.cpp | 9 +- .../clang/lib/AST/ComparisonCategories.cpp | 2 +- .../clang/lib/AST/ComputeDependence.cpp | 138 +- contrib/llvm-project/clang/lib/AST/Decl.cpp | 329 +- contrib/llvm-project/clang/lib/AST/DeclBase.cpp | 58 +- contrib/llvm-project/clang/lib/AST/DeclCXX.cpp | 131 +- contrib/llvm-project/clang/lib/AST/DeclObjC.cpp | 45 +- contrib/llvm-project/clang/lib/AST/DeclOpenMP.cpp | 112 +- contrib/llvm-project/clang/lib/AST/DeclPrinter.cpp | 28 +- .../llvm-project/clang/lib/AST/DeclTemplate.cpp | 77 +- contrib/llvm-project/clang/lib/AST/Expr.cpp | 482 +- contrib/llvm-project/clang/lib/AST/ExprCXX.cpp | 207 +- .../clang/lib/AST/ExprClassification.cpp | 4 +- .../llvm-project/clang/lib/AST/ExprConstant.cpp | 1533 ++++-- .../llvm-project/clang/lib/AST/Interp/Disasm.cpp | 4 +- .../llvm-project/clang/lib/AST/Interp/State.cpp | 2 +- .../llvm-project/clang/lib/AST/ItaniumMangle.cpp | 1046 +++- .../llvm-project/clang/lib/AST/JSONNodeDumper.cpp | 8 +- contrib/llvm-project/clang/lib/AST/Linkage.h | 2 + contrib/llvm-project/clang/lib/AST/Mangle.cpp | 72 +- .../llvm-project/clang/lib/AST/MicrosoftMangle.cpp | 424 +- contrib/llvm-project/clang/lib/AST/NSAPI.cpp | 3 + .../llvm-project/clang/lib/AST/OpenMPClause.cpp | 178 +- .../clang/lib/AST/ParentMapContext.cpp | 117 +- .../clang/lib/AST/PrintfFormatString.cpp | 3 + .../llvm-project/clang/lib/AST/RecordLayout.cpp | 41 +- .../clang/lib/AST/RecordLayoutBuilder.cpp | 380 +- contrib/llvm-project/clang/lib/AST/Stmt.cpp | 110 +- contrib/llvm-project/clang/lib/AST/StmtOpenMP.cpp | 1135 ++--- contrib/llvm-project/clang/lib/AST/StmtPrinter.cpp | 25 +- contrib/llvm-project/clang/lib/AST/StmtProfile.cpp | 9 +- .../llvm-project/clang/lib/AST/TemplateBase.cpp | 35 +- .../llvm-project/clang/lib/AST/TemplateName.cpp | 18 +- .../llvm-project/clang/lib/AST/TextNodeDumper.cpp | 51 +- contrib/llvm-project/clang/lib/AST/Type.cpp | 108 +- contrib/llvm-project/clang/lib/AST/TypeLoc.cpp | 5 +- contrib/llvm-project/clang/lib/AST/TypePrinter.cpp | 314 +- .../clang/lib/ASTMatchers/ASTMatchFinder.cpp | 447 +- .../clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 152 +- .../clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | 11 +- .../clang/lib/ASTMatchers/Dynamic/Marshallers.h | 208 +- .../clang/lib/ASTMatchers/Dynamic/Registry.cpp | 11 +- .../clang/lib/ASTMatchers/Dynamic/VariantValue.cpp | 30 + .../clang/lib/ASTMatchers/GtestMatchers.cpp | 4 +- .../llvm-project/clang/lib/Analysis/BodyFarm.cpp | 40 +- contrib/llvm-project/clang/lib/Analysis/CFG.cpp | 35 +- .../clang/lib/Analysis/CalledOnceCheck.cpp | 1525 ++++++ .../clang/lib/Analysis/ExprMutationAnalyzer.cpp | 300 +- .../Core => Analysis}/IssueHash.cpp | 41 +- .../clang/lib/Analysis/LiveVariables.cpp | 102 +- .../clang/lib/Analysis/PathDiagnostic.cpp | 46 +- .../clang/lib/Analysis/ThreadSafety.cpp | 29 +- .../clang/lib/Analysis/ThreadSafetyCommon.cpp | 4 +- contrib/llvm-project/clang/lib/Basic/Cuda.cpp | 43 +- .../llvm-project/clang/lib/Basic/Diagnostic.cpp | 35 +- .../llvm-project/clang/lib/Basic/DiagnosticIDs.cpp | 109 +- contrib/llvm-project/clang/lib/Basic/FileEntry.cpp | 24 + .../llvm-project/clang/lib/Basic/FileManager.cpp | 181 +- .../clang/lib/Basic/IdentifierTable.cpp | 5 + .../llvm-project/clang/lib/Basic/LangOptions.cpp | 2 +- contrib/llvm-project/clang/lib/Basic/Module.cpp | 21 +- .../llvm-project/clang/lib/Basic/OpenCLOptions.cpp | 106 + .../llvm-project/clang/lib/Basic/OpenMPKinds.cpp | 50 +- .../llvm-project/clang/lib/Basic/ProfileList.cpp | 113 + .../clang/lib/Basic/SourceLocation.cpp | 21 +- .../llvm-project/clang/lib/Basic/SourceManager.cpp | 506 +- contrib/llvm-project/clang/lib/Basic/TargetID.cpp | 169 + .../llvm-project/clang/lib/Basic/TargetInfo.cpp | 1 + contrib/llvm-project/clang/lib/Basic/Targets.cpp | 51 +- .../clang/lib/Basic/Targets/AArch64.cpp | 48 +- .../llvm-project/clang/lib/Basic/Targets/AArch64.h | 6 + .../clang/lib/Basic/Targets/AMDGPU.cpp | 36 +- .../llvm-project/clang/lib/Basic/Targets/AMDGPU.h | 77 +- .../llvm-project/clang/lib/Basic/Targets/ARM.cpp | 2 + .../llvm-project/clang/lib/Basic/Targets/AVR.cpp | 7 + .../clang/lib/Basic/Targets/Hexagon.cpp | 3 +- .../clang/lib/Basic/Targets/MSP430.cpp | 1 + .../llvm-project/clang/lib/Basic/Targets/Mips.cpp | 1 - .../llvm-project/clang/lib/Basic/Targets/NVPTX.cpp | 8 + .../llvm-project/clang/lib/Basic/Targets/NVPTX.h | 22 +- .../clang/lib/Basic/Targets/OSTargets.h | 76 +- .../llvm-project/clang/lib/Basic/Targets/PPC.cpp | 87 +- contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 34 +- .../llvm-project/clang/lib/Basic/Targets/RISCV.cpp | 131 +- .../llvm-project/clang/lib/Basic/Targets/RISCV.h | 34 +- .../llvm-project/clang/lib/Basic/Targets/SPIR.h | 6 +- .../llvm-project/clang/lib/Basic/Targets/Sparc.cpp | 23 +- .../llvm-project/clang/lib/Basic/Targets/Sparc.h | 11 +- .../llvm-project/clang/lib/Basic/Targets/SystemZ.h | 4 + contrib/llvm-project/clang/lib/Basic/Targets/TCE.h | 2 + contrib/llvm-project/clang/lib/Basic/Targets/VE.h | 16 +- .../llvm-project/clang/lib/Basic/Targets/X86.cpp | 59 +- contrib/llvm-project/clang/lib/Basic/Targets/X86.h | 36 +- contrib/llvm-project/clang/lib/Basic/Version.cpp | 2 - contrib/llvm-project/clang/lib/Basic/Warnings.cpp | 7 +- contrib/llvm-project/clang/lib/CodeGen/ABIInfo.h | 2 +- .../llvm-project/clang/lib/CodeGen/BackendUtil.cpp | 560 +-- .../llvm-project/clang/lib/CodeGen/CGAtomic.cpp | 60 +- .../llvm-project/clang/lib/CodeGen/CGBlocks.cpp | 17 +- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 2357 ++++++--- .../llvm-project/clang/lib/CodeGen/CGCUDANV.cpp | 109 +- .../llvm-project/clang/lib/CodeGen/CGCUDARuntime.h | 7 +- .../llvm-project/clang/lib/CodeGen/CGCXXABI.cpp | 26 +- contrib/llvm-project/clang/lib/CodeGen/CGCXXABI.h | 13 +- contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | 339 +- contrib/llvm-project/clang/lib/CodeGen/CGCall.h | 6 +- contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp | 103 +- contrib/llvm-project/clang/lib/CodeGen/CGCleanup.h | 1 + .../llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp | 269 +- .../llvm-project/clang/lib/CodeGen/CGDebugInfo.h | 14 +- contrib/llvm-project/clang/lib/CodeGen/CGDecl.cpp | 158 +- .../llvm-project/clang/lib/CodeGen/CGDeclCXX.cpp | 113 +- .../llvm-project/clang/lib/CodeGen/CGException.cpp | 28 +- contrib/llvm-project/clang/lib/CodeGen/CGExpr.cpp | 244 +- .../llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 131 +- .../llvm-project/clang/lib/CodeGen/CGExprCXX.cpp | 28 +- .../clang/lib/CodeGen/CGExprComplex.cpp | 11 +- .../clang/lib/CodeGen/CGExprConstant.cpp | 34 +- .../clang/lib/CodeGen/CGExprScalar.cpp | 440 +- .../llvm-project/clang/lib/CodeGen/CGLoopInfo.cpp | 93 +- .../llvm-project/clang/lib/CodeGen/CGLoopInfo.h | 15 +- contrib/llvm-project/clang/lib/CodeGen/CGObjC.cpp | 243 +- .../llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp | 54 +- .../llvm-project/clang/lib/CodeGen/CGObjCMac.cpp | 98 +- .../clang/lib/CodeGen/CGObjCRuntime.cpp | 10 + .../llvm-project/clang/lib/CodeGen/CGObjCRuntime.h | 14 + .../clang/lib/CodeGen/CGOpenMPRuntime.cpp | 1843 +++++-- .../clang/lib/CodeGen/CGOpenMPRuntime.h | 69 +- .../clang/lib/CodeGen/CGOpenMPRuntimeAMDGCN.cpp | 60 + .../clang/lib/CodeGen/CGOpenMPRuntimeAMDGCN.h | 43 + .../clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 4864 ++++++++++++++++++ .../clang/lib/CodeGen/CGOpenMPRuntimeGPU.h | 504 ++ .../clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 5233 +------------------ .../clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.h | 465 +- .../clang/lib/CodeGen/CGRecordLayout.h | 17 +- .../clang/lib/CodeGen/CGRecordLayoutBuilder.cpp | 187 +- contrib/llvm-project/clang/lib/CodeGen/CGStmt.cpp | 301 +- .../clang/lib/CodeGen/CGStmtOpenMP.cpp | 205 +- contrib/llvm-project/clang/lib/CodeGen/CGVTT.cpp | 13 +- .../llvm-project/clang/lib/CodeGen/CGVTables.cpp | 96 +- contrib/llvm-project/clang/lib/CodeGen/CGValue.h | 2 +- .../clang/lib/CodeGen/CodeGenAction.cpp | 220 +- .../clang/lib/CodeGen/CodeGenFunction.cpp | 350 +- .../clang/lib/CodeGen/CodeGenFunction.h | 257 +- .../clang/lib/CodeGen/CodeGenModule.cpp | 398 +- .../llvm-project/clang/lib/CodeGen/CodeGenModule.h | 58 +- .../llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp | 55 +- .../llvm-project/clang/lib/CodeGen/CodeGenPGO.h | 2 +- .../clang/lib/CodeGen/CodeGenTypeCache.h | 3 + .../clang/lib/CodeGen/CodeGenTypes.cpp | 22 +- .../clang/lib/CodeGen/CoverageMappingGen.cpp | 350 +- .../clang/lib/CodeGen/CoverageMappingGen.h | 50 +- .../clang/lib/CodeGen/ItaniumCXXABI.cpp | 183 +- .../clang/lib/CodeGen/MicrosoftCXXABI.cpp | 103 +- .../CodeGen/ObjectFilePCHContainerOperations.cpp | 10 +- .../clang/lib/CodeGen/SwiftCallingConv.cpp | 33 +- .../llvm-project/clang/lib/CodeGen/TargetInfo.cpp | 608 +-- .../llvm-project/clang/lib/CodeGen/TargetInfo.h | 8 +- .../clang/lib/CrossTU/CrossTranslationUnit.cpp | 12 +- .../llvm-project/clang/lib/Driver/Compilation.cpp | 2 + contrib/llvm-project/clang/lib/Driver/Distro.cpp | 180 +- contrib/llvm-project/clang/lib/Driver/Driver.cpp | 347 +- contrib/llvm-project/clang/lib/Driver/Job.cpp | 22 +- .../clang/lib/Driver/SanitizerArgs.cpp | 42 +- .../llvm-project/clang/lib/Driver/ToolChain.cpp | 139 +- .../clang/lib/Driver/ToolChains/AIX.cpp | 62 +- .../llvm-project/clang/lib/Driver/ToolChains/AIX.h | 7 + .../clang/lib/Driver/ToolChains/AMDGPU.cpp | 135 +- .../clang/lib/Driver/ToolChains/AMDGPU.h | 14 +- .../clang/lib/Driver/ToolChains/AVR.cpp | 306 +- .../clang/lib/Driver/ToolChains/Ananas.cpp | 10 +- .../clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 20 +- .../clang/lib/Driver/ToolChains/Arch/ARM.cpp | 261 +- .../clang/lib/Driver/ToolChains/Arch/ARM.h | 2 + .../clang/lib/Driver/ToolChains/Arch/Mips.cpp | 2 - .../clang/lib/Driver/ToolChains/Arch/PPC.cpp | 1 - .../clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 40 +- .../clang/lib/Driver/ToolChains/Arch/VE.cpp | 4 - .../clang/lib/Driver/ToolChains/Arch/VE.h | 2 - .../clang/lib/Driver/ToolChains/Arch/X86.cpp | 29 +- .../clang/lib/Driver/ToolChains/Arch/X86.h | 2 +- .../clang/lib/Driver/ToolChains/BareMetal.cpp | 146 +- .../clang/lib/Driver/ToolChains/BareMetal.h | 15 +- .../clang/lib/Driver/ToolChains/Clang.cpp | 649 ++- .../clang/lib/Driver/ToolChains/CloudABI.cpp | 5 +- .../clang/lib/Driver/ToolChains/CommonArgs.cpp | 244 +- .../clang/lib/Driver/ToolChains/CommonArgs.h | 10 +- .../clang/lib/Driver/ToolChains/CrossWindows.cpp | 15 +- .../clang/lib/Driver/ToolChains/CrossWindows.h | 6 +- .../clang/lib/Driver/ToolChains/Cuda.cpp | 102 +- .../clang/lib/Driver/ToolChains/Cuda.h | 6 +- .../clang/lib/Driver/ToolChains/Darwin.cpp | 132 +- .../clang/lib/Driver/ToolChains/Darwin.h | 21 +- .../clang/lib/Driver/ToolChains/DragonFly.cpp | 16 +- .../clang/lib/Driver/ToolChains/Flang.cpp | 44 +- .../clang/lib/Driver/ToolChains/Flang.h | 9 + .../clang/lib/Driver/ToolChains/FreeBSD.cpp | 18 +- .../clang/lib/Driver/ToolChains/Fuchsia.cpp | 29 +- .../clang/lib/Driver/ToolChains/Fuchsia.h | 6 +- .../clang/lib/Driver/ToolChains/Gnu.cpp | 154 +- .../llvm-project/clang/lib/Driver/ToolChains/Gnu.h | 6 +- .../clang/lib/Driver/ToolChains/HIP.cpp | 56 +- .../clang/lib/Driver/ToolChains/Hexagon.cpp | 10 +- .../clang/lib/Driver/ToolChains/InterfaceStubs.cpp | 2 +- .../clang/lib/Driver/ToolChains/Linux.cpp | 36 +- .../clang/lib/Driver/ToolChains/MSP430.cpp | 159 +- .../clang/lib/Driver/ToolChains/MSP430.h | 13 + .../clang/lib/Driver/ToolChains/MSVC.cpp | 65 +- .../clang/lib/Driver/ToolChains/MinGW.cpp | 25 +- .../clang/lib/Driver/ToolChains/Minix.cpp | 10 +- .../clang/lib/Driver/ToolChains/Myriad.cpp | 10 +- .../clang/lib/Driver/ToolChains/NaCl.cpp | 5 +- .../clang/lib/Driver/ToolChains/NetBSD.cpp | 10 +- .../clang/lib/Driver/ToolChains/OpenBSD.cpp | 10 +- .../clang/lib/Driver/ToolChains/OpenBSD.h | 6 +- .../clang/lib/Driver/ToolChains/PS4CPU.cpp | 47 +- .../clang/lib/Driver/ToolChains/PS4CPU.h | 6 +- .../clang/lib/Driver/ToolChains/RISCVToolchain.cpp | 21 +- .../clang/lib/Driver/ToolChains/RISCVToolchain.h | 1 + .../clang/lib/Driver/ToolChains/ROCm.h | 13 +- .../clang/lib/Driver/ToolChains/Solaris.cpp | 4 +- .../clang/lib/Driver/ToolChains/Solaris.h | 5 + .../clang/lib/Driver/ToolChains/VEToolchain.cpp | 31 +- .../clang/lib/Driver/ToolChains/VEToolchain.h | 1 + .../clang/lib/Driver/ToolChains/WebAssembly.cpp | 28 +- .../clang/lib/Driver/ToolChains/XCore.cpp | 4 +- .../clang/lib/Driver/ToolChains/ZOS.cpp | 33 + .../llvm-project/clang/lib/Driver/ToolChains/ZOS.h | 40 + contrib/llvm-project/clang/lib/Driver/Types.cpp | 4 +- contrib/llvm-project/clang/lib/Driver/XRayArgs.cpp | 26 + .../llvm-project/clang/lib/Edit/EditedSource.cpp | 4 +- .../clang/lib/Edit/RewriteObjCFoundationAPI.cpp | 2 + .../clang/lib/Format/BreakableToken.cpp | 92 +- .../llvm-project/clang/lib/Format/BreakableToken.h | 1 - .../clang/lib/Format/ContinuationIndenter.cpp | 59 +- contrib/llvm-project/clang/lib/Format/Format.cpp | 167 +- .../llvm-project/clang/lib/Format/FormatInternal.h | 1 - .../llvm-project/clang/lib/Format/FormatToken.cpp | 5 +- .../llvm-project/clang/lib/Format/FormatToken.h | 279 +- .../clang/lib/Format/FormatTokenLexer.cpp | 23 +- .../clang/lib/Format/MacroExpander.cpp | 224 + contrib/llvm-project/clang/lib/Format/Macros.h | 141 + .../clang/lib/Format/TokenAnnotator.cpp | 243 +- .../clang/lib/Format/UnwrappedLineFormatter.cpp | 71 +- .../clang/lib/Format/UnwrappedLineParser.cpp | 250 +- .../clang/lib/Format/UnwrappedLineParser.h | 5 + .../clang/lib/Format/WhitespaceManager.cpp | 86 +- .../llvm-project/clang/lib/Frontend/ASTUnit.cpp | 103 +- .../clang/lib/Frontend/ChainedIncludesSource.cpp | 11 +- .../clang/lib/Frontend/CompilerInstance.cpp | 280 +- .../clang/lib/Frontend/CompilerInvocation.cpp | 2171 +++----- .../Frontend/CreateInvocationFromCommandLine.cpp | 4 +- .../clang/lib/Frontend/DependencyFile.cpp | 17 +- .../clang/lib/Frontend/FrontendAction.cpp | 19 +- .../clang/lib/Frontend/FrontendActions.cpp | 58 +- .../clang/lib/Frontend/FrontendOptions.cpp | 2 +- .../clang/lib/Frontend/InitPreprocessor.cpp | 32 +- .../lib/Frontend/ModuleDependencyCollector.cpp | 52 +- .../clang/lib/Frontend/PrecompiledPreamble.cpp | 51 +- .../clang/lib/Frontend/Rewrite/HTMLPrint.cpp | 2 +- .../lib/Frontend/Rewrite/InclusionRewriter.cpp | 78 +- .../clang/lib/Frontend/Rewrite/RewriteMacros.cpp | 2 +- .../lib/Frontend/Rewrite/RewriteModernObjC.cpp | 57 +- .../clang/lib/Frontend/Rewrite/RewriteObjC.cpp | 47 +- .../clang/lib/Frontend/TextDiagnostic.cpp | 5 +- .../clang/lib/Frontend/TextDiagnosticPrinter.cpp | 8 +- .../lib/Frontend/VerifyDiagnosticConsumer.cpp | 12 +- .../clang/lib/Headers/__clang_cuda_builtin_vars.h | 9 + .../clang/lib/Headers/__clang_cuda_cmath.h | 50 +- .../lib/Headers/__clang_cuda_complex_builtins.h | 30 +- .../clang/lib/Headers/__clang_cuda_math.h | 9 +- .../Headers/__clang_cuda_math_forward_declares.h | 3 + .../lib/Headers/__clang_cuda_runtime_wrapper.h | 28 +- .../clang/lib/Headers/__clang_hip_cmath.h | 664 +++ .../lib/Headers/__clang_hip_libdevice_declares.h | 26 +- .../clang/lib/Headers/__clang_hip_math.h | 1148 +++-- .../lib/Headers/__clang_hip_runtime_wrapper.h | 5 + contrib/llvm-project/clang/lib/Headers/altivec.h | 1037 +++- contrib/llvm-project/clang/lib/Headers/amxintrin.h | 97 +- contrib/llvm-project/clang/lib/Headers/arm_acle.h | 26 + .../llvm-project/clang/lib/Headers/avx512fintrin.h | 157 +- .../clang/lib/Headers/avx512vlvnniintrin.h | 205 +- contrib/llvm-project/clang/lib/Headers/avxintrin.h | 6 +- .../llvm-project/clang/lib/Headers/avxvnniintrin.h | 225 + contrib/llvm-project/clang/lib/Headers/cpuid.h | 8 + .../clang/lib/Headers/cuda_wrappers/algorithm | 2 +- .../clang/lib/Headers/cuda_wrappers/new | 2 +- contrib/llvm-project/clang/lib/Headers/emmintrin.h | 2 +- .../llvm-project/clang/lib/Headers/gfniintrin.h | 181 +- .../llvm-project/clang/lib/Headers/hresetintrin.h | 49 + .../llvm-project/clang/lib/Headers/ia32intrin.h | 97 +- contrib/llvm-project/clang/lib/Headers/immintrin.h | 12 + contrib/llvm-project/clang/lib/Headers/intrin.h | 24 +- .../clang/lib/Headers/keylockerintrin.h | 506 ++ contrib/llvm-project/clang/lib/Headers/mm_malloc.h | 6 + .../llvm-project/clang/lib/Headers/opencl-c-base.h | 18 + contrib/llvm-project/clang/lib/Headers/opencl-c.h | 2 + .../clang/lib/Headers/openmp_wrappers/cmath | 5 +- .../clang/lib/Headers/openmp_wrappers/complex | 25 + .../lib/Headers/openmp_wrappers/complex_cmath.h | 388 ++ .../llvm-project/clang/lib/Headers/popcntintrin.h | 11 +- .../clang/lib/Headers/ppc_wrappers/smmintrin.h | 24 + .../llvm-project/clang/lib/Headers/uintrintrin.h | 150 + .../llvm-project/clang/lib/Headers/wasm_simd128.h | 112 +- .../llvm-project/clang/lib/Headers/x86gprintrin.h | 23 + .../clang/lib/Index/FileIndexRecord.cpp | 2 +- contrib/llvm-project/clang/lib/Index/IndexBody.cpp | 4 +- .../clang/lib/Index/IndexTypeSourceInfo.cpp | 21 + .../clang/lib/Index/IndexingAction.cpp | 11 +- .../clang/lib/Index/SimpleFormatContext.h | 72 - .../llvm-project/clang/lib/Index/USRGeneration.cpp | 3 + .../SerializablePathCollection.cpp | 91 + .../llvm-project/clang/lib/Lex/HeaderSearch.cpp | 58 +- contrib/llvm-project/clang/lib/Lex/Lexer.cpp | 49 +- .../llvm-project/clang/lib/Lex/LiteralSupport.cpp | 4 +- contrib/llvm-project/clang/lib/Lex/ModuleMap.cpp | 76 +- .../llvm-project/clang/lib/Lex/PPDirectives.cpp | 12 +- .../llvm-project/clang/lib/Lex/PPLexerChange.cpp | 27 +- .../clang/lib/Lex/PPMacroExpansion.cpp | 31 +- contrib/llvm-project/clang/lib/Lex/Pragma.cpp | 2 +- .../llvm-project/clang/lib/Lex/Preprocessor.cpp | 16 +- .../llvm-project/clang/lib/Lex/ScratchBuffer.cpp | 8 +- contrib/llvm-project/clang/lib/Lex/TokenLexer.cpp | 10 +- .../clang/lib/Parse/ParseCXXInlineMethods.cpp | 23 +- contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp | 300 +- .../llvm-project/clang/lib/Parse/ParseDeclCXX.cpp | 107 +- contrib/llvm-project/clang/lib/Parse/ParseExpr.cpp | 96 +- .../llvm-project/clang/lib/Parse/ParseExprCXX.cpp | 71 +- contrib/llvm-project/clang/lib/Parse/ParseObjc.cpp | 37 +- .../llvm-project/clang/lib/Parse/ParseOpenMP.cpp | 456 +- .../llvm-project/clang/lib/Parse/ParsePragma.cpp | 311 +- contrib/llvm-project/clang/lib/Parse/ParseStmt.cpp | 57 +- .../llvm-project/clang/lib/Parse/ParseStmtAsm.cpp | 2 +- .../llvm-project/clang/lib/Parse/ParseTemplate.cpp | 21 +- .../clang/lib/Parse/ParseTentative.cpp | 13 +- contrib/llvm-project/clang/lib/Parse/Parser.cpp | 66 +- .../llvm-project/clang/lib/Rewrite/HTMLRewrite.cpp | 22 +- .../llvm-project/clang/lib/Rewrite/Rewriter.cpp | 8 +- .../clang/lib/Rewrite/TokenRewriter.cpp | 2 +- .../clang/lib/Sema/AnalysisBasedWarnings.cpp | 102 +- .../clang/lib/Sema/CodeCompleteConsumer.cpp | 6 +- contrib/llvm-project/clang/lib/Sema/DeclSpec.cpp | 167 +- .../clang/lib/Sema/JumpDiagnostics.cpp | 17 + .../clang/lib/Sema/MultiplexExternalSemaSource.cpp | 7 - contrib/llvm-project/clang/lib/Sema/ScopeInfo.cpp | 1 + contrib/llvm-project/clang/lib/Sema/Sema.cpp | 163 +- contrib/llvm-project/clang/lib/Sema/SemaAccess.cpp | 3 +- contrib/llvm-project/clang/lib/Sema/SemaAttr.cpp | 345 +- contrib/llvm-project/clang/lib/Sema/SemaCUDA.cpp | 103 +- contrib/llvm-project/clang/lib/Sema/SemaCast.cpp | 81 +- .../llvm-project/clang/lib/Sema/SemaChecking.cpp | 1019 +++- .../clang/lib/Sema/SemaCodeComplete.cpp | 90 +- .../llvm-project/clang/lib/Sema/SemaConcept.cpp | 23 +- .../llvm-project/clang/lib/Sema/SemaCoroutine.cpp | 100 +- contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp | 1054 ++-- .../llvm-project/clang/lib/Sema/SemaDeclAttr.cpp | 1054 +++- .../llvm-project/clang/lib/Sema/SemaDeclCXX.cpp | 225 +- .../llvm-project/clang/lib/Sema/SemaDeclObjC.cpp | 76 +- .../clang/lib/Sema/SemaExceptionSpec.cpp | 4 +- contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 1002 ++-- .../llvm-project/clang/lib/Sema/SemaExprCXX.cpp | 176 +- .../llvm-project/clang/lib/Sema/SemaExprMember.cpp | 119 +- .../llvm-project/clang/lib/Sema/SemaExprObjC.cpp | 88 +- contrib/llvm-project/clang/lib/Sema/SemaInit.cpp | 356 +- contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp | 142 +- contrib/llvm-project/clang/lib/Sema/SemaLookup.cpp | 371 +- contrib/llvm-project/clang/lib/Sema/SemaModule.cpp | 2 +- .../clang/lib/Sema/SemaObjCProperty.cpp | 14 +- contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp | 1041 ++-- .../llvm-project/clang/lib/Sema/SemaOverload.cpp | 978 ++-- contrib/llvm-project/clang/lib/Sema/SemaSYCL.cpp | 20 +- contrib/llvm-project/clang/lib/Sema/SemaStmt.cpp | 217 +- .../llvm-project/clang/lib/Sema/SemaStmtAsm.cpp | 6 +- .../llvm-project/clang/lib/Sema/SemaStmtAttr.cpp | 78 +- .../llvm-project/clang/lib/Sema/SemaTemplate.cpp | 636 ++- .../clang/lib/Sema/SemaTemplateDeduction.cpp | 372 +- .../clang/lib/Sema/SemaTemplateInstantiate.cpp | 187 +- .../clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 403 +- .../clang/lib/Sema/SemaTemplateVariadic.cpp | 60 +- contrib/llvm-project/clang/lib/Sema/SemaType.cpp | 1104 +++-- .../llvm-project/clang/lib/Sema/TreeTransform.h | 205 +- .../clang/lib/Serialization/ASTCommon.cpp | 6 + .../clang/lib/Serialization/ASTReader.cpp | 422 +- .../clang/lib/Serialization/ASTReaderDecl.cpp | 156 +- .../clang/lib/Serialization/ASTReaderStmt.cpp | 365 +- .../clang/lib/Serialization/ASTWriter.cpp | 177 +- .../clang/lib/Serialization/ASTWriterDecl.cpp | 59 +- .../clang/lib/Serialization/ASTWriterStmt.cpp | 158 +- .../clang/lib/Serialization/GlobalModuleIndex.cpp | 7 +- .../clang/lib/Serialization/ModuleManager.cpp | 61 +- .../Checkers/BasicObjCFoundationChecks.cpp | 3 +- .../StaticAnalyzer/Checkers/CastValueChecker.cpp | 4 +- .../StaticAnalyzer/Checkers/CheckObjCDealloc.cpp | 2 +- .../lib/StaticAnalyzer/Checkers/DebugCheckers.cpp | 10 +- .../StaticAnalyzer/Checkers/DereferenceChecker.cpp | 69 +- .../Checkers/ExprInspectionChecker.cpp | 4 +- .../Checkers/FuchsiaHandleChecker.cpp | 312 +- .../Checkers/GenericTaintChecker.cpp | 5 +- .../StaticAnalyzer/Checkers/IteratorModeling.cpp | 103 +- .../Checkers/IteratorRangeChecker.cpp | 2 + .../Checkers/LocalizationChecker.cpp | 7 +- .../Checkers/MacOSKeychainAPIChecker.cpp | 2 +- .../lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 15 +- .../lib/StaticAnalyzer/Checkers/MoveChecker.cpp | 4 +- .../StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp | 21 +- .../Checkers/ObjCMissingSuperCallChecker.cpp | 7 +- .../lib/StaticAnalyzer/Checkers/PaddingChecker.cpp | 5 +- .../StaticAnalyzer/Checkers/PthreadLockChecker.cpp | 271 +- .../RetainCountChecker/RetainCountDiagnostics.cpp | 4 +- .../Checkers/ReturnPointerRangeChecker.cpp | 7 +- .../clang/lib/StaticAnalyzer/Checkers/SmartPtr.h | 2 + .../StaticAnalyzer/Checkers/SmartPtrChecker.cpp | 48 +- .../StaticAnalyzer/Checkers/SmartPtrModeling.cpp | 514 +- .../Checkers/StdLibraryFunctionsChecker.cpp | 2058 +++++--- .../lib/StaticAnalyzer/Checkers/StreamChecker.cpp | 70 +- .../clang/lib/StaticAnalyzer/Checkers/Taint.cpp | 2 +- .../StaticAnalyzer/Checkers/UndefBranchChecker.cpp | 7 +- .../StaticAnalyzer/Checkers/VirtualCallChecker.cpp | 4 +- .../StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp | 4 +- .../Checkers/WebKit/NoUncountedMembersChecker.cpp | 7 +- .../Checkers/WebKit/PtrTypesSemantics.cpp | 58 +- .../Checkers/WebKit/PtrTypesSemantics.h | 23 +- .../WebKit/RefCntblBaseVirtualDtorChecker.cpp | 12 +- .../Checkers/WebKit/UncountedCallArgsChecker.cpp | 3 +- .../WebKit/UncountedLambdaCapturesChecker.cpp | 107 + .../Checkers/WebKit/UncountedLocalVarsChecker.cpp | 251 + .../lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | 2 +- .../lib/StaticAnalyzer/Core/BasicValueFactory.cpp | 25 +- .../clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 13 +- .../StaticAnalyzer/Core/BugReporterVisitors.cpp | 7 +- .../clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 2 +- .../lib/StaticAnalyzer/Core/CheckerContext.cpp | 2 +- .../clang/lib/StaticAnalyzer/Core/Environment.cpp | 21 +- .../clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 153 +- .../clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 7 +- .../lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 26 +- .../Core/ExprEngineCallAndReturn.cpp | 14 +- .../lib/StaticAnalyzer/Core/ExprEngineObjC.cpp | 13 +- .../lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 47 +- .../lib/StaticAnalyzer/Core/PlistDiagnostics.cpp | 400 +- .../clang/lib/StaticAnalyzer/Core/ProgramState.cpp | 3 - .../StaticAnalyzer/Core/RangeConstraintManager.cpp | 1114 ++++- .../Core/RangedConstraintManager.cpp | 41 +- .../clang/lib/StaticAnalyzer/Core/SValBuilder.cpp | 23 +- .../clang/lib/StaticAnalyzer/Core/SVals.cpp | 48 +- .../lib/StaticAnalyzer/Core/SarifDiagnostics.cpp | 16 +- .../Core/SimpleConstraintManager.cpp | 4 +- .../lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 19 +- .../lib/StaticAnalyzer/Core/SymbolManager.cpp | 28 +- .../lib/StaticAnalyzer/Core/TextDiagnostics.cpp | 49 +- .../StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 4 +- .../clang/lib/Tooling/AllTUsExecution.cpp | 2 +- .../clang/lib/Tooling/ArgumentsAdjusters.cpp | 34 +- .../clang/lib/Tooling/CompilationDatabase.cpp | 58 +- .../clang/lib/Tooling/Core/Replacement.cpp | 2 +- .../DependencyScanningFilesystem.cpp | 20 +- .../DependencyScanningWorker.cpp | 24 +- .../DependencyScanning/ModuleDepCollector.cpp | 13 +- .../clang/lib/Tooling/FileMatchTrie.cpp | 14 +- .../lib/Tooling/Inclusions/HeaderIncludes.cpp | 52 +- .../clang/lib/Tooling/Inclusions/IncludeStyle.cpp | 1 + .../clang/lib/Tooling/JSONCompilationDatabase.cpp | 48 +- .../clang/lib/Tooling/Refactoring/ASTSelection.cpp | 2 +- .../lib/Tooling/{Core => Refactoring}/Lookup.cpp | 2 +- .../lib/Tooling/Refactoring/RefactoringActions.cpp | 4 +- .../Refactoring/Rename/SymbolOccurrences.cpp | 5 +- .../lib/Tooling/Refactoring/Rename/USRFinder.cpp | 4 +- .../Refactoring/Rename/USRFindingAction.cpp | 52 +- .../Tooling/Refactoring/Rename/USRLocFinder.cpp | 2 +- .../clang/lib/Tooling/Syntax/BuildTree.cpp | 819 ++- .../lib/Tooling/Syntax/ComputeReplacements.cpp | 15 +- .../clang/lib/Tooling/Syntax/Mutations.cpp | 36 +- .../clang/lib/Tooling/Syntax/Nodes.cpp | 604 +-- .../clang/lib/Tooling/Syntax/Synthesis.cpp | 224 +- .../clang/lib/Tooling/Syntax/Tokens.cpp | 89 +- .../llvm-project/clang/lib/Tooling/Syntax/Tree.cpp | 412 +- contrib/llvm-project/clang/lib/Tooling/Tooling.cpp | 71 +- .../clang/lib/Tooling/Transformer/Parsing.cpp | 8 +- .../lib/Tooling/Transformer/RangeSelector.cpp | 26 +- .../clang/lib/Tooling/Transformer/RewriteRule.cpp | 262 +- .../clang/lib/Tooling/Transformer/Stencil.cpp | 77 +- .../clang/lib/Tooling/Transformer/Transformer.cpp | 42 +- .../clang/tools/clang-format/ClangFormat.cpp | 32 +- .../llvm-project/clang/tools/driver/cc1_main.cpp | 10 +- .../llvm-project/clang/tools/driver/cc1as_main.cpp | 29 +- contrib/llvm-project/clang/tools/driver/driver.cpp | 7 + .../utils/TableGen/ClangASTPropertiesEmitter.cpp | 12 +- .../clang/utils/TableGen/ClangAttrEmitter.cpp | 56 +- .../utils/TableGen/ClangDiagnosticsEmitter.cpp | 5 + .../clang/utils/TableGen/ClangOptionDocEmitter.cpp | 2 - .../clang/utils/TableGen/ClangSyntaxEmitter.cpp | 236 + .../clang/utils/TableGen/NeonEmitter.cpp | 25 +- .../clang/utils/TableGen/SveEmitter.cpp | 20 +- .../llvm-project/clang/utils/TableGen/TableGen.cpp | 12 + .../clang/utils/TableGen/TableGenBackends.h | 8 +- contrib/llvm-project/compiler-rt/.clang-tidy | 2 + .../include/fuzzer/FuzzedDataProvider.h | 9 + .../compiler-rt/include/profile/InstrProfData.inc | 139 +- .../compiler-rt/include/sanitizer/asan_interface.h | 16 +- .../include/sanitizer/common_interface_defs.h | 9 +- .../include/sanitizer/dfsan_interface.h | 8 +- .../include/sanitizer/hwasan_interface.h | 3 + .../include/sanitizer/memprof_interface.h | 65 + .../compiler-rt/include/sanitizer/msan_interface.h | 3 + .../include/sanitizer/netbsd_syscall_hooks.h | 213 +- .../compiler-rt/lib/asan/asan_allocator.cpp | 479 +- .../compiler-rt/lib/asan/asan_allocator.h | 11 +- .../compiler-rt/lib/asan/asan_flags.cpp | 10 +- .../compiler-rt/lib/asan/asan_fuchsia.cpp | 35 +- .../compiler-rt/lib/asan/asan_interceptors.cpp | 41 +- .../compiler-rt/lib/asan/asan_interceptors.h | 22 +- .../compiler-rt/lib/asan/asan_interceptors_vfork.S | 3 +- .../compiler-rt/lib/asan/asan_interface_internal.h | 4 +- .../compiler-rt/lib/asan/asan_internal.h | 2 - .../compiler-rt/lib/asan/asan_linux.cpp | 45 +- .../llvm-project/compiler-rt/lib/asan/asan_mac.cpp | 48 +- .../compiler-rt/lib/asan/asan_malloc_linux.cpp | 10 +- .../compiler-rt/lib/asan/asan_malloc_local.h | 2 +- .../compiler-rt/lib/asan/asan_mapping.h | 21 + .../compiler-rt/lib/asan/asan_poisoning.cpp | 6 - .../compiler-rt/lib/asan/asan_premap_shadow.cpp | 18 +- .../compiler-rt/lib/asan/asan_report.cpp | 5 +- .../compiler-rt/lib/asan/asan_rtems.cpp | 6 + .../llvm-project/compiler-rt/lib/asan/asan_rtl.cpp | 5 +- .../compiler-rt/lib/asan/asan_shadow_setup.cpp | 45 +- .../llvm-project/compiler-rt/lib/asan/asan_stack.h | 5 - .../compiler-rt/lib/asan/asan_thread.cpp | 27 +- .../compiler-rt/lib/asan/asan_thread.h | 7 +- .../llvm-project/compiler-rt/lib/asan/asan_win.cpp | 19 +- .../compiler-rt/lib/builtins/README.txt | 2 + .../compiler-rt/lib/builtins/aarch64/lse.S | 236 + .../compiler-rt/lib/builtins/assembly.h | 93 +- .../llvm-project/compiler-rt/lib/builtins/atomic.c | 93 +- .../compiler-rt/lib/builtins/clear_cache.c | 10 +- .../compiler-rt/lib/builtins/cpu_model.c | 63 +- .../llvm-project/compiler-rt/lib/builtins/divdf3.c | 189 +- .../llvm-project/compiler-rt/lib/builtins/divdi3.c | 15 +- .../compiler-rt/lib/builtins/divmoddi4.c | 13 +- .../compiler-rt/lib/builtins/divmodsi4.c | 13 +- .../compiler-rt/lib/builtins/divmodti4.c | 32 + .../llvm-project/compiler-rt/lib/builtins/divsf3.c | 174 +- .../llvm-project/compiler-rt/lib/builtins/divsi3.c | 25 +- .../llvm-project/compiler-rt/lib/builtins/divtf3.c | 203 +- .../llvm-project/compiler-rt/lib/builtins/divti3.c | 15 +- .../llvm-project/compiler-rt/lib/builtins/emutls.c | 7 +- .../compiler-rt/lib/builtins/extendhfsf2.c | 6 +- .../compiler-rt/lib/builtins/extendhftf2.c | 23 + .../compiler-rt/lib/builtins/fp_div_impl.inc | 419 ++ .../compiler-rt/lib/builtins/fp_extend.h | 4 + .../llvm-project/compiler-rt/lib/builtins/fp_lib.h | 7 + .../compiler-rt/lib/builtins/fp_trunc.h | 4 + .../compiler-rt/lib/builtins/int_div_impl.inc | 25 + .../compiler-rt/lib/builtins/int_mulo_impl.inc | 49 + .../compiler-rt/lib/builtins/int_mulv_impl.inc | 47 + .../compiler-rt/lib/builtins/int_util.h | 16 + .../llvm-project/compiler-rt/lib/builtins/moddi3.c | 16 +- .../llvm-project/compiler-rt/lib/builtins/modti3.c | 16 +- .../compiler-rt/lib/builtins/mulodi4.c | 33 +- .../compiler-rt/lib/builtins/mulosi4.c | 33 +- .../compiler-rt/lib/builtins/muloti4.c | 33 +- .../compiler-rt/lib/builtins/mulvdi3.c | 33 +- .../compiler-rt/lib/builtins/mulvsi3.c | 33 +- .../compiler-rt/lib/builtins/mulvti3.c | 33 +- .../compiler-rt/lib/builtins/os_version_check.c | 108 +- .../compiler-rt/lib/builtins/paritydi2.c | 6 +- .../compiler-rt/lib/builtins/parityti2.c | 8 +- .../lib/builtins/riscv/int_mul_impl.inc | 6 +- .../compiler-rt/lib/builtins/truncdfhf2.c | 4 +- .../compiler-rt/lib/builtins/truncsfhf2.c | 6 +- .../compiler-rt/lib/builtins/trunctfhf2.c | 23 + contrib/llvm-project/compiler-rt/lib/cfi/cfi.cpp | 2 +- .../llvm-project/compiler-rt/lib/crt/crtbegin.c | 8 + .../llvm-project/compiler-rt/lib/dfsan/dfsan.cpp | 100 +- .../compiler-rt/lib/dfsan/dfsan_custom.cpp | 201 +- .../compiler-rt/lib/dfsan/dfsan_flags.inc | 4 - .../compiler-rt/lib/dfsan/dfsan_interceptors.cpp | 41 +- .../compiler-rt/lib/dfsan/done_abilist.txt | 85 + .../compiler-rt/lib/fuzzer/FuzzerCorpus.h | 62 +- .../compiler-rt/lib/fuzzer/FuzzerDataFlowTrace.cpp | 2 +- .../compiler-rt/lib/fuzzer/FuzzerDriver.cpp | 91 +- .../lib/fuzzer/FuzzerExtFunctionsWeak.cpp | 2 +- .../compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp | 2 +- .../compiler-rt/lib/fuzzer/FuzzerFlags.def | 37 +- .../compiler-rt/lib/fuzzer/FuzzerFork.cpp | 14 +- .../compiler-rt/lib/fuzzer/FuzzerIO.cpp | 45 + .../llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.h | 6 + .../compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp | 8 +- .../compiler-rt/lib/fuzzer/FuzzerIOWindows.cpp | 14 +- .../compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp | 253 + .../compiler-rt/lib/fuzzer/FuzzerInternal.h | 4 +- .../compiler-rt/lib/fuzzer/FuzzerLoop.cpp | 69 +- .../compiler-rt/lib/fuzzer/FuzzerMutate.cpp | 40 +- .../compiler-rt/lib/fuzzer/FuzzerMutate.h | 14 +- .../compiler-rt/lib/fuzzer/FuzzerOptions.h | 9 +- .../compiler-rt/lib/fuzzer/FuzzerPlatform.h | 18 +- .../compiler-rt/lib/fuzzer/FuzzerTracePC.cpp | 34 +- .../compiler-rt/lib/fuzzer/FuzzerTracePC.h | 6 +- .../compiler-rt/lib/fuzzer/FuzzerUtil.h | 6 + .../compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp | 19 +- .../compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp | 2 +- .../compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp | 4 +- .../compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | 14 +- .../compiler-rt/lib/gwp_asan/common.cpp | 3 + .../compiler-rt/lib/gwp_asan/crash_handler.cpp | 24 +- .../compiler-rt/lib/gwp_asan/crash_handler.h | 2 +- .../compiler-rt/lib/gwp_asan/definitions.h | 2 +- .../lib/gwp_asan/guarded_pool_allocator.cpp | 114 +- .../lib/gwp_asan/guarded_pool_allocator.h | 78 +- .../llvm-project/compiler-rt/lib/gwp_asan/mutex.h | 14 +- .../compiler-rt/lib/gwp_asan/optional/backtrace.h | 48 +- .../lib/gwp_asan/optional/backtrace_fuchsia.cpp | 21 + .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 25 +- .../optional/backtrace_sanitizer_common.cpp | 49 +- .../lib/gwp_asan/optional/options_parser.cpp | 249 +- .../lib/gwp_asan/optional/options_parser.h | 12 +- .../compiler-rt/lib/gwp_asan/optional/printf.h | 33 + .../lib/gwp_asan/optional/segv_handler.h | 70 +- .../lib/gwp_asan/optional/segv_handler_fuchsia.cpp | 22 + .../lib/gwp_asan/optional/segv_handler_posix.cpp | 182 +- .../compiler-rt/lib/gwp_asan/options.inc | 30 +- .../gwp_asan/platform_specific/common_fuchsia.cpp | 15 + .../gwp_asan/platform_specific/common_posix.cpp | 6 +- .../guarded_pool_allocator_fuchsia.cpp | 103 + .../guarded_pool_allocator_fuchsia.h | 22 + .../guarded_pool_allocator_posix.cpp | 64 +- .../guarded_pool_allocator_posix.h | 18 + .../platform_specific/guarded_pool_allocator_tls.h | 55 + .../gwp_asan/platform_specific/mutex_fuchsia.cpp | 21 + .../lib/gwp_asan/platform_specific/mutex_fuchsia.h | 23 + .../lib/gwp_asan/platform_specific/mutex_posix.h | 23 + .../platform_specific/utilities_fuchsia.cpp | 19 + .../gwp_asan/platform_specific/utilities_posix.cpp | 65 +- .../compiler-rt/lib/gwp_asan/random.cpp | 31 - .../llvm-project/compiler-rt/lib/gwp_asan/random.h | 23 - .../compiler-rt/lib/gwp_asan/utilities.cpp | 63 + .../compiler-rt/lib/gwp_asan/utilities.h | 18 +- .../llvm-project/compiler-rt/lib/hwasan/hwasan.cpp | 4 +- .../llvm-project/compiler-rt/lib/hwasan/hwasan.h | 9 +- .../compiler-rt/lib/hwasan/hwasan_allocator.cpp | 20 +- .../compiler-rt/lib/hwasan/hwasan_allocator.h | 14 +- .../lib/hwasan/hwasan_dynamic_shadow.cpp | 50 +- .../lib/hwasan/hwasan_interceptors_vfork.S | 1 + .../lib/hwasan/hwasan_interface_internal.h | 3 + .../compiler-rt/lib/hwasan/hwasan_linux.cpp | 74 +- .../compiler-rt/lib/hwasan/hwasan_malloc_bisect.h | 2 +- .../compiler-rt/lib/hwasan/hwasan_mapping.h | 9 + .../compiler-rt/lib/hwasan/hwasan_new_delete.cpp | 39 +- .../compiler-rt/lib/hwasan/hwasan_report.cpp | 25 +- .../compiler-rt/lib/hwasan/hwasan_thread.h | 2 - .../compiler-rt/lib/hwasan/hwasan_thread_list.h | 63 +- .../compiler-rt/lib/interception/interception.h | 4 +- .../lib/interception/interception_linux.cpp | 10 +- .../lib/interception/interception_linux.h | 10 +- .../lib/interception/interception_win.cpp | 6 +- contrib/llvm-project/compiler-rt/lib/lsan/lsan.cpp | 4 +- .../compiler-rt/lib/lsan/lsan_allocator.cpp | 10 + .../compiler-rt/lib/lsan/lsan_common.cpp | 298 +- .../compiler-rt/lib/lsan/lsan_common.h | 20 +- .../compiler-rt/lib/lsan/lsan_common_fuchsia.cpp | 7 +- .../compiler-rt/lib/lsan/lsan_common_linux.cpp | 5 + .../compiler-rt/lib/lsan/lsan_fuchsia.h | 2 +- .../compiler-rt/lib/lsan/lsan_interceptors.cpp | 17 +- .../llvm-project/compiler-rt/lib/lsan/lsan_posix.h | 2 +- .../compiler-rt/lib/lsan/lsan_thread.cpp | 5 + .../compiler-rt/lib/lsan/lsan_thread.h | 2 + .../compiler-rt/lib/memprof/README.txt | 17 + .../compiler-rt/lib/memprof/memprof.syms.extra | 1 + .../compiler-rt/lib/memprof/memprof_allocator.cpp | 905 ++++ .../compiler-rt/lib/memprof/memprof_allocator.h | 105 + .../lib/memprof/memprof_descriptions.cpp | 70 + .../compiler-rt/lib/memprof/memprof_descriptions.h | 45 + .../compiler-rt/lib/memprof/memprof_flags.cpp | 93 + .../compiler-rt/lib/memprof/memprof_flags.h | 45 + .../compiler-rt/lib/memprof/memprof_flags.inc | 49 + .../compiler-rt/lib/memprof/memprof_init_version.h | 26 + .../lib/memprof/memprof_interceptors.cpp | 366 ++ .../compiler-rt/lib/memprof/memprof_interceptors.h | 54 + .../memprof/memprof_interceptors_memintrinsics.cpp | 29 + .../memprof/memprof_interceptors_memintrinsics.h | 79 + .../lib/memprof/memprof_interface_internal.h | 64 + .../compiler-rt/lib/memprof/memprof_internal.h | 104 + .../compiler-rt/lib/memprof/memprof_linux.cpp | 80 + .../lib/memprof/memprof_malloc_linux.cpp | 226 + .../compiler-rt/lib/memprof/memprof_mapping.h | 113 + .../compiler-rt/lib/memprof/memprof_new_delete.cpp | 145 + .../compiler-rt/lib/memprof/memprof_posix.cpp | 55 + .../compiler-rt/lib/memprof/memprof_preinit.cpp | 23 + .../compiler-rt/lib/memprof/memprof_rtl.cpp | 321 ++ .../lib/memprof/memprof_shadow_setup.cpp | 62 + .../compiler-rt/lib/memprof/memprof_stack.cpp | 59 + .../compiler-rt/lib/memprof/memprof_stack.h | 75 + .../compiler-rt/lib/memprof/memprof_stats.cpp | 157 + .../compiler-rt/lib/memprof/memprof_stats.h | 61 + .../compiler-rt/lib/memprof/memprof_thread.cpp | 220 + .../compiler-rt/lib/memprof/memprof_thread.h | 138 + .../compiler-rt/lib/memprof/weak_symbols.txt | 1 + contrib/llvm-project/compiler-rt/lib/msan/msan.cpp | 51 +- .../compiler-rt/lib/msan/msan_interceptors.cpp | 10 +- .../compiler-rt/lib/msan/msan_interface_internal.h | 10 +- .../compiler-rt/lib/msan/msan_linux.cpp | 3 +- .../compiler-rt/lib/msan/msan_poisoning.cpp | 81 +- .../compiler-rt/lib/msan/msan_thread.cpp | 58 +- .../compiler-rt/lib/msan/msan_thread.h | 24 +- .../compiler-rt/lib/profile/GCDAProfiling.c | 75 +- .../compiler-rt/lib/profile/InstrProfiling.c | 6 +- .../compiler-rt/lib/profile/InstrProfiling.h | 9 + .../compiler-rt/lib/profile/InstrProfilingBuffer.c | 24 +- .../compiler-rt/lib/profile/InstrProfilingFile.c | 35 +- .../lib/profile/InstrProfilingInternal.c | 3 + .../lib/profile/InstrProfilingPlatformDarwin.c | 3 + .../lib/profile/InstrProfilingPlatformLinux.c | 2 +- .../compiler-rt/lib/profile/InstrProfilingPort.h | 10 +- .../compiler-rt/lib/profile/InstrProfilingValue.c | 39 +- .../lib/profile/InstrProfilingVersionVar.c | 17 + .../compiler-rt/lib/profile/InstrProfilingWriter.c | 3 + .../lib/sanitizer_common/sanitizer_allocator.cpp | 39 +- .../lib/sanitizer_common/sanitizer_allocator.h | 6 +- .../sanitizer_common/sanitizer_allocator_checks.h | 10 +- .../sanitizer_allocator_primary32.h | 1 + *** 112076 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sun Jun 13 20:02:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FA94650515; Sun, 13 Jun 2021 20:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G359C0jPbz4gZS; Sun, 13 Jun 2021 20:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 007612728E; Sun, 13 Jun 2021 20:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DK2svN014111; Sun, 13 Jun 2021 20:02:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DK2rjR014110; Sun, 13 Jun 2021 20:02:53 GMT (envelope-from git) Date: Sun, 13 Jun 2021 20:02:53 GMT Message-Id: <202106132002.15DK2rjR014110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: d409305fa383 - main - Merge llvm-project 12.0.0 release MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d409305fa3838fb39b38c26fc085fb729b8766d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 20:02:55 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d409305fa3838fb39b38c26fc085fb729b8766d5 commit d409305fa3838fb39b38c26fc085fb729b8766d5 Merge: e8d8bef961a5 b4125f7d51da Author: Dimitry Andric AuthorDate: 2021-04-26 11:23:24 +0000 Commit: Dimitry Andric CommitDate: 2021-06-13 20:01:15 +0000 Merge llvm-project 12.0.0 release This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release. PR: 255570 MFC after: 6 weeks .../clang/include/clang/AST/ASTContext.h | 3 + .../llvm-project/clang/include/clang/AST/Decl.h | 11 +- .../llvm-project/clang/include/clang/AST/DeclCXX.h | 6 + .../llvm-project/clang/include/clang/AST/Expr.h | 3 +- .../llvm-project/clang/include/clang/AST/Mangle.h | 3 + .../include/clang/AST/MangleNumberingContext.h | 5 + .../clang/include/clang/AST/RecursiveASTVisitor.h | 12 + .../clang/include/clang/ASTMatchers/ASTMatchers.h | 2 +- .../clang/include/clang/Basic/CodeGenOptions.def | 3 + .../clang/include/clang/Basic/CodeGenOptions.h | 6 + .../clang/include/clang/Driver/Options.td | 7 +- .../clang/include/clang/Lex/VariadicMacroSupport.h | 10 +- .../llvm-project/clang/include/clang/Sema/Sema.h | 18 +- contrib/llvm-project/clang/lib/AST/ASTImporter.cpp | 2 + contrib/llvm-project/clang/lib/AST/CXXABI.h | 5 +- contrib/llvm-project/clang/lib/AST/Decl.cpp | 29 +- contrib/llvm-project/clang/lib/AST/DeclCXX.cpp | 14 + .../llvm-project/clang/lib/AST/ExprConstant.cpp | 50 +- .../llvm-project/clang/lib/AST/ItaniumCXXABI.cpp | 6 + .../llvm-project/clang/lib/AST/ItaniumMangle.cpp | 346 +++-- .../llvm-project/clang/lib/AST/MicrosoftCXXABI.cpp | 33 +- .../clang/lib/ASTMatchers/ASTMatchFinder.cpp | 48 +- .../clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 2 +- .../llvm-project/clang/lib/Basic/ProfileList.cpp | 1 + .../llvm-project/clang/lib/Basic/Targets/PPC.cpp | 3 - .../llvm-project/clang/lib/Basic/Targets/RISCV.cpp | 6 +- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 2 + .../llvm-project/clang/lib/CodeGen/CGCUDANV.cpp | 8 + contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | 5 + .../clang/lib/CodeGen/CGExprConstant.cpp | 2 +- .../clang/lib/CodeGen/CGOpenMPRuntime.cpp | 34 +- .../clang/lib/CodeGen/CodeGenFunction.h | 11 + .../clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 2 +- .../clang/lib/Driver/ToolChains/Clang.cpp | 15 +- .../clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 + .../clang/lib/Driver/ToolChains/Linux.cpp | 9 - .../clang/lib/Driver/ToolChains/MSVC.cpp | 6 +- .../clang/lib/Driver/ToolChains/OpenBSD.cpp | 1 + .../clang/lib/Format/UnwrappedLineFormatter.cpp | 2 +- .../clang/lib/Frontend/CompilerInvocation.cpp | 7 +- .../clang/lib/Frontend/InitPreprocessor.cpp | 2 +- .../llvm-project/clang/lib/Headers/avx512fintrin.h | 16 +- .../llvm-project/clang/lib/Lex/Preprocessor.cpp | 8 +- contrib/llvm-project/clang/lib/Lex/TokenLexer.cpp | 10 +- contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp | 3 +- contrib/llvm-project/clang/lib/Sema/Sema.cpp | 43 +- .../clang/lib/Sema/SemaCodeComplete.cpp | 21 +- contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp | 88 +- contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 2 +- contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp | 10 +- contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp | 23 +- .../llvm-project/clang/lib/Sema/TreeTransform.h | 7 +- .../clang/lib/Serialization/ASTReaderDecl.cpp | 1 + .../clang/lib/Serialization/ASTWriter.cpp | 1 + .../sanitizer_platform_interceptors.h | 2 +- contrib/llvm-project/libcxx/include/__locale | 20 +- .../libcxx/include/__threading_support | 2 +- contrib/llvm-project/libcxx/include/bit | 2 +- contrib/llvm-project/libcxx/include/limits | 4 +- contrib/llvm-project/libcxx/include/memory | 2 +- contrib/llvm-project/libcxx/src/atomic.cpp | 6 + contrib/llvm-project/libcxx/src/locale.cpp | 2 +- contrib/llvm-project/lld/ELF/InputSection.cpp | 5 +- contrib/llvm-project/lld/docs/ReleaseNotes.rst | 108 +- .../source/Host/common/NativeProcessProtocol.cpp | 11 +- .../Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp | 48 +- .../Plugins/Platform/FreeBSD/PlatformFreeBSD.h | 3 - .../Plugins/Process/FreeBSD/FreeBSDThread.cpp | 615 --------- .../source/Plugins/Process/FreeBSD/FreeBSDThread.h | 111 -- .../NativeProcessFreeBSD.cpp | 57 +- .../NativeProcessFreeBSD.h | 11 +- .../NativeRegisterContextFreeBSD.cpp | 2 +- .../NativeRegisterContextFreeBSD.h | 0 .../FreeBSD/NativeRegisterContextFreeBSD_arm.cpp | 202 +++ .../FreeBSD/NativeRegisterContextFreeBSD_arm.h | 68 + .../FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp | 288 ++++ .../FreeBSD/NativeRegisterContextFreeBSD_arm64.h | 86 ++ .../NativeRegisterContextFreeBSD_mips64.cpp | 186 +++ .../FreeBSD/NativeRegisterContextFreeBSD_mips64.h | 71 + .../NativeRegisterContextFreeBSD_powerpc.cpp | 289 ++++ .../FreeBSD/NativeRegisterContextFreeBSD_powerpc.h | 74 + .../NativeRegisterContextFreeBSD_x86_64.cpp | 0 .../NativeRegisterContextFreeBSD_x86_64.h | 6 +- .../NativeThreadFreeBSD.cpp | 5 + .../NativeThreadFreeBSD.h | 2 +- .../Plugins/Process/FreeBSD/POSIXStopInfo.cpp | 44 - .../source/Plugins/Process/FreeBSD/POSIXStopInfo.h | 66 - .../Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | 1080 --------------- .../Plugins/Process/FreeBSD/ProcessFreeBSD.h | 221 --- .../Plugins/Process/FreeBSD/ProcessMonitor.cpp | 1424 -------------------- .../Plugins/Process/FreeBSD/ProcessMonitor.h | 279 ---- .../Plugins/Process/FreeBSD/RegisterContextPOSIX.h | 63 - .../RegisterContextPOSIXProcessMonitor_arm.cpp | 260 ---- .../RegisterContextPOSIXProcessMonitor_arm.h | 80 -- .../RegisterContextPOSIXProcessMonitor_arm64.cpp | 267 ---- .../RegisterContextPOSIXProcessMonitor_arm64.h | 82 -- .../RegisterContextPOSIXProcessMonitor_mips64.cpp | 262 ---- .../RegisterContextPOSIXProcessMonitor_mips64.h | 82 -- .../RegisterContextPOSIXProcessMonitor_powerpc.cpp | 274 ---- .../RegisterContextPOSIXProcessMonitor_powerpc.h | 84 -- .../RegisterContextPOSIXProcessMonitor_x86.cpp | 613 --------- .../RegisterContextPOSIXProcessMonitor_x86.h | 81 -- .../NetBSD/NativeRegisterContextNetBSD_x86_64.h | 4 +- .../Utility/NativeProcessSoftwareSingleStep.cpp | 182 +++ .../Utility/NativeProcessSoftwareSingleStep.h | 31 + .../Utility/NativeRegisterContextDBReg_arm64.cpp | 466 +++++++ .../Utility/NativeRegisterContextDBReg_arm64.h | 79 ++ ..._x86.cpp => NativeRegisterContextDBReg_x86.cpp} | 38 +- ...oint_x86.h => NativeRegisterContextDBReg_x86.h} | 10 +- .../Process/Utility/RegisterInfos_powerpc.h | 4 +- .../lldb/tools/lldb-server/lldb-gdbserver.cpp | 2 +- contrib/llvm-project/llvm/include/llvm-c/Core.h | 6 +- contrib/llvm-project/llvm/include/llvm-c/Orc.h | 7 +- .../llvm/include/llvm/Analysis/AssumptionCache.h | 2 +- .../llvm/include/llvm/CodeGen/FastISel.h | 5 +- .../llvm/include/llvm/CodeGen/MachineInstr.h | 7 + .../llvm/include/llvm/CodeGen/TargetLowering.h | 4 + .../llvm/include/llvm/Demangle/ItaniumDemangle.h | 68 +- .../llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | 4 +- .../llvm-project/llvm/include/llvm/IR/InstrTypes.h | 3 - .../llvm/include/llvm/IR/Instruction.h | 7 + .../llvm/include/llvm/IR/IntrinsicInst.h | 8 +- .../llvm/include/llvm/IR/Intrinsics.td | 2 +- .../llvm/include/llvm/IR/IntrinsicsRISCV.td | 7 +- .../llvm-project/llvm/include/llvm/IR/Metadata.h | 18 + .../llvm-project/llvm/include/llvm/IR/Operator.h | 5 + .../llvm/include/llvm/IR/PseudoProbe.h | 27 +- .../include/llvm/Passes/StandardInstrumentations.h | 2 + .../llvm/include/llvm/ProfileData/ProfileCommon.h | 3 + .../llvm/include/llvm/ProfileData/SampleProf.h | 29 +- .../include/llvm/ProfileData/SampleProfReader.h | 4 + .../llvm/include/llvm/Support/CommandLine.h | 13 + .../llvm/Transforms/IPO/SampleContextTracker.h | 19 +- .../llvm/Transforms/IPO/SampleProfileProbe.h | 41 + .../llvm/include/llvm/Transforms/Utils/Cloning.h | 7 + .../llvm/lib/Analysis/DemandedBits.cpp | 2 +- .../llvm/lib/Analysis/IVDescriptors.cpp | 5 +- .../llvm-project/llvm/lib/Analysis/MemorySSA.cpp | 26 - .../llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp | 81 ++ .../llvm/lib/Analysis/ValueTracking.cpp | 28 +- .../llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 9 +- .../lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 5 + .../llvm/lib/CodeGen/LiveRangeShrink.cpp | 3 +- .../llvm-project/llvm/lib/CodeGen/MachineInstr.cpp | 3 +- .../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 17 +- .../llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 10 +- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 5 +- .../lib/CodeGen/SelectionDAG/TargetLowering.cpp | 31 +- .../llvm/lib/CodeGen/StackProtector.cpp | 2 +- .../llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 8 +- .../lib/ExecutionEngine/Orc/OrcV2CBindings.cpp | 2 +- contrib/llvm-project/llvm/lib/IR/AutoUpgrade.cpp | 42 + contrib/llvm-project/llvm/lib/IR/ConstantFold.cpp | 59 +- contrib/llvm-project/llvm/lib/IR/Instruction.cpp | 14 + contrib/llvm-project/llvm/lib/IR/Operator.cpp | 20 +- contrib/llvm-project/llvm/lib/IR/PseudoProbe.cpp | 41 + contrib/llvm-project/llvm/lib/IR/Verifier.cpp | 6 - .../llvm-project/llvm/lib/MC/ELFObjectWriter.cpp | 11 + .../llvm-project/llvm/lib/Passes/PassBuilder.cpp | 6 + .../llvm-project/llvm/lib/Passes/PassRegistry.def | 1 + .../llvm/lib/Passes/StandardInstrumentations.cpp | 1 + .../lib/ProfileData/Coverage/CoverageMapping.cpp | 1 - .../llvm/lib/ProfileData/ProfileSummaryBuilder.cpp | 34 + .../llvm/lib/ProfileData/SampleProfReader.cpp | 99 +- .../llvm/lib/ProfileData/SampleProfWriter.cpp | 15 +- .../llvm-project/llvm/lib/Support/CommandLine.cpp | 25 +- .../llvm-project/llvm/lib/Support/Windows/Path.inc | 24 +- .../lib/Target/AArch64/AArch64ISelLowering.cpp | 7 +- .../AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp | 2 +- .../lib/Target/AMDGPU/SIShrinkInstructions.cpp | 24 +- .../llvm/lib/Target/ARM/ARMISelLowering.cpp | 6 +- .../llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 6 + .../llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 12 +- .../llvm/lib/Target/PowerPC/PPCISelLowering.h | 3 + .../lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp | 6 +- .../RISCV/MCTargetDesc/RISCVTargetStreamer.cpp | 6 +- .../llvm/lib/Target/RISCV/RISCVCleanupVSETVLI.cpp | 37 +- .../lib/Target/RISCV/RISCVExpandPseudoInsts.cpp | 11 +- .../llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 118 +- .../llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h | 5 +- .../llvm/lib/Target/RISCV/RISCVInstrFormatsV.td | 23 +- .../llvm/lib/Target/RISCV/RISCVInstrInfoB.td | 67 - .../llvm/lib/Target/RISCV/RISCVInstrInfoV.td | 116 +- .../lib/Target/RISCV/RISCVInstrInfoVPseudos.td | 239 ++-- .../lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td | 6 +- contrib/llvm-project/llvm/lib/Target/VE/VE.h | 10 +- .../Target/X86/Disassembler/X86Disassembler.cpp | 1 + .../llvm/lib/Target/X86/X86FastISel.cpp | 8 + .../llvm/lib/Target/X86/X86ISelLowering.cpp | 9 +- .../llvm/lib/Target/X86/X86InstrAVX512.td | 4 +- .../llvm/lib/Target/X86/X86InstrSSE.td | 16 +- .../llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 10 +- .../lib/Transforms/IPO/SampleContextTracker.cpp | 118 +- .../llvm/lib/Transforms/IPO/SampleProfile.cpp | 713 ++++++++-- .../llvm/lib/Transforms/IPO/SampleProfileProbe.cpp | 162 ++- .../Transforms/InstCombine/InstCombineCasts.cpp | 1 + .../lib/Transforms/InstCombine/InstCombinePHI.cpp | 8 +- .../InstCombine/InstCombineSimplifyDemanded.cpp | 8 +- .../InstCombine/InstructionCombining.cpp | 7 +- .../llvm/lib/Transforms/Scalar/ADCE.cpp | 2 +- .../llvm/lib/Transforms/Scalar/JumpThreading.cpp | 10 + .../llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 10 +- .../llvm/lib/Transforms/Scalar/SROA.cpp | 38 +- .../llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 67 - .../llvm/lib/Transforms/Utils/CloneFunction.cpp | 8 + .../llvm/lib/Transforms/Utils/InlineFunction.cpp | 12 +- .../llvm/lib/Transforms/Utils/Local.cpp | 33 +- .../llvm/lib/Transforms/Utils/LoopPeel.cpp | 19 +- .../llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 19 +- .../Vectorize/LoopVectorizationPlanner.h | 4 + .../lib/Transforms/Vectorize/LoopVectorize.cpp | 40 +- .../llvm-project/llvm/tools/llvm-dwp/llvm-dwp.cpp | 4 +- .../llvm/tools/llvm-objdump/llvm-objdump.cpp | 30 +- .../llvm/tools/llvm-profdata/llvm-profdata.cpp | 2 +- .../llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | 7 +- .../llvm/utils/TableGen/IntrinsicEmitter.cpp | 4 +- .../openmp/runtime/src/kmp_config.h.cmake | 4 +- .../openmp/runtime/src/kmp_runtime.cpp | 21 +- .../openmp/runtime/src/kmp_settings.cpp | 10 +- .../openmp/runtime/src/kmp_tasking.cpp | 3 +- etc/mtree/BSD.include.dist | 2 + lib/clang/include/Plugins/Plugins.def | 1 - lib/clang/include/VCSVersion.inc | 8 +- lib/clang/include/clang/Config/config.h | 2 +- lib/clang/include/llvm/Config/config.h | 4 +- lib/clang/include/llvm/Config/llvm-config.h | 2 +- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- lib/clang/liblldb/Makefile | 36 +- lib/clang/libllvm/Makefile | 1 + lib/libc++/Makefile | 26 +- lib/libc++/__config_site | 40 + lib/libomp/kmp_config.h | 18 + lib/libomp/kmp_i18n_default.inc | 10 +- lib/libomp/kmp_i18n_id.inc | 4 +- lib/libomp/omp-tools.h | 141 +- lib/libomp/omp.h | 144 +- sys/sys/param.h | 2 +- tools/build/mk/OptionalObsoleteFiles.inc | 11 + usr.bin/clang/Makefile | 1 + usr.bin/clang/bugpoint/bugpoint.1 | 8 +- usr.bin/clang/clang/clang.1 | 42 +- usr.bin/clang/llc/llc.1 | 22 +- usr.bin/clang/lldb-server/Makefile | 53 + usr.bin/clang/lldb-server/lldb-server.1 | 262 ++++ usr.bin/clang/lldb/lldb.1 | 39 +- usr.bin/clang/lli/lli.1 | 10 +- usr.bin/clang/llvm-ar/llvm-ar.1 | 10 +- usr.bin/clang/llvm-ar/llvm-ranlib.1 | 8 +- usr.bin/clang/llvm-as/llvm-as.1 | 8 +- usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 | 8 +- usr.bin/clang/llvm-cov/llvm-cov.1 | 25 +- usr.bin/clang/llvm-cxxfilt/llvm-cxxfilt.1 | 18 +- usr.bin/clang/llvm-diff/llvm-diff.1 | 8 +- usr.bin/clang/llvm-dis/llvm-dis.1 | 8 +- usr.bin/clang/llvm-dwarfdump/llvm-dwarfdump.1 | 54 +- usr.bin/clang/llvm-extract/llvm-extract.1 | 56 +- usr.bin/clang/llvm-link/llvm-link.1 | 8 +- usr.bin/clang/llvm-mca/llvm-mca.1 | 25 +- usr.bin/clang/llvm-nm/llvm-nm.1 | 15 +- usr.bin/clang/llvm-objcopy/llvm-objcopy.1 | 116 +- usr.bin/clang/llvm-objdump/llvm-objdump.1 | 683 +++++++--- usr.bin/clang/llvm-pdbutil/llvm-pdbutil.1 | 8 +- usr.bin/clang/llvm-profdata/llvm-profdata.1 | 85 +- usr.bin/clang/llvm-size/llvm-size.1 | 10 +- usr.bin/clang/llvm-strings/llvm-strings.1 | 10 +- usr.bin/clang/llvm-symbolizer/llvm-addr2line.1 | 29 +- usr.bin/clang/llvm-symbolizer/llvm-symbolizer.1 | 98 +- usr.bin/clang/llvm-tblgen/llvm-tblgen.1 | 806 ++++++++++- usr.bin/clang/opt/opt.1 | 8 +- 269 files changed, 7470 insertions(+), 7919 deletions(-) diff --cc contrib/llvm-project/clang/include/clang/AST/Decl.h index 47c282f0a63d,47c282f0a63d..1c5827b9c3a4 --- a/contrib/llvm-project/clang/include/clang/AST/Decl.h +++ b/contrib/llvm-project/clang/include/clang/AST/Decl.h @@@ -1276,15 -1276,15 +1276,12 @@@ public EvaluatedStmt *getEvaluatedStmt() const; /// Attempt to evaluate the value of the initializer attached to this -- /// declaration, and produce notes explaining why it cannot be evaluated. -- /// Returns a pointer to the value if evaluation succeeded, 0 otherwise. ++ /// declaration, and produce notes explaining why it cannot be evaluated or is ++ /// not a constant expression. Returns a pointer to the value if evaluation ++ /// succeeded, 0 otherwise. APValue *evaluateValue() const; ++ APValue *evaluateValue(SmallVectorImpl &Notes) const; --private: -- APValue *evaluateValueImpl(SmallVectorImpl &Notes, -- bool IsConstantInitialization) const; -- --public: /// Return the already-evaluated value of this variable's /// initializer, or NULL if the value is not yet known. Returns pointer /// to untyped APValue if the value could not be evaluated. diff --cc contrib/llvm-project/clang/include/clang/AST/Expr.h index a44d06967431,a44d06967431..52f8f18af205 --- a/contrib/llvm-project/clang/include/clang/AST/Expr.h +++ b/contrib/llvm-project/clang/include/clang/AST/Expr.h @@@ -699,8 -699,8 +699,7 @@@ public /// notes will be produced if the expression is not a constant expression. bool EvaluateAsInitializer(APValue &Result, const ASTContext &Ctx, const VarDecl *VD, -- SmallVectorImpl &Notes, -- bool IsConstantInitializer) const; ++ SmallVectorImpl &Notes) const; /// EvaluateWithSubstitution - Evaluate an expression as if from the context /// of a call to the given function with the given arguments, inside an diff --cc contrib/llvm-project/clang/lib/AST/Decl.cpp index feb9b0645ebc,feb9b0645ebc..10cfe145b3f0 --- a/contrib/llvm-project/clang/lib/AST/Decl.cpp +++ b/contrib/llvm-project/clang/lib/AST/Decl.cpp @@@ -2384,11 -2384,11 +2384,11 @@@ EvaluatedStmt *VarDecl::getEvaluatedStm APValue *VarDecl::evaluateValue() const { SmallVector Notes; -- return evaluateValueImpl(Notes, hasConstantInitialization()); ++ return evaluateValue(Notes); } --APValue *VarDecl::evaluateValueImpl(SmallVectorImpl &Notes, -- bool IsConstantInitialization) const { ++APValue *VarDecl::evaluateValue( ++ SmallVectorImpl &Notes) const { EvaluatedStmt *Eval = ensureEvaluatedStmt(); const auto *Init = cast(Eval->Value); @@@ -2407,16 -2407,16 +2407,8 @@@ Eval->IsEvaluating = true; -- ASTContext &Ctx = getASTContext(); -- bool Result = Init->EvaluateAsInitializer(Eval->Evaluated, Ctx, this, Notes, -- IsConstantInitialization); -- -- // In C++11, this isn't a constant initializer if we produced notes. In that -- // case, we can't keep the result, because it may only be correct under the -- // assumption that the initializer is a constant context. -- if (IsConstantInitialization && Ctx.getLangOpts().CPlusPlus11 && -- !Notes.empty()) -- Result = false; ++ bool Result = Init->EvaluateAsInitializer(Eval->Evaluated, getASTContext(), ++ this, Notes); // Ensure the computed APValue is cleaned up later if evaluation succeeded, // or that it's empty (so that there's nothing to clean up) if evaluation @@@ -2424,7 -2424,7 +2416,7 @@@ if (!Result) Eval->Evaluated = APValue(); else if (Eval->Evaluated.needsCleanup()) -- Ctx.addDestruction(&Eval->Evaluated); ++ getASTContext().addDestruction(&Eval->Evaluated); Eval->IsEvaluating = false; Eval->WasEvaluated = true; @@@ -2478,14 -2478,14 +2470,7 @@@ bool VarDecl::checkForConstantInitializ assert(!cast(Eval->Value)->isValueDependent()); // Evaluate the initializer to check whether it's a constant expression. -- Eval->HasConstantInitialization = -- evaluateValueImpl(Notes, true) && Notes.empty(); -- -- // If evaluation as a constant initializer failed, allow re-evaluation as a -- // non-constant initializer if we later find we want the value. -- if (!Eval->HasConstantInitialization) -- Eval->WasEvaluated = false; -- ++ Eval->HasConstantInitialization = evaluateValue(Notes) && Notes.empty(); return Eval->HasConstantInitialization; } diff --cc contrib/llvm-project/clang/lib/AST/ExprConstant.cpp index 56181bbe1166,1bdad771a923..b24025664684 --- a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp +++ b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp @@@ -3302,9 -3302,9 +3302,12 @@@ static bool evaluateVarDeclInit(EvalInf // Check that we can fold the initializer. In C++, we will have already done // this in the cases where it matters for conformance. -- if (!VD->evaluateValue()) { -- Info.FFDiag(E, diag::note_constexpr_var_init_non_constant, 1) << VD; ++ SmallVector Notes; ++ if (!VD->evaluateValue(Notes)) { ++ Info.FFDiag(E, diag::note_constexpr_var_init_non_constant, ++ Notes.size() + 1) << VD; NoteLValueLocation(Info, Base); ++ Info.addNotes(Notes); return false; } @@@ -14856,8 -14866,8 +14869,7 @@@ bool Expr::EvaluateAsConstantExpr(EvalR bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, const VarDecl *VD, -- SmallVectorImpl &Notes, -- bool IsConstantInitialization) const { ++ SmallVectorImpl &Notes) const { assert(!isValueDependent() && "Expression evaluator can't be called on a dependent expression."); @@@ -14870,12 -14880,12 +14882,11 @@@ Expr::EvalStatus EStatus; EStatus.Diag = &Notes; -- EvalInfo Info(Ctx, EStatus, -- (IsConstantInitialization && Ctx.getLangOpts().CPlusPlus11) -- ? EvalInfo::EM_ConstantExpression -- : EvalInfo::EM_ConstantFold); ++ EvalInfo Info(Ctx, EStatus, VD->isConstexpr() ++ ? EvalInfo::EM_ConstantExpression ++ : EvalInfo::EM_ConstantFold); Info.setEvaluatingDecl(VD, Value); -- Info.InConstantContext = IsConstantInitialization; ++ Info.InConstantContext = true; SourceLocation DeclLoc = VD->getLocation(); QualType DeclTy = VD->getType(); diff --cc contrib/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp index 497f9c04c9f8,497f9c04c9f8..decb8129e644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp @@@ -1622,8 -1622,8 +1622,8 @@@ llvm::Constant *ConstantEmitter::tryEmi if (CD->isTrivial() && CD->isDefaultConstructor()) return CGM.EmitNullConstant(D.getType()); } ++ InConstantContext = true; } -- InConstantContext = D.hasConstantInitialization(); QualType destType = D.getType(); diff --cc contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 57cc2d60e2af,83dfa0780547..caa5291ff6fa --- a/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@@ -409,6 -409,6 +409,7 @@@ class InlinedOpenMPRegionRAII llvm::DenseMap LambdaCaptureFields; FieldDecl *LambdaThisCaptureField = nullptr; const CodeGen::CGBlockInfo *BlockInfo = nullptr; ++ bool NoInheritance = false; public: /// Constructs region for combined constructs. @@@ -416,16 -416,16 +417,19 @@@ /// a list of functions used for code generation of implicitly inlined /// regions. InlinedOpenMPRegionRAII(CodeGenFunction &CGF, const RegionCodeGenTy &CodeGen, -- OpenMPDirectiveKind Kind, bool HasCancel) -- : CGF(CGF) { ++ OpenMPDirectiveKind Kind, bool HasCancel, ++ bool NoInheritance = true) ++ : CGF(CGF), NoInheritance(NoInheritance) { // Start emission for the construct. CGF.CapturedStmtInfo = new CGOpenMPInlinedRegionInfo( CGF.CapturedStmtInfo, CodeGen, Kind, HasCancel); -- std::swap(CGF.LambdaCaptureFields, LambdaCaptureFields); -- LambdaThisCaptureField = CGF.LambdaThisCaptureField; -- CGF.LambdaThisCaptureField = nullptr; -- BlockInfo = CGF.BlockInfo; -- CGF.BlockInfo = nullptr; ++ if (NoInheritance) { ++ std::swap(CGF.LambdaCaptureFields, LambdaCaptureFields); ++ LambdaThisCaptureField = CGF.LambdaThisCaptureField; ++ CGF.LambdaThisCaptureField = nullptr; ++ BlockInfo = CGF.BlockInfo; ++ CGF.BlockInfo = nullptr; ++ } } ~InlinedOpenMPRegionRAII() { @@@ -434,9 -434,9 +438,11 @@@ cast(CGF.CapturedStmtInfo)->getOldCSI(); delete CGF.CapturedStmtInfo; CGF.CapturedStmtInfo = OldCSI; -- std::swap(CGF.LambdaCaptureFields, LambdaCaptureFields); -- CGF.LambdaThisCaptureField = LambdaThisCaptureField; -- CGF.BlockInfo = BlockInfo; ++ if (NoInheritance) { ++ std::swap(CGF.LambdaCaptureFields, LambdaCaptureFields); ++ CGF.LambdaThisCaptureField = LambdaThisCaptureField; ++ CGF.BlockInfo = BlockInfo; ++ } } }; @@@ -3853,7 -3853,7 +3859,7 @@@ static void emitPrivatesInit(CodeGenFun // Processing for implicitly captured variables. InlinedOpenMPRegionRAII Region( CGF, [](CodeGenFunction &, PrePostActionTy &) {}, OMPD_unknown, -- /*HasCancel=*/false); ++ /*HasCancel=*/false, /*NoInheritance=*/true); SharedRefLValue = CGF.EmitLValue(Pair.second.OriginalRef); } if (Type->isArrayType()) { @@@ -6214,7 -6214,7 +6220,9 @@@ void CGOpenMPRuntime::emitInlinedDirect bool HasCancel) { if (!CGF.HaveInsertPoint()) return; -- InlinedOpenMPRegionRAII Region(CGF, CodeGen, InnerKind, HasCancel); ++ InlinedOpenMPRegionRAII Region(CGF, CodeGen, InnerKind, HasCancel, ++ InnerKind != OMPD_critical && ++ InnerKind != OMPD_master); CGF.CapturedStmtInfo->EmitBody(CGF, /*S=*/nullptr); } diff --cc contrib/llvm-project/lldb/source/Host/common/NativeProcessProtocol.cpp index 493e14cb904b,493e14cb904b..070fda664678 --- a/contrib/llvm-project/lldb/source/Host/common/NativeProcessProtocol.cpp +++ b/contrib/llvm-project/lldb/source/Host/common/NativeProcessProtocol.cpp @@@ -522,7 -522,7 +522,8 @@@ NativeProcessProtocol::GetSoftwareBreak static const uint8_t g_mips64_opcode[] = {0x00, 0x00, 0x00, 0x0d}; static const uint8_t g_mips64el_opcode[] = {0x0d, 0x00, 0x00, 0x00}; static const uint8_t g_s390x_opcode[] = {0x00, 0x01}; -- static const uint8_t g_ppc64le_opcode[] = {0x08, 0x00, 0xe0, 0x7f}; // trap ++ static const uint8_t g_ppc_opcode[] = {0x7f, 0xe0, 0x00, 0x08}; // trap ++ static const uint8_t g_ppcle_opcode[] = {0x08, 0x00, 0xe0, 0x7f}; // trap switch (GetArchitecture().GetMachine()) { case llvm::Triple::aarch64: @@@ -544,8 -544,8 +545,12 @@@ case llvm::Triple::systemz: return llvm::makeArrayRef(g_s390x_opcode); ++ case llvm::Triple::ppc: ++ case llvm::Triple::ppc64: ++ return llvm::makeArrayRef(g_ppc_opcode); ++ case llvm::Triple::ppc64le: -- return llvm::makeArrayRef(g_ppc64le_opcode); ++ return llvm::makeArrayRef(g_ppcle_opcode); default: return llvm::createStringError(llvm::inconvertibleErrorCode(), @@@ -568,6 -568,6 +573,8 @@@ size_t NativeProcessProtocol::GetSoftwa case llvm::Triple::mips64el: case llvm::Triple::mips: case llvm::Triple::mipsel: ++ case llvm::Triple::ppc: ++ case llvm::Triple::ppc64: case llvm::Triple::ppc64le: // On these architectures the PC doesn't get updated for breakpoint hits. return 0; diff --cc contrib/llvm-project/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp index f4d44eb7e745,f4d44eb7e745..6b39a83fd668 --- a/contrib/llvm-project/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp @@@ -214,55 -214,55 +214,9 @@@ void PlatformFreeBSD::GetStatus(Stream #endif } --size_t --PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode(Target &target, -- BreakpointSite *bp_site) { -- switch (target.GetArchitecture().GetMachine()) { -- case llvm::Triple::arm: { -- lldb::BreakpointLocationSP bp_loc_sp(bp_site->GetOwnerAtIndex(0)); -- AddressClass addr_class = AddressClass::eUnknown; -- -- if (bp_loc_sp) { -- addr_class = bp_loc_sp->GetAddress().GetAddressClass(); -- if (addr_class == AddressClass::eUnknown && -- (bp_loc_sp->GetAddress().GetFileAddress() & 1)) -- addr_class = AddressClass::eCodeAlternateISA; -- } -- -- if (addr_class == AddressClass::eCodeAlternateISA) { -- // TODO: Enable when FreeBSD supports thumb breakpoints. -- // FreeBSD kernel as of 10.x, does not support thumb breakpoints -- return 0; -- } -- -- static const uint8_t g_arm_breakpoint_opcode[] = {0xFE, 0xDE, 0xFF, 0xE7}; -- size_t trap_opcode_size = sizeof(g_arm_breakpoint_opcode); -- assert(bp_site); -- if (bp_site->SetTrapOpcode(g_arm_breakpoint_opcode, trap_opcode_size)) -- return trap_opcode_size; -- } -- LLVM_FALLTHROUGH; -- default: -- return Platform::GetSoftwareBreakpointTrapOpcode(target, bp_site); -- } --} -- bool PlatformFreeBSD::CanDebugProcess() { if (IsHost()) { -- llvm::Triple host_triple{llvm::sys::getProcessTriple()}; -- bool use_legacy_plugin; -- -- switch (host_triple.getArch()) { -- case llvm::Triple::x86: -- case llvm::Triple::x86_64: -- // FreeBSDRemote plugin supports x86 only at the moment -- use_legacy_plugin = !!getenv("FREEBSD_LEGACY_PLUGIN"); -- break; -- default: -- use_legacy_plugin = true; -- } -- -- return !use_legacy_plugin; ++ return true; } else { // If we're connected, we can debug. return IsConnected(); diff --cc contrib/llvm-project/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h index c198ea18638d,c198ea18638d..4fd10fb1be73 --- a/contrib/llvm-project/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h +++ b/contrib/llvm-project/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h @@@ -44,9 -44,9 +44,6 @@@ public bool CanDebugProcess() override; -- size_t GetSoftwareBreakpointTrapOpcode(Target &target, -- BreakpointSite *bp_site) override; -- void CalculateTrapHandlerSymbolNames() override; MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr, diff --cc contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp index 163093c2ab1f,163093c2ab1f..5961ff4439db --- a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp @@@ -213,8 -213,8 +213,9 @@@ void NativeProcessFreeBSD::MonitorSIGTR llvm::Error error = t.CopyWatchpointsFrom( static_cast(*GetCurrentThread())); if (error) { -- LLDB_LOG(log, "failed to copy watchpoints to new thread {0}: {1}", -- info.pl_lwpid, llvm::toString(std::move(error))); ++ LLDB_LOG_ERROR(log, std::move(error), ++ "failed to copy watchpoints to new thread {1}: {0}", ++ info.pl_lwpid); SetState(StateType::eStateInvalid); return; } @@@ -264,19 -264,19 +265,35 @@@ switch (info.pl_siginfo.si_code) { case TRAP_BRKPT: ++ LLDB_LOG(log, "SIGTRAP/TRAP_BRKPT: si_addr: {0}", ++ info.pl_siginfo.si_addr); ++ if (thread) { -- thread->SetStoppedByBreakpoint(); ++ auto thread_info = ++ m_threads_stepping_with_breakpoint.find(thread->GetID()); ++ if (thread_info != m_threads_stepping_with_breakpoint.end()) { ++ thread->SetStoppedByTrace(); ++ Status brkpt_error = RemoveBreakpoint(thread_info->second); ++ if (brkpt_error.Fail()) ++ LLDB_LOG(log, "pid = {0} remove stepping breakpoint: {1}", ++ thread_info->first, brkpt_error); ++ m_threads_stepping_with_breakpoint.erase(thread_info); ++ } else ++ thread->SetStoppedByBreakpoint(); FixupBreakpointPCAsNeeded(*thread); } SetState(StateType::eStateStopped, true); return; case TRAP_TRACE: ++ LLDB_LOG(log, "SIGTRAP/TRAP_TRACE: si_addr: {0}", ++ info.pl_siginfo.si_addr); ++ if (thread) { auto ®ctx = static_cast( thread->GetRegisterContext()); uint32_t wp_index = LLDB_INVALID_INDEX32; -- Status error = -- regctx.GetWatchpointHitIndex(wp_index, LLDB_INVALID_ADDRESS); ++ Status error = regctx.GetWatchpointHitIndex( ++ wp_index, reinterpret_cast(info.pl_siginfo.si_addr)); if (error.Fail()) LLDB_LOG(log, "received error while checking for watchpoint hits, pid = " @@@ -354,6 -354,6 +371,27 @@@ Status NativeProcessFreeBSD::PtraceWrap return error; } ++llvm::Expected> ++NativeProcessFreeBSD::GetSoftwareBreakpointTrapOpcode(size_t size_hint) { ++ static const uint8_t g_arm_opcode[] = {0xfe, 0xde, 0xff, 0xe7}; ++ static const uint8_t g_thumb_opcode[] = {0x01, 0xde}; ++ ++ switch (GetArchitecture().GetMachine()) { ++ case llvm::Triple::arm: ++ switch (size_hint) { ++ case 2: ++ return llvm::makeArrayRef(g_thumb_opcode); ++ case 4: ++ return llvm::makeArrayRef(g_arm_opcode); ++ default: ++ return llvm::createStringError(llvm::inconvertibleErrorCode(), ++ "Unrecognised trap opcode size hint!"); ++ } ++ default: ++ return NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode(size_hint); ++ } ++} ++ Status NativeProcessFreeBSD::Resume(const ResumeActionList &resume_actions) { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS)); LLDB_LOG(log, "pid {0}", GetID()); @@@ -623,9 -623,9 +661,8 @@@ size_t NativeProcessFreeBSD::UpdateThre Status NativeProcessFreeBSD::SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware) { if (hardware) -- return Status("NativeProcessFreeBSD does not support hardware breakpoints"); -- else -- return SetSoftwareBreakpoint(addr, size); ++ return SetHardwareBreakpoint(addr, size); ++ return SetSoftwareBreakpoint(addr, size); } Status NativeProcessFreeBSD::GetLoadedModuleFileSpec(const char *module_path, @@@ -878,3 -878,3 +915,7 @@@ Status NativeProcessFreeBSD::Reinitiali return error; } ++ ++bool NativeProcessFreeBSD::SupportHardwareSingleStepping() const { ++ return !m_arch.IsMIPS(); ++} diff --cc contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.h index 3c7a9400f9c4,3c7a9400f9c4..ceffc370ca33 --- a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.h +++ b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.h @@@ -10,6 -10,6 +10,8 @@@ #define liblldb_NativeProcessFreeBSD_H_ #include "Plugins/Process/POSIX/NativeProcessELF.h" ++#include "Plugins/Process/Utility/NativeProcessSoftwareSingleStep.h" ++ #include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/FileSpec.h" @@@ -25,7 -25,7 +27,8 @@@ namespace process_freebsd /// for debugging. /// /// Changes in the inferior process state are broadcasted. --class NativeProcessFreeBSD : public NativeProcessELF { ++class NativeProcessFreeBSD : public NativeProcessELF, ++ private NativeProcessSoftwareSingleStep { public: class Factory : public NativeProcessProtocol::Factory { public: @@@ -84,6 -84,6 +87,12 @@@ static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, int data = 0, int *result = nullptr); ++ bool SupportHardwareSingleStepping() const; ++ ++protected: ++ llvm::Expected> ++ GetSoftwareBreakpointTrapOpcode(size_t size_hint) override; ++ private: MainLoop::SignalHandleUP m_sigchld_handle; ArchSpec m_arch; diff --cc contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.cpp index ac3cc4fe788a,ac3cc4fe788a..3d744f773a26 --- a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.cpp @@@ -8,7 -8,7 +8,7 @@@ #include "NativeRegisterContextFreeBSD.h" --#include "Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h" ++#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h" #include "lldb/Host/common/NativeProcessProtocol.h" diff --cc contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp index 000000000000,000000000000..c4ee3773eaeb new file mode 100644 --- /dev/null +++ b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp @@@ -1,0 -1,0 +1,202 @@@ ++//===-- NativeRegisterContextFreeBSD_arm.cpp ------------------------------===// ++// ++// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. ++// See https://llvm.org/LICENSE.txt for license information. ++// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ++// ++//===----------------------------------------------------------------------===// ++ ++#if defined(__arm__) ++ ++#include "NativeRegisterContextFreeBSD_arm.h" ++ ++#include "lldb/Utility/DataBufferHeap.h" ++#include "lldb/Utility/RegisterValue.h" ++#include "lldb/Utility/Status.h" ++ ++#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h" ++#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h" ++ ++// clang-format off ++#include ++#include ++#include ++// clang-format on ++ ++using namespace lldb; ++using namespace lldb_private; ++using namespace lldb_private::process_freebsd; ++ ++NativeRegisterContextFreeBSD * ++NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD( ++ const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { ++ return new NativeRegisterContextFreeBSD_arm(target_arch, native_thread); ++} ++ ++NativeRegisterContextFreeBSD_arm::NativeRegisterContextFreeBSD_arm( ++ const ArchSpec &target_arch, NativeThreadProtocol &native_thread) ++ : NativeRegisterContextRegisterInfo( ++ native_thread, new RegisterInfoPOSIX_arm(target_arch)) {} ++ ++RegisterInfoPOSIX_arm & ++NativeRegisterContextFreeBSD_arm::GetRegisterInfo() const { ++ return static_cast(*m_register_info_interface_up); ++} ++ ++uint32_t NativeRegisterContextFreeBSD_arm::GetRegisterSetCount() const { ++ return GetRegisterInfo().GetRegisterSetCount(); ++} ++ ++const RegisterSet * ++NativeRegisterContextFreeBSD_arm::GetRegisterSet(uint32_t set_index) const { ++ return GetRegisterInfo().GetRegisterSet(set_index); ++} ++ ++uint32_t NativeRegisterContextFreeBSD_arm::GetUserRegisterCount() const { ++ uint32_t count = 0; ++ for (uint32_t set_index = 0; set_index < GetRegisterSetCount(); ++set_index) ++ count += GetRegisterSet(set_index)->num_registers; ++ return count; ++} ++ ++Status NativeRegisterContextFreeBSD_arm::ReadRegisterSet(uint32_t set) { ++ switch (set) { ++ case RegisterInfoPOSIX_arm::GPRegSet: ++ return NativeProcessFreeBSD::PtraceWrapper(PT_GETREGS, m_thread.GetID(), ++ m_reg_data.data()); ++ case RegisterInfoPOSIX_arm::FPRegSet: ++ return NativeProcessFreeBSD::PtraceWrapper( ++ PT_GETVFPREGS, m_thread.GetID(), ++ m_reg_data.data() + sizeof(RegisterInfoPOSIX_arm::GPR)); ++ } ++ llvm_unreachable("NativeRegisterContextFreeBSD_arm::ReadRegisterSet"); ++} ++ ++Status NativeRegisterContextFreeBSD_arm::WriteRegisterSet(uint32_t set) { ++ switch (set) { ++ case RegisterInfoPOSIX_arm::GPRegSet: ++ return NativeProcessFreeBSD::PtraceWrapper(PT_SETREGS, m_thread.GetID(), ++ m_reg_data.data()); ++ case RegisterInfoPOSIX_arm::FPRegSet: ++ return NativeProcessFreeBSD::PtraceWrapper( ++ PT_SETVFPREGS, m_thread.GetID(), ++ m_reg_data.data() + sizeof(RegisterInfoPOSIX_arm::GPR)); ++ } ++ llvm_unreachable("NativeRegisterContextFreeBSD_arm::WriteRegisterSet"); ++} ++ ++Status ++NativeRegisterContextFreeBSD_arm::ReadRegister(const RegisterInfo *reg_info, ++ RegisterValue ®_value) { ++ Status error; ++ ++ if (!reg_info) { ++ error.SetErrorString("reg_info NULL"); ++ return error; ++ } ++ ++ const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB]; ++ ++ if (reg == LLDB_INVALID_REGNUM) ++ return Status("no lldb regnum for %s", reg_info && reg_info->name ++ ? reg_info->name ++ : ""); ++ ++ uint32_t set = GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg); ++ error = ReadRegisterSet(set); ++ if (error.Fail()) ++ return error; ++ ++ assert(reg_info->byte_offset + reg_info->byte_size <= m_reg_data.size()); ++ reg_value.SetBytes(m_reg_data.data() + reg_info->byte_offset, ++ reg_info->byte_size, endian::InlHostByteOrder()); ++ return error; ++} ++ ++Status NativeRegisterContextFreeBSD_arm::WriteRegister( ++ const RegisterInfo *reg_info, const RegisterValue ®_value) { ++ Status error; ++ ++ if (!reg_info) ++ return Status("reg_info NULL"); ++ ++ const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB]; ++ ++ if (reg == LLDB_INVALID_REGNUM) ++ return Status("no lldb regnum for %s", reg_info && reg_info->name ++ ? reg_info->name ++ : ""); ++ ++ uint32_t set = GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg); ++ error = ReadRegisterSet(set); ++ if (error.Fail()) ++ return error; ++ ++ assert(reg_info->byte_offset + reg_info->byte_size <= m_reg_data.size()); ++ ::memcpy(m_reg_data.data() + reg_info->byte_offset, reg_value.GetBytes(), ++ reg_info->byte_size); ++ ++ return WriteRegisterSet(set); ++} ++ ++Status NativeRegisterContextFreeBSD_arm::ReadAllRegisterValues( ++ lldb::DataBufferSP &data_sp) { ++ Status error; ++ ++ error = ReadRegisterSet(RegisterInfoPOSIX_arm::GPRegSet); ++ if (error.Fail()) ++ return error; ++ ++ error = ReadRegisterSet(RegisterInfoPOSIX_arm::FPRegSet); ++ if (error.Fail()) ++ return error; ++ ++ data_sp.reset(new DataBufferHeap(m_reg_data.size(), 0)); ++ uint8_t *dst = data_sp->GetBytes(); ++ ::memcpy(dst, m_reg_data.data(), m_reg_data.size()); ++ ++ return error; ++} ++ ++Status NativeRegisterContextFreeBSD_arm::WriteAllRegisterValues( ++ const lldb::DataBufferSP &data_sp) { ++ Status error; ++ ++ if (!data_sp) { ++ error.SetErrorStringWithFormat( ++ "NativeRegisterContextFreeBSD_arm::%s invalid data_sp provided", ++ __FUNCTION__); ++ return error; ++ } ++ ++ if (data_sp->GetByteSize() != m_reg_data.size()) { ++ error.SetErrorStringWithFormat( ++ "NativeRegisterContextFreeBSD_arm::%s data_sp contained mismatched " ++ "data size, expected %" PRIu64 ", actual %" PRIu64, ++ __FUNCTION__, m_reg_data.size(), data_sp->GetByteSize()); ++ return error; ++ } ++ ++ uint8_t *src = data_sp->GetBytes(); ++ if (src == nullptr) { ++ error.SetErrorStringWithFormat("NativeRegisterContextFreeBSD_arm::%s " ++ "DataBuffer::GetBytes() returned a null " ++ "pointer", ++ __FUNCTION__); ++ return error; ++ } ++ ::memcpy(m_reg_data.data(), src, m_reg_data.size()); ++ ++ error = WriteRegisterSet(RegisterInfoPOSIX_arm::GPRegSet); ++ if (error.Fail()) ++ return error; *** 31327 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sun Jun 13 20:18:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91033653F3D; Sun, 13 Jun 2021 20:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G35WM3hmBz4hCY; Sun, 13 Jun 2021 20:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 669F92714B; Sun, 13 Jun 2021 20:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DKIdF7028220; Sun, 13 Jun 2021 20:18:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DKIdBV028219; Sun, 13 Jun 2021 20:18:39 GMT (envelope-from git) Date: Sun, 13 Jun 2021 20:18:39 GMT Message-Id: <202106132018.15DKIdBV028219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 0afa9be03937 - main - tests/netgraph: Missed fixup after D30699 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0afa9be03937d60cb5aeba64c81e3e2165bd3737 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 20:18:39 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=0afa9be03937d60cb5aeba64c81e3e2165bd3737 commit 0afa9be03937d60cb5aeba64c81e3e2165bd3737 Author: Lutz Donnerhacke AuthorDate: 2021-06-10 10:21:14 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-13 20:16:52 +0000 tests/netgraph: Missed fixup after D30699 During D30699 the existing basic tests were missed. Furthermore debugging output was still in the code, which is removed now. MFC: together with D30699 Differential Revision: https://reviews.freebsd.org/D30714 --- tests/sys/netgraph/basic.c | 59 ++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/tests/sys/netgraph/basic.c b/tests/sys/netgraph/basic.c index 614208ba42a8..83a129a1972a 100644 --- a/tests/sys/netgraph/basic.c +++ b/tests/sys/netgraph/basic.c @@ -37,8 +37,6 @@ #include "util.h" -static void get_data(void *data, size_t len, void *ctx); - ATF_TC(send_recv); ATF_TC_HEAD(send_recv, conf) { @@ -48,16 +46,16 @@ ATF_TC_HEAD(send_recv, conf) ATF_TC_BODY(send_recv, dummy) { char msg[] = "test"; - int received; + ng_counter_t r; ng_init(); ng_connect(".", "a", ".", "b"); - ng_register_data("b", get_data); + ng_register_data("b", get_data0); ng_send_data("a", msg, sizeof(msg)); - received = 0; - ng_handle_events(50, &received); - ATF_CHECK(received == 1); + ng_counter_clear(r); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 1); } ATF_TC(node); @@ -69,7 +67,7 @@ ATF_TC_HEAD(node, conf) ATF_TC_BODY(node, dummy) { char msg[] = "test"; - int received; + ng_counter_t r; ng_init(); ng_mkpeer(".", "a", "hub", "a"); @@ -78,20 +76,20 @@ ATF_TC_BODY(node, dummy) ng_connect(".", "b", "test hub:", "b"); ng_connect(".", "c", "test hub:", "c"); - ng_register_data("a", get_data); - ng_register_data("b", get_data); - ng_register_data("c", get_data); + ng_register_data("a", get_data0); + ng_register_data("b", get_data1); + ng_register_data("c", get_data2); - received = 0; + ng_counter_clear(r); ng_send_data("a", msg, sizeof(msg)); - ng_handle_events(50, &received); - ATF_CHECK(received == 2); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1); ng_rmhook(".", "b"); - received = 0; + ng_counter_clear(r); ng_send_data("a", msg, sizeof(msg)); - ng_handle_events(50, &received); - ATF_CHECK(received == 1); + ng_handle_events(50, &r); + ATF_CHECK(r[0] == 0 && r[1] == 0 && r[2] == 1); ng_shutdown("test hub:"); } @@ -146,13 +144,14 @@ ATF_TC_HEAD(queuelimit, conf) ATF_TC_BODY(queuelimit, dummy) { - int received, i; + ng_counter_t r; + int i; char msg[] = "test"; const int MAX = 1000; ng_init(); ng_connect(".", "a", ".", "b"); - ng_register_data("b", get_data); + ng_register_data("b", get_data0); ng_errors(PASS); for (i = 0; i < MAX; i++) @@ -163,15 +162,13 @@ ATF_TC_BODY(queuelimit, dummy) /* no ng_handle_events -> messages stall */ } ng_errors(FAIL); - printf("queued %d\n", i); - sleep(3); - received = 0; - ng_handle_events(50, &received); - ATF_CHECK(received > 100); - ATF_CHECK(received == i); + ng_counter_clear(r); + ng_handle_events(50, &r); + ATF_CHECK(r[0] > 100); + ATF_CHECK(r[0] == i); atf_tc_expect_fail("Queue full (%d)", i); - ATF_CHECK(received == MAX); + ATF_CHECK(r[0] == MAX); atf_tc_expect_pass(); } @@ -185,13 +182,3 @@ ATF_TP_ADD_TCS(basic) return atf_no_error(); } - -static void -get_data(void *data, size_t len, void *ctx) -{ - int *cnt = ctx; - - (void)data; - printf("Got %zu bytes of data.\n", len); - (*cnt)++; -} From owner-dev-commits-src-all@freebsd.org Sun Jun 13 20:32:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFEE665736C; Sun, 13 Jun 2021 20:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G35qB5z3Zz4jfw; Sun, 13 Jun 2021 20:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5DD427A0A; Sun, 13 Jun 2021 20:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DKWMlB051797; Sun, 13 Jun 2021 20:32:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DKWM4R051796; Sun, 13 Jun 2021 20:32:22 GMT (envelope-from git) Date: Sun, 13 Jun 2021 20:32:22 GMT Message-Id: <202106132032.15DKWM4R051796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 43e4821315c3 - main - tests/netgraph: Check for PR241954 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43e4821315c31db067e23564b9bfafb519e77b2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 20:32:23 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=43e4821315c31db067e23564b9bfafb519e77b2b commit 43e4821315c31db067e23564b9bfafb519e77b2b Author: Lutz Donnerhacke AuthorDate: 2021-06-10 09:54:31 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-13 20:29:56 +0000 tests/netgraph: Check for PR241954 Add tests to check for renaming issues reported in PR241954 and solved in D30110. MFC: Together with D30629 Differential Revision: https://reviews.freebsd.org/D30713 --- tests/sys/netgraph/basic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/sys/netgraph/basic.c b/tests/sys/netgraph/basic.c index 83a129a1972a..573422add694 100644 --- a/tests/sys/netgraph/basic.c +++ b/tests/sys/netgraph/basic.c @@ -73,6 +73,13 @@ ATF_TC_BODY(node, dummy) ng_mkpeer(".", "a", "hub", "a"); ng_name("a", "test hub"); + ng_errors(PASS); + ng_name("a", "test hub"); + ng_errors(FAIL); + if (errno == EADDRINUSE) + atf_tc_expect_fail("PR241954"); + ATF_CHECK_ERRNO(0, 1); + atf_tc_expect_pass(); ng_connect(".", "b", "test hub:", "b"); ng_connect(".", "c", "test hub:", "c"); From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:02:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2CC06427DF; Sun, 13 Jun 2021 22:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qT504wz3F2R; Sun, 13 Jun 2021 22:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C9A01096; Sun, 13 Jun 2021 22:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2j2L074737; Sun, 13 Jun 2021 22:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2jIp074736; Sun, 13 Jun 2021 22:02:45 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:45 GMT Message-Id: <202106132202.15DM2jIp074736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 4458105f0647 - stable/13 - usbhid(4): Fix NULL pointer dereference in usbd_xfer_max_len() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4458105f064740da227ad608ccb5c58805cfac3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:45 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=4458105f064740da227ad608ccb5c58805cfac3e commit 4458105f064740da227ad608ccb5c58805cfac3e Author: Vladimir Kondratyev AuthorDate: 2021-05-28 20:13:44 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:57:31 +0000 usbhid(4): Fix NULL pointer dereference in usbd_xfer_max_len() Which happens when USB transfer setup is failed. PR: 254974 Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30485 (cherry picked from commit e889a462d878675551b227a382764c3879e6c2b3) --- sys/dev/usb/input/usbhid.c | 64 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index 70b1f4ae99c2..4fb846840b8a 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -308,6 +308,22 @@ static const struct usb_config usbhid_config[USBHID_N_TRANSFER] = { }, }; +static inline usb_frlength_t +usbhid_xfer_max_len(struct usb_xfer *xfer) +{ + return (xfer == NULL ? 0 : usbd_xfer_max_len(xfer)); +} + +static inline int +usbhid_xfer_check_len(struct usbhid_softc* sc, int xfer_idx, hid_size_t len) +{ + if (sc->sc_xfer[xfer_idx] == NULL) + return (ENODEV); + if (len > usbd_xfer_max_len(sc->sc_xfer[xfer_idx])) + return (ENOBUFS); + return (0); +} + static void usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, struct hid_rdesc_info *rdesc) @@ -320,6 +336,7 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, sc->sc_intr_handler = intr; sc->sc_intr_ctx = context; bcopy(usbhid_config, sc->sc_config, sizeof(usbhid_config)); + bzero(sc->sc_xfer, sizeof(sc->sc_xfer)); /* Set buffer sizes to match HID report sizes */ sc->sc_config[USBHID_INTR_OUT_DT].bufsize = rdesc->osize; @@ -342,17 +359,15 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, sc->sc_xfer + n, sc->sc_config + n, 1, (void *)(sc->sc_xfer_ctx + n), &sc->sc_mtx); if (error) - break; + DPRINTF("xfer %d setup error=%s\n", n, + usbd_errstr(error)); } - if (error) - DPRINTF("error=%s\n", usbd_errstr(error)); - - rdesc->rdsize = usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT]); - rdesc->grsize = usbd_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT]); + rdesc->rdsize = usbhid_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT]); + rdesc->grsize = usbhid_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT]); rdesc->srsize = rdesc->grsize; rdesc->wrsize = nowrite ? rdesc->srsize : - usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_OUT_DT]); + usbhid_xfer_max_len(sc->sc_xfer[USBHID_INTR_OUT_DT]); sc->sc_intr_buf = malloc(rdesc->rdsize, M_USBDEV, M_ZERO | M_WAITOK); } @@ -371,6 +386,9 @@ usbhid_intr_start(device_t dev) { struct usbhid_softc* sc = device_get_softc(dev); + if (sc->sc_xfer[USBHID_INTR_IN_DT] == NULL) + return (ENODEV); + mtx_lock(&sc->sc_mtx); sc->sc_xfer_ctx[USBHID_INTR_IN_DT] = (struct usbhid_xfer_ctx) { .req.intr.maxlen = @@ -493,8 +511,9 @@ usbhid_get_report(device_t dev, void *buf, hid_size_t maxlen, union usbhid_device_request req; int error; - if (maxlen > usbd_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, maxlen); + if (error) + return (error); req.ctrl.bmRequestType = UT_READ_CLASS_INTERFACE; req.ctrl.bRequest = UR_GET_REPORT; @@ -516,9 +535,11 @@ usbhid_set_report(device_t dev, const void *buf, hid_size_t len, uint8_t type, { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; - if (len > usbd_xfer_max_len(sc->sc_xfer[USBHID_CTRL_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, len); + if (error) + return (error); req.ctrl.bmRequestType = UT_WRITE_CLASS_INTERFACE; req.ctrl.bRequest = UR_SET_REPORT; @@ -538,8 +559,9 @@ usbhid_read(device_t dev, void *buf, hid_size_t maxlen, hid_size_t *actlen) union usbhid_device_request req; int error; - if (maxlen > usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_INTR_IN_DT, maxlen); + if (error) + return (error); req.intr.maxlen = maxlen; error = usbhid_sync_xfer(sc, USBHID_INTR_IN_DT, &req, buf); @@ -554,9 +576,11 @@ usbhid_write(device_t dev, const void *buf, hid_size_t len) { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; - if (len > usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_OUT_DT])) - return (ENOBUFS); + error = usbhid_xfer_check_len(sc, USBHID_INTR_OUT_DT, len); + if (error) + return (error); req.intr.maxlen = len; return (usbhid_sync_xfer(sc, USBHID_INTR_OUT_DT, &req, @@ -568,6 +592,11 @@ usbhid_set_idle(device_t dev, uint16_t duration, uint8_t id) { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; + + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, 0); + if (error) + return (error); /* Duration is measured in 4 milliseconds per unit. */ req.ctrl.bmRequestType = UT_WRITE_CLASS_INTERFACE; @@ -585,6 +614,11 @@ usbhid_set_protocol(device_t dev, uint16_t protocol) { struct usbhid_softc* sc = device_get_softc(dev); union usbhid_device_request req; + int error; + + error = usbhid_xfer_check_len(sc, USBHID_CTRL_DT, 0); + if (error) + return (error); req.ctrl.bmRequestType = UT_WRITE_CLASS_INTERFACE; req.ctrl.bRequest = UR_SET_PROTOCOL; From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:02:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E90DA6427E5; Sun, 13 Jun 2021 22:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qV65ryz3DxB; Sun, 13 Jun 2021 22:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B85FFDF2; Sun, 13 Jun 2021 22:02:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2kg1074761; Sun, 13 Jun 2021 22:02:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2k52074760; Sun, 13 Jun 2021 22:02:46 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:46 GMT Message-Id: <202106132202.15DM2k52074760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: a303f4b1c1d3 - stable/13 - usbhid(4): Add second set of USB transfers to work in polled mode. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a303f4b1c1d300488d5116bbf8f3692f545fbdd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:47 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a303f4b1c1d300488d5116bbf8f3692f545fbdd1 commit a303f4b1c1d300488d5116bbf8f3692f545fbdd1 Author: Vladimir Kondratyev AuthorDate: 2021-05-28 20:25:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:57:37 +0000 usbhid(4): Add second set of USB transfers to work in polled mode. The second set of USB transfer is requested by hkbd(4) and should improve HID keyboard handling in kdb and panic contexts. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30486 (cherry picked from commit 9aa0e5af75d033aa2dff763dd2886daaa7213612) --- sys/dev/hid/hid_if.m | 9 +++--- sys/dev/hid/hidbus.c | 3 ++ sys/dev/iicbus/iichid.c | 3 ++ sys/dev/usb/input/usbhid.c | 77 +++++++++++++++++++++++++++++++++++++--------- 4 files changed, 73 insertions(+), 19 deletions(-) diff --git a/sys/dev/hid/hid_if.m b/sys/dev/hid/hid_if.m index e33791ba24e8..896308fccd17 100644 --- a/sys/dev/hid/hid_if.m +++ b/sys/dev/hid/hid_if.m @@ -44,8 +44,8 @@ INTERFACE hid; # rdesc is pointer to structire containing requested maximal sizes of input, # output and feature reports. It is used by hardware transport drivers # to determine sizes of internal buffers. -# This function returns zero upon success. A non-zero return value indicates -# failure. +# This function can be subsequently called with intr parameter set to NULL +# to request intr_poll method support for transport driver. # METHOD void intr_setup { device_t dev; @@ -76,8 +76,9 @@ METHOD int intr_stop { }; # -# The following function gets called from the HID keyboard driver -# when the system has paniced. +# The following function gets called from the HID keyboard driver when +# the system has paniced. intr_setup method with NULL passed as intr parameter +# must be called once before to let transport driver to be prepared. # METHOD void intr_poll { device_t dev; diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c index be3564842988..3064f9999f2f 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -457,6 +457,9 @@ hidbus_write_ivar(device_t bus, device_t child, int which, uintptr_t value) break; case HIDBUS_IVAR_FLAGS: tlc->flags = value; + if ((value & HIDBUS_FLAG_CAN_POLL) != 0) + HID_INTR_SETUP( + device_get_parent(bus), NULL, NULL, NULL); break; case HIDBUS_IVAR_DRIVER_INFO: tlc->driver_info = value; diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index fe949f113984..7c51a697c4c7 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -782,6 +782,9 @@ iichid_intr_setup(device_t dev, hid_intr_t intr, void *context, { struct iichid_softc *sc; + if (intr == NULL) + return; + sc = device_get_softc(dev); /* * Do not rely on wMaxInputLength, as some devices may set it to diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index 4fb846840b8a..c6f2a1f24303 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR usbhid_debug #include @@ -85,6 +86,8 @@ SYSCTL_INT(_hw_usb_usbhid, OID_AUTO, debug, CTLFLAG_RWTUN, &usbhid_debug, 0, "Debug level"); #endif +/* Second set of USB transfers for polling mode */ +#define POLL_XFER(xfer) ((xfer) + USBHID_N_TRANSFER) enum { USBHID_INTR_OUT_DT, USBHID_INTR_IN_DT, @@ -123,8 +126,9 @@ struct usbhid_softc { struct mtx sc_mtx; struct usb_config sc_config[USBHID_N_TRANSFER]; - struct usb_xfer *sc_xfer[USBHID_N_TRANSFER]; - struct usbhid_xfer_ctx sc_xfer_ctx[USBHID_N_TRANSFER]; + struct usb_xfer *sc_xfer[POLL_XFER(USBHID_N_TRANSFER)]; + struct usbhid_xfer_ctx sc_xfer_ctx[POLL_XFER(USBHID_N_TRANSFER)]; + bool sc_can_poll; struct usb_device *sc_udev; uint8_t sc_iface_no; @@ -317,6 +321,8 @@ usbhid_xfer_max_len(struct usb_xfer *xfer) static inline int usbhid_xfer_check_len(struct usbhid_softc* sc, int xfer_idx, hid_size_t len) { + if (USB_IN_POLLING_MODE_FUNC()) + xfer_idx = POLL_XFER(xfer_idx); if (sc->sc_xfer[xfer_idx] == NULL) return (ENODEV); if (len > usbd_xfer_max_len(sc->sc_xfer[xfer_idx])) @@ -333,6 +339,39 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, bool nowrite; int error; + nowrite = hid_test_quirk(&sc->sc_hw, HQ_NOWRITE); + + /* + * Setup the USB transfers one by one, so they are memory independent + * which allows for handling panics triggered by the HID drivers + * itself, typically by hkbd via CTRL+ALT+ESC sequences. Or if the HID + * keyboard driver was processing a key at the moment of panic. + */ + if (intr == NULL) { + if (sc->sc_can_poll) + return; + for (n = 0; n != USBHID_N_TRANSFER; n++) { + if (nowrite && n == USBHID_INTR_OUT_DT) + continue; + error = usbd_transfer_setup(sc->sc_udev, + &sc->sc_iface_index, sc->sc_xfer + POLL_XFER(n), + sc->sc_config + n, 1, + (void *)(sc->sc_xfer_ctx + POLL_XFER(n)), + &sc->sc_mtx); + if (error) + DPRINTF("xfer %d setup error=%s\n", n, + usbd_errstr(error)); + } + mtx_lock(&sc->sc_mtx); + if (sc->sc_xfer[USBHID_INTR_IN_DT] != NULL && + sc->sc_xfer[USBHID_INTR_IN_DT]->flags_int.started) + usbd_transfer_start( + sc->sc_xfer[POLL_XFER(USBHID_INTR_IN_DT)]); + mtx_unlock(&sc->sc_mtx); + sc->sc_can_poll = true; + return; + } + sc->sc_intr_handler = intr; sc->sc_intr_ctx = context; bcopy(usbhid_config, sc->sc_config, sizeof(usbhid_config)); @@ -344,14 +383,6 @@ usbhid_intr_setup(device_t dev, hid_intr_t intr, void *context, sc->sc_config[USBHID_CTRL_DT].bufsize = MAX(rdesc->isize, MAX(rdesc->osize, rdesc->fsize)); - nowrite = hid_test_quirk(&sc->sc_hw, HQ_NOWRITE); - - /* - * Setup the USB transfers one by one, so they are memory independent - * which allows for handling panics triggered by the HID drivers - * itself, typically by hkbd via CTRL+ALT+ESC sequences. Or if the HID - * keyboard driver was processing a key at the moment of panic. - */ for (n = 0; n != USBHID_N_TRANSFER; n++) { if (nowrite && n == USBHID_INTR_OUT_DT) continue; @@ -378,6 +409,10 @@ usbhid_intr_unsetup(device_t dev) struct usbhid_softc* sc = device_get_softc(dev); usbd_transfer_unsetup(sc->sc_xfer, USBHID_N_TRANSFER); + if (sc->sc_can_poll) + usbd_transfer_unsetup( + sc->sc_xfer, POLL_XFER(USBHID_N_TRANSFER)); + sc->sc_can_poll = false; free(sc->sc_intr_buf, M_USBDEV); } @@ -397,7 +432,16 @@ usbhid_intr_start(device_t dev) .cb_ctx = sc, .buf = sc->sc_intr_buf, }; + sc->sc_xfer_ctx[POLL_XFER(USBHID_INTR_IN_DT)] = (struct usbhid_xfer_ctx) { + .req.intr.maxlen = + usbd_xfer_max_len(sc->sc_xfer[USBHID_INTR_IN_DT]), + .cb = usbhid_intr_handler_cb, + .cb_ctx = sc, + .buf = sc->sc_intr_buf, + }; usbd_transfer_start(sc->sc_xfer[USBHID_INTR_IN_DT]); + if (sc->sc_can_poll) + usbd_transfer_start(sc->sc_xfer[POLL_XFER(USBHID_INTR_IN_DT)]); mtx_unlock(&sc->sc_mtx); return (0); @@ -410,6 +454,8 @@ usbhid_intr_stop(device_t dev) usbd_transfer_drain(sc->sc_xfer[USBHID_INTR_IN_DT]); usbd_transfer_drain(sc->sc_xfer[USBHID_INTR_OUT_DT]); + if (sc->sc_can_poll) + usbd_transfer_drain(sc->sc_xfer[POLL_XFER(USBHID_INTR_IN_DT)]); return (0); } @@ -419,7 +465,9 @@ usbhid_intr_poll(device_t dev) { struct usbhid_softc* sc = device_get_softc(dev); + MPASS(sc->sc_can_poll); usbd_transfer_poll(sc->sc_xfer + USBHID_INTR_IN_DT, 1); + usbd_transfer_poll(sc->sc_xfer + POLL_XFER(USBHID_INTR_IN_DT), 1); } /* @@ -430,12 +478,13 @@ usbhid_sync_xfer(struct usbhid_softc* sc, int xfer_idx, union usbhid_device_request *req, void *buf) { int error, timeout; - struct usbhid_xfer_ctx *xfer_ctx, save; + struct usbhid_xfer_ctx *xfer_ctx; xfer_ctx = sc->sc_xfer_ctx + xfer_idx; if (USB_IN_POLLING_MODE_FUNC()) { - save = *xfer_ctx; + xfer_ctx = POLL_XFER(xfer_ctx); + xfer_idx = POLL_XFER(xfer_idx); } else { mtx_lock(&sc->sc_mtx); ++xfer_ctx->waiters; @@ -473,9 +522,7 @@ usbhid_sync_xfer(struct usbhid_softc* sc, int xfer_idx, if (error == 0) *req = xfer_ctx->req; - if (USB_IN_POLLING_MODE_FUNC()) { - *xfer_ctx = save; - } else { + if (!USB_IN_POLLING_MODE_FUNC()) { xfer_ctx->influx = false; if (xfer_ctx->waiters != 0) wakeup_one(&xfer_ctx->waiters); From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:02:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65DFF6424CE; Sun, 13 Jun 2021 22:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qY0pWyz3F03; Sun, 13 Jun 2021 22:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01AF6DF4; Sun, 13 Jun 2021 22:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2mxi074816; Sun, 13 Jun 2021 22:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2m7E074815; Sun, 13 Jun 2021 22:02:48 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:48 GMT Message-Id: <202106132202.15DM2m7E074815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: a4a738ba7575 - stable/13 - ums(4): Do not stop USB xfers on FIFO close when evdev is still active MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4a738ba757571088143c8c781d187b71c3a672d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:49 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a4a738ba757571088143c8c781d187b71c3a672d commit a4a738ba757571088143c8c781d187b71c3a672d Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:38:53 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:59:18 +0000 ums(4): Do not stop USB xfers on FIFO close when evdev is still active This fixes lose of evdev events after moused has been killed. While here use bitwise operations for UMS_EVDEV_OPENED flag. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30342 (cherry picked from commit 05ab03a31798d4cc96c22a8f30b1d9a0d7a3dd35) --- sys/dev/usb/input/ums.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 3d57a6c7be5d..cce1831287e4 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -380,7 +380,7 @@ tr_setup: /* check if we can put more data into the FIFO */ if (usb_fifo_put_bytes_max(sc->sc_fifo.fp[USB_FIFO_RX]) == 0) { #ifdef EVDEV_SUPPORT - if (sc->sc_evflags == 0) + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) break; #else break; @@ -858,7 +858,10 @@ ums_fifo_stop_read(struct usb_fifo *fifo) { struct ums_softc *sc = usb_fifo_softc(fifo); - ums_stop_rx(sc); +#ifdef EVDEV_SUPPORT + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) +#endif + ums_stop_rx(sc); } #if ((MOUSE_SYS_PACKETSIZE != 8) || \ @@ -945,7 +948,7 @@ ums_ev_open(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = UMS_EVDEV_OPENED; + sc->sc_evflags |= UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) { ums_reset(sc); @@ -962,7 +965,7 @@ ums_ev_close(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = 0; + sc->sc_evflags &= ~UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) ums_stop_rx(sc); @@ -984,7 +987,7 @@ ums_fifo_open(struct usb_fifo *fifo, int fflags) /* check for first open */ #ifdef EVDEV_SUPPORT - if (sc->sc_fflags == 0 && sc->sc_evflags == 0) + if (sc->sc_fflags == 0 && (sc->sc_evflags & UMS_EVDEV_OPENED) == 0) ums_reset(sc); #else if (sc->sc_fflags == 0) From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:02:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 038CB6429A8; Sun, 13 Jun 2021 22:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qW6bnFz3Dm1; Sun, 13 Jun 2021 22:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB03BFB3; Sun, 13 Jun 2021 22:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2lH4074791; Sun, 13 Jun 2021 22:02:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2lBS074790; Sun, 13 Jun 2021 22:02:47 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:47 GMT Message-Id: <202106132202.15DM2lBS074790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 927742783f9e - stable/13 - ums(4): Start USB xfers on opening of evdev node unconditionally. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 927742783f9e870d0a58196d2b64491e460f9af5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:48 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=927742783f9e870d0a58196d2b64491e460f9af5 commit 927742783f9e870d0a58196d2b64491e460f9af5 Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:41:17 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:58:44 +0000 ums(4): Start USB xfers on opening of evdev node unconditionally. This fixes inability to start USB xfers in a case when FIFO has been already open()-ed but no read() or poll() calls has been issued yet. MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D30343 (cherry picked from commit 47791339f0cfe3282a6f64b5607047f7bca968ad) --- sys/dev/usb/input/ums.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 6b7c3d526ad0..3d57a6c7be5d 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -949,8 +949,8 @@ ums_ev_open(struct evdev_dev *evdev) if (sc->sc_fflags == 0) { ums_reset(sc); - ums_start_rx(sc); } + ums_start_rx(sc); return (0); } From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:02:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBCBC642B19; Sun, 13 Jun 2021 22:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37qZ2W9rz3Dpp; Sun, 13 Jun 2021 22:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 178DCE3F; Sun, 13 Jun 2021 22:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM2n2m074840; Sun, 13 Jun 2021 22:02:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM2nmR074839; Sun, 13 Jun 2021 22:02:49 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:02:49 GMT Message-Id: <202106132202.15DM2nmR074839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: e9dd950507ed - stable/13 - iwmbtfw(8): Improve Intel 7260/7265 adaptors handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e9dd950507ed02b7d9ef1f78334246e757b47894 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:02:51 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e9dd950507ed02b7d9ef1f78334246e757b47894 commit e9dd950507ed02b7d9ef1f78334246e757b47894 Author: Vladimir Kondratyev AuthorDate: 2021-05-31 19:32:08 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 21:59:38 +0000 iwmbtfw(8): Improve Intel 7260/7265 adaptors handling - Allow firmware downloading for hw_variant #8; - Enter manufacturer mode for setting of event mask; - Handle multi-event response on HCI commands for 7260; This allows to remove kludge with skipping of 0xfc2f opcode. - Disable patch and exit manufacturer mode on downloading failure; - Use default firmware if correct firmware file is not found; Reviewed by: Philippe Michaud-Boudreault Tested by: arrowd Differential revision: https://reviews.freebsd.org/D30543 (cherry picked from commit da93a73f834612b659b37b513c8296e1178d249b) --- usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c | 14 ++++ usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 116 ++++++++++++++++++++-------------- usr.sbin/bluetooth/iwmbtfw/main.c | 9 ++- 3 files changed, 91 insertions(+), 48 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c index fc93ce094adc..963d5d5d9008 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c @@ -116,10 +116,12 @@ char * iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, const char *prefix, const char *suffix) { + struct stat sb; char *fwname; switch (ver->hw_variant) { case 0x07: /* 7260 */ + case 0x08: /* 7265 */ asprintf(&fwname, "%s/ibt-hw-%x.%x.%x-fw-%x.%x.%x.%x.%x.%s", prefix, le16toh(ver->hw_platform), @@ -131,6 +133,18 @@ iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, le16toh(ver->fw_build_ww), le16toh(ver->fw_build_yy), suffix); + /* + * Fallback to the default firmware patch if + * the correct firmware patch file is not found. + */ + if (stat(fwname, &sb) != 0 && errno == ENOENT) { + free(fwname); + asprintf(&fwname, "%s/ibt-hw-%x.%x.%s", + prefix, + le16toh(ver->hw_platform), + le16toh(ver->hw_variant), + suffix); + } break; case 0x0b: /* 8260 */ diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index f4272548d560..218fd28b74a2 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -134,17 +134,18 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, struct iwmbt_firmware fw_job = *fw; uint16_t cmd_opcode; uint8_t cmd_length; - uint8_t cmd_buf[IWMBT_HCI_MAX_CMD_SIZE]; + struct iwmbt_hci_cmd *cmd_buf; uint8_t evt_code; uint8_t evt_length; uint8_t evt_buf[IWMBT_HCI_MAX_EVENT_SIZE]; - int skip_patch = 0; + int activate_patch = 0; - for (;;) { - skip_patch = 0; - - if (fw_job.len < 4) - break; + while (fw_job.len > 0) { + if (fw_job.len < 4) { + iwmbt_err("Invalid firmware, unexpected EOF in HCI " + "command header. Remains=%d", fw_job.len); + return (-1); + } if (fw_job.buf[0] != 0x01) { iwmbt_err("Invalid firmware, expected HCI command (%d)", @@ -159,47 +160,61 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, /* Load in the HCI command to perform. */ cmd_opcode = le16dec(fw_job.buf); cmd_length = fw_job.buf[2]; - memcpy(cmd_buf, fw_job.buf, 3); + cmd_buf = (struct iwmbt_hci_cmd *)fw_job.buf; iwmbt_debug("opcode=%04x, len=%02x", cmd_opcode, cmd_length); - /* For some reason the command 0xfc2f hangs up my card. */ - if (cmd_opcode == 0xfc2f) - skip_patch = 1; + /* + * If there is a command that loads a patch in the + * firmware file, then activate the patch upon success, + * otherwise just disable the manufacturer mode. + */ + if (cmd_opcode == 0xfc8e) + activate_patch = 1; /* Advance by three. */ fw_job.buf += 3; fw_job.len -= 3; - if (fw_job.len < cmd_length) - cmd_length = fw_job.len; - - /* Copy data to HCI command buffer. */ - memcpy(cmd_buf + 3, fw_job.buf, - MIN(cmd_length, IWMBT_HCI_MAX_CMD_SIZE - 3)); + if (fw_job.len < cmd_length) { + iwmbt_err("Invalid firmware, unexpected EOF in HCI " + "command data. len=%d, remains=%d", + cmd_length, fw_job.len); + return (-1); + } /* Advance by data length. */ fw_job.buf += cmd_length; fw_job.len -= cmd_length; + ret = libusb_control_transfer(hdl, + LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_DEVICE, + 0, + 0, + 0, + (uint8_t *)cmd_buf, + IWMBT_HCI_CMD_SIZE(cmd_buf), + IWMBT_HCI_CMD_TIMEOUT); + + if (ret < 0) { + iwmbt_err("libusb_control_transfer() failed: err=%s", + libusb_strerror(ret)); + return (-1); + } + /* * Every command has its associated event: data must match * what is recorded in the firmware file. Perform that check * now. - * - * Some commands are mapped to more than one event sequence, - * in that case we can drop the non-patch commands, as we - * probably don't need them for operation of the card. - * */ - for (;;) { + while (fw_job.len > 0 && fw_job.buf[0] == 0x02) { /* Is this the end of the file? */ - if (fw_job.len < 3) - break; - - if (fw_job.buf[0] != 0x02) - break; + if (fw_job.len < 3) { + iwmbt_err("Invalid firmware, unexpected EOF in" + "event header. remains=%d", fw_job.len); + return (-1); + } /* Advance by one. */ fw_job.buf++; @@ -219,30 +234,39 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, iwmbt_debug("event=%04x, len=%02x", evt_code, evt_length); + if (fw_job.len < evt_length) { + iwmbt_err("Invalid firmware, unexpected EOF in" + " event data. len=%d, remains=%d", + evt_length, fw_job.len); + return (-1); + } + + ret = libusb_interrupt_transfer(hdl, + IWMBT_INTERRUPT_ENDPOINT_ADDR, + evt_buf, + IWMBT_HCI_MAX_EVENT_SIZE, + &transferred, + IWMBT_HCI_CMD_TIMEOUT); + + if (ret < 0) { + iwmbt_err("libusb_interrupt_transfer() failed:" + " err=%s", libusb_strerror(ret)); + return (-1); + } + + if ((int)evt_length + 2 != transferred || + memcmp(evt_buf + 2, fw_job.buf, evt_length) != 0) { + iwmbt_err("event does not match firmware"); + return (-1); + } + /* Advance by data length. */ fw_job.buf += evt_length; fw_job.len -= evt_length; - - if (skip_patch == 0) { - ret = iwmbt_hci_command(hdl, - (struct iwmbt_hci_cmd *)cmd_buf, - evt_buf, - IWMBT_HCI_MAX_EVENT_SIZE, - &transferred, - IWMBT_HCI_CMD_TIMEOUT); - - if (ret < 0) { - iwmbt_debug("Can't send patch: " - "code=%d, size=%d", - ret, - transferred); - return (-1); - } - } } } - return (0); + return (activate_patch); } int diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 3476e3fcd613..202894740805 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -441,13 +441,15 @@ main(int argc, char *argv[]) /* Download firmware and parse it for magic Intel Reset parameter */ r = iwmbt_patch_firmware(hdl, firmware_path); free(firmware_path); - if (r < 0) + if (r < 0) { + (void)iwmbt_exit_manufacturer(hdl, 0x01); goto shutdown; + } iwmbt_info("Firmware download complete"); /* Exit manufacturer mode */ - r = iwmbt_exit_manufacturer(hdl, 0x02); + r = iwmbt_exit_manufacturer(hdl, r == 0 ? 0x00 : 0x02); if (r < 0) { iwmbt_debug("iwmbt_exit_manufacturer() failed code %d", r); goto shutdown; @@ -462,9 +464,12 @@ main(int argc, char *argv[]) iwmbt_dump_version(&ver); /* Set Intel Event mask */ + if (iwmbt_enter_manufacturer(hdl) < 0) + goto reset; r = iwmbt_set_event_mask(hdl); if (r == 0) iwmbt_info("Intel Event Mask is set"); + (void)iwmbt_exit_manufacturer(hdl, 0x00); } else { From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:08:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 261C3644503; Sun, 13 Jun 2021 22:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37xr0bNhz3FTR; Sun, 13 Jun 2021 22:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F11141026; Sun, 13 Jun 2021 22:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM8Fqj075400; Sun, 13 Jun 2021 22:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM8FOM075399; Sun, 13 Jun 2021 22:08:15 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:08:15 GMT Message-Id: <202106132208.15DM8FOM075399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 7c55c8c7ff72 - stable/12 - ums(4): Start USB xfers on opening of evdev node unconditionally. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7c55c8c7ff7259bc40d2df7b07865bb800aba49f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:08:16 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7c55c8c7ff7259bc40d2df7b07865bb800aba49f commit 7c55c8c7ff7259bc40d2df7b07865bb800aba49f Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:41:17 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 22:05:21 +0000 ums(4): Start USB xfers on opening of evdev node unconditionally. This fixes inability to start USB xfers in a case when FIFO has been already open()-ed but no read() or poll() calls has been issued yet. Differential revision: https://reviews.freebsd.org/D30343 (cherry picked from commit 47791339f0cfe3282a6f64b5607047f7bca968ad) --- sys/dev/usb/input/ums.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 40b7a8aed774..cd5cc905f1b5 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -959,8 +959,8 @@ ums_ev_open(struct evdev_dev *evdev) if (sc->sc_fflags == 0) { ums_reset(sc); - ums_start_rx(sc); } + ums_start_rx(sc); return (0); } From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:08:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 627CB64441F; Sun, 13 Jun 2021 22:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G37xs1jy2z3FD4; Sun, 13 Jun 2021 22:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E966CFC; Sun, 13 Jun 2021 22:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DM8H3m075424; Sun, 13 Jun 2021 22:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DM8HtC075423; Sun, 13 Jun 2021 22:08:17 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:08:17 GMT Message-Id: <202106132208.15DM8HtC075423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8696dd92ffb7 - stable/12 - ums(4): Do not stop USB xfers on FIFO close when evdev is still active MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8696dd92ffb776263226114f23715746a9abc296 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:08:17 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8696dd92ffb776263226114f23715746a9abc296 commit 8696dd92ffb776263226114f23715746a9abc296 Author: Vladimir Kondratyev AuthorDate: 2021-05-23 22:38:53 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-06-13 22:05:25 +0000 ums(4): Do not stop USB xfers on FIFO close when evdev is still active This fixes lose of evdev events after moused has been killed. While here use bitwise operations for UMS_EVDEV_OPENED flag. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30342 (cherry picked from commit 05ab03a31798d4cc96c22a8f30b1d9a0d7a3dd35) --- sys/dev/usb/input/ums.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index cd5cc905f1b5..dced48754041 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -381,7 +381,7 @@ tr_setup: /* check if we can put more data into the FIFO */ if (usb_fifo_put_bytes_max(sc->sc_fifo.fp[USB_FIFO_RX]) == 0) { #ifdef EVDEV_SUPPORT - if (sc->sc_evflags == 0) + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) break; #else break; @@ -866,7 +866,10 @@ ums_fifo_stop_read(struct usb_fifo *fifo) { struct ums_softc *sc = usb_fifo_softc(fifo); - ums_stop_rx(sc); +#ifdef EVDEV_SUPPORT + if ((sc->sc_evflags & UMS_EVDEV_OPENED) == 0) +#endif + ums_stop_rx(sc); } @@ -955,7 +958,7 @@ ums_ev_open(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = UMS_EVDEV_OPENED; + sc->sc_evflags |= UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) { ums_reset(sc); @@ -972,7 +975,7 @@ ums_ev_close(struct evdev_dev *evdev) mtx_assert(&sc->sc_mtx, MA_OWNED); - sc->sc_evflags = 0; + sc->sc_evflags &= ~UMS_EVDEV_OPENED; if (sc->sc_fflags == 0) ums_stop_rx(sc); @@ -994,7 +997,7 @@ ums_fifo_open(struct usb_fifo *fifo, int fflags) /* check for first open */ #ifdef EVDEV_SUPPORT - if (sc->sc_fflags == 0 && sc->sc_evflags == 0) + if (sc->sc_fflags == 0 && (sc->sc_evflags & UMS_EVDEV_OPENED) == 0) ums_reset(sc); #else if (sc->sc_fflags == 0) From owner-dev-commits-src-all@freebsd.org Sun Jun 13 22:43:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A93464D20F; Sun, 13 Jun 2021 22:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G38kV2QJPz3H6N; Sun, 13 Jun 2021 22:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BFEB1A14; Sun, 13 Jun 2021 22:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DMhUWP027578; Sun, 13 Jun 2021 22:43:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DMhUtp027577; Sun, 13 Jun 2021 22:43:30 GMT (envelope-from git) Date: Sun, 13 Jun 2021 22:43:30 GMT Message-Id: <202106132243.15DMhUtp027577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: efec757b2042 - main - bhyve: enhance debug info for memory range clash MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efec757b20425ac68171acc7f9cec8be750db688 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 22:43:30 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=efec757b20425ac68171acc7f9cec8be750db688 commit efec757b20425ac68171acc7f9cec8be750db688 Author: Robert Crowston AuthorDate: 2021-04-10 19:16:02 +0000 Commit: Warner Losh CommitDate: 2021-06-13 22:41:45 +0000 bhyve: enhance debug info for memory range clash Explain what the two clashing regions are. Reivewed by: grehan, jhb Differential Revision: https://reviews.freebsd.org/D29696 Pull Request: https://github.com/freebsd/freebsd-src/pull/463 --- usr.sbin/bhyve/mem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/mem.c b/usr.sbin/bhyve/mem.c index 90aefe45c856..55f851590128 100644 --- a/usr.sbin/bhyve/mem.c +++ b/usr.sbin/bhyve/mem.c @@ -109,9 +109,11 @@ mmio_rb_add(struct mmio_rb_tree *rbt, struct mmio_rb_range *new) if (overlap != NULL) { #ifdef RB_DEBUG - printf("overlap detected: new %lx:%lx, tree %lx:%lx\n", + printf("overlap detected: new %lx:%lx, tree %lx:%lx, '%s' " + "claims region already claimed for '%s'\n", new->mr_base, new->mr_end, - overlap->mr_base, overlap->mr_end); + overlap->mr_base, overlap->mr_end, + new->mr_param.name, overlap->mr_param.name); #endif return (EEXIST);