From owner-dev-commits-src-all@freebsd.org Mon Feb 22 01:13: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 4628454225A; Mon, 22 Feb 2021 01:13: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 4DkPMb1Wqyz3wBS; Mon, 22 Feb 2021 01:13: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 1C9281CAE8; Mon, 22 Feb 2021 01:13: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 11M1Dl1l010884; Mon, 22 Feb 2021 01:13:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M1DlYp010883; Mon, 22 Feb 2021 01:13:47 GMT (envelope-from git) Date: Mon, 22 Feb 2021 01:13:47 GMT Message-Id: <202102220113.11M1DlYp010883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang Subject: git: c05f4077ecc4 - stable/13 - pxeboot(8): remove antiquated information MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c05f4077ecc45406d52dc64bddb95a15c633d1e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 01:13:47 -0000 The branch stable/13 has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c05f4077ecc45406d52dc64bddb95a15c633d1e8 commit c05f4077ecc45406d52dc64bddb95a15c633d1e8 Author: Guangyuan Yang AuthorDate: 2021-02-15 22:03:37 +0000 Commit: Guangyuan Yang CommitDate: 2021-02-22 01:13:24 +0000 pxeboot(8): remove antiquated information While I was there: - Fix some typos - Fix an excessive argument "indent" reported by mandoc -Tlint - Replace a dead link with the one suggested by https://www.uefi.org/uefi Submitted by: linimon (in part) Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D27774 (cherry picked from commit c90fb7acf099f1dc982f8d6087aa92809ae43727) --- stand/i386/pxeldr/pxeboot.8 | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/stand/i386/pxeldr/pxeboot.8 b/stand/i386/pxeldr/pxeboot.8 index c9fa434b3028..58b1f06bcd0f 100644 --- a/stand/i386/pxeldr/pxeboot.8 +++ b/stand/i386/pxeldr/pxeboot.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 25, 2018 +.Dd February 15, 2021 .Dt PXEBOOT 8 .Os .Sh NAME @@ -97,19 +97,19 @@ from the specified server before loading any other files. .Pp Valid .Va option root-path -Syntax is the following -.Bl -tag -width ://ip/path indent +syntax is the following +.Bl -tag -width ://ip/path .It /path path to the root filesystem on the NFS server -.It ip:/path +.It ip://path path to the root filesystem on the NFS server .Ar ip -.It nfs:/path +.It nfs://path path to the root filesystem on the NFS server .It nfs://ip/path path to the root filesystem on the NFS server .Ar ip -.It tftp:/path +.It tftp://path path to the root filesystem on the TFTP server .It tftp://ip/path path to the root filesystem on the TFTP server @@ -129,18 +129,9 @@ In all other respects, acts just like .Xr loader 8 . .Pp -As PXE is still in its infancy, some firmware versions may not work -properly. -The -.Nm -bootloader has been extensively tested on version 0.99 of Intel firmware; -pre-release versions of the newer 2.0 firmware are known to have -problems. -Check with the device's manufacturer for their latest stable release. -.Pp For further information on Intel's PXE specifications and Wired for Management (WfM) systems, see -.Li http://www.intel.com/design/archives/wfm/ . +.Li http://www.pix.net/software/pxeboot/archive/pxespec.pdf . .Sh SEE ALSO .Xr loader 8 .Sh HISTORY From owner-dev-commits-src-all@freebsd.org Mon Feb 22 05:24: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 CC13654820C; Mon, 22 Feb 2021 05:24: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 4DkVwK5QQwz4c0F; Mon, 22 Feb 2021 05:24: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 ACB5F20079; Mon, 22 Feb 2021 05:24: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 11M5O1Bt043558; Mon, 22 Feb 2021 05:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M5O1lU043557; Mon, 22 Feb 2021 05:24:01 GMT (envelope-from git) Date: Mon, 22 Feb 2021 05:24:01 GMT Message-Id: <202102220524.11M5O1lU043557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 9c59d7533731 - stable/12 - libpmc: fix linking with C programs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9c59d753373189f83b4447fe6a5456573451e014 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 05:24:01 -0000 The branch stable/12 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=9c59d753373189f83b4447fe6a5456573451e014 commit 9c59d753373189f83b4447fe6a5456573451e014 Author: Alan Somers AuthorDate: 2021-02-21 20:56:57 +0000 Commit: Alan Somers CommitDate: 2021-02-22 05:23:12 +0000 libpmc: fix linking with C programs Revision r334749 Added some C++ code to libpmc. It didn't change the ABI, but it did introduce a dependency on libc++. Nobody noticed because every program that in the base system that uses libpmc is also C++. Reported-by: Dom Dwyer Reviewed By: vangyzen Differential Revision: https://reviews.freebsd.org/D28550 (cherry picked from commit 04e34c0202ea50cea67d5779f54bc612c74e6532) --- lib/libpmc/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile index 35bacb26bd11..1e204e13fdb2 100644 --- a/lib/libpmc/Makefile +++ b/lib/libpmc/Makefile @@ -8,6 +8,12 @@ INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${.CURDIR} CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align +.include +.if ${COMPILER_TYPE} == "gcc" +LDADD+= -lstdc++ +.else +LDADD+= -lc++ +.endif .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" From owner-dev-commits-src-all@freebsd.org Mon Feb 22 05:50: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 4BECE548A34; Mon, 22 Feb 2021 05:50: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 4DkWWG1jpRz4dRq; Mon, 22 Feb 2021 05:50: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 2DD1B20337; Mon, 22 Feb 2021 05:50: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 11M5ooYm077662; Mon, 22 Feb 2021 05:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M5oone077661; Mon, 22 Feb 2021 05:50:50 GMT (envelope-from git) Date: Mon, 22 Feb 2021 05:50:50 GMT Message-Id: <202102220550.11M5oone077661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 5dbb407145c8 - stable/13 - MFC jail: Change both root and working directories in jail_attach(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5dbb407145c8128753fa30b695bc266dc671e433 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 05:50:50 -0000 The branch stable/13 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=5dbb407145c8128753fa30b695bc266dc671e433 commit 5dbb407145c8128753fa30b695bc266dc671e433 Author: Jamie Gritton AuthorDate: 2021-02-19 22:13:35 +0000 Commit: Jamie Gritton CommitDate: 2021-02-22 05:49:40 +0000 MFC jail: Change both root and working directories in jail_attach(2) jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Reported by: mjg Approved by: markj, kib (cherry picked from commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5) --- lib/libc/sys/jail.2 | 5 ++++- sys/kern/kern_descrip.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- sys/kern/kern_jail.c | 2 +- sys/sys/filedesc.h | 1 + 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/jail.2 b/lib/libc/sys/jail.2 index 2e13a6c3a381..82c2e97d4a7b 100644 --- a/lib/libc/sys/jail.2 +++ b/lib/libc/sys/jail.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 19, 2021 .Dt JAIL 2 .Os .Sh NAME @@ -228,6 +228,9 @@ The system call attaches the current process to an existing jail, identified by .Fa jid . +It changes the process's root and current directories to the jail's +.Va path +directory. .Pp The .Fn jail_remove diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 059e5123c7b5..31c7d3bf2188 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3795,9 +3795,8 @@ pwd_drop(struct pwd *pwd) } /* -* Common routine for kern_chroot() and jail_attach(). The caller is -* responsible for invoking priv_check() and mac_vnode_check_chroot() to -* authorize this operation. +* The caller is responsible for invoking priv_check() and +* mac_vnode_check_chroot() to authorize this operation. */ int pwd_chroot(struct thread *td, struct vnode *vp) @@ -3859,6 +3858,46 @@ pwd_chdir(struct thread *td, struct vnode *vp) pwd_drop(oldpwd); } +/* + * jail_attach(2) changes both root and working directories. + */ +int +pwd_chroot_chdir(struct thread *td, struct vnode *vp) +{ + struct pwddesc *pdp; + struct filedesc *fdp; + struct pwd *newpwd, *oldpwd; + int error; + + fdp = td->td_proc->p_fd; + pdp = td->td_proc->p_pd; + newpwd = pwd_alloc(); + FILEDESC_SLOCK(fdp); + PWDDESC_XLOCK(pdp); + oldpwd = PWDDESC_XLOCKED_LOAD_PWD(pdp); + error = chroot_refuse_vdir_fds(fdp); + FILEDESC_SUNLOCK(fdp); + if (error != 0) { + PWDDESC_XUNLOCK(pdp); + pwd_drop(newpwd); + return (error); + } + + vrefact(vp); + newpwd->pwd_rdir = vp; + vrefact(vp); + newpwd->pwd_cdir = vp; + if (oldpwd->pwd_jdir == NULL) { + vrefact(vp); + newpwd->pwd_jdir = vp; + } + pwd_fill(oldpwd, newpwd); + pwd_set(pdp, newpwd); + PWDDESC_XUNLOCK(pdp); + pwd_drop(oldpwd); + return (0); +} + void pwd_ensure_dirs(void) { diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index b56c889eeb7e..90ab69a372d2 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2495,7 +2495,7 @@ do_jail_attach(struct thread *td, struct prison *pr) goto e_unlock; #endif VOP_UNLOCK(pr->pr_root); - if ((error = pwd_chroot(td, pr->pr_root))) + if ((error = pwd_chroot_chdir(td, pr->pr_root))) goto e_revert_osd; newcred = crget(); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 890232b7f160..8c5aa258ed28 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -333,6 +333,7 @@ void pdunshare(struct thread *td); void pwd_chdir(struct thread *td, struct vnode *vp); int pwd_chroot(struct thread *td, struct vnode *vp); +int pwd_chroot_chdir(struct thread *td, struct vnode *vp); void pwd_ensure_dirs(void); void pwd_set_rootvnode(void); From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08:37: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 31D4654D5C4; Mon, 22 Feb 2021 08:37: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 4DkbCz0gtMz4p5R; Mon, 22 Feb 2021 08:37: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 05FEA22A0A; Mon, 22 Feb 2021 08:37: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 11M8boQT094960; Mon, 22 Feb 2021 08:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M8boEe094959; Mon, 22 Feb 2021 08:37:50 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:37:50 GMT Message-Id: <202102220837.11M8boEe094959@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: 882cbdeb21dc - stable/13 - netgraph/ng_bridge: Introduce "uplink" ports without MAC learning 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: 882cbdeb21dc745354781fbae1d4634ebb81fce3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:37:51 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=882cbdeb21dc745354781fbae1d4634ebb81fce3 commit 882cbdeb21dc745354781fbae1d4634ebb81fce3 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:08:24 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:20:37 +0000 netgraph/ng_bridge: Introduce "uplink" ports without MAC learning The ng_bridge(4) node is designed to work in moderately small environments. Connecting such a node to a larger network rapidly fills the MAC table for no reason. It even become complicated to obtain data from the gettable message, because the result is too large to transmit. This patch introduces, two new functionality bits on the hooks: - Allow or disallow MAC address learning for incoming patckets. - Allow or disallow sending unknown MACs through this hook. Uplinks are characterized by denied learing while sending out unknowns. Normal links are charaterized by allowed learning and sending out unknowns. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D23963 (cherry picked from commit f961caf2184c94d6f59c8d522207156b3533d977) --- share/man/man4/ng_bridge.4 | 30 +++++++++++++-- sys/netgraph/ng_bridge.c | 95 +++++++++++++++++++++++++++++----------------- sys/netgraph/ng_bridge.h | 2 + 3 files changed, 89 insertions(+), 38 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 85c2d8871c7c..b5937375e87a 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2019 +.Dd February 6, 2021 .Dt NG_BRIDGE 4 .Os .Sh NAME @@ -92,6 +92,23 @@ To connect the host machine to a bridged network, simply connect the hook of an .Xr ng_ether 4 node to the bridge node. +.Pp +Instead of naming a hook +.Dv linkX +the hook might be also named +.Dv uplinkX . +The node does not learn MAC addresses on uplink hooks, which keeps +the internal address table small. +This way it is desirable to connect the +.Dv lower +hook of an +.Xr ng_ether 4 +node to an +.Dv uplink +hook of the bridge, and ignore the complexity of the outside world. +Frames with unknown MACs are always sent out to +.Dv uplink +hooks, so no functionality is lost. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: @@ -141,8 +158,9 @@ The node configuration is not changed. This command takes a four byte link number as an argument and returns a .Dv "struct ng_bridge_link_stats" -containing statistics for the corresponding link, which must be -currently connected: +containing statistics for the corresponding +.Dv link , +which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ struct ng_bridge_link_stats { @@ -162,6 +180,12 @@ struct ng_bridge_link_stats { uint64_t memoryFailures; /* times couldn't get mem or mbuf */ }; .Ed +.Pp +Negative numbers refer to the +.Dv uplink +hooks. +So querying for -7 will get the statistics for hook +.Dv uplink7 . .It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats This command takes a four byte link number as an argument and clears the statistics for that link. diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 1521b1cee901..a21da545e210 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -91,6 +91,8 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ + unsigned int learnMac : 1, /* autolearn macs */ + sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_stats stats; /* link stats */ }; @@ -334,38 +336,49 @@ static int ng_bridge_newhook(node_p node, hook_p hook, const char *name) { const priv_p priv = NG_NODE_PRIVATE(node); + char linkName[NG_HOOKSIZ]; + u_int32_t linkNum; + link_p link; + const char *prefix = NG_BRIDGE_HOOK_LINK_PREFIX; + bool isUplink; /* Check for a link hook */ - if (strlen(name) > strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) { - char linkName[NG_HOOKSIZ]; - u_int32_t linkNum; - link_p link; - - /* primitive parsing */ - linkNum = strtoul(name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); - /* validation by comparing against the reconstucted name */ - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - linkNum); - if (strcmp(linkName, name) != 0) - return (EINVAL); - - if(NG_PEER_NODE(hook) == node) - return (ELOOP); - - link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, - M_WAITOK|M_ZERO); - if (link == NULL) - return (ENOMEM); - link->hook = hook; - NG_HOOK_SET_PRIVATE(hook, link); - priv->numLinks++; - return (0); + if (strlen(name) <= strlen(prefix)) + return (EINVAL); /* Unknown hook name */ + + isUplink = (name[0] == 'u'); + if (isUplink) + prefix = NG_BRIDGE_HOOK_UPLINK_PREFIX; + + /* primitive parsing */ + linkNum = strtoul(name + strlen(prefix), NULL, 10); + /* validation by comparing against the reconstucted name */ + snprintf(linkName, sizeof(linkName), "%s%u", prefix, linkNum); + if (strcmp(linkName, name) != 0) + return (EINVAL); + + if (linkNum == 0 && isUplink) + return (EINVAL); + + if(NG_PEER_NODE(hook) == node) + return (ELOOP); + + link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_ZERO); + if (link == NULL) + return (ENOMEM); + + link->hook = hook; + if (isUplink) { + link->learnMac = 0; + link->sendUnknown = 1; + } else { + link->learnMac = 1; + link->sendUnknown = 1; } - /* Unknown hook name */ - return (EINVAL); + NG_HOOK_SET_PRIVATE(hook, link); + priv->numLinks++; + return (0); } /* @@ -438,6 +451,11 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) i = 0; for (bucket = 0; bucket < priv->numBuckets; bucket++) { SLIST_FOREACH(hent, &priv->tab[bucket], next) { + const char *name = NG_HOOK_NAME(hent->host.link->hook); + const char *prefix = name[0] == 'u' ? + NG_BRIDGE_HOOK_UPLINK_PREFIX : + NG_BRIDGE_HOOK_LINK_PREFIX; + memcpy(ary->hosts[i].addr, hent->host.addr, sizeof(ary->hosts[i].addr)); @@ -445,9 +463,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary->hosts[i].staleness = hent->host.staleness; ary->hosts[i].linkNum = strtol( - NG_HOOK_NAME(hent->host.link->hook) + - strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); + name + strlen(prefix), NULL, 10); i++; } } @@ -506,15 +522,20 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; link_p link; char linkName[NG_HOOKSIZ]; + int linkNum; /* Get link number */ if (msg->header.arglen != sizeof(u_int32_t)) { error = EINVAL; break; } - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - *((u_int32_t *)msg->data)); + linkNum = *((int32_t *)msg->data); + if (linkNum < 0) + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_UPLINK_PREFIX, -linkNum); + else + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, linkNum); if ((hook = ng_findhook(node, linkName)) == NULL) { error = ENOTCONN; @@ -609,6 +630,10 @@ ng_bridge_send_ctx(hook_p dst, void *arg) return (1); } + /* Skip sending unknowns to undesired links */ + if (!ctx->manycast && !destLink->sendUnknown) + return (1); + if (ctx->foundFirst == NULL) { /* * This is the first usable link we have found. @@ -750,7 +775,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) host->link = ctx.incoming; host->age = 0; } - } else { + } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index 765d279bfdb1..ec237eb19cac 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -64,6 +64,8 @@ /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ +#define NG_BRIDGE_HOOK_UPLINK_PREFIX "uplink" /* append decimal integer */ +#define NG_BRIDGE_HOOK_UPLINK_FMT "uplink%d" /* for use with printf(3) */ /* Node configuration structure */ struct ng_bridge_config { From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08:37: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 5697654D272; Mon, 22 Feb 2021 08:37: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 4DkbD01C4Pz4nkB; Mon, 22 Feb 2021 08:37: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 1C2F222A0B; Mon, 22 Feb 2021 08:37: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 11M8bqij094980; Mon, 22 Feb 2021 08:37:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M8bqrf094979; Mon, 22 Feb 2021 08:37:52 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:37:52 GMT Message-Id: <202102220837.11M8bqrf094979@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: 8135f3f2fcd1 - stable/13 - netgraph/ng_bridge: Derive forwarding mode from first attached hook 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: 8135f3f2fcd13feeba0362e59549ce3cb51d8c6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:37:52 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=8135f3f2fcd13feeba0362e59549ce3cb51d8c6e commit 8135f3f2fcd13feeba0362e59549ce3cb51d8c6e Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:25:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:21:04 +0000 netgraph/ng_bridge: Derive forwarding mode from first attached hook Handling of unknown MACs on an bridge with incomplete learning capabilites (aka uplink ports) can be defined in different ways. The classical approach is to broadcast unicast frames send to an unknown MAC, because the unknown devices can be everywhere. This mode is default for ng_bridge(4). In the case of dedicated uplink ports, which prohibit learning of MAC addresses in order to save memory and CPU cycles, the broadcast approach is dangerous. All traffic to the uplink port is broadcasted to every downlink port, too. In this case, it's better to restrict the distribution of frames to unknown MAC to the uplink ports only. In order to keep the chance small and the handling as natural as possible, the first attached link is used to determine the behaviour of the bridge: If it is an "uplink" port, then the bridge switch from classical mode to restricted mode. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28487 (cherry picked from commit c869d905baa4e329dfd6793e7487b5985248ddb6) --- share/man/man4/ng_bridge.4 | 16 ++++++++++++++++ sys/netgraph/ng_bridge.c | 8 ++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index b5937375e87a..1451773711e9 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -109,6 +109,22 @@ hook of the bridge, and ignore the complexity of the outside world. Frames with unknown MACs are always sent out to .Dv uplink hooks, so no functionality is lost. +.Pp +Frames with unknown destination MAC addresses are replicated to any +available hook, unless the first connected hook is an +.Ar uplink +hook. +In this case the node assumes, that all unknown MAC addresses are +located soley on the +.Ar uplink +hooks and only those hooks will be used to send out frames with +unknown destination MACs. +If the first connected hook is an +.Ar link +hook, the node will replicate such frames to all types of hooks, +even if +.Ar uplink +hooks are connected later. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index a21da545e210..ed08020ead70 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -105,7 +105,8 @@ struct ng_bridge_private { u_int numBuckets; /* num buckets in table */ u_int hashMask; /* numBuckets - 1 */ int numLinks; /* num connected links */ - int persistent; /* can exist w/o hooks */ + unsigned int persistent : 1, /* can exist w/o hooks */ + sendUnknown : 1;/* links receive unknowns by default */ struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; @@ -309,6 +310,7 @@ ng_bridge_constructor(node_p node) priv->conf.loopTimeout = DEFAULT_LOOP_TIMEOUT; priv->conf.maxStaleness = DEFAULT_MAX_STALENESS; priv->conf.minStableAge = DEFAULT_MIN_STABLE_AGE; + priv->sendUnknown = 1; /* classic bridge */ /* * This node has all kinds of stuff that could be screwed by SMP. @@ -371,9 +373,11 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (isUplink) { link->learnMac = 0; link->sendUnknown = 1; + if (priv->numLinks == 0) /* if the first link is an uplink */ + priv->sendUnknown = 0; /* switch to restrictive mode */ } else { link->learnMac = 1; - link->sendUnknown = 1; + link->sendUnknown = priv->sendUnknown; } NG_HOOK_SET_PRIVATE(hook, link); From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08:37: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 B841054D980; Mon, 22 Feb 2021 08:37: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 4DkbD24vjHz4p8c; Mon, 22 Feb 2021 08:37: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 5DD7622726; Mon, 22 Feb 2021 08:37: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 11M8bsn6095020; Mon, 22 Feb 2021 08:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M8bsLC095019; Mon, 22 Feb 2021 08:37:54 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:37:54 GMT Message-Id: <202102220837.11M8bsLC095019@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: 1e2c1b762275 - stable/13 - netgraph/ng_bridge: Make simple internal functions read-only 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: 1e2c1b762275513160f7305cfb72d1c35475c693 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:37:55 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=1e2c1b762275513160f7305cfb72d1c35475c693 commit 1e2c1b762275513160f7305cfb72d1c35475c693 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 22:18:55 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:21:23 +0000 netgraph/ng_bridge: Make simple internal functions read-only The data path in netgraph is designed to work on an read only state of the whole netgraph network. Currently this is achived by convention, there is no technical enforcment. In the case of NETGRAPH_DEBUG all nodes can be annotated for debugging purposes, so the strict enforcment needs to be lifted for this purpose. This patch is part of a series to make ng_bridge multithreaded, which is done by rewrite the data path to operate on const. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28141 (cherry picked from commit 6117aa58fa4f5891badf58b13c759976983f4f04) --- sys/netgraph/netgraph.h | 9 ++++++++- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 7535472dc631..9cc298b38236 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -87,6 +87,13 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; +typedef struct ng_item const *item_cp; +typedef struct ng_hook const *hook_cp; +#ifdef NETGRAPH_DEBUG +typedef struct ng_node *node_cp; /* annotated during debug */ +#else /* NETGRAPH_DEBUG */ +typedef struct ng_node const *node_cp; +#endif /* NETGRAPH_DEBUG */ /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1139,7 +1146,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_p node); +ng_ID_t ng_node2ID(node_cp node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index dadf86eb8dde..6ab39421b255 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_p node) +ng_node2ID(node_cp node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 49d8aae87ccf..f177b9da340a 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,6 +115,7 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; +typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -130,6 +131,7 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; +typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_p node); +static const char *ng_bridge_nodename(node_cp node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -989,7 +991,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_p priv, const u_char *addr) +ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1200,7 +1202,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_p node) +ng_bridge_nodename(node_cp node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08:37: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 3798354D65C; Mon, 22 Feb 2021 08:37: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 4DkbD13pPGz4nsd; Mon, 22 Feb 2021 08:37: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 5872322A0C; Mon, 22 Feb 2021 08:37: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 11M8brGr095002; Mon, 22 Feb 2021 08:37:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M8brPD095001; Mon, 22 Feb 2021 08:37:53 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:37:53 GMT Message-Id: <202102220837.11M8brPD095001@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: d7187b4b1c70 - stable/13 - netgraph/ng_bridge: switch stats to counter framework 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: d7187b4b1c70dd4e4065f564b6e35555c5b0e574 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:37:54 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=d7187b4b1c70dd4e4065f564b6e35555c5b0e574 commit d7187b4b1c70dd4e4065f564b6e35555c5b0e574 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 06:16:34 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:21:13 +0000 netgraph/ng_bridge: switch stats to counter framework This is the first patch of a series of necessary steps to make ng_bridge(4) multithreaded. Reviewed by: melifaro (network), afedorov Differential Revision: https://reviews.freebsd.org/D28125 (cherry picked from commit 66c72859f66dc6c852234589f3508ce5d36d0336) --- sys/netgraph/ng_bridge.c | 133 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index ed08020ead70..49d8aae87ccf 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -65,6 +65,8 @@ #include #include #include +#include +#include #include #include @@ -87,13 +89,31 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", #define M_NETGRAPH_BRIDGE M_NETGRAPH #endif +/* Counter based stats */ +struct ng_bridge_link_kernel_stats { + counter_u64_t recvOctets; /* total octets rec'd on link */ + counter_u64_t recvPackets; /* total pkts rec'd on link */ + counter_u64_t recvMulticasts; /* multicast pkts rec'd on link */ + counter_u64_t recvBroadcasts; /* broadcast pkts rec'd on link */ + counter_u64_t recvUnknown; /* pkts rec'd with unknown dest addr */ + counter_u64_t recvRunts; /* pkts rec'd less than 14 bytes */ + counter_u64_t recvInvalid; /* pkts rec'd with bogus source addr */ + counter_u64_t xmitOctets; /* total octets xmit'd on link */ + counter_u64_t xmitPackets; /* total pkts xmit'd on link */ + counter_u64_t xmitMulticasts; /* multicast pkts xmit'd on link */ + counter_u64_t xmitBroadcasts; /* broadcast pkts xmit'd on link */ + counter_u64_t loopDrops; /* pkts dropped due to loopback */ + counter_u64_t loopDetects; /* number of loop detections */ + counter_u64_t memoryFailures; /* times couldn't get mem or mbuf */ +}; + /* Per-link private data */ struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ unsigned int learnMac : 1, /* autolearn macs */ sendUnknown : 1;/* send unknown macs out */ - struct ng_bridge_link_stats stats; /* link stats */ + struct ng_bridge_link_kernel_stats stats; /* link stats */ }; /* Per-node private data */ @@ -369,6 +389,21 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (link == NULL) return (ENOMEM); + link->stats.recvOctets = counter_u64_alloc(M_WAITOK); + link->stats.recvPackets = counter_u64_alloc(M_WAITOK); + link->stats.recvMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.recvBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.recvUnknown = counter_u64_alloc(M_WAITOK); + link->stats.recvRunts = counter_u64_alloc(M_WAITOK); + link->stats.recvInvalid = counter_u64_alloc(M_WAITOK); + link->stats.xmitOctets = counter_u64_alloc(M_WAITOK); + link->stats.xmitPackets = counter_u64_alloc(M_WAITOK); + link->stats.xmitMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.xmitBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.loopDrops = counter_u64_alloc(M_WAITOK); + link->stats.loopDetects = counter_u64_alloc(M_WAITOK); + link->stats.memoryFailures = counter_u64_alloc(M_WAITOK); + link->hook = hook; if (isUplink) { link->learnMac = 0; @@ -388,14 +423,31 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) /* * Receive a control message */ +static void ng_bridge_clear_link_stats(struct ng_bridge_link_kernel_stats * p) +{ + counter_u64_zero(p->recvOctets); + counter_u64_zero(p->recvPackets); + counter_u64_zero(p->recvMulticasts); + counter_u64_zero(p->recvBroadcasts); + counter_u64_zero(p->recvUnknown); + counter_u64_zero(p->recvRunts); + counter_u64_zero(p->recvInvalid); + counter_u64_zero(p->xmitOctets); + counter_u64_zero(p->xmitPackets); + counter_u64_zero(p->xmitMulticasts); + counter_u64_zero(p->xmitBroadcasts); + counter_u64_zero(p->loopDrops); + counter_u64_zero(p->loopDetects); + counter_u64_zero(p->memoryFailures); +}; + static int ng_bridge_reset_link(hook_p hook, void *arg __unused) { link_p priv = NG_HOOK_PRIVATE(hook); priv->loopCount = 0; - bzero(&priv->stats, sizeof(priv->stats)); - + ng_bridge_clear_link_stats(&priv->stats); return (1); } @@ -549,17 +601,34 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) /* Get/clear stats */ if (msg->header.cmd != NGM_BRIDGE_CLR_STATS) { + struct ng_bridge_link_stats *rs; + NG_MKRESPONSE(resp, msg, sizeof(link->stats), M_NOWAIT); if (resp == NULL) { error = ENOMEM; break; } - bcopy(&link->stats, - resp->data, sizeof(link->stats)); + rs = (struct ng_bridge_link_stats *)resp->data; +#define FETCH(x) rs->x = counter_u64_fetch(link->stats.x) + FETCH(recvOctets); + FETCH(recvPackets); + FETCH(recvMulticasts); + FETCH(recvBroadcasts); + FETCH(recvUnknown); + FETCH(recvRunts); + FETCH(recvInvalid); + FETCH(xmitOctets); + FETCH(xmitPackets); + FETCH(xmitMulticasts); + FETCH(xmitBroadcasts); + FETCH(loopDrops); + FETCH(loopDetects); + FETCH(memoryFailures); +#undef FETCH } if (msg->header.cmd != NGM_BRIDGE_GET_STATS) - bzero(&link->stats, sizeof(link->stats)); + ng_bridge_clear_link_stats(&link->stats); break; } case NGM_BRIDGE_GET_TABLE: @@ -654,22 +723,22 @@ ng_bridge_send_ctx(hook_p dst, void *arg) */ m2 = m_dup(ctx->m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { - ctx->incoming->stats.memoryFailures++; + counter_u64_add(ctx->incoming->stats.memoryFailures, 1); ctx->error = ENOBUFS; return (0); /* abort loop */ } /* Update stats */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m2->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, m2->m_pkthdr.len); switch (ctx->manycast) { default: /* unknown unicast */ break; case 1: /* multicast */ - destLink->stats.xmitMulticasts++; + counter_u64_add(destLink->stats.xmitMulticasts, 1); break; case 2: /* broadcast */ - destLink->stats.xmitBroadcasts++; + counter_u64_add(destLink->stats.xmitBroadcasts, 1); break; } @@ -695,19 +764,19 @@ ng_bridge_rcvdata(hook_p hook, item_p item) ctx.incoming = NG_HOOK_PRIVATE(hook); /* Sanity check packet and pull up header */ if (ctx.m->m_pkthdr.len < ETHER_HDR_LEN) { - ctx.incoming->stats.recvRunts++; + counter_u64_add(ctx.incoming->stats.recvRunts, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); } if (ctx.m->m_len < ETHER_HDR_LEN && !(ctx.m = m_pullup(ctx.m, ETHER_HDR_LEN))) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); return (ENOBUFS); } eh = mtod(ctx.m, struct ether_header *); if ((eh->ether_shost[0] & 1) != 0) { - ctx.incoming->stats.recvInvalid++; + counter_u64_add(ctx.incoming->stats.recvInvalid, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); @@ -715,21 +784,21 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Is link disabled due to a loopback condition? */ if (ctx.incoming->loopCount != 0) { - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX is this an appropriate error? */ } /* Update stats */ - ctx.incoming->stats.recvPackets++; - ctx.incoming->stats.recvOctets += ctx.m->m_pkthdr.len; + counter_u64_add(ctx.incoming->stats.recvPackets, 1); + counter_u64_add(ctx.incoming->stats.recvOctets, ctx.m->m_pkthdr.len); if ((ctx.manycast = (eh->ether_dhost[0] & 1)) != 0) { if (ETHER_EQUAL(eh->ether_dhost, ng_bridge_bcast_addr)) { - ctx.incoming->stats.recvBroadcasts++; + counter_u64_add(ctx.incoming->stats.recvBroadcasts, 1); ctx.manycast = 2; } else - ctx.incoming->stats.recvMulticasts++; + counter_u64_add(ctx.incoming->stats.recvMulticasts, 1); } /* Look up packet's source Ethernet address in hashtable */ @@ -763,13 +832,13 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Mark link as linka non grata */ ctx.incoming->loopCount = priv->conf.loopTimeout; - ctx.incoming->stats.loopDetects++; + counter_u64_add(ctx.incoming->stats.loopDetects, 1); /* Forget all hosts on this link */ ng_bridge_remove_hosts(priv, ctx.incoming); /* Drop packet */ - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX appropriate? */ @@ -781,7 +850,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ENOMEM); @@ -812,14 +881,14 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Deliver packet out the destination link */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += ctx.m->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, ctx.m->m_pkthdr.len); NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); return (ctx.error); } /* Destination host is not known */ - ctx.incoming->stats.recvUnknown++; + counter_u64_add(ctx.incoming->stats.recvUnknown, 1); } /* Distribute unknown, multicast, broadcast pkts to all other links */ @@ -879,6 +948,20 @@ ng_bridge_disconnect(hook_p hook) ng_bridge_remove_hosts(priv, link); /* Free associated link information */ + counter_u64_free(link->stats.recvOctets); + counter_u64_free(link->stats.recvPackets); + counter_u64_free(link->stats.recvMulticasts); + counter_u64_free(link->stats.recvBroadcasts); + counter_u64_free(link->stats.recvUnknown); + counter_u64_free(link->stats.recvRunts); + counter_u64_free(link->stats.recvInvalid); + counter_u64_free(link->stats.xmitOctets); + counter_u64_free(link->stats.xmitPackets); + counter_u64_free(link->stats.xmitMulticasts); + counter_u64_free(link->stats.xmitBroadcasts); + counter_u64_free(link->stats.loopDrops); + counter_u64_free(link->stats.loopDetects); + counter_u64_free(link->stats.memoryFailures); free(link, M_NETGRAPH_BRIDGE); priv->numLinks--; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08:38: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 456C754DA01; Mon, 22 Feb 2021 08:38: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 4DkbD56Vcsz4p8m; Mon, 22 Feb 2021 08:37: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 A453222821; Mon, 22 Feb 2021 08: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 11M8buKU095064; Mon, 22 Feb 2021 08: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 11M8buO6095063; Mon, 22 Feb 2021 08:37:56 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:37:56 GMT Message-Id: <202102220837.11M8buO6095063@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: 88e916bff035 - stable/13 - netgraph/ng_bridge: Document staleness in multithreaded operation 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: 88e916bff0357ffd0a4b8844cc03c79fcaa2022c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:38:01 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=88e916bff0357ffd0a4b8844cc03c79fcaa2022c commit 88e916bff0357ffd0a4b8844cc03c79fcaa2022c Author: Lutz Donnerhacke AuthorDate: 2021-02-09 11:32:46 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:21:55 +0000 netgraph/ng_bridge: Document staleness in multithreaded operation In the data path of ng_bridge(4), the only value of the host struct, which needs to be modified, is the staleness, which is reset every time a frame is received. It's save to leave the code as it is. This patch is part of a series to make ng_bridge(4) multithreaded. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28546 (cherry picked from commit 011b7317dbb5038a95b9b4fca050325a62f3991e) --- sys/netgraph/ng_bridge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 316f9d4fab8c..b6f763dcb631 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -808,7 +808,10 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Look up packet's source Ethernet address in hashtable */ if ((host = ng_bridge_get(priv, eh->ether_shost)) != NULL) { - /* Update time since last heard from this host */ + /* Update time since last heard from this host. + * This is safe without locking, because it's + * the only operation during shared access. + */ host->staleness = 0; /* Did host jump to a different link? */ From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08: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 0376B54D909; Mon, 22 Feb 2021 08: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 4DkbD40m2Sz4nyK; Mon, 22 Feb 2021 08:37: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 8921322727; Mon, 22 Feb 2021 08:37: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 11M8btOD095042; Mon, 22 Feb 2021 08:37:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M8btBY095041; Mon, 22 Feb 2021 08:37:55 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:37:55 GMT Message-Id: <202102220837.11M8btBY095041@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: 0952f69003e8 - stable/13 - netgraph/ng_bridge: Merge internal structures 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: 0952f69003e8a264989f032413055370289fa685 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:37:58 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=0952f69003e8a264989f032413055370289fa685 commit 0952f69003e8a264989f032413055370289fa685 Author: Lutz Donnerhacke AuthorDate: 2021-02-08 21:36:46 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:21:49 +0000 netgraph/ng_bridge: Merge internal structures In a earlier version of ng_bridge(4) the exernal visible host entry structure was a strict subset of the internal one. So internal view was a direct annotation of the external structure. This strict inheritance was lost many versions ago. There is no need to encapsulate a part of the internal represntation as a separate structure. This patch is a preparation to make the internal structure read only in the data path in order to make ng_bridge(4) multithreaded. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28545 (cherry picked from commit ccf4cd2e7830394467d5f6cf546ab453f9657b69) --- sys/netgraph/ng_bridge.c | 85 +++++++++++++++++++++++++----------------------- sys/netgraph/ng_bridge.h | 7 ---- 2 files changed, 44 insertions(+), 48 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index f177b9da340a..316f9d4fab8c 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -134,13 +134,16 @@ typedef struct ng_bridge_private *priv_p; typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ -struct ng_bridge_hent { - struct ng_bridge_host host; /* actual host info */ - SLIST_ENTRY(ng_bridge_hent) next; /* next entry in bucket */ +struct ng_bridge_host { + u_char addr[6]; /* ethernet address */ + link_p link; /* link where addr can be found */ + u_int16_t age; /* seconds ago entry was created */ + u_int16_t staleness; /* seconds ago host last heard from */ + SLIST_ENTRY(ng_bridge_host) next; /* next entry in bucket */ }; /* Hash table bucket declaration */ -SLIST_HEAD(ng_bridge_bucket, ng_bridge_hent); +SLIST_HEAD(ng_bridge_bucket, ng_bridge_host); /* Netgraph node methods */ static ng_constructor_t ng_bridge_constructor; @@ -636,7 +639,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_BRIDGE_GET_TABLE: { struct ng_bridge_host_ary *ary; - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; int i = 0, bucket; NG_MKRESPONSE(resp, msg, sizeof(*ary) @@ -648,14 +651,14 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary = (struct ng_bridge_host_ary *)resp->data; ary->numHosts = priv->numHosts; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) { + SLIST_FOREACH(host, &priv->tab[bucket], next) { memcpy(ary->hosts[i].addr, - hent->host.addr, + host->addr, sizeof(ary->hosts[i].addr)); - ary->hosts[i].age = hent->host.age; - ary->hosts[i].staleness = hent->host.staleness; + ary->hosts[i].age = host->age; + ary->hosts[i].staleness = host->staleness; strncpy(ary->hosts[i].hook, - NG_HOOK_NAME(hent->host.link->hook), + NG_HOOK_NAME(host->link->hook), sizeof(ary->hosts[i].hook)); i++; } @@ -994,11 +997,11 @@ static struct ng_bridge_host * ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - if (ETHER_EQUAL(hent->host.addr, addr)) - return (&hent->host); + SLIST_FOREACH(host, &priv->tab[bucket], next) { + if (ETHER_EQUAL(host->addr, addr)) + return (host); } return (NULL); } @@ -1012,27 +1015,27 @@ static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link) { const int bucket = HASH(addr, priv->hashMask); - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; #ifdef INVARIANTS /* Assert that entry does not already exist in hashtable */ - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - KASSERT(!ETHER_EQUAL(hent->host.addr, addr), + SLIST_FOREACH(host, &priv->tab[bucket], next) { + KASSERT(!ETHER_EQUAL(host->addr, addr), ("%s: entry %6D exists in table", __func__, addr, ":")); } #endif /* Allocate and initialize new hashtable entry */ - hent = malloc(sizeof(*hent), M_NETGRAPH_BRIDGE, M_NOWAIT); - if (hent == NULL) + host = malloc(sizeof(*host), M_NETGRAPH_BRIDGE, M_NOWAIT); + if (host == NULL) return (0); - bcopy(addr, hent->host.addr, ETHER_ADDR_LEN); - hent->host.link = link; - hent->host.staleness = 0; - hent->host.age = 0; + bcopy(addr, host->addr, ETHER_ADDR_LEN); + host->link = link; + host->staleness = 0; + host->age = 0; /* Add new element to hash bucket */ - SLIST_INSERT_HEAD(&priv->tab[bucket], hent, next); + SLIST_INSERT_HEAD(&priv->tab[bucket], host, next); priv->numHosts++; /* Resize table if necessary */ @@ -1077,12 +1080,12 @@ ng_bridge_rehash(priv_p priv) struct ng_bridge_bucket *const oldList = &priv->tab[oldBucket]; while (!SLIST_EMPTY(oldList)) { - struct ng_bridge_hent *const hent + struct ng_bridge_host *const host = SLIST_FIRST(oldList); SLIST_REMOVE_HEAD(oldList, next); - newBucket = HASH(hent->host.addr, newMask); - SLIST_INSERT_HEAD(&newTab[newBucket], hent, next); + newBucket = HASH(host->addr, newMask); + SLIST_INSERT_HEAD(&newTab[newBucket], host, next); } } @@ -1113,17 +1116,17 @@ ng_bridge_remove_hosts(priv_p priv, link_p link) int bucket; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]); + struct ng_bridge_host **hptr = &SLIST_FIRST(&priv->tab[bucket]); while (*hptr != NULL) { - struct ng_bridge_hent *const hent = *hptr; + struct ng_bridge_host *const host = *hptr; - if (link == NULL || hent->host.link == link) { - *hptr = SLIST_NEXT(hent, next); - free(hent, M_NETGRAPH_BRIDGE); + if (link == NULL || host->link == link) { + *hptr = SLIST_NEXT(host, next); + free(host, M_NETGRAPH_BRIDGE); priv->numHosts--; } else - hptr = &SLIST_NEXT(hent, next); + hptr = &SLIST_NEXT(host, next); } } } @@ -1164,20 +1167,20 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) /* Update host time counters and remove stale entries */ for (bucket = 0; bucket < priv->numBuckets; bucket++) { - struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]); + struct ng_bridge_host **hptr = &SLIST_FIRST(&priv->tab[bucket]); while (*hptr != NULL) { - struct ng_bridge_hent *const hent = *hptr; + struct ng_bridge_host *const host = *hptr; /* Remove hosts we haven't heard from in a while */ - if (++hent->host.staleness >= priv->conf.maxStaleness) { - *hptr = SLIST_NEXT(hent, next); - free(hent, M_NETGRAPH_BRIDGE); + if (++host->staleness >= priv->conf.maxStaleness) { + *hptr = SLIST_NEXT(host, next); + free(host, M_NETGRAPH_BRIDGE); priv->numHosts--; } else { - if (hent->host.age < 0xffff) - hent->host.age++; - hptr = &SLIST_NEXT(hent, next); + if (host->age < 0xffff) + host->age++; + hptr = &SLIST_NEXT(host, next); counter++; } } diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index ec237eb19cac..f8eb0ca8a7da 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -130,13 +130,6 @@ struct ng_bridge_link_stats { struct ng_bridge_link; typedef struct ng_bridge_link *link_p; -/* Structure describing a single host */ -struct ng_bridge_host { - u_char addr[6]; /* ethernet address */ - link_p link; /* link where addr can be found */ - u_int16_t age; /* seconds ago entry was created */ - u_int16_t staleness; /* seconds ago host last heard from */ -}; #ifdef NGM_BRIDGE_TABLE_ABI struct ng_bridge_host_tbl { From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08:38: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 C231254D6CF; Mon, 22 Feb 2021 08:38: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 4DkbD65WkLz4p8x; Mon, 22 Feb 2021 08: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 BC89822822; Mon, 22 Feb 2021 08: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 11M8bvVj095084; Mon, 22 Feb 2021 08: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 11M8bvYt095083; Mon, 22 Feb 2021 08:37:57 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:37:57 GMT Message-Id: <202102220837.11M8bvYt095083@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: dcb4190179bd - stable/13 - netgraph/ng_bridge: Add counters for the first link, too 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: dcb4190179bd5588b28286828d65d50b9ba182cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:38:02 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=dcb4190179bd5588b28286828d65d50b9ba182cc commit dcb4190179bd5588b28286828d65d50b9ba182cc Author: Lutz Donnerhacke AuthorDate: 2021-02-10 10:47:38 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:22:03 +0000 netgraph/ng_bridge: Add counters for the first link, too For broadcast, multicast and unknown unicast, the replication loop sends a copy of the packet to each link, beside the first one. This special path is handled later, but the counters are not updated. Factor out the common send and count actions as a function. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28537 (cherry picked from commit 3c958f5fdfc01b7579ea0fbfc3f15f8a85bebee9) --- sys/netgraph/ng_bridge.c | 59 +++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index b6f763dcb631..3b00e4c03124 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -695,6 +695,41 @@ struct ng_bridge_send_ctx { int manycast, error; }; +/* + * Update stats and send out + */ +static inline int +ng_bridge_send_data(link_cp dst, int manycast, struct mbuf *m, item_p item) { + int error = 0; + size_t len = m->m_pkthdr.len; + + if(item != NULL) + NG_FWD_NEW_DATA(error, item, dst->hook, m); + else + NG_SEND_DATA_ONLY(error, dst->hook, m); + + if (error == 0) { + counter_u64_add(dst->stats.xmitPackets, 1); + counter_u64_add(dst->stats.xmitOctets, len); + switch (manycast) { + default: /* unknown unicast */ + break; + case 1: /* multicast */ + counter_u64_add(dst->stats.xmitMulticasts, 1); + break; + case 2: /* broadcast */ + counter_u64_add(dst->stats.xmitBroadcasts, 1); + break; + } + } + + return (error); +} + +/* + * Loop body for sending to multiple destinations + * return 0 to stop looping + */ static int ng_bridge_send_ctx(hook_p dst, void *arg) { @@ -733,22 +768,8 @@ ng_bridge_send_ctx(hook_p dst, void *arg) return (0); /* abort loop */ } - /* Update stats */ - counter_u64_add(destLink->stats.xmitPackets, 1); - counter_u64_add(destLink->stats.xmitOctets, m2->m_pkthdr.len); - switch (ctx->manycast) { - default: /* unknown unicast */ - break; - case 1: /* multicast */ - counter_u64_add(destLink->stats.xmitMulticasts, 1); - break; - case 2: /* broadcast */ - counter_u64_add(destLink->stats.xmitBroadcasts, 1); - break; - } - /* Send packet */ - NG_SEND_DATA_ONLY(error, destLink->hook, m2); + error = ng_bridge_send_data(destLink, ctx->manycast, m2, NULL); if(error) ctx->error = error; return (1); @@ -889,10 +910,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Deliver packet out the destination link */ - counter_u64_add(destLink->stats.xmitPackets, 1); - counter_u64_add(destLink->stats.xmitOctets, ctx.m->m_pkthdr.len); - NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); - return (ctx.error); + return (ng_bridge_send_data(destLink, ctx.manycast, ctx.m, item)); } /* Destination host is not known */ @@ -913,8 +931,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) * If we've sent all the others, send the original * on the first link we found. */ - NG_FWD_NEW_DATA(ctx.error, item, ctx.foundFirst->hook, ctx.m); - return (ctx.error); + return (ng_bridge_send_data(ctx.foundFirst, ctx.manycast, ctx.m, item)); } /* From owner-dev-commits-src-all@freebsd.org Mon Feb 22 08:41: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 E0D3854DBCF; Mon, 22 Feb 2021 08:41: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 4DkbJX64fzz4q11; Mon, 22 Feb 2021 08:41: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 C3734228AE; Mon, 22 Feb 2021 08:41: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 11M8fmuK007169; Mon, 22 Feb 2021 08:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M8fmlP007168; Mon, 22 Feb 2021 08:41:48 GMT (envelope-from git) Date: Mon, 22 Feb 2021 08:41:48 GMT Message-Id: <202102220841.11M8fmlP007168@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: 511690b108f8 - stable/13 - ng_bridge.4: Use more suitable mandoc macros 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: 511690b108f8f4ac65ee297786e20a0f134b0185 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 08:41:48 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=511690b108f8f4ac65ee297786e20a0f134b0185 commit 511690b108f8f4ac65ee297786e20a0f134b0185 Author: Lutz Donnerhacke AuthorDate: 2021-02-05 21:24:06 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-22 08:40:40 +0000 ng_bridge.4: Use more suitable mandoc macros yuripv@ suggested to replace inappropriate macros by better ones. Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D28510 (cherry picked from commit 689561d4032233bc171cff30d6756c3cf3b22720) --- share/man/man4/ng_bridge.4 | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 1451773711e9..be128d62c938 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -79,35 +79,35 @@ mechanism on a per-link basis is not yet implemented. This node type supports an unlimited number of hooks. Each connected hook represents a bridged link. The hooks are named -.Dv link0 , -.Dv link1 , +.Ar link0 , +.Ar link1 , etc. Typically these hooks are connected to the -.Dv lower +.Ar lower hooks of one or more .Xr ng_ether 4 nodes. To connect the host machine to a bridged network, simply connect the -.Dv upper +.Ar upper hook of an .Xr ng_ether 4 node to the bridge node. .Pp Instead of naming a hook -.Dv linkX +.Ar linkX the hook might be also named -.Dv uplinkX . +.Ar uplinkX . The node does not learn MAC addresses on uplink hooks, which keeps the internal address table small. This way it is desirable to connect the -.Dv lower +.Ar lower hook of an .Xr ng_ether 4 node to an -.Dv uplink +.Ar uplink hook of the bridge, and ignore the complexity of the outside world. Frames with unknown MACs are always sent out to -.Dv uplink +.Ar uplink hooks, so no functionality is lost. .Pp Frames with unknown destination MAC addresses are replicated to any @@ -129,10 +129,10 @@ hooks are connected later. This node type supports the generic control messages, plus the following: .Bl -tag -width foo -.It Dv NGM_BRIDGE_SET_CONFIG Pq Ic setconfig +.It Dv NGM_BRIDGE_SET_CONFIG Pq Ar setconfig Set the node configuration. This command takes a -.Dv "struct ng_bridge_config" +.Vt "struct ng_bridge_config" as an argument: .Bd -literal -offset 0n /* Node configuration structure */ @@ -145,37 +145,37 @@ struct ng_bridge_config { .Ed .Pp The -.Dv debugLevel +.Va debugLevel field sets the debug level on the node. At level of 2 or greater, detected loops are logged. The default level is 1. .Pp The -.Dv loopTimeout +.Va loopTimeout determines how long (in seconds) a looped link is muted. The default is 60 seconds. The -.Dv maxStaleness +.Va maxStaleness parameter determines how long a period of inactivity before a host's entry is forgotten. The default is 15 minutes. The -.Dv minStableAge +.Va minStableAge determines how quickly a host must jump from one link to another before we declare a loopback condition. The default is one second. -.It Dv NGM_BRIDGE_GET_CONFIG Pq Ic getconfig +.It Dv NGM_BRIDGE_GET_CONFIG Pq Ar getconfig Returns the current configuration as a -.Dv "struct ng_bridge_config" . -.It Dv NGM_BRIDGE_RESET Pq Ic reset +.Vt "struct ng_bridge_config" . +.It Dv NGM_BRIDGE_RESET Pq Ar reset Causes the node to forget all hosts and unmute all links. The node configuration is not changed. -.It Dv NGM_BRIDGE_GET_STATS Pq Ic getstats +.It Dv NGM_BRIDGE_GET_STATS Pq Ar getstats This command takes a four byte link number as an argument and returns a -.Dv "struct ng_bridge_link_stats" +.Vt "struct ng_bridge_link_stats" containing statistics for the corresponding -.Dv link , +.Ar link , which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ @@ -198,21 +198,21 @@ struct ng_bridge_link_stats { .Ed .Pp Negative numbers refer to the -.Dv uplink +.Ar uplink hooks. So querying for -7 will get the statistics for hook -.Dv uplink7 . -.It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats +.Ar uplink7 . +.It Dv NGM_BRIDGE_CLR_STATS Pq Ar clrstats This command takes a four byte link number as an argument and clears the statistics for that link. -.It Dv NGM_BRIDGE_GETCLR_STATS Pq Ic getclrstats +.It Dv NGM_BRIDGE_GETCLR_STATS Pq Ar getclrstats Same as .Dv NGM_BRIDGE_GET_STATS , but also atomically clears the statistics as well. -.It Dv NGM_BRIDGE_GET_TABLE Pq Ic gettable +.It Dv NGM_BRIDGE_GET_TABLE Pq Ar gettable Returns the current host mapping table used to direct packets, in a -.Dv "struct ng_bridge_host_ary" . -.It Dv NGM_BRIDGE_SET_PERSISTENT Pq Ic setpersistent +.Vt "struct ng_bridge_host_ary" . +.It Dv NGM_BRIDGE_SET_PERSISTENT Pq Ar setpersistent This command sets the persistent flag on the node, and takes no arguments. .El .Sh SHUTDOWN From owner-dev-commits-src-all@freebsd.org Mon Feb 22 11:51: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 AA50A551F82; Mon, 22 Feb 2021 11:51: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 4DkgWH49Kcz3GxM; Mon, 22 Feb 2021 11:51: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 81F1024D72; Mon, 22 Feb 2021 11:51: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 11MBpN2j054666; Mon, 22 Feb 2021 11:51:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MBpNqU054665; Mon, 22 Feb 2021 11:51:23 GMT (envelope-from git) Date: Mon, 22 Feb 2021 11:51:23 GMT Message-Id: <202102221151.11MBpNqU054665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan Eßer Subject: git: 4aa71da8dc00 - stable/13 - bc: Upgrade to version 3.3.0 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4aa71da8dc004aa5027836259433e5bff3cd9104 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 11:51:23 -0000 The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=4aa71da8dc004aa5027836259433e5bff3cd9104 commit 4aa71da8dc004aa5027836259433e5bff3cd9104 Author: Stefan Eßer AuthorDate: 2021-02-17 21:56:16 +0000 Commit: Stefan Eßer CommitDate: 2021-02-22 11:50:32 +0000 bc: Upgrade to version 3.3.0 This update changes the behavior of "-e" or "-f" in BC_ENV_ARGS: Use of these options on the command line makes bc exit after executing the given commands. These options will not cause bc to exit when passed via the environment (but EOF in STDIN or -e or -f on the command line will make bc exit as before). The same applies to DC_ENV_ARGS with regard to the dc program. (cherry picked from commit 9a995fe186257315e7b3d01e24c55d86bb18fd32) --- contrib/bc/Makefile.in | 2 +- contrib/bc/NEWS.md | 20 ++++++++++++++++++++ contrib/bc/README.md | 2 +- contrib/bc/configure.sh | 7 +------ contrib/bc/include/args.h | 2 +- contrib/bc/include/status.h | 10 +++++++--- contrib/bc/include/vm.h | 1 + contrib/bc/manuals/bc.1.md.in | 23 ++++++++++++++++------- contrib/bc/manuals/bc/A.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/A.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/E.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/E.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/EH.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/EH.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/EHN.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/EHN.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/EHNP.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/EHNP.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/EHP.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/EHP.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/EN.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/EN.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/ENP.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/ENP.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/EP.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/EP.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/H.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/H.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/HN.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/HN.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/HNP.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/HNP.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/HP.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/HP.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/N.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/N.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/NP.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/NP.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bc/P.1 | 25 +++++++++++++++++++------ contrib/bc/manuals/bc/P.1.md | 23 ++++++++++++++++------- contrib/bc/manuals/bcl.3 | 2 +- contrib/bc/manuals/build.md | 16 ++++++++++++++++ contrib/bc/manuals/dc.1.md.in | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/A.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/A.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/E.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/E.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/EH.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/EH.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/EHN.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/EHN.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/EHNP.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/EHNP.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/EHP.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/EHP.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/EN.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/EN.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/ENP.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/ENP.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/EP.1 | 27 ++++++++++++++++++++------- contrib/bc/manuals/dc/EP.1.md | 25 +++++++++++++++++-------- contrib/bc/manuals/dc/H.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/H.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/HN.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/HN.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/HNP.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/HNP.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/HP.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/HP.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/N.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/N.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/NP.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/NP.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/dc/P.1 | 29 +++++++++++++++++++++-------- contrib/bc/manuals/dc/P.1.md | 27 ++++++++++++++++++--------- contrib/bc/manuals/header_bc.txt | 2 +- contrib/bc/manuals/header_bcl.txt | 2 +- contrib/bc/manuals/header_dc.txt | 2 +- contrib/bc/release.sh | 2 +- contrib/bc/src/args.c | 4 +++- contrib/bc/src/vm.c | 6 +++--- contrib/bc/tests/script.sh | 2 +- 82 files changed, 1262 insertions(+), 502 deletions(-) diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 8ae982bd99fe..dbb5debd44cc 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.2.6 +VERSION = 3.3.0 SRC = %%SRC%% OBJ = %%OBJ%% diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 5982defb754c..6a8899200f4a 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,25 @@ # News +## 3.3.0 + +This is a production release that changes one behavior and fixes documentation +bugs. + +The changed behavior is the treatment of `-e` and `-f` when given through +`BC_ENV_ARGS` or `DC_ENV_ARGS`. Now `bc` and `dc` do not exit when those options +(or their equivalents) are given through those environment variables. However, +`bc` and `dc` still exit when they or their equivalents are given on the +command-line. + +## 3.2.7 + +This is a production release that removes a small non-portable shell operation +in `configure.sh`. This problem was only noticed on OpenBSD, not FreeBSD or +Linux. + +Non-OpenBSD users do ***NOT*** need to upgrade, although NetBSD users may also +need to upgrade. + ## 3.2.6 This is a production release that fixes the build on FreeBSD. diff --git a/contrib/bc/README.md b/contrib/bc/README.md index beda88d23f90..2f95e16ed246 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -342,7 +342,7 @@ Folders: [20]: https://git.yzena.com/gavin/bc [21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ [22]: https://www.deepl.com/translator -[23]: https://svnweb.freebsd.org/base/head/contrib/bc/ +[23]: https://cgit.freebsd.org/src/tree/contrib/bc [24]: https://bugs.freebsd.org/ [25]: https://reviews.freebsd.org/ [26]: ./manuals/bcl.3.md diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index ae1675cde97d..310c26882906 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -253,7 +253,7 @@ replace_ext() { _replace_ext_ext1="$2" _replace_ext_ext2="$3" - _replace_ext_result=${_replace_ext_file%.$_replace_ext_ext1}.$_replace_ext_ext2 + _replace_ext_result="${_replace_ext_file%.$_replace_ext_ext1}.$_replace_ext_ext2" printf '%s\n' "$_replace_ext_result" } @@ -1199,17 +1199,12 @@ SRC_TARGETS="" src_files=$(find_src_files $unneeded) -temp_ifs="$IFS" -IFS=$'\n' - for f in $src_files; do o=$(replace_ext "$f" "c" "o") SRC_TARGETS=$(printf '%s\n\n%s: %s %s\n\t$(CC) $(CFLAGS) -o %s -c %s\n' \ "$SRC_TARGETS" "$o" "$headers" "$f" "$o" "$f") done -IFS="$temp_ifs" - contents=$(replace "$contents" "HEADERS" "$headers") contents=$(replace "$contents" "BC_ENABLED" "$bc") diff --git a/contrib/bc/include/args.h b/contrib/bc/include/args.h index 6b68ed300440..d53785067237 100644 --- a/contrib/bc/include/args.h +++ b/contrib/bc/include/args.h @@ -39,7 +39,7 @@ #include #include -void bc_args(int argc, char *argv[]); +void bc_args(int argc, char *argv[], bool exit_exprs); extern const char* const bc_args_env_name; diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index 3fa844485690..cf41a3ce4670 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -176,11 +176,15 @@ typedef enum BcErr { #endif // __STDC_VERSION__ #if defined(__clang__) || defined(__GNUC__) -#if defined(__has_attribute) && __has_attribute(fallthrough) +#if defined(__has_attribute) +#if __has_attribute(fallthrough) #define BC_FALLTHROUGH __attribute__((fallthrough)); -#else // defined(__has_attribute) && __has_attribute(fallthrough) +#else // __has_attribute(fallthrough) #define BC_FALLTHROUGH -#endif // defined(__has_attribute) && __has_attribute(fallthrough) +#endif // __has_attribute(fallthrough) +#else // defined(__has_attribute) +#define BC_FALLTHROUGH +#endif // defined(__has_attribute) #else // defined(__clang__) || defined(__GNUC__) #define BC_FALLTHROUGH #endif // defined(__clang__) || defined(__GNUC__) diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h index 8b0babff4d81..80a060edd42f 100644 --- a/contrib/bc/include/vm.h +++ b/contrib/bc/include/vm.h @@ -356,6 +356,7 @@ typedef struct BcVm { uint16_t line_len; bool no_exit_exprs; + bool exit_exprs; bool eof; #endif // !BC_ENABLE_LIBRARY diff --git a/contrib/bc/manuals/bc.1.md.in b/contrib/bc/manuals/bc.1.md.in index 624ea3fb54ab..1ce83b8237cd 100644 --- a/contrib/bc/manuals/bc.1.md.in +++ b/contrib/bc/manuals/bc.1.md.in @@ -229,10 +229,13 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. - However, if any other **-e**, **--expression**, **-f**, or **--file** - arguments are given after that, bc(1) will give a fatal error and exit. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**, whether on the + command-line or in **BC_ENV_ARGS**. However, if any other **-e**, + **--expression**, **-f**, or **--file** arguments are given after **-f-** or + equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -242,8 +245,12 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**. However, if any other + **-e**, **--expression**, **-f**, or **--file** arguments are given after + **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -251,7 +258,9 @@ All long options are **non-portable extensions**. # STDOUT -Any non-error output is written to **stdout**. +Any non-error output is written to **stdout**. In addition, if history (see the +**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled, +both are output to **stdout**. **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index da35e8c7eaee..d1e80769c855 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -230,12 +230,16 @@ This means that if a file is given before an expression, the file is read in and evaluated first. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. +\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]BC_ENV_ARGS\f[R]. However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that, -bc(1) will give a fatal error and exit. +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -247,9 +251,15 @@ If expressions are also given (see above), the expressions are evaluated in the order given. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to \f[B]-f\f[R] or \f[B]\[en]file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -258,6 +268,9 @@ All long options are \f[B]non-portable extensions\f[R]. .SH STDOUT .PP Any non-error output is written to \f[B]stdout\f[R]. +In addition, if history (see the \f[B]HISTORY\f[R] section) and the +prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output +to \f[B]stdout\f[R]. .PP \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index 293a21ad0259..0cf7a4a0d70e 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -187,10 +187,13 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. - However, if any other **-e**, **--expression**, **-f**, or **--file** - arguments are given after that, bc(1) will give a fatal error and exit. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**, whether on the + command-line or in **BC_ENV_ARGS**. However, if any other **-e**, + **--expression**, **-f**, or **--file** arguments are given after **-f-** or + equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -200,8 +203,12 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**. However, if any other + **-e**, **--expression**, **-f**, or **--file** arguments are given after + **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -209,7 +216,9 @@ All long options are **non-portable extensions**. # STDOUT -Any non-error output is written to **stdout**. +Any non-error output is written to **stdout**. In addition, if history (see the +**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled, +both are output to **stdout**. **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index 02a56e6c653c..597cde782788 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -192,12 +192,16 @@ This means that if a file is given before an expression, the file is read in and evaluated first. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. +\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]BC_ENV_ARGS\f[R]. However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that, -bc(1) will give a fatal error and exit. +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -209,9 +213,15 @@ If expressions are also given (see above), the expressions are evaluated in the order given. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to \f[B]-f\f[R] or \f[B]\[en]file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -220,6 +230,9 @@ All long options are \f[B]non-portable extensions\f[R]. .SH STDOUT .PP Any non-error output is written to \f[B]stdout\f[R]. +In addition, if history (see the \f[B]HISTORY\f[R] section) and the +prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output +to \f[B]stdout\f[R]. .PP \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot diff --git a/contrib/bc/manuals/bc/E.1.md b/contrib/bc/manuals/bc/E.1.md index 7cbc1a56548a..864cf32068bf 100644 --- a/contrib/bc/manuals/bc/E.1.md +++ b/contrib/bc/manuals/bc/E.1.md @@ -171,10 +171,13 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. - However, if any other **-e**, **--expression**, **-f**, or **--file** - arguments are given after that, bc(1) will give a fatal error and exit. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**, whether on the + command-line or in **BC_ENV_ARGS**. However, if any other **-e**, + **--expression**, **-f**, or **--file** arguments are given after **-f-** or + equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -184,8 +187,12 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**. However, if any other + **-e**, **--expression**, **-f**, or **--file** arguments are given after + **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -193,7 +200,9 @@ All long options are **non-portable extensions**. # STDOUT -Any non-error output is written to **stdout**. +Any non-error output is written to **stdout**. In addition, if history (see the +**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled, +both are output to **stdout**. **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1 index 8cb2a3bc8335..dca77a99162e 100644 --- a/contrib/bc/manuals/bc/EH.1 +++ b/contrib/bc/manuals/bc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -189,12 +189,16 @@ This means that if a file is given before an expression, the file is read in and evaluated first. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. +\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]BC_ENV_ARGS\f[R]. However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that, -bc(1) will give a fatal error and exit. +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -206,9 +210,15 @@ If expressions are also given (see above), the expressions are evaluated in the order given. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to \f[B]-f\f[R] or \f[B]\[en]file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -217,6 +227,9 @@ All long options are \f[B]non-portable extensions\f[R]. .SH STDOUT .PP Any non-error output is written to \f[B]stdout\f[R]. +In addition, if history (see the \f[B]HISTORY\f[R] section) and the +prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output +to \f[B]stdout\f[R]. .PP \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot diff --git a/contrib/bc/manuals/bc/EH.1.md b/contrib/bc/manuals/bc/EH.1.md index 351882878cd3..c1e324ab6ebc 100644 --- a/contrib/bc/manuals/bc/EH.1.md +++ b/contrib/bc/manuals/bc/EH.1.md @@ -168,10 +168,13 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. - However, if any other **-e**, **--expression**, **-f**, or **--file** - arguments are given after that, bc(1) will give a fatal error and exit. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**, whether on the + command-line or in **BC_ENV_ARGS**. However, if any other **-e**, + **--expression**, **-f**, or **--file** arguments are given after **-f-** or + equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -181,8 +184,12 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**. However, if any other + **-e**, **--expression**, **-f**, or **--file** arguments are given after + **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -190,7 +197,9 @@ All long options are **non-portable extensions**. # STDOUT -Any non-error output is written to **stdout**. +Any non-error output is written to **stdout**. In addition, if history (see the +**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled, +both are output to **stdout**. **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1 index f751f9d31beb..6b208ade85fd 100644 --- a/contrib/bc/manuals/bc/EHN.1 +++ b/contrib/bc/manuals/bc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -189,12 +189,16 @@ This means that if a file is given before an expression, the file is read in and evaluated first. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. +\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]BC_ENV_ARGS\f[R]. However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that, -bc(1) will give a fatal error and exit. +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -206,9 +210,15 @@ If expressions are also given (see above), the expressions are evaluated in the order given. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to \f[B]-f\f[R] or \f[B]\[en]file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -217,6 +227,9 @@ All long options are \f[B]non-portable extensions\f[R]. .SH STDOUT .PP Any non-error output is written to \f[B]stdout\f[R]. +In addition, if history (see the \f[B]HISTORY\f[R] section) and the +prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output +to \f[B]stdout\f[R]. .PP \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot diff --git a/contrib/bc/manuals/bc/EHN.1.md b/contrib/bc/manuals/bc/EHN.1.md index dfe1c401970f..4ee01a4bbcc8 100644 --- a/contrib/bc/manuals/bc/EHN.1.md +++ b/contrib/bc/manuals/bc/EHN.1.md @@ -168,10 +168,13 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. - However, if any other **-e**, **--expression**, **-f**, or **--file** - arguments are given after that, bc(1) will give a fatal error and exit. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**, whether on the + command-line or in **BC_ENV_ARGS**. However, if any other **-e**, + **--expression**, **-f**, or **--file** arguments are given after **-f-** or + equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -181,8 +184,12 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**. However, if any other + **-e**, **--expression**, **-f**, or **--file** arguments are given after + **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -190,7 +197,9 @@ All long options are **non-portable extensions**. # STDOUT -Any non-error output is written to **stdout**. +Any non-error output is written to **stdout**. In addition, if history (see the +**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled, +both are output to **stdout**. **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if diff --git a/contrib/bc/manuals/bc/EHNP.1 b/contrib/bc/manuals/bc/EHNP.1 index e25cd1a7da42..7bd46f38e104 100644 --- a/contrib/bc/manuals/bc/EHNP.1 +++ b/contrib/bc/manuals/bc/EHNP.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -184,12 +184,16 @@ This means that if a file is given before an expression, the file is read in and evaluated first. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. +\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]BC_ENV_ARGS\f[R]. However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that, -bc(1) will give a fatal error and exit. +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -201,9 +205,15 @@ If expressions are also given (see above), the expressions are evaluated in the order given. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to \f[B]-f\f[R] or \f[B]\[en]file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -212,6 +222,9 @@ All long options are \f[B]non-portable extensions\f[R]. .SH STDOUT .PP Any non-error output is written to \f[B]stdout\f[R]. +In addition, if history (see the \f[B]HISTORY\f[R] section) and the +prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output +to \f[B]stdout\f[R]. .PP \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot diff --git a/contrib/bc/manuals/bc/EHNP.1.md b/contrib/bc/manuals/bc/EHNP.1.md index e55673769736..8aca89e6f7b0 100644 --- a/contrib/bc/manuals/bc/EHNP.1.md +++ b/contrib/bc/manuals/bc/EHNP.1.md @@ -164,10 +164,13 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. - However, if any other **-e**, **--expression**, **-f**, or **--file** - arguments are given after that, bc(1) will give a fatal error and exit. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**, whether on the + command-line or in **BC_ENV_ARGS**. However, if any other **-e**, + **--expression**, **-f**, or **--file** arguments are given after **-f-** or + equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -177,8 +180,12 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**. However, if any other + **-e**, **--expression**, **-f**, or **--file** arguments are given after + **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -186,7 +193,9 @@ All long options are **non-portable extensions**. # STDOUT -Any non-error output is written to **stdout**. +Any non-error output is written to **stdout**. In addition, if history (see the +**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled, +both are output to **stdout**. **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if diff --git a/contrib/bc/manuals/bc/EHP.1 b/contrib/bc/manuals/bc/EHP.1 index 7f35d1a1be7f..31c02f1b9591 100644 --- a/contrib/bc/manuals/bc/EHP.1 +++ b/contrib/bc/manuals/bc/EHP.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -184,12 +184,16 @@ This means that if a file is given before an expression, the file is read in and evaluated first. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. +\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]BC_ENV_ARGS\f[R]. However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that, -bc(1) will give a fatal error and exit. +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -201,9 +205,15 @@ If expressions are also given (see above), the expressions are evaluated in the order given. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to \f[B]-f\f[R] or \f[B]\[en]file\f[R]. +However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -212,6 +222,9 @@ All long options are \f[B]non-portable extensions\f[R]. .SH STDOUT .PP Any non-error output is written to \f[B]stdout\f[R]. +In addition, if history (see the \f[B]HISTORY\f[R] section) and the +prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output +to \f[B]stdout\f[R]. .PP \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot diff --git a/contrib/bc/manuals/bc/EHP.1.md b/contrib/bc/manuals/bc/EHP.1.md index 11050003420f..2c9ab3909dd6 100644 --- a/contrib/bc/manuals/bc/EHP.1.md +++ b/contrib/bc/manuals/bc/EHP.1.md @@ -164,10 +164,13 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. - However, if any other **-e**, **--expression**, **-f**, or **--file** - arguments are given after that, bc(1) will give a fatal error and exit. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**, whether on the + command-line or in **BC_ENV_ARGS**. However, if any other **-e**, + **--expression**, **-f**, or **--file** arguments are given after **-f-** or + equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -177,8 +180,12 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - After processing all expressions and files, bc(1) will exit, unless **-** - (**stdin**) was given as an argument at least once to **-f** or **--file**. + If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**, + see the **ENVIRONMENT VARIABLES** section), then after processing all + expressions and files, bc(1) will exit, unless **-** (**stdin**) was given + as an argument at least once to **-f** or **--file**. However, if any other + **-e**, **--expression**, **-f**, or **--file** arguments are given after + **-f-** or equivalent is given, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -186,7 +193,9 @@ All long options are **non-portable extensions**. # STDOUT -Any non-error output is written to **stdout**. +Any non-error output is written to **stdout**. In addition, if history (see the +**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled, +both are output to **stdout**. **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1 index c8e3a327b2f8..faa6bf488e28 100644 --- a/contrib/bc/manuals/bc/EN.1 +++ b/contrib/bc/manuals/bc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -192,12 +192,16 @@ This means that if a file is given before an expression, the file is read in and evaluated first. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to -\f[B]-f\f[R] or \f[B]\[en]file\f[R]. +\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in +\f[B]BC_ENV_ARGS\f[R]. However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R], -\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that, -bc(1) will give a fatal error and exit. +\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after +\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and +exit. .PP This is a \f[B]non-portable extension\f[R]. .RE @@ -209,9 +213,15 @@ If expressions are also given (see above), the expressions are evaluated in the order given. .RS .PP -After processing all expressions and files, bc(1) will exit, unless +If this option is given on the command-line (i.e., not in +\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section), +then after processing all expressions and files, bc(1) will exit, unless \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to *** 3436 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Feb 22 12:02: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 5FC9A55325B; Mon, 22 Feb 2021 12:02: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 4Dkgld2FS6z3JMT; Mon, 22 Feb 2021 12:02: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 3FF2E253A6; Mon, 22 Feb 2021 12:02: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 11MC25F7071532; Mon, 22 Feb 2021 12:02:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MC24EB071531; Mon, 22 Feb 2021 12:02:04 GMT (envelope-from git) Date: Mon, 22 Feb 2021 12:02:04 GMT Message-Id: <202102221202.11MC24EB071531@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: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 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: ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 12:02:05 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 commit ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 Merge: c02a28754bc2 0626917d0786 Author: Martin Matuska AuthorDate: 2021-02-22 11:35:56 +0000 Commit: Martin Matuska CommitDate: 2021-02-22 12:01:17 +0000 zfs: merge OpenZFS master-9312e0fd1 Notable upstream changes: 778869fa1 Fix reporting of mount progress e7adccf7f Disable use of hardware crypto offload drivers on FreeBSD 03e02e5b5 Fix checksum errors not being counted on repeated repair 64e0fe14f Restore FreeBSD resource usage accounting 11f2e9a49 Fix panic if scrubbing after removing a slog device MFC after: 2 weeks cddl/lib/libzpool/Makefile | 1 + stand/libsa/zfs/zstd_shim.c | 5 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 3 - sys/contrib/openzfs/cmd/ztest/ztest.c | 113 ++++++++- .../openzfs/include/os/freebsd/spl/sys/uio.h | 43 +--- sys/contrib/openzfs/include/os/linux/spl/sys/uio.h | 22 +- .../include/os/linux/zfs/sys/zfs_context_os.h | 1 - sys/contrib/openzfs/include/sys/Makefile.am | 1 + sys/contrib/openzfs/include/sys/spa.h | 3 +- sys/contrib/openzfs/include/sys/uio_impl.h | 21 +- sys/contrib/openzfs/include/sys/zfs_context.h | 3 +- sys/contrib/openzfs/include/sys/zfs_racct.h | 37 +++ sys/contrib/openzfs/lib/libzpool/Makefile.am | 1 + sys/contrib/openzfs/lib/libzpool/util.c | 74 ++++-- .../lib/libzutil/os/linux/zutil_device_path_os.c | 252 ++++++++++++--------- sys/contrib/openzfs/module/Makefile.bsd | 1 + .../openzfs/module/os/freebsd/spl/spl_uio.c | 9 +- .../openzfs/module/os/freebsd/zfs/crypto_os.c | 15 +- .../openzfs/module/os/freebsd/zfs/zfs_racct.c | 55 +++++ .../openzfs/module/os/linux/zfs/Makefile.in | 1 + .../openzfs/module/os/linux/zfs/zfs_racct.c | 36 +++ sys/contrib/openzfs/module/zfs/arc.c | 2 + sys/contrib/openzfs/module/zfs/dmu.c | 5 + sys/contrib/openzfs/module/zfs/dsl_scan.c | 6 +- sys/contrib/openzfs/module/zfs/spa_config.c | 2 +- sys/contrib/openzfs/module/zfs/vdev.c | 9 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 10 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 20 +- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 3 + sys/contrib/openzfs/module/zfs/zfs_fm.c | 46 +++- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 2 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 2 +- sys/contrib/openzfs/module/zfs/zio.c | 11 +- sys/contrib/openzfs/scripts/zfs.sh | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 3 +- .../functional/cli_root/zpool_events/Makefile.am | 3 +- .../zpool_events/zpool_events_clear_retained.ksh | 135 +++++++++++ .../zpool_events/zpool_events_duplicates.ksh | 11 - sys/modules/zfs/Makefile | 1 + sys/modules/zfs/zfs_config.h | 2 +- 40 files changed, 724 insertions(+), 248 deletions(-) diff --cc cddl/lib/libzpool/Makefile index d9b2e67094e3,000000000000..6893e31ff20a mode 100644,000000..100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@@ -1,266 -1,0 +1,267 @@@ +# $FreeBSD$ + +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs + +# ZFS_COMMON_SRCS +.PATH: ${ZFSTOP}/module/zfs +.PATH: ${ZFSTOP}/module/zcommon +.PATH: ${ZFSTOP}/module/unicode +# LUA_SRCS +.PATH: ${ZFSTOP}/module/lua +# ZSTD_SRCS +.PATH: ${ZFSTOP}/module/zstd +.PATH: ${ZFSTOP}/module/zstd/lib + +.PATH: ${ZFSTOP}/module/os/linux/zfs + +.PATH: ${ZFSTOP}/lib/libzpool + +.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} +ATOMIC_SRCS= opensolaris_atomic.S +ACFLAGS+= -Wa,--noexecstack +.else +.PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern +ATOMIC_SRCS= opensolaris_atomic.c +.endif + +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" +# Don't waste GOT entries on small data. +PICFLAG= -fPIC +.endif + +LIB= zpool + +USER_C = \ + kernel.c \ + taskq.c \ + util.c + +KERNEL_C = \ + zfeature_common.c \ + zfs_comutil.c \ + zfs_deleg.c \ + zfs_fletcher.c \ + zfs_fletcher_superscalar.c \ + zfs_fletcher_superscalar4.c \ + zfs_namecheck.c \ + zfs_prop.c \ + zfs_zstd.c \ + zpool_prop.c \ + zprop_common.c \ + abd.c \ + abd_os.c \ + aggsum.c \ + arc.c \ + arc_os.c \ + blkptr.c \ + bplist.c \ + bpobj.c \ + bptree.c \ + btree.c \ + bqueue.c \ + cityhash.c \ + dbuf.c \ + dbuf_stats.c \ + ddt.c \ + ddt_zap.c \ + dmu.c \ + dmu_diff.c \ + dmu_object.c \ + dmu_objset.c \ + dmu_recv.c \ + dmu_redact.c \ + dmu_send.c \ + dmu_traverse.c \ + dmu_tx.c \ + dmu_zfetch.c \ + dnode.c \ + dnode_sync.c \ + dsl_bookmark.c \ + dsl_dataset.c \ + dsl_deadlist.c \ + dsl_deleg.c \ + dsl_dir.c \ + dsl_crypt.c \ + dsl_pool.c \ + dsl_prop.c \ + dsl_scan.c \ + dsl_synctask.c \ + dsl_destroy.c \ + dsl_userhold.c \ + edonr_zfs.c \ + hkdf.c \ + fm.c \ + gzip.c \ + lzjb.c \ + lz4.c \ + metaslab.c \ + mmp.c \ + multilist.c \ + objlist.c \ + pathname.c \ + range_tree.c \ + refcount.c \ + rrwlock.c \ + sa.c \ + sha256.c \ + skein_zfs.c \ + spa.c \ + spa_boot.c \ + spa_checkpoint.c \ + spa_config.c \ + spa_errlog.c \ + spa_history.c \ + spa_log_spacemap.c \ + spa_misc.c \ + spa_stats.c \ + space_map.c \ + space_reftree.c \ + txg.c \ + trace.c \ + uberblock.c \ + unique.c \ + vdev.c \ + vdev_cache.c \ + vdev_draid.c \ + vdev_draid_rand.c \ + vdev_file.c \ + vdev_indirect_births.c \ + vdev_indirect.c \ + vdev_indirect_mapping.c \ + vdev_initialize.c \ + vdev_label.c \ + vdev_mirror.c \ + vdev_missing.c \ + vdev_queue.c \ + vdev_raidz.c \ + vdev_raidz_math_aarch64_neon.c \ + vdev_raidz_math_aarch64_neonx2.c \ + vdev_raidz_math_avx2.c \ + vdev_raidz_math_avx512bw.c \ + vdev_raidz_math_avx512f.c \ + vdev_raidz_math.c \ + vdev_raidz_math_scalar.c \ + vdev_rebuild.c \ + vdev_removal.c \ + vdev_root.c \ + vdev_trim.c \ + zap.c \ + zap_leaf.c \ + zap_micro.c \ + zcp.c \ + zcp_get.c \ + zcp_global.c \ + zcp_iter.c \ + zcp_set.c \ + zcp_synctask.c \ + zfeature.c \ + zfs_byteswap.c \ + zfs_debug.c \ + zfs_fm.c \ + zfs_fuid.c \ + zfs_sa.c \ + zfs_znode.c \ ++ zfs_racct.c \ + zfs_ratelimit.c \ + zfs_rlock.c \ + zil.c \ + zio.c \ + zio_checksum.c \ + zio_compress.c \ + zio_crypt.c \ + zio_inject.c \ + zle.c \ + zrlock.c \ + zstd.c \ + zthr.c + +ARCH_C = +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +ARCH_C += vdev_raidz_math_sse2.c \ + vdev_raidz_math_ssse3.c \ + zfs_fletcher_intel.c \ + zfs_fletcher_sse.c +CFLAGS += -DHAVE_SSE2 -DHAVE_SSE3 +.endif +.if ${MACHINE_ARCH} == "amd64" +ARCH_C += zfs_fletcher_avx512.c +CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F \ + -DHAVE_AVX512BW +.endif +.if ${MACHINE_CPUARCH} == "aarch64" +ARCH_C += zfs_fletcher_aarch64_neon.c +.endif + +LUA_C = \ + lapi.c \ + lauxlib.c \ + lbaselib.c \ + lcode.c \ + lcompat.c \ + lcorolib.c \ + lctype.c \ + ldebug.c \ + ldo.c \ + lfunc.c \ + lgc.c \ + llex.c \ + lmem.c \ + lobject.c \ + lopcodes.c \ + lparser.c \ + lstate.c \ + lstring.c \ + lstrlib.c \ + ltable.c \ + ltablib.c \ + ltm.c \ + lvm.c \ + lzio.c + +UNICODE_C = u8_textprep.c uconv.c + +SRCS= ${USER_C} ${KERNEL_C} ${LUA_C} ${UNICODE_C} ${ARCH_C} + +WARNS?= 2 +CFLAGS+= \ + -DIN_BASE \ + -I${ZFSTOP}/include \ + -I${ZFSTOP}/lib/libspl/include \ + -I${ZFSTOP}/lib/libspl/include/os/freebsd \ + -I${SRCTOP}/sys \ + -I${ZFSTOP}/include/os/freebsd/zfs \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ + -I${ZFSTOP}/module/icp/include \ + -include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \ + -DHAVE_ISSETUGID \ + -include ${SRCTOP}/sys/modules/zfs/zfs_config.h \ + -I${SRCTOP}/sys/modules/zfs \ + -I${ZFSTOP}/include/os/freebsd/zfs \ + -DLIB_ZPOOL_BUILD -DZFS_DEBUG \ + +# XXX: pthread doesn't have mutex_owned() equivalent, so we need to look +# into libthr private structures. That's sooo evil, but it's only for +# ZFS debugging tools needs. +CFLAGS+= -DWANTS_MUTEX_OWNED +CFLAGS+= -I${SRCTOP}/lib/libpthread/thread +CFLAGS+= -I${SRCTOP}/lib/libpthread/sys +CFLAGS+= -I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include +CFLAGS.gcc+= -fms-extensions + +LIBADD= md pthread z spl icp nvpair avl umem + +# atomic.S doesn't like profiling. +MK_PROFILE= no + +CSTD= c99 + +# Since there are many asserts in this library, it makes no sense to compile +# it without debugging. + +CFLAGS+= -g -DDEBUG=1 + +CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zstd.c+= -fno-tree-vectorize + +.include diff --cc stand/libsa/zfs/zstd_shim.c index b94df6f51913,000000000000..91f5171a72b5 mode 100644,000000..100644 --- a/stand/libsa/zfs/zstd_shim.c +++ b/stand/libsa/zfs/zstd_shim.c @@@ -1,40 -1,0 +1,45 @@@ +/*- + * Copyright (c) 2020 M. Warner Losh + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +/* + * Small amount of shim code needed to get zfs_zstd.c to compile. These items + * here should all be defined in the SPL or as part of libstand somewhere, but + * aren't for reasons that haven't been tracked down yet. Ideally, they would + * all go away and we'd compile zfs_zstd.c directly. Based on an original by + * Matt Macey, but only the #include remains untouched from that. + */ + +#define ZFS_MODULE_PARAM_ARGS void +typedef int boolean_t; /* This one may be tough to get rid of */ + ++/* TODO: openzfs/include/sys/uio_impl.h must not be included */ ++#ifndef _SYS_UIO_IMPL_H ++#define _SYS_UIO_IMPL_H ++#endif ++ +#include diff --cc sys/contrib/openzfs/include/sys/zfs_racct.h index 000000000000,cfcdd336ea42..cfcdd336ea42 mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/sys/zfs_racct.h +++ b/sys/contrib/openzfs/include/sys/zfs_racct.h diff --cc sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c index 000000000000,b46cc046268e..b46cc046268e mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c diff --cc sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c index 000000000000,7897e0f9edc1..7897e0f9edc1 mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c diff --cc sys/contrib/openzfs/module/zfs/zfs_ioctl.c index 0e35fd069cbb,000000000000..922253469fba mode 100644,000000..100644 --- a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c +++ b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c @@@ -1,7688 -1,0 +1,7688 @@@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 Martin Matuska + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. + * Portions Copyright 2012 Pawel Jakub Dawidek + * Copyright (c) 2014, 2016 Joyent, Inc. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Toomas Soome + * Copyright (c) 2016 Actifio, Inc. All rights reserved. + * Copyright (c) 2018, loli10K . All rights reserved. + * Copyright 2017 RackTop Systems. + * Copyright (c) 2017 Open-E, Inc. All Rights Reserved. + * Copyright (c) 2019 Datto Inc. + * Copyright (c) 2019, 2020 by Christian Schwarz. All rights reserved. + * Copyright (c) 2019, Klara Inc. + * Copyright (c) 2019, Allan Jude + */ + +/* + * ZFS ioctls. + * + * This file handles the ioctls to /dev/zfs, used for configuring ZFS storage + * pools and filesystems, e.g. with /sbin/zfs and /sbin/zpool. + * + * There are two ways that we handle ioctls: the legacy way where almost + * all of the logic is in the ioctl callback, and the new way where most + * of the marshalling is handled in the common entry point, zfsdev_ioctl(). + * + * Non-legacy ioctls should be registered by calling + * zfs_ioctl_register() from zfs_ioctl_init(). The ioctl is invoked + * from userland by lzc_ioctl(). + * + * The registration arguments are as follows: + * + * const char *name + * The name of the ioctl. This is used for history logging. If the + * ioctl returns successfully (the callback returns 0), and allow_log + * is true, then a history log entry will be recorded with the input & + * output nvlists. The log entry can be printed with "zpool history -i". + * + * zfs_ioc_t ioc + * The ioctl request number, which userland will pass to ioctl(2). + * We want newer versions of libzfs and libzfs_core to run against + * existing zfs kernel modules (i.e. a deferred reboot after an update). + * Therefore the ioctl numbers cannot change from release to release. + * + * zfs_secpolicy_func_t *secpolicy + * This function will be called before the zfs_ioc_func_t, to + * determine if this operation is permitted. It should return EPERM + * on failure, and 0 on success. Checks include determining if the + * dataset is visible in this zone, and if the user has either all + * zfs privileges in the zone (SYS_MOUNT), or has been granted permission + * to do this operation on this dataset with "zfs allow". + * + * zfs_ioc_namecheck_t namecheck + * This specifies what to expect in the zfs_cmd_t:zc_name -- a pool + * name, a dataset name, or nothing. If the name is not well-formed, + * the ioctl will fail and the callback will not be called. + * Therefore, the callback can assume that the name is well-formed + * (e.g. is null-terminated, doesn't have more than one '@' character, + * doesn't have invalid characters). + * + * zfs_ioc_poolcheck_t pool_check + * This specifies requirements on the pool state. If the pool does + * not meet them (is suspended or is readonly), the ioctl will fail + * and the callback will not be called. If any checks are specified + * (i.e. it is not POOL_CHECK_NONE), namecheck must not be NO_NAME. + * Multiple checks can be or-ed together (e.g. POOL_CHECK_SUSPENDED | + * POOL_CHECK_READONLY). + * + * zfs_ioc_key_t *nvl_keys + * The list of expected/allowable innvl input keys. This list is used + * to validate the nvlist input to the ioctl. + * + * boolean_t smush_outnvlist + * If smush_outnvlist is true, then the output is presumed to be a + * list of errors, and it will be "smushed" down to fit into the + * caller's buffer, by removing some entries and replacing them with a + * single "N_MORE_ERRORS" entry indicating how many were removed. See + * nvlist_smush() for details. If smush_outnvlist is false, and the + * outnvlist does not fit into the userland-provided buffer, then the + * ioctl will fail with ENOMEM. + * + * zfs_ioc_func_t *func + * The callback function that will perform the operation. + * + * The callback should return 0 on success, or an error number on + * failure. If the function fails, the userland ioctl will return -1, + * and errno will be set to the callback's return value. The callback + * will be called with the following arguments: + * + * const char *name + * The name of the pool or dataset to operate on, from + * zfs_cmd_t:zc_name. The 'namecheck' argument specifies the + * expected type (pool, dataset, or none). + * + * nvlist_t *innvl + * The input nvlist, deserialized from zfs_cmd_t:zc_nvlist_src. Or + * NULL if no input nvlist was provided. Changes to this nvlist are + * ignored. If the input nvlist could not be deserialized, the + * ioctl will fail and the callback will not be called. + * + * nvlist_t *outnvl + * The output nvlist, initially empty. The callback can fill it in, + * and it will be returned to userland by serializing it into + * zfs_cmd_t:zc_nvlist_dst. If it is non-empty, and serialization + * fails (e.g. because the caller didn't supply a large enough + * buffer), then the overall ioctl will fail. See the + * 'smush_nvlist' argument above for additional behaviors. + * + * There are two typical uses of the output nvlist: + * - To return state, e.g. property values. In this case, + * smush_outnvlist should be false. If the buffer was not large + * enough, the caller will reallocate a larger buffer and try + * the ioctl again. + * + * - To return multiple errors from an ioctl which makes on-disk + * changes. In this case, smush_outnvlist should be true. + * Ioctls which make on-disk modifications should generally not + * use the outnvl if they succeed, because the caller can not + * distinguish between the operation failing, and + * deserialization failing. + * + * IOCTL Interface Errors + * + * The following ioctl input errors can be returned: + * ZFS_ERR_IOC_CMD_UNAVAIL the ioctl number is not supported by kernel + * ZFS_ERR_IOC_ARG_UNAVAIL an input argument is not supported by kernel + * ZFS_ERR_IOC_ARG_REQUIRED a required input argument is missing + * ZFS_ERR_IOC_ARG_BADTYPE an input argument has an invalid type + */ + +#include +#include +#include - #include ++#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zfs_namecheck.h" +#include "zfs_prop.h" +#include "zfs_deleg.h" +#include "zfs_comutil.h" + +#include +#include +#include + +kmutex_t zfsdev_state_lock; +zfsdev_state_t *zfsdev_state_list; + +/* + * Limit maximum nvlist size. We don't want users passing in insane values + * for zc->zc_nvlist_src_size, since we will need to allocate that much memory. + * Defaults to 0=auto which is handled by platform code. + */ +unsigned long zfs_max_nvlist_src_size = 0; + +/* + * When logging the output nvlist of an ioctl in the on-disk history, limit + * the logged size to this many bytes. This must be less then DMU_MAX_ACCESS. + * This applies primarily to zfs_ioc_channel_program(). + */ +unsigned long zfs_history_output_max = 1024 * 1024; + +uint_t zfs_fsyncer_key; +uint_t zfs_allow_log_key; + +/* DATA_TYPE_ANY is used when zkey_type can vary. */ +#define DATA_TYPE_ANY DATA_TYPE_UNKNOWN + +typedef struct zfs_ioc_vec { + zfs_ioc_legacy_func_t *zvec_legacy_func; + zfs_ioc_func_t *zvec_func; + zfs_secpolicy_func_t *zvec_secpolicy; + zfs_ioc_namecheck_t zvec_namecheck; + boolean_t zvec_allow_log; + zfs_ioc_poolcheck_t zvec_pool_check; + boolean_t zvec_smush_outnvlist; + const char *zvec_name; + const zfs_ioc_key_t *zvec_nvl_keys; + size_t zvec_nvl_key_count; +} zfs_ioc_vec_t; + +/* This array is indexed by zfs_userquota_prop_t */ +static const char *userquota_perms[] = { + ZFS_DELEG_PERM_USERUSED, + ZFS_DELEG_PERM_USERQUOTA, + ZFS_DELEG_PERM_GROUPUSED, + ZFS_DELEG_PERM_GROUPQUOTA, + ZFS_DELEG_PERM_USEROBJUSED, + ZFS_DELEG_PERM_USEROBJQUOTA, + ZFS_DELEG_PERM_GROUPOBJUSED, + ZFS_DELEG_PERM_GROUPOBJQUOTA, + ZFS_DELEG_PERM_PROJECTUSED, + ZFS_DELEG_PERM_PROJECTQUOTA, + ZFS_DELEG_PERM_PROJECTOBJUSED, + ZFS_DELEG_PERM_PROJECTOBJQUOTA, +}; + +static int zfs_ioc_userspace_upgrade(zfs_cmd_t *zc); +static int zfs_ioc_id_quota_upgrade(zfs_cmd_t *zc); +static int zfs_check_settable(const char *name, nvpair_t *property, + cred_t *cr); +static int zfs_check_clearable(const char *dataset, nvlist_t *props, + nvlist_t **errors); +static int zfs_fill_zplprops_root(uint64_t, nvlist_t *, nvlist_t *, + boolean_t *); +int zfs_set_prop_nvlist(const char *, zprop_source_t, nvlist_t *, nvlist_t *); +static int get_nvlist(uint64_t nvl, uint64_t size, int iflag, nvlist_t **nvp); + +static void +history_str_free(char *buf) +{ + kmem_free(buf, HIS_MAX_RECORD_LEN); +} + +static char * +history_str_get(zfs_cmd_t *zc) +{ + char *buf; + + if (zc->zc_history == 0) + return (NULL); + + buf = kmem_alloc(HIS_MAX_RECORD_LEN, KM_SLEEP); + if (copyinstr((void *)(uintptr_t)zc->zc_history, + buf, HIS_MAX_RECORD_LEN, NULL) != 0) { + history_str_free(buf); + return (NULL); + } + + buf[HIS_MAX_RECORD_LEN -1] = '\0'; + + return (buf); +} + +/* + * Return non-zero if the spa version is less than requested version. + */ +static int +zfs_earlier_version(const char *name, int version) +{ + spa_t *spa; + + if (spa_open(name, &spa, FTAG) == 0) { + if (spa_version(spa) < version) { + spa_close(spa, FTAG); + return (1); + } + spa_close(spa, FTAG); + } + return (0); +} + +/* + * Return TRUE if the ZPL version is less than requested version. + */ +static boolean_t +zpl_earlier_version(const char *name, int version) +{ + objset_t *os; + boolean_t rc = B_TRUE; + + if (dmu_objset_hold(name, FTAG, &os) == 0) { + uint64_t zplversion; + + if (dmu_objset_type(os) != DMU_OST_ZFS) { + dmu_objset_rele(os, FTAG); + return (B_TRUE); + } + /* XXX reading from non-owned objset */ + if (zfs_get_zplprop(os, ZFS_PROP_VERSION, &zplversion) == 0) + rc = zplversion < version; + dmu_objset_rele(os, FTAG); + } + return (rc); +} + +static void +zfs_log_history(zfs_cmd_t *zc) +{ + spa_t *spa; + char *buf; + + if ((buf = history_str_get(zc)) == NULL) + return; + + if (spa_open(zc->zc_name, &spa, FTAG) == 0) { + if (spa_version(spa) >= SPA_VERSION_ZPOOL_HISTORY) + (void) spa_history_log(spa, buf); + spa_close(spa, FTAG); + } + history_str_free(buf); +} + +/* + * Policy for top-level read operations (list pools). Requires no privileges, + * and can be used in the local zone, as there is no associated dataset. + */ +/* ARGSUSED */ +static int +zfs_secpolicy_none(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + return (0); +} + +/* + * Policy for dataset read operations (list children, get statistics). Requires + * no privileges, but must be visible in the local zone. + */ +/* ARGSUSED */ +static int +zfs_secpolicy_read(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) +{ + if (INGLOBALZONE(curproc) || + zone_dataset_visible(zc->zc_name, NULL)) + return (0); + + return (SET_ERROR(ENOENT)); +} + +static int +zfs_dozonecheck_impl(const char *dataset, uint64_t zoned, cred_t *cr) +{ + int writable = 1; + + /* + * The dataset must be visible by this zone -- check this first + * so they don't see EPERM on something they shouldn't know about. + */ + if (!INGLOBALZONE(curproc) && + !zone_dataset_visible(dataset, &writable)) + return (SET_ERROR(ENOENT)); + + if (INGLOBALZONE(curproc)) { + /* + * If the fs is zoned, only root can access it from the + * global zone. + */ + if (secpolicy_zfs(cr) && zoned) + return (SET_ERROR(EPERM)); + } else { + /* + * If we are in a local zone, the 'zoned' property must be set. + */ + if (!zoned) + return (SET_ERROR(EPERM)); + + /* must be writable by this zone */ + if (!writable) + return (SET_ERROR(EPERM)); + } + return (0); +} + +static int +zfs_dozonecheck(const char *dataset, cred_t *cr) +{ + uint64_t zoned; + + if (dsl_prop_get_integer(dataset, zfs_prop_to_name(ZFS_PROP_ZONED), + &zoned, NULL)) + return (SET_ERROR(ENOENT)); + + return (zfs_dozonecheck_impl(dataset, zoned, cr)); +} + +static int +zfs_dozonecheck_ds(const char *dataset, dsl_dataset_t *ds, cred_t *cr) +{ + uint64_t zoned; + + if (dsl_prop_get_int_ds(ds, zfs_prop_to_name(ZFS_PROP_ZONED), &zoned)) + return (SET_ERROR(ENOENT)); + + return (zfs_dozonecheck_impl(dataset, zoned, cr)); +} + +static int +zfs_secpolicy_write_perms_ds(const char *name, dsl_dataset_t *ds, + const char *perm, cred_t *cr) +{ + int error; + + error = zfs_dozonecheck_ds(name, ds, cr); + if (error == 0) { + error = secpolicy_zfs(cr); + if (error != 0) + error = dsl_deleg_access_impl(ds, perm, cr); + } + return (error); +} + +static int +zfs_secpolicy_write_perms(const char *name, const char *perm, cred_t *cr) +{ + int error; + dsl_dataset_t *ds; + dsl_pool_t *dp; + + /* + * First do a quick check for root in the global zone, which + * is allowed to do all write_perms. This ensures that zfs_ioc_* + * will get to handle nonexistent datasets. + */ + if (INGLOBALZONE(curproc) && secpolicy_zfs(cr) == 0) + return (0); + + error = dsl_pool_hold(name, FTAG, &dp); + if (error != 0) + return (error); + + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error != 0) { + dsl_pool_rele(dp, FTAG); + return (error); + } + + error = zfs_secpolicy_write_perms_ds(name, ds, perm, cr); + + dsl_dataset_rele(ds, FTAG); + dsl_pool_rele(dp, FTAG); + return (error); +} + +/* + * Policy for setting the security label property. + * + * Returns 0 for success, non-zero for access and other errors. + */ +static int +zfs_set_slabel_policy(const char *name, const char *strval, cred_t *cr) +{ +#ifdef HAVE_MLSLABEL + char ds_hexsl[MAXNAMELEN]; + bslabel_t ds_sl, new_sl; + boolean_t new_default = FALSE; + uint64_t zoned; + int needed_priv = -1; + int error; + + /* First get the existing dataset label. */ + error = dsl_prop_get(name, zfs_prop_to_name(ZFS_PROP_MLSLABEL), + 1, sizeof (ds_hexsl), &ds_hexsl, NULL); + if (error != 0) + return (SET_ERROR(EPERM)); + + if (strcasecmp(strval, ZFS_MLSLABEL_DEFAULT) == 0) + new_default = TRUE; + + /* The label must be translatable */ + if (!new_default && (hexstr_to_label(strval, &new_sl) != 0)) + return (SET_ERROR(EINVAL)); + + /* + * In a non-global zone, disallow attempts to set a label that + * doesn't match that of the zone; otherwise no other checks + * are needed. + */ + if (!INGLOBALZONE(curproc)) { + if (new_default || !blequal(&new_sl, CR_SL(CRED()))) + return (SET_ERROR(EPERM)); + return (0); + } + + /* + * For global-zone datasets (i.e., those whose zoned property is + * "off", verify that the specified new label is valid for the + * global zone. + */ + if (dsl_prop_get_integer(name, + zfs_prop_to_name(ZFS_PROP_ZONED), &zoned, NULL)) + return (SET_ERROR(EPERM)); + if (!zoned) { + if (zfs_check_global_label(name, strval) != 0) + return (SET_ERROR(EPERM)); + } + + /* + * If the existing dataset label is nondefault, check if the + * dataset is mounted (label cannot be changed while mounted). + * Get the zfsvfs_t; if there isn't one, then the dataset isn't + * mounted (or isn't a dataset, doesn't exist, ...). + */ + if (strcasecmp(ds_hexsl, ZFS_MLSLABEL_DEFAULT) != 0) { + objset_t *os; + static const char *setsl_tag = "setsl_tag"; + + /* + * Try to own the dataset; abort if there is any error, + * (e.g., already mounted, in use, or other error). + */ + error = dmu_objset_own(name, DMU_OST_ZFS, B_TRUE, B_TRUE, + setsl_tag, &os); + if (error != 0) + return (SET_ERROR(EPERM)); + + dmu_objset_disown(os, B_TRUE, setsl_tag); + + if (new_default) { + needed_priv = PRIV_FILE_DOWNGRADE_SL; *** 13292 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Feb 22 14:01: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 BA57E5555B1; Mon, 22 Feb 2021 14:01:52 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DkkPr2bBCz3QWf; Mon, 22 Feb 2021 14:01:52 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1614002510; bh=RshxKn7DxHBVrpQFHH9KW00K6KP1MchdXQIihxjjFDU=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=FkrMHOYnYdt4/NWzl9j+f5rkDLO22EtWp5Nwqftcsxd9ehF4hg6Qu2K+yQiHSb8if x21kGhKKCiMGRY86fdDGPLLVJRWqGLez6WhXp1FyaUvQYN0fgN8sCCqAkLm0BQbXKr 6LFTXGf5L6hG/4OENX+XzN301FigQMd4SfY4YFUE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from thor.intern.walstatt.dynvpn.de ([78.54.86.30]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MowGU-1lckN92ZY6-00qThr; Mon, 22 Feb 2021 15:01:49 +0100 Date: Mon, 22 Feb 2021 15:01:15 +0100 From: "O. Hartmann" To: Martin Matuska Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 Message-ID: <20210222150142.4b76b7c6@thor.intern.walstatt.dynvpn.de> In-Reply-To: <202102221202.11MC24EB071531@gitrepo.freebsd.org> References: <202102221202.11MC24EB071531@gitrepo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:H6bAXWu+woGj6FYzyVt9ydG9d011msmErMRVoTp63+Chr6c7Sio +FXNYrfG7Ox3Ojg82XJWB1trztPj0tplwuSl9GMkbOIacjSezTiouKljyQHKFQMQhVE2lrJ S754erfwzvSFl9PfTLAtDWUfPS4bNIX3gibsgwAfvaXQCQHRENJVrFsAiYHz14DQe70W+Fg yzDpwNUFiBm2gh1vl2qwA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:D+m0HsgFXjo=:gwdKAGPNriQZD5ExDy6pFE wkjs7BsZ2H5j8VfTCbdufHpoLp6zhJXPQBWMawG0PLQq9eSucw9r1O7R83w/wYEh7oH1JwMLJ 3lo0Fo76Lw1nQ4ONtq5slvSLTCiXuFpgPD26SPeiq6/DA+URopTKVqONhe0uiZcLdptv7EGtF 0u4zCn3xk+q++ixEQMK/RYoOpWODASfyAojYHkHZ8ojVv4UmwUh9CMxT6PnJwc8qvsfm9ZJy1 5en+KxICAuujSLUUhUTyMa097Maq3YSjpyQ3Nculea1fD7siWaE/iNujri4E7eec8b/sq0mvd Gp2rkl9U+sJlWYEcxAlWTnKK0M1MERuaNia0xAdNvAjgmhWccbdv3XFnXYA4RAbkoCi/vlEPk muzwxZb3hQ7iVy9QnS4OMZkkG25kmvpuAX0uXYoU2Phl986wvNYu1Q6vx2K7pAS5FgtxIavAx mG3cdBlmbzQsukFfOPt7NUXG+IifDd2mvuJ+CSAIVGYv8yunwQ2xaQFHEFuc9S8Xebkgv3zY6 OgZe3aOxwxLvskbkSd/CP1gHC+BZExesY1OKneN5U5jDBj4vgrzWQ5EU7hgeit1ks2pmsa3nb +/VVTByWjtCtS+PESOvsVXacGPlAMRZoJjtcIrQbG0a45GIw+1f/FrI1YNGZMYx+tIKopBF76 LYHe7YFN01QNDR0zxQiBfbyNJS4i677ID+j7SmNXzkTtsbqetj5R0QeP5N2O7LRyWrKPSdf3F 42Xfw31CiPK+gbkhQpe4eyFz9hyg8qPjfQg7iPsoSFeAJRtgRY9KmBH73ropnqeoRHNJ3Z2Sw nlk0Ft+wExka+tZz2RCNM0Wxp0rOde+1RFbxybHAE36qRsYXKqR1Ey4BimCS9eWtfPLFhIFtx iqlkmeu7MWug5blI5eVA== X-Rspamd-Queue-Id: 4DkkPr2bBCz3QWf 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: Mon, 22 Feb 2021 14:01:52 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIE1v biwgMjIgRmViIDIwMjEgMTI6MDI6MDQgR01UDQpNYXJ0aW4gTWF0dXNrYSA8bW1ARnJlZUJTRC5v cmc+IHNjaHJpZWI6DQoNCj4gVGhlIGJyYW5jaCBtYWluIGhhcyBiZWVuIHVwZGF0ZWQgYnkgbW06 DQo+IA0KPiBVUkw6IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9zcmMvY29tbWl0Lz9pZD1iYTI3 ZGQ4YmU4MjE3OTJlMTViZGFiZmFjNjlmZDZjYWIwY2Y5ZGQzDQo+IA0KPiBjb21taXQgYmEyN2Rk OGJlODIxNzkyZTE1YmRhYmZhYzY5ZmQ2Y2FiMGNmOWRkMw0KPiBNZXJnZTogYzAyYTI4NzU0YmMy IDA2MjY5MTdkMDc4Ng0KPiBBdXRob3I6ICAgICBNYXJ0aW4gTWF0dXNrYSA8bW1ARnJlZUJTRC5v cmc+DQo+IEF1dGhvckRhdGU6IDIwMjEtMDItMjIgMTE6MzU6NTYgKzAwMDANCj4gQ29tbWl0OiAg ICAgTWFydGluIE1hdHVza2EgPG1tQEZyZWVCU0Qub3JnPg0KPiBDb21taXREYXRlOiAyMDIxLTAy LTIyIDEyOjAxOjE3ICswMDAwDQo+IA0KPiAgICAgemZzOiBtZXJnZSBPcGVuWkZTIG1hc3Rlci05 MzEyZTBmZDENCj4gICAgIA0KPiAgICAgTm90YWJsZSB1cHN0cmVhbSBjaGFuZ2VzOg0KPiAgICAg ICA3Nzg4NjlmYTEgRml4IHJlcG9ydGluZyBvZiBtb3VudCBwcm9ncmVzcw0KPiAgICAgICBlN2Fk Y2NmN2YgRGlzYWJsZSB1c2Ugb2YgaGFyZHdhcmUgY3J5cHRvIG9mZmxvYWQgZHJpdmVycyBvbiBG cmVlQlNEDQo+ICAgICAgIDAzZTAyZTViNSBGaXggY2hlY2tzdW0gZXJyb3JzIG5vdCBiZWluZyBj b3VudGVkIG9uIHJlcGVhdGVkIHJlcGFpcg0KPiAgICAgICA2NGUwZmUxNGYgUmVzdG9yZSBGcmVl QlNEIHJlc291cmNlIHVzYWdlIGFjY291bnRpbmcNCj4gICAgICAgMTFmMmU5YTQ5IEZpeCBwYW5p YyBpZiBzY3J1YmJpbmcgYWZ0ZXIgcmVtb3ZpbmcgYSBzbG9nIGRldmljZQ0KPiAgICAgDQo+ICAg ICBNRkMgYWZ0ZXI6ICAgICAgMiB3ZWVrcw0KPiANCj4gIGNkZGwvbGliL2xpYnpwb29sL01ha2Vm aWxlICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAxICsNCj4gIHN0YW5kL2xpYnNhL3pmcy96 c3RkX3NoaW0uYyAgICAgICAgICAgICAgICAgICAgICAgIHwgICA1ICsNCj4gIHN5cy9jb250cmli L29wZW56ZnMvY21kL3pmcy96ZnNfbWFpbi5jICAgICAgICAgICAgIHwgICAzIC0NCj4gIHN5cy9j b250cmliL29wZW56ZnMvY21kL3p0ZXN0L3p0ZXN0LmMgICAgICAgICAgICAgIHwgMTEzICsrKysr KysrLQ0KPiAgLi4uL29wZW56ZnMvaW5jbHVkZS9vcy9mcmVlYnNkL3NwbC9zeXMvdWlvLmggICAg ICAgfCAgNDMgKy0tLQ0KPiAgc3lzL2NvbnRyaWIvb3Blbnpmcy9pbmNsdWRlL29zL2xpbnV4L3Nw bC9zeXMvdWlvLmggfCAgMjIgKy0NCj4gIC4uLi9pbmNsdWRlL29zL2xpbnV4L3pmcy9zeXMvemZz X2NvbnRleHRfb3MuaCAgICAgIHwgICAxIC0NCj4gIHN5cy9jb250cmliL29wZW56ZnMvaW5jbHVk ZS9zeXMvTWFrZWZpbGUuYW0gICAgICAgIHwgICAxICsNCj4gIHN5cy9jb250cmliL29wZW56ZnMv aW5jbHVkZS9zeXMvc3BhLmggICAgICAgICAgICAgIHwgICAzICstDQo+ICBzeXMvY29udHJpYi9v cGVuemZzL2luY2x1ZGUvc3lzL3Vpb19pbXBsLmggICAgICAgICB8ICAyMSArLQ0KPiAgc3lzL2Nv bnRyaWIvb3Blbnpmcy9pbmNsdWRlL3N5cy96ZnNfY29udGV4dC5oICAgICAgfCAgIDMgKy0NCj4g IHN5cy9jb250cmliL29wZW56ZnMvaW5jbHVkZS9zeXMvemZzX3JhY2N0LmggICAgICAgIHwgIDM3 ICsrKw0KPiAgc3lzL2NvbnRyaWIvb3Blbnpmcy9saWIvbGlienBvb2wvTWFrZWZpbGUuYW0gICAg ICAgfCAgIDEgKw0KPiAgc3lzL2NvbnRyaWIvb3Blbnpmcy9saWIvbGlienBvb2wvdXRpbC5jICAg ICAgICAgICAgfCAgNzQgKysrKy0tDQo+ICAuLi4vbGliL2xpYnp1dGlsL29zL2xpbnV4L3p1dGls X2RldmljZV9wYXRoX29zLmMgICB8IDI1MiArKysrKysrKysrKystLS0tLS0tLS0NCj4gIHN5cy9j b250cmliL29wZW56ZnMvbW9kdWxlL01ha2VmaWxlLmJzZCAgICAgICAgICAgIHwgICAxICsNCj4g IC4uLi9vcGVuemZzL21vZHVsZS9vcy9mcmVlYnNkL3NwbC9zcGxfdWlvLmMgICAgICAgIHwgICA5 ICstDQo+ICAuLi4vb3Blbnpmcy9tb2R1bGUvb3MvZnJlZWJzZC96ZnMvY3J5cHRvX29zLmMgICAg ICB8ICAxNSArLQ0KPiAgLi4uL29wZW56ZnMvbW9kdWxlL29zL2ZyZWVic2QvemZzL3pmc19yYWNj dC5jICAgICAgfCAgNTUgKysrKysNCj4gIC4uLi9vcGVuemZzL21vZHVsZS9vcy9saW51eC96ZnMv TWFrZWZpbGUuaW4gICAgICAgIHwgICAxICsNCj4gIC4uLi9vcGVuemZzL21vZHVsZS9vcy9saW51 eC96ZnMvemZzX3JhY2N0LmMgICAgICAgIHwgIDM2ICsrKw0KPiAgc3lzL2NvbnRyaWIvb3Blbnpm cy9tb2R1bGUvemZzL2FyYy5jICAgICAgICAgICAgICAgfCAgIDIgKw0KPiAgc3lzL2NvbnRyaWIv b3Blbnpmcy9tb2R1bGUvemZzL2RtdS5jICAgICAgICAgICAgICAgfCAgIDUgKw0KPiAgc3lzL2Nv bnRyaWIvb3Blbnpmcy9tb2R1bGUvemZzL2RzbF9zY2FuLmMgICAgICAgICAgfCAgIDYgKy0NCj4g IHN5cy9jb250cmliL29wZW56ZnMvbW9kdWxlL3pmcy9zcGFfY29uZmlnLmMgICAgICAgIHwgICAy ICstDQo+ICBzeXMvY29udHJpYi9vcGVuemZzL21vZHVsZS96ZnMvdmRldi5jICAgICAgICAgICAg ICB8ICAgOSArLQ0KPiAgc3lzL2NvbnRyaWIvb3Blbnpmcy9tb2R1bGUvemZzL3ZkZXZfaW5kaXJl Y3QuYyAgICAgfCAgMTAgKy0NCj4gIHN5cy9jb250cmliL29wZW56ZnMvbW9kdWxlL3pmcy92ZGV2 X3JhaWR6LmMgICAgICAgIHwgIDIwICstDQo+ICBzeXMvY29udHJpYi9vcGVuemZzL21vZHVsZS96 ZnMvdmRldl9yZWJ1aWxkLmMgICAgICB8ICAgMyArDQo+ICBzeXMvY29udHJpYi9vcGVuemZzL21v ZHVsZS96ZnMvemZzX2ZtLmMgICAgICAgICAgICB8ICA0NiArKystDQo+ICBzeXMvY29udHJpYi9v cGVuemZzL21vZHVsZS96ZnMvemZzX2lvY3RsLmMgICAgICAgICB8ICAgMiArLQ0KPiAgc3lzL2Nv bnRyaWIvb3Blbnpmcy9tb2R1bGUvemZzL3pmc192bm9wcy5jICAgICAgICAgfCAgIDIgKy0NCj4g IHN5cy9jb250cmliL29wZW56ZnMvbW9kdWxlL3pmcy96aW8uYyAgICAgICAgICAgICAgIHwgIDEx ICstDQo+ICBzeXMvY29udHJpYi9vcGVuemZzL3NjcmlwdHMvemZzLnNoICAgICAgICAgICAgICAg ICB8ICAgMiArLQ0KPiAgc3lzL2NvbnRyaWIvb3Blbnpmcy90ZXN0cy9ydW5maWxlcy9jb21tb24u cnVuICAgICAgfCAgIDMgKy0NCj4gIC4uLi9mdW5jdGlvbmFsL2NsaV9yb290L3pwb29sX2V2ZW50 cy9NYWtlZmlsZS5hbSAgIHwgICAzICstDQo+ICAuLi4venBvb2xfZXZlbnRzL3pwb29sX2V2ZW50 c19jbGVhcl9yZXRhaW5lZC5rc2ggICB8IDEzNSArKysrKysrKysrKw0KPiAgLi4uL3pwb29sX2V2 ZW50cy96cG9vbF9ldmVudHNfZHVwbGljYXRlcy5rc2ggICAgICAgfCAgMTEgLQ0KPiAgc3lzL21v ZHVsZXMvemZzL01ha2VmaWxlICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIDEgKw0KPiAg c3lzL21vZHVsZXMvemZzL3pmc19jb25maWcuaCAgICAgICAgICAgICAgICAgICAgICAgfCAgIDIg Ky0NCj4gIDQwIGZpbGVzIGNoYW5nZWQsIDcyNCBpbnNlcnRpb25zKCspLCAyNDggZGVsZXRpb25z KC0pDQo+IA0KPiBkaWZmIC0tY2MgY2RkbC9saWIvbGlienBvb2wvTWFrZWZpbGUNCj4gaW5kZXgg ZDliMmU2NzA5NGUzLDAwMDAwMDAwMDAwMC4uNjg5M2UzMWZmMjBhDQo+IG1vZGUgMTAwNjQ0LDAw MDAwMC4uMTAwNjQ0DQo+IC0tLSBhL2NkZGwvbGliL2xpYnpwb29sL01ha2VmaWxlDQo+ICsrKyBi L2NkZGwvbGliL2xpYnpwb29sL01ha2VmaWxlDQo+IEBAQCAtMSwyNjYgLTEsMCArMSwyNjcgQEBA DQo+ICArIyAkRnJlZUJTRCQNCj4gICsNCj4gICtaRlNUT1A9CSR7U1JDVE9QfS9zeXMvY29udHJp Yi9vcGVuemZzDQo+ICArDQo+ICArIyBaRlNfQ09NTU9OX1NSQ1MNCj4gICsuUEFUSDogJHtaRlNU T1B9L21vZHVsZS96ZnMNCj4gICsuUEFUSDogJHtaRlNUT1B9L21vZHVsZS96Y29tbW9uDQo+ICAr LlBBVEg6ICR7WkZTVE9QfS9tb2R1bGUvdW5pY29kZQ0KPiAgKyMgTFVBX1NSQ1MNCj4gICsuUEFU SDogJHtaRlNUT1B9L21vZHVsZS9sdWENCj4gICsjIFpTVERfU1JDUw0KPiAgKy5QQVRIOiAke1pG U1RPUH0vbW9kdWxlL3pzdGQNCj4gICsuUEFUSDogJHtaRlNUT1B9L21vZHVsZS96c3RkL2xpYg0K PiAgKw0KPiAgKy5QQVRIOiAke1pGU1RPUH0vbW9kdWxlL29zL2xpbnV4L3pmcw0KPiAgKw0KPiAg Ky5QQVRIOiAke1pGU1RPUH0vbGliL2xpYnpwb29sDQo+ICArDQo+ICArLmlmDQo+IGV4aXN0cygk e1NSQ1RPUH0vc3lzL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy9jb21tb24vYXRvbWljLyR7TUFD SElORV9BUkNIfS9vcGVuc29sYXJpc19hdG9taWMuUykNCj4gKy5QQVRIOiAke1NSQ1RPUH0vc3lz L2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy9jb21tb24vYXRvbWljLyR7TUFDSElORV9BUkNIfQ0K PiArQVRPTUlDX1NSQ1M9CW9wZW5zb2xhcmlzX2F0b21pYy5TICtBQ0ZMQUdTKz0JLVdhLC0tbm9l eGVjc3RhY2sNCj4gICsuZWxzZQ0KPiAgKy5QQVRIOiAke1NSQ1RPUH0vc3lzL2NkZGwvY29tcGF0 L29wZW5zb2xhcmlzL2tlcm4NCj4gICtBVE9NSUNfU1JDUz0Jb3BlbnNvbGFyaXNfYXRvbWljLmMN Cj4gICsuZW5kaWYNCj4gICsNCj4gICsuaWYgJHtNQUNISU5FX0FSQ0h9ID09ICJwb3dlcnBjIiB8 fCAke01BQ0hJTkVfQVJDSH0gPT0gInBvd2VycGNzcGUiDQo+ICArIyBEb24ndCB3YXN0ZSBHT1Qg ZW50cmllcyBvbiBzbWFsbCBkYXRhLg0KPiAgK1BJQ0ZMQUc9CS1mUElDDQo+ICArLmVuZGlmDQo+ ICArDQo+ICArTElCPQkJenBvb2wNCj4gICsNCj4gICtVU0VSX0MgPSBcDQo+ICArCWtlcm5lbC5j IFwNCj4gICsJdGFza3EuYyBcDQo+ICArCXV0aWwuYw0KPiAgKw0KPiAgK0tFUk5FTF9DID0gXA0K PiAgKwl6ZmVhdHVyZV9jb21tb24uYyBcDQo+ICArCXpmc19jb211dGlsLmMgXA0KPiAgKwl6ZnNf ZGVsZWcuYyBcDQo+ICArCXpmc19mbGV0Y2hlci5jIFwNCj4gICsJemZzX2ZsZXRjaGVyX3N1cGVy c2NhbGFyLmMgXA0KPiAgKwl6ZnNfZmxldGNoZXJfc3VwZXJzY2FsYXI0LmMgXA0KPiAgKwl6ZnNf bmFtZWNoZWNrLmMgXA0KPiAgKwl6ZnNfcHJvcC5jIFwNCj4gICsJemZzX3pzdGQuYyBcDQo+ICAr CXpwb29sX3Byb3AuYyBcDQo+ICArCXpwcm9wX2NvbW1vbi5jIFwNCj4gICsJYWJkLmMgXA0KPiAg KwlhYmRfb3MuYyBcDQo+ICArCWFnZ3N1bS5jIFwNCj4gICsJYXJjLmMgXA0KPiAgKwlhcmNfb3Mu YyBcDQo+ICArCWJsa3B0ci5jIFwNCj4gICsJYnBsaXN0LmMgXA0KPiAgKwlicG9iai5jIFwNCj4g ICsJYnB0cmVlLmMgXA0KPiAgKwlidHJlZS5jIFwNCj4gICsJYnF1ZXVlLmMgXA0KPiAgKwljaXR5 aGFzaC5jIFwNCj4gICsJZGJ1Zi5jIFwNCj4gICsJZGJ1Zl9zdGF0cy5jIFwNCj4gICsJZGR0LmMg XA0KPiAgKwlkZHRfemFwLmMgXA0KPiAgKwlkbXUuYyBcDQo+ICArCWRtdV9kaWZmLmMgXA0KPiAg KwlkbXVfb2JqZWN0LmMgXA0KPiAgKwlkbXVfb2Jqc2V0LmMgXA0KPiAgKwlkbXVfcmVjdi5jIFwN Cj4gICsJZG11X3JlZGFjdC5jIFwNCj4gICsJZG11X3NlbmQuYyBcDQo+ICArCWRtdV90cmF2ZXJz ZS5jIFwNCj4gICsJZG11X3R4LmMgXA0KPiAgKwlkbXVfemZldGNoLmMgXA0KPiAgKwlkbm9kZS5j IFwNCj4gICsJZG5vZGVfc3luYy5jIFwNCj4gICsJZHNsX2Jvb2ttYXJrLmMgXA0KPiAgKwlkc2xf ZGF0YXNldC5jIFwNCj4gICsJZHNsX2RlYWRsaXN0LmMgXA0KPiAgKwlkc2xfZGVsZWcuYyBcDQo+ ICArCWRzbF9kaXIuYyBcDQo+ICArCWRzbF9jcnlwdC5jIFwNCj4gICsJZHNsX3Bvb2wuYyBcDQo+ ICArCWRzbF9wcm9wLmMgXA0KPiAgKwlkc2xfc2Nhbi5jIFwNCj4gICsJZHNsX3N5bmN0YXNrLmMg XA0KPiAgKwlkc2xfZGVzdHJveS5jIFwNCj4gICsJZHNsX3VzZXJob2xkLmMgXA0KPiAgKwllZG9u cl96ZnMuYyBcDQo+ICArCWhrZGYuYyBcDQo+ICArCWZtLmMgXA0KPiAgKwlnemlwLmMgXA0KPiAg KwlsempiLmMgXA0KPiAgKwlsejQuYyBcDQo+ICArCW1ldGFzbGFiLmMgXA0KPiAgKwltbXAuYyBc DQo+ICArCW11bHRpbGlzdC5jIFwNCj4gICsJb2JqbGlzdC5jIFwNCj4gICsJcGF0aG5hbWUuYyBc DQo+ICArCXJhbmdlX3RyZWUuYyBcDQo+ICArCXJlZmNvdW50LmMgXA0KPiAgKwlycndsb2NrLmMg XA0KPiAgKwlzYS5jIFwNCj4gICsJc2hhMjU2LmMgXA0KPiAgKwlza2Vpbl96ZnMuYyBcDQo+ICAr CXNwYS5jIFwNCj4gICsJc3BhX2Jvb3QuYyBcDQo+ICArCXNwYV9jaGVja3BvaW50LmMgXA0KPiAg KwlzcGFfY29uZmlnLmMgXA0KPiAgKwlzcGFfZXJybG9nLmMgXA0KPiAgKwlzcGFfaGlzdG9yeS5j IFwNCj4gICsJc3BhX2xvZ19zcGFjZW1hcC5jIFwNCj4gICsJc3BhX21pc2MuYyBcDQo+ICArCXNw YV9zdGF0cy5jIFwNCj4gICsJc3BhY2VfbWFwLmMgXA0KPiAgKwlzcGFjZV9yZWZ0cmVlLmMgXA0K PiAgKwl0eGcuYyBcDQo+ICArCXRyYWNlLmMgXA0KPiAgKwl1YmVyYmxvY2suYyBcDQo+ICArCXVu aXF1ZS5jIFwNCj4gICsJdmRldi5jIFwNCj4gICsJdmRldl9jYWNoZS5jIFwNCj4gICsJdmRldl9k cmFpZC5jIFwNCj4gICsJdmRldl9kcmFpZF9yYW5kLmMgXA0KPiAgKwl2ZGV2X2ZpbGUuYyBcDQo+ ICArCXZkZXZfaW5kaXJlY3RfYmlydGhzLmMgXA0KPiAgKwl2ZGV2X2luZGlyZWN0LmMgXA0KPiAg Kwl2ZGV2X2luZGlyZWN0X21hcHBpbmcuYyBcDQo+ICArCXZkZXZfaW5pdGlhbGl6ZS5jIFwNCj4g ICsJdmRldl9sYWJlbC5jIFwNCj4gICsJdmRldl9taXJyb3IuYyBcDQo+ICArCXZkZXZfbWlzc2lu Zy5jIFwNCj4gICsJdmRldl9xdWV1ZS5jIFwNCj4gICsJdmRldl9yYWlkei5jIFwNCj4gICsJdmRl dl9yYWlkel9tYXRoX2FhcmNoNjRfbmVvbi5jIFwNCj4gICsJdmRldl9yYWlkel9tYXRoX2FhcmNo NjRfbmVvbngyLmMgXA0KPiAgKwl2ZGV2X3JhaWR6X21hdGhfYXZ4Mi5jIFwNCj4gICsJdmRldl9y YWlkel9tYXRoX2F2eDUxMmJ3LmMgXA0KPiAgKwl2ZGV2X3JhaWR6X21hdGhfYXZ4NTEyZi5jIFwN Cj4gICsJdmRldl9yYWlkel9tYXRoLmMgXA0KPiAgKwl2ZGV2X3JhaWR6X21hdGhfc2NhbGFyLmMg XA0KPiAgKwl2ZGV2X3JlYnVpbGQuYyBcDQo+ICArCXZkZXZfcmVtb3ZhbC5jIFwNCj4gICsJdmRl dl9yb290LmMgXA0KPiAgKwl2ZGV2X3RyaW0uYyBcDQo+ICArCXphcC5jIFwNCj4gICsJemFwX2xl YWYuYyBcDQo+ICArCXphcF9taWNyby5jIFwNCj4gICsJemNwLmMgXA0KPiAgKwl6Y3BfZ2V0LmMg XA0KPiAgKwl6Y3BfZ2xvYmFsLmMgXA0KPiAgKwl6Y3BfaXRlci5jIFwNCj4gICsJemNwX3NldC5j IFwNCj4gICsJemNwX3N5bmN0YXNrLmMgXA0KPiAgKwl6ZmVhdHVyZS5jIFwNCj4gICsJemZzX2J5 dGVzd2FwLmMgXA0KPiAgKwl6ZnNfZGVidWcuYyBcDQo+ICArCXpmc19mbS5jIFwNCj4gICsJemZz X2Z1aWQuYyBcDQo+ICArCXpmc19zYS5jIFwNCj4gICsJemZzX3pub2RlLmMgXA0KPiArKwl6ZnNf cmFjY3QuYyBcDQo+ICArCXpmc19yYXRlbGltaXQuYyBcDQo+ICArCXpmc19ybG9jay5jIFwNCj4g ICsJemlsLmMgXA0KPiAgKwl6aW8uYyBcDQo+ICArCXppb19jaGVja3N1bS5jIFwNCj4gICsJemlv X2NvbXByZXNzLmMgXA0KPiAgKwl6aW9fY3J5cHQuYyBcDQo+ICArCXppb19pbmplY3QuYyBcDQo+ ICArCXpsZS5jIFwNCj4gICsJenJsb2NrLmMgXA0KPiAgKwl6c3RkLmMgXA0KPiAgKwl6dGhyLmMN Cj4gICsNCj4gICtBUkNIX0MgPQ0KPiAgKy5pZiAke01BQ0hJTkVfQVJDSH0gPT0gImFtZDY0IiB8 fCAke01BQ0hJTkVfQVJDSH0gPT0gImkzODYiDQo+ICArQVJDSF9DICs9IAl2ZGV2X3JhaWR6X21h dGhfc3NlMi5jIFwNCj4gICsJCXZkZXZfcmFpZHpfbWF0aF9zc3NlMy5jIFwNCj4gICsJCXpmc19m bGV0Y2hlcl9pbnRlbC5jIFwNCj4gICsJCXpmc19mbGV0Y2hlcl9zc2UuYyANCj4gICtDRkxBR1Mg Kz0gIC1ESEFWRV9TU0UyIAktREhBVkVfU1NFMw0KPiAgKy5lbmRpZg0KPiAgKy5pZiAke01BQ0hJ TkVfQVJDSH0gPT0gImFtZDY0Ig0KPiAgK0FSQ0hfQyArPQl6ZnNfZmxldGNoZXJfYXZ4NTEyLmMN Cj4gICtDRkxBR1MrPSAtREhBVkVfQVZYMiAtREhBVkVfQVZYIC1EX194ODZfNjQgLURIQVZFX0FW WDUxMkYgXA0KPiAgKwktREhBVkVfQVZYNTEyQlcNCj4gICsuZW5kaWYNCj4gICsuaWYgJHtNQUNI SU5FX0NQVUFSQ0h9ID09ICJhYXJjaDY0Ig0KPiAgK0FSQ0hfQyArPQl6ZnNfZmxldGNoZXJfYWFy Y2g2NF9uZW9uLmMNCj4gICsuZW5kaWYNCj4gICsNCj4gICtMVUFfQyA9IFwNCj4gICsJbGFwaS5j IFwNCj4gICsJbGF1eGxpYi5jIFwNCj4gICsJbGJhc2VsaWIuYyBcDQo+ICArCWxjb2RlLmMgXA0K PiAgKwlsY29tcGF0LmMgXA0KPiAgKwlsY29yb2xpYi5jIFwNCj4gICsJbGN0eXBlLmMgXA0KPiAg KwlsZGVidWcuYyBcDQo+ICArCWxkby5jIFwNCj4gICsJbGZ1bmMuYyBcDQo+ICArCWxnYy5jIFwN Cj4gICsJbGxleC5jIFwNCj4gICsJbG1lbS5jIFwNCj4gICsJbG9iamVjdC5jIFwNCj4gICsJbG9w Y29kZXMuYyBcDQo+ICArCWxwYXJzZXIuYyBcDQo+ICArCWxzdGF0ZS5jIFwNCj4gICsJbHN0cmlu Zy5jIFwNCj4gICsJbHN0cmxpYi5jIFwNCj4gICsJbHRhYmxlLmMgXA0KPiAgKwlsdGFibGliLmMg XA0KPiAgKwlsdG0uYyBcDQo+ICArCWx2bS5jIFwNCj4gICsJbHppby5jDQo+ICArDQo+ICArVU5J Q09ERV9DID0gdThfdGV4dHByZXAuYyB1Y29udi5jDQo+ICArDQo+ICArU1JDUz0JCSR7VVNFUl9D fSAke0tFUk5FTF9DfSAke0xVQV9DfSAke1VOSUNPREVfQ30gJHtBUkNIX0N9DQo+ICArDQo+ICAr V0FSTlM/PQkJMg0KPiAgK0NGTEFHUys9IFwNCj4gICsJLURJTl9CQVNFIFwNCj4gICsJLUkke1pG U1RPUH0vaW5jbHVkZSBcDQo+ICArCS1JJHtaRlNUT1B9L2xpYi9saWJzcGwvaW5jbHVkZSBcDQo+ ICArCS1JJHtaRlNUT1B9L2xpYi9saWJzcGwvaW5jbHVkZS9vcy9mcmVlYnNkIFwNCj4gICsJLUkk e1NSQ1RPUH0vc3lzIFwNCj4gICsJLUkke1pGU1RPUH0vaW5jbHVkZS9vcy9mcmVlYnNkL3pmcyBc DQo+ICArCS1JJHtTUkNUT1B9L2NkZGwvY29tcGF0L29wZW5zb2xhcmlzL2luY2x1ZGUgXA0KPiAg KwktSSR7WkZTVE9QfS9tb2R1bGUvaWNwL2luY2x1ZGUgXA0KPiAgKwktaW5jbHVkZSAke1pGU1RP UH0vaW5jbHVkZS9vcy9mcmVlYnNkL3NwbC9zeXMvY2NvbXBpbGUuaCBcDQo+ICArCS1ESEFWRV9J U1NFVFVHSUQgXA0KPiAgKwktaW5jbHVkZSAke1NSQ1RPUH0vc3lzL21vZHVsZXMvemZzL3pmc19j b25maWcuaCBcDQo+ICArCS1JJHtTUkNUT1B9L3N5cy9tb2R1bGVzL3pmcyBcDQo+ICArCS1JJHta RlNUT1B9L2luY2x1ZGUvb3MvZnJlZWJzZC96ZnMgXA0KPiAgKwktRExJQl9aUE9PTF9CVUlMRCAt RFpGU19ERUJVRyBcDQo+ICArDQo+ICArIyBYWFg6IHB0aHJlYWQgZG9lc24ndCBoYXZlIG11dGV4 X293bmVkKCkgZXF1aXZhbGVudCwgc28gd2UgbmVlZCB0byBsb29rDQo+ICArIyAgICAgIGludG8g bGlidGhyIHByaXZhdGUgc3RydWN0dXJlcy4gVGhhdCdzIHNvb28gZXZpbCwgYnV0IGl0J3Mgb25s eSBmb3INCj4gICsjICAgICAgWkZTIGRlYnVnZ2luZyB0b29scyBuZWVkcy4NCj4gICtDRkxBR1Mr PQktRFdBTlRTX01VVEVYX09XTkVEDQo+ICArQ0ZMQUdTKz0JLUkke1NSQ1RPUH0vbGliL2xpYnB0 aHJlYWQvdGhyZWFkDQo+ICArQ0ZMQUdTKz0JLUkke1NSQ1RPUH0vbGliL2xpYnB0aHJlYWQvc3lz DQo+ICArQ0ZMQUdTKz0JLUkke1NSQ1RPUH0vbGliL2xpYnRoci9hcmNoLyR7TUFDSElORV9DUFVB UkNIfS9pbmNsdWRlDQo+ICArQ0ZMQUdTLmdjYys9CS1mbXMtZXh0ZW5zaW9ucw0KPiAgKw0KPiAg K0xJQkFERD0JCW1kIHB0aHJlYWQgeiBzcGwgaWNwIG52cGFpciBhdmwgdW1lbQ0KPiAgKw0KPiAg KyMgYXRvbWljLlMgZG9lc24ndCBsaWtlIHByb2ZpbGluZy4NCj4gICtNS19QUk9GSUxFPQlubw0K PiAgKw0KPiAgK0NTVEQ9CWM5OQ0KPiAgKw0KPiAgKyMgU2luY2UgdGhlcmUgYXJlIG1hbnkgYXNz ZXJ0cyBpbiB0aGlzIGxpYnJhcnksIGl0IG1ha2VzIG5vIHNlbnNlIHRvIGNvbXBpbGUNCj4gICsj IGl0IHdpdGhvdXQgZGVidWdnaW5nLg0KPiAgKw0KPiAgK0NGTEFHUys9CS1nIC1EREVCVUc9MQ0K PiAgKw0KPiAgK0NGTEFHUy56ZnNfenN0ZC5jPQktV25vLWNhc3QtcXVhbCAtV25vLXBvaW50ZXIt YXJpdGgNCj4gICtDRkxBR1MuenN0ZC5jKz0JLWZuby10cmVlLXZlY3Rvcml6ZQ0KPiAgKw0KPiAg Ky5pbmNsdWRlIDxic2QubGliLm1rPg0KPiBkaWZmIC0tY2Mgc3RhbmQvbGlic2EvemZzL3pzdGRf c2hpbS5jDQo+IGluZGV4IGI5NGRmNmY1MTkxMywwMDAwMDAwMDAwMDAuLjkxZjUxNzFhNzJiNQ0K PiBtb2RlIDEwMDY0NCwwMDAwMDAuLjEwMDY0NA0KPiAtLS0gYS9zdGFuZC9saWJzYS96ZnMvenN0 ZF9zaGltLmMNCj4gKysrIGIvc3RhbmQvbGlic2EvemZzL3pzdGRfc2hpbS5jDQo+IEBAQCAtMSw0 MCAtMSwwICsxLDQ1IEBAQA0KPiAgKy8qLQ0KPiAgKyAqIENvcHlyaWdodCAoYykgMjAyMCBNLiBX YXJuZXIgTG9zaCA8aW1wQEZyZWVCU0Qub3JnPg0KPiAgKyAqDQo+ICArICogUmVkaXN0cmlidXRp b24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0DQo+ ICArICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxv d2luZyBjb25kaXRpb25zDQo+ICArICogYXJlIG1ldDoNCj4gICsgKiAxLiBSZWRpc3RyaWJ1dGlv bnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodA0KPiAgKyAq ICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlz Y2xhaW1lci4NCj4gICsgKiAyLiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCBy ZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodA0KPiAgKyAqICAgIG5vdGljZSwgdGhpcyBsaXN0 IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGUNCj4gICsg KiAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0 aGUgZGlzdHJpYnV0aW9uLg0KPiAgKyAqDQo+ICArICogVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURF RCBCWSBUSEUgQVVUSE9SIEFORCBDT05UUklCVVRPUlMgYGBBUyBJUycnIEFORA0KPiAgKyAqIEFO WSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlU RUQgVE8sIFRIRQ0KPiAgKyAqIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkg QU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFDQo+ICArICogQVJFIERJU0NMQUlN RUQuICBJTiBOTyBFVkVOVCBTSEFMTCBUSEUgQVVUSE9SIE9SIENPTlRSSUJVVE9SUyBCRSBMSUFC TEUNCj4gICsgKiBGT1IgQU5ZIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUws IEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTA0KPiAgKyAqIERBTUFHRVMgKElOQ0xVRElORywg QlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTDQo+ICAr ICogT1IgU0VSVklDRVM7IExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVT UyBJTlRFUlJVUFRJT04pDQo+ICArICogSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWSBUSEVPUlkg T0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QNCj4gICsgKiBMSUFCSUxJ VFksIE9SIFRPUlQgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJ TiBBTlkgV0FZDQo+ICArICogT1VUIE9GIFRIRSBVU0UgT0YgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJ RiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRg0KPiAgKyAqIFNVQ0ggREFNQUdFLg0KPiAg KyAqDQo+ICArICovDQo+ICArI2luY2x1ZGUgPHN5cy9jZGVmcy5oPg0KPiAgK19fRkJTRElEKCIk RnJlZUJTRCQiKTsNCj4gICsNCj4gICsvKg0KPiAgKyAqIFNtYWxsIGFtb3VudCBvZiBzaGltIGNv ZGUgbmVlZGVkIHRvIGdldCB6ZnNfenN0ZC5jIHRvIGNvbXBpbGUuIFRoZXNlIGl0ZW1zDQo+ICAr ICogaGVyZSBzaG91bGQgYWxsIGJlIGRlZmluZWQgaW4gdGhlIFNQTCBvciBhcyBwYXJ0IG9mIGxp YnN0YW5kIHNvbWV3aGVyZSwgYnV0DQo+ICArICogYXJlbid0IGZvciByZWFzb25zIHRoYXQgaGF2 ZW4ndCBiZWVuIHRyYWNrZWQgZG93biB5ZXQuIElkZWFsbHksIHRoZXkgd291bGQNCj4gICsgKiBh bGwgZ28gYXdheSBhbmQgd2UnZCBjb21waWxlIHpmc196c3RkLmMgZGlyZWN0bHkuIEJhc2VkIG9u IGFuIG9yaWdpbmFsIGJ5DQo+ICArICogTWF0dCBNYWNleSwgYnV0IG9ubHkgdGhlICNpbmNsdWRl IHJlbWFpbnMgdW50b3VjaGVkIGZyb20gdGhhdC4NCj4gICsgKi8NCj4gICsNCj4gICsjZGVmaW5l IFpGU19NT0RVTEVfUEFSQU1fQVJHUyB2b2lkDQo+ICArdHlwZWRlZiBpbnQgYm9vbGVhbl90Owkv KiBUaGlzIG9uZSBtYXkgYmUgdG91Z2ggdG8gZ2V0IHJpZCBvZiAqLw0KPiAgKw0KPiArKy8qIFRP RE86IG9wZW56ZnMvaW5jbHVkZS9zeXMvdWlvX2ltcGwuaCBtdXN0IG5vdCBiZSBpbmNsdWRlZCAq Lw0KPiArKyNpZm5kZWYgX1NZU19VSU9fSU1QTF9IDQo+ICsrI2RlZmluZSBfU1lTX1VJT19JTVBM X0gNCj4gKysjZW5kaWYNCj4gKysNCj4gICsjaW5jbHVkZSA8Y29udHJpYi9vcGVuemZzL21vZHVs ZS96c3RkL3pmc196c3RkLmM+DQo+IGRpZmYgLS1jYyBzeXMvY29udHJpYi9vcGVuemZzL2luY2x1 ZGUvc3lzL3pmc19yYWNjdC5oDQo+IGluZGV4IDAwMDAwMDAwMDAwMCxjZmNkZDMzNmVhNDIuLmNm Y2RkMzM2ZWE0Mg0KPiBtb2RlIDAwMDAwMCwxMDA2NDQuLjEwMDY0NA0KPiAtLS0gYS9zeXMvY29u dHJpYi9vcGVuemZzL2luY2x1ZGUvc3lzL3pmc19yYWNjdC5oDQo+ICsrKyBiL3N5cy9jb250cmli L29wZW56ZnMvaW5jbHVkZS9zeXMvemZzX3JhY2N0LmgNCj4gZGlmZiAtLWNjIHN5cy9jb250cmli L29wZW56ZnMvbW9kdWxlL29zL2ZyZWVic2QvemZzL3pmc19yYWNjdC5jDQo+IGluZGV4IDAwMDAw MDAwMDAwMCxiNDZjYzA0NjI2OGUuLmI0NmNjMDQ2MjY4ZQ0KPiBtb2RlIDAwMDAwMCwxMDA2NDQu LjEwMDY0NA0KPiAtLS0gYS9zeXMvY29udHJpYi9vcGVuemZzL21vZHVsZS9vcy9mcmVlYnNkL3pm cy96ZnNfcmFjY3QuYw0KPiArKysgYi9zeXMvY29udHJpYi9vcGVuemZzL21vZHVsZS9vcy9mcmVl YnNkL3pmcy96ZnNfcmFjY3QuYw0KPiBkaWZmIC0tY2Mgc3lzL2NvbnRyaWIvb3Blbnpmcy9tb2R1 bGUvb3MvbGludXgvemZzL3pmc19yYWNjdC5jDQo+IGluZGV4IDAwMDAwMDAwMDAwMCw3ODk3ZTBm OWVkYzEuLjc4OTdlMGY5ZWRjMQ0KPiBtb2RlIDAwMDAwMCwxMDA2NDQuLjEwMDY0NA0KPiAtLS0g YS9zeXMvY29udHJpYi9vcGVuemZzL21vZHVsZS9vcy9saW51eC96ZnMvemZzX3JhY2N0LmMNCj4g KysrIGIvc3lzL2NvbnRyaWIvb3Blbnpmcy9tb2R1bGUvb3MvbGludXgvemZzL3pmc19yYWNjdC5j DQo+IGRpZmYgLS1jYyBzeXMvY29udHJpYi9vcGVuemZzL21vZHVsZS96ZnMvemZzX2lvY3RsLmMN Cj4gaW5kZXggMGUzNWZkMDY5Y2JiLDAwMDAwMDAwMDAwMC4uOTIyMjUzNDY5ZmJhDQo+IG1vZGUg MTAwNjQ0LDAwMDAwMC4uMTAwNjQ0DQo+IC0tLSBhL3N5cy9jb250cmliL29wZW56ZnMvbW9kdWxl L3pmcy96ZnNfaW9jdGwuYw0KPiArKysgYi9zeXMvY29udHJpYi9vcGVuemZzL21vZHVsZS96ZnMv emZzX2lvY3RsLmMNCj4gQEBAIC0xLDc2ODggLTEsMCArMSw3Njg4IEBAQA0KPiAgKy8qDQo+ICAr ICogQ0RETCBIRUFERVIgU1RBUlQNCj4gICsgKg0KPiAgKyAqIFRoZSBjb250ZW50cyBvZiB0aGlz IGZpbGUgYXJlIHN1YmplY3QgdG8gdGhlIHRlcm1zIG9mIHRoZQ0KPiAgKyAqIENvbW1vbiBEZXZl bG9wbWVudCBhbmQgRGlzdHJpYnV0aW9uIExpY2Vuc2UgKHRoZSAiTGljZW5zZSIpLg0KPiAgKyAq IFlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUg TGljZW5zZS4NCj4gICsgKg0KPiAgKyAqIFlvdSBjYW4gb2J0YWluIGEgY29weSBvZiB0aGUgbGlj ZW5zZSBhdCB1c3Ivc3JjL09QRU5TT0xBUklTLkxJQ0VOU0UNCj4gICsgKiBvciBodHRwOi8vd3d3 Lm9wZW5zb2xhcmlzLm9yZy9vcy9saWNlbnNpbmcuDQo+ICArICogU2VlIHRoZSBMaWNlbnNlIGZv ciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zDQo+ICArICogYW5k IGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KPiAgKyAqDQo+ICArICogV2hlbiBkaXN0 cmlidXRpbmcgQ292ZXJlZCBDb2RlLCBpbmNsdWRlIHRoaXMgQ0RETCBIRUFERVIgaW4gZWFjaA0K PiAgKyAqIGZpbGUgYW5kIGluY2x1ZGUgdGhlIExpY2Vuc2UgZmlsZSBhdCB1c3Ivc3JjL09QRU5T T0xBUklTLkxJQ0VOU0UuDQo+ICArICogSWYgYXBwbGljYWJsZSwgYWRkIHRoZSBmb2xsb3dpbmcg YmVsb3cgdGhpcyBDRERMIEhFQURFUiwgd2l0aCB0aGUNCj4gICsgKiBmaWVsZHMgZW5jbG9zZWQg YnkgYnJhY2tldHMgIltdIiByZXBsYWNlZCB3aXRoIHlvdXIgb3duIGlkZW50aWZ5aW5nDQo+ICAr ICogaW5mb3JtYXRpb246IFBvcnRpb25zIENvcHlyaWdodCBbeXl5eV0gW25hbWUgb2YgY29weXJp Z2h0IG93bmVyXQ0KPiAgKyAqDQo+ICArICogQ0RETCBIRUFERVIgRU5EDQo+ICArICovDQo+ICAr DQo+ICArLyoNCj4gICsgKiBDb3B5cmlnaHQgKGMpIDIwMDUsIDIwMTAsIE9yYWNsZSBhbmQvb3Ig aXRzIGFmZmlsaWF0ZXMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQo+ICArICogUG9ydGlvbnMgQ29w eXJpZ2h0IDIwMTEgTWFydGluIE1hdHVza2ENCj4gICsgKiBDb3B5cmlnaHQgMjAxNSwgT21uaVRJ IENvbXB1dGVyIENvbnN1bHRpbmcsIEluYy4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCj4gICsgKiBQ b3J0aW9ucyBDb3B5cmlnaHQgMjAxMiBQYXdlbCBKYWt1YiBEYXdpZGVrIDxwYXdlbEBkYXdpZGVr Lm5ldD4NCj4gICsgKiBDb3B5cmlnaHQgKGMpIDIwMTQsIDIwMTYgSm95ZW50LCBJbmMuIEFsbCBy aWdodHMgcmVzZXJ2ZWQuDQo+ICArICogQ29weXJpZ2h0IDIwMTYgTmV4ZW50YSBTeXN0ZW1zLCBJ bmMuICBBbGwgcmlnaHRzIHJlc2VydmVkLg0KPiAgKyAqIENvcHlyaWdodCAoYykgMjAxNCwgSm95 ZW50LCBJbmMuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQo+ICArICogQ29weXJpZ2h0IChjKSAyMDEx LCAyMDIwIGJ5IERlbHBoaXguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQo+ICArICogQ29weXJpZ2h0 IChjKSAyMDEzIGJ5IFNhc28gS2lzZWxrb3YuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQo+ICArICog Q29weXJpZ2h0IChjKSAyMDEzIFN0ZXZlbiBIYXJ0bGFuZC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4N Cj4gICsgKiBDb3B5cmlnaHQgKGMpIDIwMTQgSW50ZWdyb3MgW2ludGVncm9zLmNvbV0NCj4gICsg KiBDb3B5cmlnaHQgMjAxNiBUb29tYXMgU29vbWUgPHRzb29tZUBtZS5jb20+DQo+ICArICogQ29w eXJpZ2h0IChjKSAyMDE2IEFjdGlmaW8sIEluYy4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCj4gICsg KiBDb3B5cmlnaHQgKGMpIDIwMTgsIGxvbGkxMEsgPGV6b21vcmkubm96b211QGdtYWlsLmNvbT4u IEFsbCByaWdodHMgcmVzZXJ2ZWQuDQo+ICArICogQ29weXJpZ2h0IDIwMTcgUmFja1RvcCBTeXN0 ZW1zLg0KPiAgKyAqIENvcHlyaWdodCAoYykgMjAxNyBPcGVuLUUsIEluYy4gQWxsIFJpZ2h0cyBS ZXNlcnZlZC4NCj4gICsgKiBDb3B5cmlnaHQgKGMpIDIwMTkgRGF0dG8gSW5jLg0KPiAgKyAqIENv cHlyaWdodCAoYykgMjAxOSwgMjAyMCBieSBDaHJpc3RpYW4gU2Nod2Fyei4gQWxsIHJpZ2h0cyBy ZXNlcnZlZC4NCj4gICsgKiBDb3B5cmlnaHQgKGMpIDIwMTksIEtsYXJhIEluYy4NCj4gICsgKiBD b3B5cmlnaHQgKGMpIDIwMTksIEFsbGFuIEp1ZGUNCj4gICsgKi8NCj4gICsNCj4gICsvKg0KPiAg KyAqIFpGUyBpb2N0bHMuDQo+ICArICoNCj4gICsgKiBUaGlzIGZpbGUgaGFuZGxlcyB0aGUgaW9j dGxzIHRvIC9kZXYvemZzLCB1c2VkIGZvciBjb25maWd1cmluZyBaRlMgc3RvcmFnZQ0KPiAgKyAq IHBvb2xzIGFuZCBmaWxlc3lzdGVtcywgZS5nLiB3aXRoIC9zYmluL3pmcyBhbmQgL3NiaW4venBv b2wuDQo+ICArICoNCj4gICsgKiBUaGVyZSBhcmUgdHdvIHdheXMgdGhhdCB3ZSBoYW5kbGUgaW9j dGxzOiB0aGUgbGVnYWN5IHdheSB3aGVyZSBhbG1vc3QNCj4gICsgKiBhbGwgb2YgdGhlIGxvZ2lj IGlzIGluIHRoZSBpb2N0bCBjYWxsYmFjaywgYW5kIHRoZSBuZXcgd2F5IHdoZXJlIG1vc3QNCj4g ICsgKiBvZiB0aGUgbWFyc2hhbGxpbmcgaXMgaGFuZGxlZCBpbiB0aGUgY29tbW9uIGVudHJ5IHBv aW50LCB6ZnNkZXZfaW9jdGwoKS4NCj4gICsgKg0KPiAgKyAqIE5vbi1sZWdhY3kgaW9jdGxzIHNo b3VsZCBiZSByZWdpc3RlcmVkIGJ5IGNhbGxpbmcNCj4gICsgKiB6ZnNfaW9jdGxfcmVnaXN0ZXIo KSBmcm9tIHpmc19pb2N0bF9pbml0KCkuICBUaGUgaW9jdGwgaXMgaW52b2tlZA0KPiAgKyAqIGZy b20gdXNlcmxhbmQgYnkgbHpjX2lvY3RsKCkuDQo+ICArICoNCj4gICsgKiBUaGUgcmVnaXN0cmF0 aW9uIGFyZ3VtZW50cyBhcmUgYXMgZm9sbG93czoNCj4gICsgKg0KPiAgKyAqIGNvbnN0IGNoYXIg Km5hbWUNCj4gICsgKiAgIFRoZSBuYW1lIG9mIHRoZSBpb2N0bC4gIFRoaXMgaXMgdXNlZCBmb3Ig aGlzdG9yeSBsb2dnaW5nLiAgSWYgdGhlDQo+ICArICogICBpb2N0bCByZXR1cm5zIHN1Y2Nlc3Nm dWxseSAodGhlIGNhbGxiYWNrIHJldHVybnMgMCksIGFuZCBhbGxvd19sb2cNCj4gICsgKiAgIGlz IHRydWUsIHRoZW4gYSBoaXN0b3J5IGxvZyBlbnRyeSB3aWxsIGJlIHJlY29yZGVkIHdpdGggdGhl IGlucHV0ICYNCj4gICsgKiAgIG91dHB1dCBudmxpc3RzLiAgVGhlIGxvZyBlbnRyeSBjYW4gYmUg cHJpbnRlZCB3aXRoICJ6cG9vbCBoaXN0b3J5IC1pIi4NCj4gICsgKg0KPiAgKyAqIHpmc19pb2Nf dCBpb2MNCj4gICsgKiAgIFRoZSBpb2N0bCByZXF1ZXN0IG51bWJlciwgd2hpY2ggdXNlcmxhbmQg d2lsbCBwYXNzIHRvIGlvY3RsKDIpLg0KPiAgKyAqICAgV2Ugd2FudCBuZXdlciB2ZXJzaW9ucyBv ZiBsaWJ6ZnMgYW5kIGxpYnpmc19jb3JlIHRvIHJ1biBhZ2FpbnN0DQo+ICArICogICBleGlzdGlu ZyB6ZnMga2VybmVsIG1vZHVsZXMgKGkuZS4gYSBkZWZlcnJlZCByZWJvb3QgYWZ0ZXIgYW4gdXBk YXRlKS4NCj4gICsgKiAgIFRoZXJlZm9yZSB0aGUgaW9jdGwgbnVtYmVycyBjYW5ub3QgY2hhbmdl IGZyb20gcmVsZWFzZSB0byByZWxlYXNlLg0KPiAgKyAqDQo+ICArICogemZzX3NlY3BvbGljeV9m dW5jX3QgKnNlY3BvbGljeQ0KPiAgKyAqICAgVGhpcyBmdW5jdGlvbiB3aWxsIGJlIGNhbGxlZCBi ZWZvcmUgdGhlIHpmc19pb2NfZnVuY190LCB0bw0KPiAgKyAqICAgZGV0ZXJtaW5lIGlmIHRoaXMg b3BlcmF0aW9uIGlzIHBlcm1pdHRlZC4gIEl0IHNob3VsZCByZXR1cm4gRVBFUk0NCj4gICsgKiAg IG9uIGZhaWx1cmUsIGFuZCAwIG9uIHN1Y2Nlc3MuICBDaGVja3MgaW5jbHVkZSBkZXRlcm1pbmlu ZyBpZiB0aGUNCj4gICsgKiAgIGRhdGFzZXQgaXMgdmlzaWJsZSBpbiB0aGlzIHpvbmUsIGFuZCBp ZiB0aGUgdXNlciBoYXMgZWl0aGVyIGFsbA0KPiAgKyAqICAgemZzIHByaXZpbGVnZXMgaW4gdGhl IHpvbmUgKFNZU19NT1VOVCksIG9yIGhhcyBiZWVuIGdyYW50ZWQgcGVybWlzc2lvbg0KPiAgKyAq ICAgdG8gZG8gdGhpcyBvcGVyYXRpb24gb24gdGhpcyBkYXRhc2V0IHdpdGggInpmcyBhbGxvdyIu DQo+ICArICoNCj4gICsgKiB6ZnNfaW9jX25hbWVjaGVja190IG5hbWVjaGVjaw0KPiAgKyAqICAg VGhpcyBzcGVjaWZpZXMgd2hhdCB0byBleHBlY3QgaW4gdGhlIHpmc19jbWRfdDp6Y19uYW1lIC0t IGEgcG9vbA0KPiAgKyAqICAgbmFtZSwgYSBkYXRhc2V0IG5hbWUsIG9yIG5vdGhpbmcuICBJZiB0 aGUgbmFtZSBpcyBub3Qgd2VsbC1mb3JtZWQsDQo+ICArICogICB0aGUgaW9jdGwgd2lsbCBmYWls IGFuZCB0aGUgY2FsbGJhY2sgd2lsbCBub3QgYmUgY2FsbGVkLg0KPiAgKyAqICAgVGhlcmVmb3Jl LCB0aGUgY2FsbGJhY2sgY2FuIGFzc3VtZSB0aGF0IHRoZSBuYW1lIGlzIHdlbGwtZm9ybWVkDQo+ ICArICogICAoZS5nLiBpcyBudWxsLXRlcm1pbmF0ZWQsIGRvZXNuJ3QgaGF2ZSBtb3JlIHRoYW4g b25lICdAJyBjaGFyYWN0ZXIsDQo+ICArICogICBkb2Vzbid0IGhhdmUgaW52YWxpZCBjaGFyYWN0 ZXJzKS4NCj4gICsgKg0KPiAgKyAqIHpmc19pb2NfcG9vbGNoZWNrX3QgcG9vbF9jaGVjaw0KPiAg KyAqICAgVGhpcyBzcGVjaWZpZXMgcmVxdWlyZW1lbnRzIG9uIHRoZSBwb29sIHN0YXRlLiAgSWYg dGhlIHBvb2wgZG9lcw0KPiAgKyAqICAgbm90IG1lZXQgdGhlbSAoaXMgc3VzcGVuZGVkIG9yIGlz IHJlYWRvbmx5KSwgdGhlIGlvY3RsIHdpbGwgZmFpbA0KPiAgKyAqICAgYW5kIHRoZSBjYWxsYmFj ayB3aWxsIG5vdCBiZSBjYWxsZWQuICBJZiBhbnkgY2hlY2tzIGFyZSBzcGVjaWZpZWQNCj4gICsg KiAgIChpLmUuIGl0IGlzIG5vdCBQT09MX0NIRUNLX05PTkUpLCBuYW1lY2hlY2sgbXVzdCBub3Qg YmUgTk9fTkFNRS4NCj4gICsgKiAgIE11bHRpcGxlIGNoZWNrcyBjYW4gYmUgb3ItZWQgdG9nZXRo ZXIgKGUuZy4gUE9PTF9DSEVDS19TVVNQRU5ERUQgfA0KPiAgKyAqICAgUE9PTF9DSEVDS19SRUFE T05MWSkuDQo+ICArICoNCj4gICsgKiB6ZnNfaW9jX2tleV90ICpudmxfa2V5cw0KPiAgKyAqICBU aGUgbGlzdCBvZiBleHBlY3RlZC9hbGxvd2FibGUgaW5udmwgaW5wdXQga2V5cy4gVGhpcyBsaXN0 IGlzIHVzZWQNCj4gICsgKiAgdG8gdmFsaWRhdGUgdGhlIG52bGlzdCBpbnB1dCB0byB0aGUgaW9j dGwuDQo+ICArICoNCj4gICsgKiBib29sZWFuX3Qgc211c2hfb3V0bnZsaXN0DQo+ICArICogICBJ ZiBzbXVzaF9vdXRudmxpc3QgaXMgdHJ1ZSwgdGhlbiB0aGUgb3V0cHV0IGlzIHByZXN1bWVkIHRv IGJlIGENCj4gICsgKiAgIGxpc3Qgb2YgZXJyb3JzLCBhbmQgaXQgd2lsbCBiZSAic211c2hlZCIg ZG93biB0byBmaXQgaW50byB0aGUNCj4gICsgKiAgIGNhbGxlcidzIGJ1ZmZlciwgYnkgcmVtb3Zp bmcgc29tZSBlbnRyaWVzIGFuZCByZXBsYWNpbmcgdGhlbSB3aXRoIGENCj4gICsgKiAgIHNpbmds ZSAiTl9NT1JFX0VSUk9SUyIgZW50cnkgaW5kaWNhdGluZyBob3cgbWFueSB3ZXJlIHJlbW92ZWQu ICBTZWUNCj4gICsgKiAgIG52bGlzdF9zbXVzaCgpIGZvciBkZXRhaWxzLiAgSWYgc211c2hfb3V0 bnZsaXN0IGlzIGZhbHNlLCBhbmQgdGhlDQo+ICArICogICBvdXRudmxpc3QgZG9lcyBub3QgZml0 IGludG8gdGhlIHVzZXJsYW5kLXByb3ZpZGVkIGJ1ZmZlciwgdGhlbiB0aGUNCj4gICsgKiAgIGlv Y3RsIHdpbGwgZmFpbCB3aXRoIEVOT01FTS4NCj4gICsgKg0KPiAgKyAqIHpmc19pb2NfZnVuY190 ICpmdW5jDQo+ICArICogICBUaGUgY2FsbGJhY2sgZnVuY3Rpb24gdGhhdCB3aWxsIHBlcmZvcm0g dGhlIG9wZXJhdGlvbi4NCj4gICsgKg0KPiAgKyAqICAgVGhlIGNhbGxiYWNrIHNob3VsZCByZXR1 cm4gMCBvbiBzdWNjZXNzLCBvciBhbiBlcnJvciBudW1iZXIgb24NCj4gICsgKiAgIGZhaWx1cmUu ICBJZiB0aGUgZnVuY3Rpb24gZmFpbHMsIHRoZSB1c2VybGFuZCBpb2N0bCB3aWxsIHJldHVybiAt MSwNCj4gICsgKiAgIGFuZCBlcnJubyB3aWxsIGJlIHNldCB0byB0aGUgY2FsbGJhY2sncyByZXR1 cm4gdmFsdWUuICBUaGUgY2FsbGJhY2sNCj4gICsgKiAgIHdpbGwgYmUgY2FsbGVkIHdpdGggdGhl IGZvbGxvd2luZyBhcmd1bWVudHM6DQo+ICArICoNCj4gICsgKiAgIGNvbnN0IGNoYXIgKm5hbWUN Cj4gICsgKiAgICAgVGhlIG5hbWUgb2YgdGhlIHBvb2wgb3IgZGF0YXNldCB0byBvcGVyYXRlIG9u LCBmcm9tDQo+ICArICogICAgIHpmc19jbWRfdDp6Y19uYW1lLiAgVGhlICduYW1lY2hlY2snIGFy Z3VtZW50IHNwZWNpZmllcyB0aGUNCj4gICsgKiAgICAgZXhwZWN0ZWQgdHlwZSAocG9vbCwgZGF0 YXNldCwgb3Igbm9uZSkuDQo+ICArICoNCj4gICsgKiAgIG52bGlzdF90ICppbm52bA0KPiAgKyAq ICAgICBUaGUgaW5wdXQgbnZsaXN0LCBkZXNlcmlhbGl6ZWQgZnJvbSB6ZnNfY21kX3Q6emNfbnZs aXN0X3NyYy4gIE9yDQo+ICArICogICAgIE5VTEwgaWYgbm8gaW5wdXQgbnZsaXN0IHdhcyBwcm92 aWRlZC4gIENoYW5nZXMgdG8gdGhpcyBudmxpc3QgYXJlDQo+ICArICogICAgIGlnbm9yZWQuICBJ ZiB0aGUgaW5wdXQgbnZsaXN0IGNvdWxkIG5vdCBiZSBkZXNlcmlhbGl6ZWQsIHRoZQ0KPiAgKyAq ICAgICBpb2N0bCB3aWxsIGZhaWwgYW5kIHRoZSBjYWxsYmFjayB3aWxsIG5vdCBiZSBjYWxsZWQu DQo+ICArICoNCj4gICsgKiAgIG52bGlzdF90ICpvdXRudmwNCj4gICsgKiAgICAgVGhlIG91dHB1 dCBudmxpc3QsIGluaXRpYWxseSBlbXB0eS4gIFRoZSBjYWxsYmFjayBjYW4gZmlsbCBpdCBpbiwN Cj4gICsgKiAgICAgYW5kIGl0IHdpbGwgYmUgcmV0dXJuZWQgdG8gdXNlcmxhbmQgYnkgc2VyaWFs aXppbmcgaXQgaW50bw0KPiAgKyAqICAgICB6ZnNfY21kX3Q6emNfbnZsaXN0X2RzdC4gIElmIGl0 IGlzIG5vbi1lbXB0eSwgYW5kIHNlcmlhbGl6YXRpb24NCj4gICsgKiAgICAgZmFpbHMgKGUuZy4g YmVjYXVzZSB0aGUgY2FsbGVyIGRpZG4ndCBzdXBwbHkgYSBsYXJnZSBlbm91Z2gNCj4gICsgKiAg ICAgYnVmZmVyKSwgdGhlbiB0aGUgb3ZlcmFsbCBpb2N0bCB3aWxsIGZhaWwuICBTZWUgdGhlDQo+ ICArICogICAgICdzbXVzaF9udmxpc3QnIGFyZ3VtZW50IGFib3ZlIGZvciBhZGRpdGlvbmFsIGJl aGF2aW9ycy4NCj4gICsgKg0KPiAgKyAqICAgICBUaGVyZSBhcmUgdHdvIHR5cGljYWwgdXNlcyBv ZiB0aGUgb3V0cHV0IG52bGlzdDoNCj4gICsgKiAgICAgICAtIFRvIHJldHVybiBzdGF0ZSwgZS5n LiBwcm9wZXJ0eSB2YWx1ZXMuICBJbiB0aGlzIGNhc2UsDQo+ICArICogICAgICAgICBzbXVzaF9v dXRudmxpc3Qgc2hvdWxkIGJlIGZhbHNlLiAgSWYgdGhlIGJ1ZmZlciB3YXMgbm90IGxhcmdlDQo+ ICArICogICAgICAgICBlbm91Z2gsIHRoZSBjYWxsZXIgd2lsbCByZWFsbG9jYXRlIGEgbGFyZ2Vy IGJ1ZmZlciBhbmQgdHJ5DQo+ICArICogICAgICAgICB0aGUgaW9jdGwgYWdhaW4uDQo+ICArICoN Cj4gICsgKiAgICAgICAtIFRvIHJldHVybiBtdWx0aXBsZSBlcnJvcnMgZnJvbSBhbiBpb2N0bCB3 aGljaCBtYWtlcyBvbi1kaXNrDQo+ICArICogICAgICAgICBjaGFuZ2VzLiAgSW4gdGhpcyBjYXNl LCBzbXVzaF9vdXRudmxpc3Qgc2hvdWxkIGJlIHRydWUuDQo+ICArICogICAgICAgICBJb2N0bHMg d2hpY2ggbWFrZSBvbi1kaXNrIG1vZGlmaWNhdGlvbnMgc2hvdWxkIGdlbmVyYWxseSBub3QNCj4g ICsgKiAgICAgICAgIHVzZSB0aGUgb3V0bnZsIGlmIHRoZXkgc3VjY2VlZCwgYmVjYXVzZSB0aGUg Y2FsbGVyIGNhbiBub3QNCj4gICsgKiAgICAgICAgIGRpc3Rpbmd1aXNoIGJldHdlZW4gdGhlIG9w ZXJhdGlvbiBmYWlsaW5nLCBhbmQNCj4gICsgKiAgICAgICAgIGRlc2VyaWFsaXphdGlvbiBmYWls aW5nLg0KPiAgKyAqDQo+ICArICogSU9DVEwgSW50ZXJmYWNlIEVycm9ycw0KPiAgKyAqDQo+ICAr ICogVGhlIGZvbGxvd2luZyBpb2N0bCBpbnB1dCBlcnJvcnMgY2FuIGJlIHJldHVybmVkOg0KPiAg KyAqICAgWkZTX0VSUl9JT0NfQ01EX1VOQVZBSUwJdGhlIGlvY3RsIG51bWJlciBpcyBub3Qgc3Vw cG9ydGVkIGJ5IGtlcm5lbA0KPiAgKyAqICAgWkZTX0VSUl9JT0NfQVJHX1VOQVZBSUwJYW4gaW5w dXQgYXJndW1lbnQgaXMgbm90IHN1cHBvcnRlZCBieSBrZXJuZWwNCj4gICsgKiAgIFpGU19FUlJf SU9DX0FSR19SRVFVSVJFRAlhIHJlcXVpcmVkIGlucHV0IGFyZ3VtZW50IGlzIG1pc3NpbmcNCj4g ICsgKiAgIFpGU19FUlJfSU9DX0FSR19CQURUWVBFCWFuIGlucHV0IGFyZ3VtZW50IGhhcyBhbiBp bnZhbGlkIHR5cGUNCj4gICsgKi8NCj4gICsNCj4gICsjaW5jbHVkZSA8c3lzL3R5cGVzLmg+DQo+ ICArI2luY2x1ZGUgPHN5cy9wYXJhbS5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvZXJybm8uaD4NCj4g LSAjaW5jbHVkZSA8c3lzL3Vpby5oPg0KPiArKyNpbmNsdWRlIDxzeXMvdWlvX2ltcGwuaD4NCj4g ICsjaW5jbHVkZSA8c3lzL2ZpbGUuaD4NCj4gICsjaW5jbHVkZSA8c3lzL2ttZW0uaD4NCj4gICsj aW5jbHVkZSA8c3lzL2Ntbl9lcnIuaD4NCj4gICsjaW5jbHVkZSA8c3lzL3N0YXQuaD4NCj4gICsj aW5jbHVkZSA8c3lzL3pmc19pb2N0bC5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvemZzX3F1b3RhLmg+ DQo+ICArI2luY2x1ZGUgPHN5cy96ZnNfdmZzb3BzLmg+DQo+ICArI2luY2x1ZGUgPHN5cy96ZnNf em5vZGUuaD4NCj4gICsjaW5jbHVkZSA8c3lzL3phcC5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvc3Bh Lmg+DQo+ICArI2luY2x1ZGUgPHN5cy9zcGFfaW1wbC5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvdmRl di5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvdmRldl9pbXBsLmg+DQo+ICArI2luY2x1ZGUgPHN5cy9k bXUuaD4NCj4gICsjaW5jbHVkZSA8c3lzL2RzbF9kaXIuaD4NCj4gICsjaW5jbHVkZSA8c3lzL2Rz bF9kYXRhc2V0Lmg+DQo+ICArI2luY2x1ZGUgPHN5cy9kc2xfcHJvcC5oPg0KPiAgKyNpbmNsdWRl IDxzeXMvZHNsX2RlbGVnLmg+DQo+ICArI2luY2x1ZGUgPHN5cy9kbXVfb2Jqc2V0Lmg+DQo+ICAr I2luY2x1ZGUgPHN5cy9kbXVfaW1wbC5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvZG11X3JlZGFjdC5o Pg0KPiAgKyNpbmNsdWRlIDxzeXMvZG11X3R4Lmg+DQo+ICArI2luY2x1ZGUgPHN5cy9zdW5kZGku aD4NCj4gICsjaW5jbHVkZSA8c3lzL3BvbGljeS5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvem9uZS5o Pg0KPiAgKyNpbmNsdWRlIDxzeXMvbnZwYWlyLmg+DQo+ICArI2luY2x1ZGUgPHN5cy9wYXRobmFt ZS5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvZnMvemZzLmg+DQo+ICArI2luY2x1ZGUgPHN5cy96ZnNf Y3RsZGlyLmg+DQo+ICArI2luY2x1ZGUgPHN5cy96ZnNfZGlyLmg+DQo+ICArI2luY2x1ZGUgPHN5 cy96ZnNfb25leGl0Lmg+DQo+ICArI2luY2x1ZGUgPHN5cy96dm9sLmg+DQo+ICArI2luY2x1ZGUg PHN5cy9kc2xfc2Nhbi5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvZm0vdXRpbC5oPg0KPiAgKyNpbmNs dWRlIDxzeXMvZHNsX2NyeXB0Lmg+DQo+ICArI2luY2x1ZGUgPHN5cy9ycndsb2NrLmg+DQo+ICAr I2luY2x1ZGUgPHN5cy96ZnNfZmlsZS5oPg0KPiAgKw0KPiAgKyNpbmNsdWRlIDxzeXMvZG11X3Jl Y3YuaD4NCj4gICsjaW5jbHVkZSA8c3lzL2RtdV9zZW5kLmg+DQo+ICArI2luY2x1ZGUgPHN5cy9k bXVfcmVjdi5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvZHNsX2Rlc3Ryb3kuaD4NCj4gICsjaW5jbHVk ZSA8c3lzL2RzbF9ib29rbWFyay5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvZHNsX3VzZXJob2xkLmg+ DQo+ICArI2luY2x1ZGUgPHN5cy96ZmVhdHVyZS5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvemNwLmg+ DQo+ICArI2luY2x1ZGUgPHN5cy96aW9fY2hlY2tzdW0uaD4NCj4gICsjaW5jbHVkZSA8c3lzL3Zk ZXZfcmVtb3ZhbC5oPg0KPiAgKyNpbmNsdWRlIDxzeXMvdmRldl9pbXBsLmg+DQo+ICArI2luY2x1 ZGUgPHN5cy92ZGV2X2luaXRpYWxpemUuaD4NCj4gICsjaW5jbHVkZSA8c3lzL3ZkZXZfdHJpbS5o Pg0KPiAgKw0KPiAgKyNpbmNsdWRlICJ6ZnNfbmFtZWNoZWNrLmgiDQo+ICArI2luY2x1ZGUgInpm c19wcm9wLmgiDQo+ICArI2luY2x1ZGUgInpmc19kZWxlZy5oIg0KPiAgKyNpbmNsdWRlICJ6ZnNf Y29tdXRpbC5oIg0KPiAgKw0KPiAgKyNpbmNsdWRlIDxzeXMvbHVhL2x1YS5oPg0KPiAgKyNpbmNs dWRlIDxzeXMvbHVhL2xhdXhsaWIuaD4NCj4gICsjaW5jbHVkZSA8c3lzL3pmc19pb2N0bF9pbXBs Lmg+DQo+ICArDQo+ICAra211dGV4X3QgemZzZGV2X3N0YXRlX2xvY2s7DQo+ICAremZzZGV2X3N0 YXRlX3QgKnpmc2Rldl9zdGF0ZV9saXN0Ow0KPiAgKw0KPiAgKy8qDQo+ICArICogTGltaXQgbWF4 aW11bSBudmxpc3Qgc2l6ZS4gIFdlIGRvbid0IHdhbnQgdXNlcnMgcGFzc2luZyBpbiBpbnNhbmUg dmFsdWVzDQo+ICArICogZm9yIHpjLT56Y19udmxpc3Rfc3JjX3NpemUsIHNpbmNlIHdlIHdpbGwg bmVlZCB0byBhbGxvY2F0ZSB0aGF0IG11Y2ggbWVtb3J5Lg0KPiAgKyAqIERlZmF1bHRzIHRvIDA9 YXV0byB3aGljaCBpcyBoYW5kbGVkIGJ5IHBsYXRmb3JtIGNvZGUuDQo+ICArICovDQo+ICArdW5z aWduZWQgbG9uZyB6ZnNfbWF4X252bGlzdF9zcmNfc2l6ZSA9IDA7DQo+ICArDQo+ICArLyoNCj4g ICsgKiBXaGVuIGxvZ2dpbmcgdGhlIG91dHB1dCBudmxpc3Qgb2YgYW4gaW9jdGwgaW4gdGhlIG9u LWRpc2sgaGlzdG9yeSwgbGltaXQNCj4gICsgKiB0aGUgbG9nZ2VkIHNpemUgdG8gdGhpcyBtYW55 IGJ5dGVzLiAgVGhpcyBtdXN0IGJlIGxlc3MgdGhlbiBETVVfTUFYX0FDQ0VTUy4NCj4gICsgKiBU aGlzIGFwcGxpZXMgcHJpbWFyaWx5IHRvIHpmc19pb2NfY2hhbm5lbF9wcm9ncmFtKCkuDQo+ICAr ICovDQo+ICArdW5zaWduZWQgbG9uZyB6ZnNfaGlzdG9yeV9vdXRwdXRfbWF4ID0gMTAyNCAqIDEw MjQ7DQo+ICArDQo+ICArdWludF90IHpmc19mc3luY2VyX2tleTsNCj4gICt1aW50X3QgemZzX2Fs bG93X2xvZ19rZXk7DQo+ICArDQo+ICArLyogREFUQV9UWVBFX0FOWSBpcyB1c2VkIHdoZW4gemtl eV90eXBlIGNhbiB2YXJ5LiAqLw0KPiAgKyNkZWZpbmUJREFUQV9UWVBFX0FOWQlEQVRBX1RZUEVf VU5LTk9XTg0KPiAgKw0KPiAgK3R5cGVkZWYgc3RydWN0IHpmc19pb2NfdmVjIHsNCj4gICsJemZz X2lvY19sZWdhY3lfZnVuY190CSp6dmVjX2xlZ2FjeV9mdW5jOw0KPiAgKwl6ZnNfaW9jX2Z1bmNf dAkJKnp2ZWNfZnVuYzsNCj4gICsJemZzX3NlY3BvbGljeV9mdW5jX3QJKnp2ZWNfc2VjcG9saWN5 Ow0KPiAgKwl6ZnNfaW9jX25hbWVjaGVja190CXp2ZWNfbmFtZWNoZWNrOw0KPiAgKwlib29sZWFu X3QJCXp2ZWNfYWxsb3dfbG9nOw0KPiAgKwl6ZnNfaW9jX3Bvb2xjaGVja190CXp2ZWNfcG9vbF9j aGVjazsNCj4gICsJYm9vbGVhbl90CQl6dmVjX3NtdXNoX291dG52bGlzdDsNCj4gICsJY29uc3Qg Y2hhcgkJKnp2ZWNfbmFtZTsNCj4gICsJY29uc3QgemZzX2lvY19rZXlfdAkqenZlY19udmxfa2V5 czsNCj4gICsJc2l6ZV90CQkJenZlY19udmxfa2V5X2NvdW50Ow0KPiAgK30gemZzX2lvY192ZWNf dDsNCj4gICsNCj4gICsvKiBUaGlzIGFycmF5IGlzIGluZGV4ZWQgYnkgemZzX3VzZXJxdW90YV9w cm9wX3QgKi8NCj4gICtzdGF0aWMgY29uc3QgY2hhciAqdXNlcnF1b3RhX3Blcm1zW10gPSB7DQo+ ICArCVpGU19ERUxFR19QRVJNX1VTRVJVU0VELA0KPiAgKwlaRlNfREVMRUdfUEVSTV9VU0VSUVVP VEEsDQo+ICArCVpGU19ERUxFR19QRVJNX0dST1VQVVNFRCwNCj4gICsJWkZTX0RFTEVHX1BFUk1f R1JPVVBRVU9UQSwNCj4gICsJWkZTX0RFTEVHX1BFUk1fVVNFUk9CSlVTRUQsDQo+ICArCVpGU19E RUxFR19QRVJNX1VTRVJPQkpRVU9UQSwNCj4gICsJWkZTX0RFTEVHX1BFUk1fR1JPVVBPQkpVU0VE LA0KPiAgKwlaRlNfREVMRUdfUEVSTV9HUk9VUE9CSlFVT1RBLA0KPiAgKwlaRlNfREVMRUdfUEVS TV9QUk9KRUNUVVNFRCwNCj4gICsJWkZTX0RFTEVHX1BFUk1fUFJPSkVDVFFVT1RBLA0KPiAgKwla RlNfREVMRUdfUEVSTV9QUk9KRUNUT0JKVVNFRCwNCj4gICsJWkZTX0RFTEVHX1BFUk1fUFJPSkVD VE9CSlFVT1RBLA0KPiAgK307DQo+ICArDQo+ICArc3RhdGljIGludCB6ZnNfaW9jX3VzZXJzcGFj ZV91cGdyYWRlKHpmc19jbWRfdCAqemMpOw0KPiAgK3N0YXRpYyBpbnQgemZzX2lvY19pZF9xdW90 YV91cGdyYWRlKHpmc19jbWRfdCAqemMpOw0KPiAgK3N0YXRpYyBpbnQgemZzX2NoZWNrX3NldHRh YmxlKGNvbnN0IGNoYXIgKm5hbWUsIG52cGFpcl90ICpwcm9wZXJ0eSwNCj4gICsgICAgY3JlZF90 ICpjcik7DQo+ICArc3RhdGljIGludCB6ZnNfY2hlY2tfY2xlYXJhYmxlKGNvbnN0IGNoYXIgKmRh dGFzZXQsIG52bGlzdF90ICpwcm9wcywNCj4gICsgICAgbnZsaXN0X3QgKiplcnJvcnMpOw0KPiAg K3N0YXRpYyBpbnQgemZzX2ZpbGxfenBscHJvcHNfcm9vdCh1aW50NjRfdCwgbnZsaXN0X3QgKiwg bnZsaXN0X3QgKiwNCj4gICsgICAgYm9vbGVhbl90ICopOw0KPiAgK2ludCB6ZnNfc2V0X3Byb3Bf bnZsaXN0KGNvbnN0IGNoYXIgKiwgenByb3Bfc291cmNlX3QsIG52bGlzdF90ICosIG52bGlzdF90 ICopOw0KPiAgK3N0YXRpYyBpbnQgZ2V0X252bGlzdCh1aW50NjRfdCBudmwsIHVpbnQ2NF90IHNp emUsIGludCBpZmxhZywgbnZsaXN0X3QgKipudnApOw0KPiAgKw0KPiAgK3N0YXRpYyB2b2lkDQo+ ICAraGlzdG9yeV9zdHJfZnJlZShjaGFyICpidWYpDQo+ICArew0KPiAgKwlrbWVtX2ZyZWUoYnVm LCBISVNfTUFYX1JFQ09SRF9MRU4pOw0KPiAgK30NCj4gICsNCj4gICtzdGF0aWMgY2hhciAqDQo+ ICAraGlzdG9yeV9zdHJfZ2V0KHpmc19jbWRfdCAqemMpDQo+ICArew0KPiAgKwljaGFyICpidWY7 DQo+ICArDQo+ICArCWlmICh6Yy0+emNfaGlzdG9yeSA9PSAwKQ0KPiAgKwkJcmV0dXJuIChOVUxM KTsNCj4gICsNCj4gICsJYnVmID0ga21lbV9hbGxvYyhISVNfTUFYX1JFQ09SRF9MRU4sIEtNX1NM RUVQKTsNCj4gICsJaWYgKGNvcHlpbnN0cigodm9pZCAqKSh1aW50cHRyX3QpemMtPnpjX2hpc3Rv cnksDQo+ICArCSAgICBidWYsIEhJU19NQVhfUkVDT1JEX0xFTiwgTlVMTCkgIT0gMCkgew0KPiAg KwkJaGlzdG9yeV9zdHJfZnJlZShidWYpOw0KPiAgKwkJcmV0dXJuIChOVUxMKTsNCj4gICsJfQ0K PiAgKw0KPiAgKwlidWZbSElTX01BWF9SRUNPUkRfTEVOIC0xXSA9ICdcMCc7DQo+ICArDQo+ICAr CXJldHVybiAoYnVmKTsNCj4gICt9DQo+ICArDQo+ICArLyoNCj4gICsgKiBSZXR1cm4gbm9uLXpl cm8gaWYgdGhlIHNwYSB2ZXJzaW9uIGlzIGxlc3MgdGhhbiByZXF1ZXN0ZWQgdmVyc2lvbi4NCj4g ICsgKi8NCj4gICtzdGF0aWMgaW50DQo+ICAremZzX2VhcmxpZXJfdmVyc2lvbihjb25zdCBjaGFy ICpuYW1lLCBpbnQgdmVyc2lvbikNCj4gICt7DQo+ICArCXNwYV90ICpzcGE7DQo+ICArDQo+ICAr CWlmIChzcGFfb3BlbihuYW1lLCAmc3BhLCBGVEFHKSA9PSAwKSB7DQo+ICArCQlpZiAoc3BhX3Zl cnNpb24oc3BhKSA8IHZlcnNpb24pIHsNCj4gICsJCQlzcGFfY2xvc2Uoc3BhLCBGVEFHKTsNCj4g ICsJCQlyZXR1cm4gKDEpOw0KPiAgKwkJfQ0KPiAgKwkJc3BhX2Nsb3NlKHNwYSwgRlRBRyk7DQo+ ICArCX0NCj4gICsJcmV0dXJuICgwKTsNCj4gICt9DQo+ICArDQo+ICArLyoNCj4gICsgKiBSZXR1 cm4gVFJVRSBpZiB0aGUgWlBMIHZlcnNpb24gaXMgbGVzcyB0aGFuIHJlcXVlc3RlZCB2ZXJzaW9u Lg0KPiAgKyAqLw0KPiAgK3N0YXRpYyBib29sZWFuX3QNCj4gICt6cGxfZWFybGllcl92ZXJzaW9u KGNvbnN0IGNoYXIgKm5hbWUsIGludCB2ZXJzaW9uKQ0KPiAgK3sNCj4gICsJb2Jqc2V0X3QgKm9z Ow0KPiAgKwlib29sZWFuX3QgcmMgPSBCX1RSVUU7DQo+ICArDQo+ICArCWlmIChkbXVfb2Jqc2V0 X2hvbGQobmFtZSwgRlRBRywgJm9zKSA9PSAwKSB7DQo+ICArCQl1aW50NjRfdCB6cGx2ZXJzaW9u Ow0KPiAgKw0KPiAgKwkJaWYgKGRtdV9vYmpzZXRfdHlwZShvcykgIT0gRE1VX09TVF9aRlMpIHsN Cj4gICsJCQlkbXVfb2Jqc2V0X3JlbGUob3MsIEZUQUcpOw0KPiAgKwkJCXJldHVybiAoQl9UUlVF KTsNCj4gICsJCX0NCj4gICsJCS8qIFhYWCByZWFkaW5nIGZyb20gbm9uLW93bmVkIG9ianNldCAq Lw0KPiAgKwkJaWYgKHpmc19nZXRfenBscHJvcChvcywgWkZTX1BST1BfVkVSU0lPTiwgJnpwbHZl cnNpb24pID09IDApDQo+ICArCQkJcmMgPSB6cGx2ZXJzaW9uIDwgdmVyc2lvbjsNCj4gICsJCWRt dV9vYmpzZXRfcmVsZShvcywgRlRBRyk7DQo+ICArCX0NCj4gICsJcmV0dXJuIChyYyk7DQo+ICAr fQ0KPiAgKw0KPiAgK3N0YXRpYyB2b2lkDQo+ICAremZzX2xvZ19oaXN0b3J5KHpmc19jbWRfdCAq emMpDQo+ICArew0KPiAgKwlzcGFfdCAqc3BhOw0KPiAgKwljaGFyICpidWY7DQo+ICArDQo+ICAr CWlmICgoYnVmID0gaGlzdG9yeV9zdHJfZ2V0KHpjKSkgPT0gTlVMTCkNCj4gICsJCXJldHVybjsN Cj4gICsNCj4gICsJaWYgKHNwYV9vcGVuKHpjLT56Y19uYW1lLCAmc3BhLCBGVEFHKSA9PSAwKSB7 DQo+ICArCQlpZiAoc3BhX3ZlcnNpb24oc3BhKSA+PSBTUEFfVkVSU0lPTl9aUE9PTF9ISVNUT1JZ KQ0KPiAgKwkJCSh2b2lkKSBzcGFfaGlzdG9yeV9sb2coc3BhLCBidWYpOw0KPiAgKwkJc3BhX2Ns b3NlKHNwYSwgRlRBRyk7DQo+ICArCX0NCj4gICsJaGlzdG9yeV9zdHJfZnJlZShidWYpOw0KPiAg K30NCj4gICsNCj4gICsvKg0KPiAgKyAqIFBvbGljeSBmb3IgdG9wLWxldmVsIHJlYWQgb3BlcmF0 aW9ucyAobGlzdCBwb29scykuICBSZXF1aXJlcyBubyBwcml2aWxlZ2VzLA0KPiAgKyAqIGFuZCBj YW4gYmUgdXNlZCBpbiB0aGUgbG9jYWwgem9uZSwgYXMgdGhlcmUgaXMgbm8gYXNzb2NpYXRlZCBk YXRhc2V0Lg0KPiAgKyAqLw0KPiAgKy8qIEFSR1NVU0VEICovDQo+ICArc3RhdGljIGludA0KPiAg K3pmc19zZWNwb2xpY3lfbm9uZSh6ZnNfY21kX3QgKnpjLCBudmxpc3RfdCAqaW5udmwsIGNyZWRf dCAqY3IpDQo+ICArew0KPiAgKwlyZXR1cm4gKDApOw0KPiAgK30NCj4gICsNCj4gICsvKg0KPiAg KyAqIFBvbGljeSBmb3IgZGF0YXNldCByZWFkIG9wZXJhdGlvbnMgKGxpc3QgY2hpbGRyZW4sIGdl dCBzdGF0aXN0aWNzKS4gIFJlcXVpcmVzDQo+ICArICogbm8gcHJpdmlsZWdlcywgYnV0IG11c3Qg YmUgdmlzaWJsZSBpbiB0aGUgbG9jYWwgem9uZS4NCj4gICsgKi8NCj4gICsvKiBBUkdTVVNFRCAq Lw0KPiAgK3N0YXRpYyBpbnQNCj4gICt6ZnNfc2VjcG9saWN5X3JlYWQoemZzX2NtZF90ICp6Yywg bnZsaXN0X3QgKmlubnZsLCBjcmVkX3QgKmNyKQ0KPiAgK3sNCj4gICsJaWYgKElOR0xPQkFMWk9O RShjdXJwcm9jKSB8fA0KPiAgKwkgICAgem9uZV9kYXRhc2V0X3Zpc2libGUoemMtPnpjX25hbWUs IE5VTEwpKQ0KPiAgKwkJcmV0dXJuICgwKTsNCj4gICsNCj4gICsJcmV0dXJuIChTRVRfRVJST1Io RU5PRU5UKSk7DQo+ICArfQ0KPiAgKw0KPiAgK3N0YXRpYyBpbnQNCj4gICt6ZnNfZG96b25lY2hl Y2tfaW1wbChjb25zdCBjaGFyICpkYXRhc2V0LCB1aW50NjRfdCB6b25lZCwgY3JlZF90ICpjcikN Cj4gICt7DQo+ICArCWludCB3cml0YWJsZSA9IDE7DQo+ICArDQo+ICArCS8qDQo+ICArCSAqIFRo ZSBkYXRhc2V0IG11c3QgYmUgdmlzaWJsZSBieSB0aGlzIHpvbmUgLS0gY2hlY2sgdGhpcyBmaXJz dA0KPiAgKwkgKiBzbyB0aGV5IGRvbid0IHNlZSBFUEVSTSBvbiBzb21ldGhpbmcgdGhleSBzaG91 bGRuJ3Qga25vdyBhYm91dC4NCj4gICsJICovDQo+ICArCWlmICghSU5HTE9CQUxaT05FKGN1cnBy b2MpICYmDQo+ICArCSAgICAhem9uZV9kYXRhc2V0X3Zpc2libGUoZGF0YXNldCwgJndyaXRhYmxl KSkNCj4gICsJCXJldHVybiAoU0VUX0VSUk9SKEVOT0VOVCkpOw0KPiAgKw0KPiAgKwlpZiAoSU5H TE9CQUxaT05FKGN1cnByb2MpKSB7DQo+ICArCQkvKg0KPiAgKwkJICogSWYgdGhlIGZzIGlzIHpv bmVkLCBvbmx5IHJvb3QgY2FuIGFjY2VzcyBpdCBmcm9tIHRoZQ0KPiAgKwkJICogZ2xvYmFsIHpv bmUuDQo+ICArCQkgKi8NCj4gICsJCWlmIChzZWNwb2xpY3lfemZzKGNyKSAmJiB6b25lZCkNCj4g ICsJCQlyZXR1cm4gKFNFVF9FUlJPUihFUEVSTSkpOw0KPiAgKwl9IGVsc2Ugew0KPiAgKwkJLyoN Cj4gICsJCSAqIElmIHdlIGFyZSBpbiBhIGxvY2FsIHpvbmUsIHRoZSAnem9uZWQnIHByb3BlcnR5 IG11c3QgYmUgc2V0Lg0KPiAgKwkJICovDQo+ICArCQlpZiAoIXpvbmVkKQ0KPiAgKwkJCXJldHVy biAoU0VUX0VSUk9SKEVQRVJNKSk7DQo+ICArDQo+ICArCQkvKiBtdXN0IGJlIHdyaXRhYmxlIGJ5 IHRoaXMgem9uZSAqLw0KPiAgKwkJaWYgKCF3cml0YWJsZSkNCj4gICsJCQlyZXR1cm4gKFNFVF9F UlJPUihFUEVSTSkpOw0KPiAgKwl9DQo+ICArCXJldHVybiAoMCk7DQo+ICArfQ0KPiAgKw0KPiAg K3N0YXRpYyBpbnQNCj4gICt6ZnNfZG96b25lY2hlY2soY29uc3QgY2hhciAqZGF0YXNldCwgY3Jl ZF90ICpjcikNCj4gICt7DQo+ICArCXVpbnQ2NF90IHpvbmVkOw0KPiAgKw0KPiAgKwlpZiAoZHNs X3Byb3BfZ2V0X2ludGVnZXIoZGF0YXNldCwgemZzX3Byb3BfdG9fbmFtZShaRlNfUFJPUF9aT05F RCksDQo+ICArCSAgICAmem9uZWQsIE5VTEwpKQ0KPiAgKwkJcmV0dXJuIChTRVRfRVJST1IoRU5P RU5UKSk7DQo+ICArDQo+ICArCXJldHVybiAoemZzX2Rvem9uZWNoZWNrX2ltcGwoZGF0YXNldCwg em9uZWQsIGNyKSk7DQo+ICArfQ0KPiAgKw0KPiAgK3N0YXRpYyBpbnQNCj4gICt6ZnNfZG96b25l Y2hlY2tfZHMoY29uc3QgY2hhciAqZGF0YXNldCwgZHNsX2RhdGFzZXRfdCAqZHMsIGNyZWRfdCAq Y3IpDQo+ICArew0KPiAgKwl1aW50NjRfdCB6b25lZDsNCj4gICsNCj4gICsJaWYgKGRzbF9wcm9w X2dldF9pbnRfZHMoZHMsIHpmc19wcm9wX3RvX25hbWUoWkZTX1BST1BfWk9ORUQpLCAmem9uZWQp KQ0KPiAgKwkJcmV0dXJuIChTRVRfRVJST1IoRU5PRU5UKSk7DQo+ICArDQo+ICArCXJldHVybiAo emZzX2Rvem9uZWNoZWNrX2ltcGwoZGF0YXNldCwgem9uZWQsIGNyKSk7DQo+ICArfQ0KPiAgKw0K PiAgK3N0YXRpYyBpbnQNCj4gICt6ZnNfc2VjcG9saWN5X3dyaXRlX3Blcm1zX2RzKGNvbnN0IGNo YXIgKm5hbWUsIGRzbF9kYXRhc2V0X3QgKmRzLA0KPiAgKyAgICBjb25zdCBjaGFyICpwZXJtLCBj cmVkX3QgKmNyKQ0KPiAgK3sNCj4gICsJaW50IGVycm9yOw0KPiAgKw0KPiAgKwllcnJvciA9IHpm c19kb3pvbmVjaGVja19kcyhuYW1lLCBkcywgY3IpOw0KPiAgKwlpZiAoZXJyb3IgPT0gMCkgew0K PiAgKwkJZXJyb3IgPSBzZWNwb2xpY3lfemZzKGNyKTsNCj4gICsJCWlmIChlcnJvciAhPSAwKQ0K PiAgKwkJCWVycm9yID0gZHNsX2RlbGVnX2FjY2Vzc19pbXBsKGRzLCBwZXJtLCBjcik7DQo+ICAr CX0NCj4gICsJcmV0dXJuIChlcnJvcik7DQo+ICArfQ0KPiAgKw0KPiAgK3N0YXRpYyBpbnQNCj4g ICt6ZnNfc2VjcG9saWN5X3dyaXRlX3Blcm1zKGNvbnN0IGNoYXIgKm5hbWUsIGNvbnN0IGNoYXIg KnBlcm0sIGNyZWRfdCAqY3IpDQo+ICArew0KPiAgKwlpbnQgZXJyb3I7DQo+ICArCWRzbF9kYXRh c2V0X3QgKmRzOw0KPiAgKwlkc2xfcG9vbF90ICpkcDsNCj4gICsNCj4gICsJLyoNCj4gICsJICog Rmlyc3QgZG8gYSBxdWljayBjaGVjayBmb3Igcm9vdCBpbiB0aGUgZ2xvYmFsIHpvbmUsIHdoaWNo DQo+ICArCSAqIGlzIGFsbG93ZWQgdG8gZG8gYWxsIHdyaXRlX3Blcm1zLiAgVGhpcyBlbnN1cmVz IHRoYXQgemZzX2lvY18qDQo+ICArCSAqIHdpbGwgZ2V0IHRvIGhhbmRsZSBub25leGlzdGVudCBk YXRhc2V0cy4NCj4gICsJICovDQo+ICArCWlmIChJTkdMT0JBTFpPTkUoY3VycHJvYykgJiYgc2Vj cG9saWN5X3pmcyhjcikgPT0gMCkNCj4gICsJCXJldHVybiAoMCk7DQo+ICArDQo+ICArCWVycm9y ID0gZHNsX3Bvb2xfaG9sZChuYW1lLCBGVEFHLCAmZHApOw0KPiAgKwlpZiAoZXJyb3IgIT0gMCkN Cj4gICsJCXJldHVybiAoZXJyb3IpOw0KPiAgKw0KPiAgKwllcnJvciA9IGRzbF9kYXRhc2V0X2hv bGQoZHAsIG5hbWUsIEZUQUcsICZkcyk7DQo+ICArCWlmIChlcnJvciAhPSAwKSB7DQo+ICArCQlk c2xfcG9vbF9yZWxlKGRwLCBGVEFHKTsNCj4gICsJCXJldHVybiAoZXJyb3IpOw0KPiAgKwl9DQo+ ICArDQo+ICArCWVycm9yID0gemZzX3NlY3BvbGljeV93cml0ZV9wZXJtc19kcyhuYW1lLCBkcywg cGVybSwgY3IpOw0KPiAgKw0KPiAgKwlkc2xfZGF0YXNldF9yZWxlKGRzLCBGVEFHKTsNCj4gICsJ ZHNsX3Bvb2xfcmVsZShkcCwgRlRBRyk7DQo+ICArCXJldHVybiAoZXJyb3IpOw0KPiAgK30NCj4g ICsNCj4gICsvKg0KPiAgKyAqIFBvbGljeSBmb3Igc2V0dGluZyB0aGUgc2VjdXJpdHkgbGFiZWwg cHJvcGVydHkuDQo+ICArICoNCj4gICsgKiBSZXR1cm5zIDAgZm9yIHN1Y2Nlc3MsIG5vbi16ZXJv IGZvciBhY2Nlc3MgYW5kIG90aGVyIGVycm9ycy4NCj4gICsgKi8NCj4gICtzdGF0aWMgaW50DQo+ ICAremZzX3NldF9zbGFiZWxfcG9saWN5KGNvbnN0IGNoYXIgKm5hbWUsIGNvbnN0IGNoYXIgKnN0 cnZhbCwgY3JlZF90ICpjcikNCj4gICt7DQo+ICArI2lmZGVmIEhBVkVfTUxTTEFCRUwNCj4gICsJ Y2hhcgkJZHNfaGV4c2xbTUFYTkFNRUxFTl07DQo+ICArCWJzbGFiZWxfdAlkc19zbCwgbmV3X3Ns Ow0KPiAgKwlib29sZWFuX3QJbmV3X2RlZmF1bHQgPSBGQUxTRTsNCj4gICsJdWludDY0X3QJem9u ZWQ7DQo+ICArCWludAkJbmVlZGVkX3ByaXYgPSAtMTsNCj4gICsJaW50CQllcnJvcjsNCj4gICsN Cj4gICsJLyogRmlyc3QgZ2V0IHRoZSBleGlzdGluZyBkYXRhc2V0IGxhYmVsLiAqLw0KPiAgKwll cnJvciA9IGRzbF9wcm9wX2dldChuYW1lLCB6ZnNfcHJvcF90b19uYW1lKFpGU19QUk9QX01MU0xB QkVMKSwNCj4gICsJICAgIDEsIHNpemVvZiAoZHNfaGV4c2wpLCAmZHNfaGV4c2wsIE5VTEwpOw0K PiAgKwlpZiAoZXJyb3IgIT0gMCkNCj4gICsJCXJldHVybiAoU0VUX0VSUk9SKEVQRVJNKSk7DQo+ ICArDQo+ICArCWlmIChzdHJjYXNlY21wKHN0cnZhbCwgWkZTX01MU0xBQkVMX0RFRkFVTFQpID09 IDApDQo+ICArCQluZXdfZGVmYXVsdCA9IFRSVUU7DQo+ICArDQo+ICArCS8qIFRoZSBsYWJlbCBt dXN0IGJlIHRyYW5zbGF0YWJsZSAqLw0KPiAgKwlpZiAoIW5ld19kZWZhdWx0ICYmIChoZXhzdHJf dG9fbGFiZWwoc3RydmFsLCAmbmV3X3NsKSAhPSAwKSkNCj4gICsJCXJldHVybiAoU0VUX0VSUk9S KEVJTlZBTCkpOw0KPiAgKw0KPiAgKwkvKg0KPiAgKwkgKiBJbiBhIG5vbi1nbG9iYWwgem9uZSwg ZGlzYWxsb3cgYXR0ZW1wdHMgdG8gc2V0IGEgbGFiZWwgdGhhdA0KPiAgKwkgKiBkb2Vzbid0IG1h dGNoIHRoYXQgb2YgdGhlIHpvbmU7IG90aGVyd2lzZSBubyBvdGhlciBjaGVja3MNCj4gICsJICog YXJlIG5lZWRlZC4NCj4gICsJICovDQo+ICArCWlmICghSU5HTE9CQUxaT05FKGN1cnByb2MpKSB7 DQo+ICArCQlpZiAobmV3X2RlZmF1bHQgfHwgIWJsZXF1YWwoJm5ld19zbCwgQ1JfU0woQ1JFRCgp KSkpDQo+ICArCQkJcmV0dXJuIChTRVRfRVJST1IoRVBFUk0pKTsNCj4gICsJCXJldHVybiAoMCk7 DQo+ICArCX0NCj4gICsNCj4gICsJLyoNCj4gICsJICogRm9yIGdsb2JhbC16b25lIGRhdGFzZXRz IChpLmUuLCB0aG9zZSB3aG9zZSB6b25lZCBwcm9wZXJ0eSBpcw0KPiAgKwkgKiAib2ZmIiwgdmVy aWZ5IHRoYXQgdGhlIHNwZWNpZmllZCBuZXcgbGFiZWwgaXMgdmFsaWQgZm9yIHRoZQ0KPiAgKwkg KiBnbG9iYWwgem9uZS4NCj4gICsJICovDQo+ICArCWlmIChkc2xfcHJvcF9nZXRfaW50ZWdlcihu YW1lLA0KPiAgKwkgICAgemZzX3Byb3BfdG9fbmFtZShaRlNfUFJPUF9aT05FRCksICZ6b25lZCwg TlVMTCkpDQo+ICArCQlyZXR1cm4gKFNFVF9FUlJPUihFUEVSTSkpOw0KPiAgKwlpZiAoIXpvbmVk KSB7DQo+ICArCQlpZiAoemZzX2NoZWNrX2dsb2JhbF9sYWJlbChuYW1lLCBzdHJ2YWwpICE9IDAp DQo+ICArCQkJcmV0dXJuIChTRVRfRVJST1IoRVBFUk0pKTsNCj4gICsJfQ0KPiAgKw0KPiAgKwkv Kg0KPiAgKwkgKiBJZiB0aGUgZXhpc3RpbmcgZGF0YXNldCBsYWJlbCBpcyBub25kZWZhdWx0LCBj aGVjayBpZiB0aGUNCj4gICsJICogZGF0YXNldCBpcyBtb3VudGVkIChsYWJlbCBjYW5ub3QgYmUg Y2hhbmdlZCB3aGlsZSBtb3VudGVkKS4NCj4gICsJICogR2V0IHRoZSB6ZnN2ZnNfdDsgaWYgdGhl cmUgaXNuJ3Qgb25lLCB0aGVuIHRoZSBkYXRhc2V0IGlzbid0DQo+ICArCSAqIG1vdW50ZWQgKG9y IGlzbid0IGEgZGF0YXNldCwgZG9lc24ndCBleGlzdCwgLi4uKS4NCj4gICsJICovDQo+ICArCWlm IChzdHJjYXNlY21wKGRzX2hleHNsLCBaRlNfTUxTTEFCRUxfREVGQVVMVCkgIT0gMCkgew0KPiAg KwkJb2Jqc2V0X3QgKm9zOw0KPiAgKwkJc3RhdGljIGNvbnN0IGNoYXIgKnNldHNsX3RhZyA9ICJz ZXRzbF90YWciOw0KPiAgKw0KPiAgKwkJLyoNCj4gICsJCSAqIFRyeSB0byBvd24gdGhlIGRhdGFz ZXQ7IGFib3J0IGlmIHRoZXJlIGlzIGFueSBlcnJvciwNCj4gICsJCSAqIChlLmcuLCBhbHJlYWR5 IG1vdW50ZWQsIGluIHVzZSwgb3Igb3RoZXIgZXJyb3IpLg0KPiAgKwkJICovDQo+ICArCQllcnJv ciA9IGRtdV9vYmpzZXRfb3duKG5hbWUsIERNVV9PU1RfWkZTLCBCX1RSVUUsIEJfVFJVRSwNCj4g ICsJCSAgICBzZXRzbF90YWcsICZvcyk7DQo+ICArCQlpZiAoZXJyb3IgIT0gMCkNCj4gICsJCQly ZXR1cm4gKFNFVF9FUlJPUihFUEVSTSkpOw0KPiAgKw0KPiAgKwkJZG11X29ianNldF9kaXNvd24o b3MsIEJfVFJVRSwgc2V0c2xfdGFnKTsNCj4gICsNCj4gICsJCWlmIChuZXdfZGVmYXVsdCkgew0K PiAgKwkJCW5lZWRlZF9wcml2ID0gUFJJVl9GSUxFX0RPV05HUkFERV9TTDsNCj4gKioqIDEzMjky IExJTkVTIFNLSVBQRUQgKioqDQo+IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fDQo+IGRldi1jb21taXRzLXNyYy1tYWluQGZyZWVic2Qub3JnIG1haWxpbmcg bGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4vbGlzdGluZm8vZGV2LWNv bW1pdHMtc3JjLW1haW4NCj4gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYW55IG1haWwgdG8gImRldi1j b21taXRzLXNyYy1tYWluLXVuc3Vic2NyaWJlQGZyZWVic2Qub3JnIg0KDQpPbiBGcmVlQlNEIDE0 LUNVUlJFTlQsIHdpdGggWkZTIHN0YXRpY2FsbHkgYnVpbHRpbiB0aGUga2VybmVsLCB0aGlzIGNv bW1pdCByZW5kZXJzICJtYWtlDQpidWlsZGtlcm5lbCIgdG8gZmFpbDoNCg0KWy4uLl0NCg0KPT09 PiBjYW0gKGFsbCkNCi0gLS0tIGtlcm5lbCAtLS0NCmxkOiBlcnJvcjogdW5kZWZpbmVkIHN5bWJv bDogemZzX3JhY2N0X3JlYWQNCj4+PiByZWZlcmVuY2VkIGJ5IGFyYy5jDQo+Pj4gICAgICAgICAg ICAgICBhcmMubzooYXJjX3JlYWQpDQotIC0tLSBtb2R1bGVzLWFsbCAtLS0NCi0gLS0tIGFsbF9z dWJkaXJfY2FyZGJ1cyAtLS0NCj09PT4gY2FyZGJ1cyAoYWxsKQ0KLSAtLS0ga2VybmVsIC0tLQ0K DQpsZDogZXJyb3I6IHVuZGVmaW5lZCBzeW1ib2w6IHpmc19yYWNjdF93cml0ZQ0KPj4+IHJlZmVy ZW5jZWQgYnkgZG11LmMNCj4+PiAgICAgICAgICAgICAgIGRtdS5vOihkbXVfYnVmX2hvbGRfYXJy YXlfYnlfZG5vZGUpDQo+Pj4gcmVmZXJlbmNlZCBieSBkbXUuYw0KPj4+ICAgICAgICAgICAgICAg ZG11Lm86KGRtdV9hc3NpZ25fYXJjYnVmX2J5X2Rub2RlKQ0KKioqIFtrZXJuZWxdIEVycm9yIGNv ZGUgMQ0KDQptYWtlWzJdOiBzdG9wcGVkIGluIC91c3Ivb2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQv c3lzL0NVUlJFTlQxNA0KLSAtLS0gbW9kdWxlcy1hbGwgLS0tDQoqKiogW21vZHVsZXMtYWxsXSBF cnJvciBjb2RlIDYNCg0KDQoNCi0gLS0gDQpPLiBIYXJ0bWFubg0KDQpJY2ggd2lkZXJzcHJlY2hl IGRlciBOdXR6dW5nIG9kZXIgw5xiZXJtaXR0bHVuZyBtZWluZXIgRGF0ZW4gZsO8cg0KV2VyYmV6 d2Vja2Ugb2RlciBmw7xyIGRpZSBNYXJrdC0gb2RlciBNZWludW5nc2ZvcnNjaHVuZyAowqcgMjgg QWJzLiA0IEJEU0cpLg0KLS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0NCg0KaUhVRUFSWUlB QjBXSVFTeThJQnhBUERrcVZCYVRKNDROMVpaUGJhNVJ3VUNZRE81UmdBS0NSQTROMVpaUGJhNQ0K Uno0L0FRRGhoYnNJV1FZWjNaZ3JNZnpTczBtNDEwQ3B2bzVtek9VMXlJSDNQSVhKMUFEL2JVUHgv UlVoRXVZWA0KMTdXbVFSNSt1dVVMOXcxL3JUTldwczViYVBIbWFBdz0NCj03aWd0DQotLS0tLUVO RCBQR1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-dev-commits-src-all@freebsd.org Mon Feb 22 14:07: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 65C7B55625A; Mon, 22 Feb 2021 14:07: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 4DkkX72VVWz3Qth; Mon, 22 Feb 2021 14:07: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 489D426C33; Mon, 22 Feb 2021 14:07: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 11ME7J8Q031515; Mon, 22 Feb 2021 14:07:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ME7JRD031514; Mon, 22 Feb 2021 14:07:19 GMT (envelope-from git) Date: Mon, 22 Feb 2021 14:07:19 GMT Message-Id: <202102221407.11ME7JRD031514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan Eßer Subject: git: a0ba293c2fa0 - main - Add missing entry for zfs_racct.c 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: a0ba293c2fa0c45532520f9a288f7422902c1ccc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 14:07:19 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=a0ba293c2fa0c45532520f9a288f7422902c1ccc commit a0ba293c2fa0c45532520f9a288f7422902c1ccc Author: Stefan Eßer AuthorDate: 2021-02-22 14:06:48 +0000 Commit: Stefan Eßer CommitDate: 2021-02-22 14:06:48 +0000 Add missing entry for zfs_racct.c --- sys/conf/files | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/conf/files b/sys/conf/files index 8501f6fa9c1a..58ec6f3caf2a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -217,6 +217,7 @@ contrib/openzfs/module/os/freebsd/zfs/zfs_dir.c optional zfs compile-with "${ZF contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}" From owner-dev-commits-src-all@freebsd.org Mon Feb 22 15:05: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 1C795541BA6; Mon, 22 Feb 2021 15:05: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 4Dklpr0GBvz3lXS; Mon, 22 Feb 2021 15:05: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 EFDCE27A98; Mon, 22 Feb 2021 15:05: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 11MF57u9009664; Mon, 22 Feb 2021 15:05:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MF57Fi009663; Mon, 22 Feb 2021 15:05:07 GMT (envelope-from git) Date: Mon, 22 Feb 2021 15:05:07 GMT Message-Id: <202102221505.11MF57Fi009663@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: 608c44f96e88 - main - m_uiotombuf_nomap(): Stop clearing PG_ZERO in newly allocated pages 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: 608c44f96e88f28f9607374a6c9327d13d3d3d0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 15:05:08 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=608c44f96e88f28f9607374a6c9327d13d3d3d0e commit 608c44f96e88f28f9607374a6c9327d13d3d3d0e Author: Mark Johnston AuthorDate: 2021-02-22 15:03:37 +0000 Commit: Mark Johnston CommitDate: 2021-02-22 15:04:46 +0000 m_uiotombuf_nomap(): Stop clearing PG_ZERO in newly allocated pages The caller should not be passing M_ZERO in the first place, so PG_ZERO will not be preserved by the page allocator and clearing it accomplishes nothing. Reviewed by: gallatin, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28808 --- sys/kern/uipc_mbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index f73bfab07eaf..5296aac0edc4 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1656,6 +1656,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) VM_ALLOC_WIRED; MPASS((flags & M_PKTHDR) == 0); + MPASS((how & M_ZERO) == 0); /* * len can be zero or an arbitrary large value bound by @@ -1709,7 +1710,6 @@ retry_page: goto retry_page; } } - pg_array[i]->flags &= ~PG_ZERO; mb->m_epg_pa[i] = VM_PAGE_TO_PHYS(pg_array[i]); mb->m_epg_npgs++; } From owner-dev-commits-src-all@freebsd.org Mon Feb 22 15:31: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 957C9542969; Mon, 22 Feb 2021 15:31: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 4DkmPq3rb6z3nk7; Mon, 22 Feb 2021 15:31: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 76F0F27BDC; Mon, 22 Feb 2021 15:31: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 11MFVxTa048363; Mon, 22 Feb 2021 15:31:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MFVxQU048362; Mon, 22 Feb 2021 15:31:59 GMT (envelope-from git) Date: Mon, 22 Feb 2021 15:31:59 GMT Message-Id: <202102221531.11MFVxQU048362@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: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template 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: aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 15:31:59 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 commit aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 Author: Ed Maste AuthorDate: 2021-02-20 18:49:31 +0000 Commit: Ed Maste CommitDate: 2021-02-22 15:29:56 +0000 git hooks: add "Fixes" trailer to commit message template A number of projects use "Fixes: " to identify a commit that is fixed by a given change. Adopt that convention. Differential Revision: https://reviews.freebsd.org/D28693 --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 4d1072700af0..761b4443cfd8 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -48,6 +48,7 @@ $(awk '1;/^#$/{exit}' $1) # Tested by: # Approved by: # Obtained from: +# Fixes: # MFC after: # MFH: # Relnotes: From owner-dev-commits-src-all@freebsd.org Mon Feb 22 15:50: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 6C55D5434ED; Mon, 22 Feb 2021 15:50: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 4Dkmpc2Prnz3qNk; Mon, 22 Feb 2021 15:50: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 45C2E27FE9; Mon, 22 Feb 2021 15:50: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 11MFo0xY063261; Mon, 22 Feb 2021 15:50:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MFo03I063245; Mon, 22 Feb 2021 15:50:00 GMT (envelope-from git) Date: Mon, 22 Feb 2021 15:50:00 GMT Message-Id: <202102221550.11MFo03I063245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: 808d4aad1022 - main - xen-blkback: fix leak of grant maps on ring setup failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 808d4aad1022a2a33d222663b0c9badde30b9d45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 15:50:00 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=808d4aad1022a2a33d222663b0c9badde30b9d45 commit 808d4aad1022a2a33d222663b0c9badde30b9d45 Author: Roger Pau Monné AuthorDate: 2021-01-20 18:40:51 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-22 15:47:52 +0000 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Sponsored by: Citrix Systems R&D --- sys/dev/xen/blkback/blkback.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index 762f25302c00..678472cc2ab8 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -2893,10 +2893,31 @@ xbb_connect_ring(struct xbb_softc *xbb) ring_idx < xbb->ring_config.ring_pages; ring_idx++, gnt++) { if (gnt->status != 0) { + struct gnttab_unmap_grant_ref unmap[XBB_MAX_RING_PAGES]; + unsigned int i, j; + xbb->ring_config.va = 0; xenbus_dev_fatal(xbb->dev, EACCES, "Ring shared page mapping failed. " "Status %d.", gnt->status); + + /* Unmap everything to avoid leaking grant table maps */ + for (i = 0, j = 0; i < xbb->ring_config.ring_pages; + i++) { + if (gnts[i].status != GNTST_okay) + continue; + + unmap[j].host_addr = gnts[i].host_addr; + unmap[j].dev_bus_addr = gnts[i].dev_bus_addr; + unmap[j++].handle = gnts[i].handle; + } + if (j != 0) { + error = HYPERVISOR_grant_table_op( + GNTTABOP_unmap_grant_ref, unmap, j); + if (error != 0) + panic("Unable to unmap grants (%d)", + error); + } return (EACCES); } xbb->ring_config.handle[ring_idx] = gnt->handle; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 16:15: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 6F50E544099; Mon, 22 Feb 2021 16:15: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 4DknMw2mHjz3rwf; Mon, 22 Feb 2021 16:15: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 51CA167B; Mon, 22 Feb 2021 16:15: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 11MGFODe001911; Mon, 22 Feb 2021 16:15:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MGFOkP001910; Mon, 22 Feb 2021 16:15:24 GMT (envelope-from git) Date: Mon, 22 Feb 2021 16:15:24 GMT Message-Id: <202102221615.11MGFOkP001910@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: 9febbc454190 - main - Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. 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: 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 16:15:24 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9febbc4541903bb8e6b0f1c84988c98b2f7c96ef commit 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef Author: Hans Petter Selasky AuthorDate: 2021-02-22 10:58:46 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-22 16:13:58 +0000 Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. If a TCP packet must be retransmitted and the data length has changed in the retransmitted packet, due to the internal workings of TCP, typically when ACK packets are lost, then there is a 30% chance that the logic in GetDeltaSeqOut() will find the correct length, which is the last length received. This can be explained as follows: If a "227 Entering Passive Mode" packet must be retransmittet and the length changes from 51 to 50 bytes, for example, then we have three cases for the list scan in GetDeltaSeqOut(), depending on how many prior packets were received modulus N_LINK_TCP_DATA=3: case 1: index 0: original packet 51 index 1: retransmitted packet 50 index 2: not relevant case 2: index 0: not relevant index 1: original packet 51 index 2: retransmitted packet 50 case 3: index 0: retransmitted packet 50 index 1: not relevant index 2: original packet 51 This patch simply changes the searching order for TCP packets, always starting at the last received packet instead of any received packet, in GetDeltaAckIn() and GetDeltaSeqOut(). Else no functional changes. Discussed with: rscheff@ Submitted by: Andreas Longwitz PR: 230755 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/libalias/alias_db.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 1f85a606b2d5..c87273c863ca 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -1937,14 +1937,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, ack_diff_min; delta = 0; ack_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int ack_diff; @@ -1976,14 +1980,18 @@ TCP packet. To do this, a circular list of ACK numbers where the TCP packet size was altered is searched. */ - int i; + int i, j; int delta, seq_diff_min; delta = 0; seq_diff_min = -1; - for (i = 0; i < N_LINK_TCP_DATA; i++) { + i = lnk->data.tcp->state.index; + for (j = 0; j < N_LINK_TCP_DATA; j++) { struct ack_data_record x; + if (i == 0) + i = N_LINK_TCP_DATA; + i--; x = lnk->data.tcp->ack[i]; if (x.active == 1) { int seq_diff; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 16:28: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 ECB9E54431D; Mon, 22 Feb 2021 16:28: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 4Dknfh6RbMz3sNs; Mon, 22 Feb 2021 16:28: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 CFFB98BD; Mon, 22 Feb 2021 16:28: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 11MGSCiR015836; Mon, 22 Feb 2021 16:28:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MGSC0t015835; Mon, 22 Feb 2021 16:28:12 GMT (envelope-from git) Date: Mon, 22 Feb 2021 16:28:12 GMT Message-Id: <202102221628.11MGSC0t015835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: e540e45097e5 - stable/13 - MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e540e45097e54aaae553ea12468801ceab473d47 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 16:28:13 -0000 The branch stable/13 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=e540e45097e54aaae553ea12468801ceab473d47 commit e540e45097e54aaae553ea12468801ceab473d47 Author: Michal Krawczyk AuthorDate: 2021-02-18 09:00:58 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-22 15:59:42 +0000 MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table In the new ENA-based instances like c6gn, the vector table moved to a new PCIe bar - BAR1. Previously it was always located on the BAR0, so the resources were already allocated together with the registers. As the FreeBSD isn't doing any resource allocation behind the scenes, the driver is responsible to allocate them explicitly, before other parts of the OS (like the PCI code allocating MSIx) will be able to access them. To determine dynamically BAR on which the MSIx vector table is present the pci_msix_table_bar() is being used and the new BAR is allocated if needed. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc (cherry picked from commit 1c808fcd859f5ce24132a903a4c7c9996e0513b1) --- sys/dev/ena/ena.c | 21 +++++++++++++++++++++ sys/dev/ena/ena.h | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index b0e05f23b563..680eb0e9d049 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -299,6 +299,11 @@ ena_free_pci_resources(struct ena_adapter *adapter) bus_release_resource(pdev, SYS_RES_MEMORY, PCIR_BAR(ENA_REG_BAR), adapter->registers); } + + if (adapter->msix != NULL) { + bus_release_resource(pdev, SYS_RES_MEMORY, + adapter->msix_rid, adapter->msix); + } } static int @@ -3532,6 +3537,7 @@ ena_attach(device_t pdev) struct ena_adapter *adapter; struct ena_com_dev *ena_dev = NULL; uint32_t max_num_io_queues; + int msix_rid; int rid, rc; adapter = device_get_softc(pdev); @@ -3570,6 +3576,20 @@ ena_attach(device_t pdev) goto err_dev_free; } + /* MSIx vector table may reside on BAR0 with registers or on BAR1. */ + msix_rid = pci_msix_table_bar(pdev); + if (msix_rid != rid) { + adapter->msix = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, + &msix_rid, RF_ACTIVE); + if (unlikely(adapter->msix == NULL)) { + device_printf(pdev, + "unable to allocate bus resource: msix!\n"); + rc = ENOMEM; + goto err_pci_free; + } + adapter->msix_rid = msix_rid; + } + ena_dev->bus = malloc(sizeof(struct ena_bus), M_DEVBUF, M_WAITOK | M_ZERO); @@ -3735,6 +3755,7 @@ err_com_free: ena_com_mmio_reg_read_request_destroy(ena_dev); err_bus_free: free(ena_dev->bus, M_DEVBUF); +err_pci_free: ena_free_pci_resources(adapter); err_dev_free: free(ena_dev, M_DEVBUF); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 28da047e2e1b..f3e92f31341a 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 2 #define DRV_MODULE_VER_MINOR 3 -#define DRV_MODULE_VER_SUBMINOR 0 +#define DRV_MODULE_VER_SUBMINOR 1 #define DRV_MODULE_NAME "ena" @@ -398,6 +398,8 @@ struct ena_adapter { /* OS resources */ struct resource *memory; struct resource *registers; + struct resource *msix; + int msix_rid; struct sx global_lock; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 16:30: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 091BA5445AC; Mon, 22 Feb 2021 16:30: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 4Dknhz6sgyz3sgV; Mon, 22 Feb 2021 16:30: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 DE7A5953; Mon, 22 Feb 2021 16:30: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 11MGUBcl019533; Mon, 22 Feb 2021 16:30:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MGUBqS019527; Mon, 22 Feb 2021 16:30:11 GMT (envelope-from git) Date: Mon, 22 Feb 2021 16:30:11 GMT Message-Id: <202102221630.11MGUBqS019527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: 5de955fe436a - releng/13.0 - MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5de955fe436a208f93359e84a059b74bb0169ce6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 16:30:12 -0000 The branch releng/13.0 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=5de955fe436a208f93359e84a059b74bb0169ce6 commit 5de955fe436a208f93359e84a059b74bb0169ce6 Author: Michal Krawczyk AuthorDate: 2021-02-18 09:00:58 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-22 16:29:40 +0000 MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table In the new ENA-based instances like c6gn, the vector table moved to a new PCIe bar - BAR1. Previously it was always located on the BAR0, so the resources were already allocated together with the registers. As the FreeBSD isn't doing any resource allocation behind the scenes, the driver is responsible to allocate them explicitly, before other parts of the OS (like the PCI code allocating MSIx) will be able to access them. To determine dynamically BAR on which the MSIx vector table is present the pci_msix_table_bar() is being used and the new BAR is allocated if needed. Approved by: re (gjb) Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc (cherry picked from commit 1c808fcd859f5ce24132a903a4c7c9996e0513b1) (cherry picked from commit e540e45097e54aaae553ea12468801ceab473d47) --- sys/dev/ena/ena.c | 21 +++++++++++++++++++++ sys/dev/ena/ena.h | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index b0e05f23b563..680eb0e9d049 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -299,6 +299,11 @@ ena_free_pci_resources(struct ena_adapter *adapter) bus_release_resource(pdev, SYS_RES_MEMORY, PCIR_BAR(ENA_REG_BAR), adapter->registers); } + + if (adapter->msix != NULL) { + bus_release_resource(pdev, SYS_RES_MEMORY, + adapter->msix_rid, adapter->msix); + } } static int @@ -3532,6 +3537,7 @@ ena_attach(device_t pdev) struct ena_adapter *adapter; struct ena_com_dev *ena_dev = NULL; uint32_t max_num_io_queues; + int msix_rid; int rid, rc; adapter = device_get_softc(pdev); @@ -3570,6 +3576,20 @@ ena_attach(device_t pdev) goto err_dev_free; } + /* MSIx vector table may reside on BAR0 with registers or on BAR1. */ + msix_rid = pci_msix_table_bar(pdev); + if (msix_rid != rid) { + adapter->msix = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, + &msix_rid, RF_ACTIVE); + if (unlikely(adapter->msix == NULL)) { + device_printf(pdev, + "unable to allocate bus resource: msix!\n"); + rc = ENOMEM; + goto err_pci_free; + } + adapter->msix_rid = msix_rid; + } + ena_dev->bus = malloc(sizeof(struct ena_bus), M_DEVBUF, M_WAITOK | M_ZERO); @@ -3735,6 +3755,7 @@ err_com_free: ena_com_mmio_reg_read_request_destroy(ena_dev); err_bus_free: free(ena_dev->bus, M_DEVBUF); +err_pci_free: ena_free_pci_resources(adapter); err_dev_free: free(ena_dev, M_DEVBUF); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 28da047e2e1b..f3e92f31341a 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 2 #define DRV_MODULE_VER_MINOR 3 -#define DRV_MODULE_VER_SUBMINOR 0 +#define DRV_MODULE_VER_SUBMINOR 1 #define DRV_MODULE_NAME "ena" @@ -398,6 +398,8 @@ struct ena_adapter { /* OS resources */ struct resource *memory; struct resource *registers; + struct resource *msix; + int msix_rid; struct sx global_lock; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 16:30: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 68840544531; Mon, 22 Feb 2021 16:30: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 4DknjS2HwPz3spy; Mon, 22 Feb 2021 16:30: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 41924D21; Mon, 22 Feb 2021 16:30: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 11MGUarp023750; Mon, 22 Feb 2021 16:30:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MGUaKw023749; Mon, 22 Feb 2021 16:30:36 GMT (envelope-from git) Date: Mon, 22 Feb 2021 16:30:36 GMT Message-Id: <202102221630.11MGUaKw023749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 5d07525b81af - releng/13.0 - pkg(7): address minor nits (mostly clang-analyze complaints) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5d07525b81af284c2be4ae438bcf000785122cf2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 16:30:36 -0000 The branch releng/13.0 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5d07525b81af284c2be4ae438bcf000785122cf2 commit 5d07525b81af284c2be4ae438bcf000785122cf2 Author: Kyle Evans AuthorDate: 2021-02-12 00:58:27 +0000 Commit: Kyle Evans CommitDate: 2021-02-22 16:30:26 +0000 pkg(7): address minor nits (mostly clang-analyze complaints) - One (1) spurious whitespace. - One (1) occurrence of "random(3) bad, arc4random(3)" good. - Three (3) writes that will never be seen. The latter two points are complaints from clang-analyze. Switching to arc4random(3) is decidedly a good idea because we weren't doing any kind of PRNG seeding anyways. The discarded assignments are arguably good for future-proofing, but it's better to improve the S/N ratio from clang-analyze. Approved by: re (gjb) (cherry picked from commit b2c4ca8d2872bc4410626f2b1ceafa49de5828ce) (cherry picked from commit 9ec09b04df17b3601e6f5ae8664c6ab81e1e4783) --- usr.sbin/pkg/dns_utils.c | 5 +++-- usr.sbin/pkg/pkg.c | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/usr.sbin/pkg/dns_utils.c b/usr.sbin/pkg/dns_utils.c index 78ebdd426f8b..f3bde529daca 100644 --- a/usr.sbin/pkg/dns_utils.c +++ b/usr.sbin/pkg/dns_utils.c @@ -87,7 +87,7 @@ compute_weight(struct dns_srvinfo **d, int first, int last) int *chosen; totalweight = 0; - + for (i = 0; i <= last; i++) totalweight += d[i]->weight; @@ -98,7 +98,8 @@ compute_weight(struct dns_srvinfo **d, int first, int last) for (i = 0; i <= last; i++) { for (;;) { - chosen[i] = random() % (d[i]->weight * 100 / totalweight); + chosen[i] = arc4random_uniform(d[i]->weight * 100 / + totalweight); for (j = 0; j < i; j++) { if (chosen[i] == chosen[j]) break; diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 788fdb39ebb9..20f6396eb73b 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -434,9 +434,7 @@ sha256_fd(int fd, char out[SHA256_DIGEST_LENGTH * 2 + 1]) int ret; SHA256_CTX sha256; - my_fd = -1; fp = NULL; - r = 0; ret = 1; out[0] = '\0'; @@ -627,7 +625,6 @@ parse_cert(int fd) { ssize_t linelen; buf = NULL; - my_fd = -1; sc = NULL; line = NULL; linecap = 0; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 17:27: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 4B48A545F56; Mon, 22 Feb 2021 17:27: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 4Dkpyp1SWRz4RwS; Mon, 22 Feb 2021 17:27: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 24CA11821; Mon, 22 Feb 2021 17:27: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 11MHRExS094489; Mon, 22 Feb 2021 17:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MHRE2Y094488; Mon, 22 Feb 2021 17:27:14 GMT (envelope-from git) Date: Mon, 22 Feb 2021 17:27:14 GMT Message-Id: <202102221727.11MHRE2Y094488@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: 64649f028542 - stable/13 - zfs: fix panic if scrubbing after removing a slog device 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: 64649f0285424435634c2dfd39f49536fc2b50dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 17:27:14 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=64649f0285424435634c2dfd39f49536fc2b50dd commit 64649f0285424435634c2dfd39f49536fc2b50dd Author: Martin Matuska AuthorDate: 2021-02-22 17:05:07 +0000 Commit: Martin Matuska CommitDate: 2021-02-22 17:26:12 +0000 zfs: fix panic if scrubbing after removing a slog device From openzfs-master 11f2e9a4 commit message: vdev_ops: don't try to call vdev_op_hold or vdev_op_rele when NULL This prevents a panic after a SLOG add/removal on the root pool followed by a zpool scrub. When a SLOG is removed, a hole takes its place - the vdev_ops for a hole is vdev_hole_ops, which defines the handler functions of vdev_op_hold and vdev_op_rele as NULL. Patch Author: Patrick Mooney Obtained from: openzfs/zfs@11f2e9a491baa2ae3fc00f6b8b892fa91a852ca1 PR: 252396 MFS after: 3 days (direct commit) --- sys/contrib/openzfs/module/zfs/vdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/vdev.c b/sys/contrib/openzfs/module/zfs/vdev.c index 7ffe924212da..5b83f8c22fed 100644 --- a/sys/contrib/openzfs/module/zfs/vdev.c +++ b/sys/contrib/openzfs/module/zfs/vdev.c @@ -2393,7 +2393,7 @@ vdev_hold(vdev_t *vd) for (int c = 0; c < vd->vdev_children; c++) vdev_hold(vd->vdev_child[c]); - if (vd->vdev_ops->vdev_op_leaf) + if (vd->vdev_ops->vdev_op_leaf && vd->vdev_ops->vdev_op_hold != NULL) vd->vdev_ops->vdev_op_hold(vd); } @@ -2404,7 +2404,7 @@ vdev_rele(vdev_t *vd) for (int c = 0; c < vd->vdev_children; c++) vdev_rele(vd->vdev_child[c]); - if (vd->vdev_ops->vdev_op_leaf) + if (vd->vdev_ops->vdev_op_leaf && vd->vdev_ops->vdev_op_rele != NULL) vd->vdev_ops->vdev_op_rele(vd); } From owner-dev-commits-src-all@freebsd.org Mon Feb 22 17:41: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 A46A9546688; Mon, 22 Feb 2021 17:41: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 4DkqHJ4HFVz4SdQ; Mon, 22 Feb 2021 17:41: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 858981C8D; Mon, 22 Feb 2021 17:41: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 11MHfW6I020187; Mon, 22 Feb 2021 17:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MHfWSA020186; Mon, 22 Feb 2021 17:41:32 GMT (envelope-from git) Date: Mon, 22 Feb 2021 17:41:32 GMT Message-Id: <202102221741.11MHfWSA020186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 1ec3feb64826 - main - Update libm tests from NetBSD MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ec3feb64826d2a43d41e74684690985bf20e71c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 17:41:32 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1ec3feb64826d2a43d41e74684690985bf20e71c commit 1ec3feb64826d2a43d41e74684690985bf20e71c Author: Alex Richardson AuthorDate: 2021-02-22 17:19:06 +0000 Commit: Alex Richardson CommitDate: 2021-02-22 17:41:04 +0000 Update libm tests from NetBSD I did this without a full vendor update since that would cause too many conflicts. Since these files now almost match the NetBSD sources the next git subtree merge should work just fine. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28797 --- contrib/netbsd-tests/lib/libm/t_acos.c | 4 +- contrib/netbsd-tests/lib/libm/t_asin.c | 35 ++++-- contrib/netbsd-tests/lib/libm/t_bit.c | 102 +++++++++++++++ contrib/netbsd-tests/lib/libm/t_cabsl.cxx | 66 ++++++++++ contrib/netbsd-tests/lib/libm/t_cbrt.c | 95 +++++++++----- contrib/netbsd-tests/lib/libm/t_cos.c | 196 ++++++++++++++++++++++++----- contrib/netbsd-tests/lib/libm/t_cosh.c | 58 +++++---- contrib/netbsd-tests/lib/libm/t_exp.c | 52 ++++---- contrib/netbsd-tests/lib/libm/t_fe_round.c | 138 +++++++++++++++++++- contrib/netbsd-tests/lib/libm/t_fenv.c | 12 +- contrib/netbsd-tests/lib/libm/t_fmod.c | 8 +- contrib/netbsd-tests/lib/libm/t_ilogb.c | 8 +- contrib/netbsd-tests/lib/libm/t_ldexp.c | 37 +++--- contrib/netbsd-tests/lib/libm/t_libm.h | 6 +- contrib/netbsd-tests/lib/libm/t_log.c | 18 +-- contrib/netbsd-tests/lib/libm/t_round.c | 55 +++++++- contrib/netbsd-tests/lib/libm/t_scalbn.c | 58 ++++++--- contrib/netbsd-tests/lib/libm/t_sin.c | 91 +++++++++----- contrib/netbsd-tests/lib/libm/t_sinh.c | 56 ++++----- contrib/netbsd-tests/lib/libm/t_sqrt.c | 84 ++++++++----- contrib/netbsd-tests/lib/libm/t_tan.c | 86 +++++++++---- lib/msun/tests/Makefile | 2 + 22 files changed, 946 insertions(+), 321 deletions(-) diff --git a/contrib/netbsd-tests/lib/libm/t_acos.c b/contrib/netbsd-tests/lib/libm/t_acos.c index f051fb64df42..973f0245cdab 100644 --- a/contrib/netbsd-tests/lib/libm/t_acos.c +++ b/contrib/netbsd-tests/lib/libm/t_acos.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_acos.c,v 1.10 2014/03/05 20:14:46 dsl Exp $ */ +/* $NetBSD: t_acos.c,v 1.11 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ ATF_LIBM_TEST(acos_inrange, "Test acos/acosf(x) for some valid values") { 0, M_PI / 2, }, { 0.1, 1.470628905633337, }, { 0.5, 1.047197551196598, }, - { 0.99, 0.141539473324427, }, + { 0.99, 0.1415394733244273, }, }; unsigned int i; diff --git a/contrib/netbsd-tests/lib/libm/t_asin.c b/contrib/netbsd-tests/lib/libm/t_asin.c index 06de85216429..213b1f875439 100644 --- a/contrib/netbsd-tests/lib/libm/t_asin.c +++ b/contrib/netbsd-tests/lib/libm/t_asin.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_asin.c,v 1.3 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_asin.c,v 1.4 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -30,6 +30,7 @@ */ #include +#include #include static const struct { @@ -117,13 +118,14 @@ ATF_TC_HEAD(asin_inrange, tc) ATF_TC_BODY(asin_inrange, tc) { - const double eps = 1.0e-15; - double y; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - y = asin(values[i].x); - if (fabs(y - values[i].y) > eps) + double x = values[i].x; + double y = values[i].y; + + if (!(fabs((asin(x) - y)/y) <= eps)) atf_tc_fail_nonfatal("asin(%g) != %g", values[i].x, values[i].y); } @@ -230,16 +232,25 @@ ATF_TC_HEAD(asinf_inrange, tc) ATF_TC_BODY(asinf_inrange, tc) { - const float eps = 1.0e-6; - float x; - float y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - x = values[i].x; - y = values[i].y; - if (fabs(asinf(x) - y) > eps) - atf_tc_fail_nonfatal("asinf(%g) != %g", x, y); + float x = values[i].x; + float y = values[i].y; + +#ifdef __NetBSD__ + if (fabs(x) == 0.5) + atf_tc_expect_fail("asinf is busted," + " gives ~2ulp error"); +#endif + if (!(fabsf((asinf(x) - y)/y) <= eps)) { + atf_tc_fail_nonfatal("asinf(%.8g) = %.8g != %.8g," + " error=~%.1fulp", + x, asinf(x), y, fabsf(((asinf(x) - y)/y)/eps)); + } + if (fabs(x) == 0.5) + atf_tc_expect_pass(); } } diff --git a/contrib/netbsd-tests/lib/libm/t_bit.c b/contrib/netbsd-tests/lib/libm/t_bit.c new file mode 100644 index 000000000000..b6e0218f601c --- /dev/null +++ b/contrib/netbsd-tests/lib/libm/t_bit.c @@ -0,0 +1,102 @@ +/* $NetBSD: t_bit.c,v 1.1 2019/04/26 08:52:16 maya Exp $ */ + +/* + * Written by Maya Rashish + * Public domain. + * + * Testing signbit{,f,l} function correctly + */ + +#include +#include +#include +#include +#include +#include + +static const struct { + double input; + bool is_negative; +} values[] = { + { -1, true}, + { -123, true}, + { -123E6, true}, +#ifdef INFINITY + { -INFINITY, true}, + { INFINITY, false}, +#endif + { 123E6, false}, + { 0, false}, + { -FLT_MIN, true}, + { FLT_MIN, false}, + /* + * Cannot be accurately represented as float, + * but sign should be preserved + */ + { DBL_MAX, false}, + { -DBL_MAX, true}, +}; + +#ifdef __HAVE_LONG_DOUBLE +static const struct { + long double input; + bool is_negative; +} ldbl_values[] = { + { -LDBL_MIN, true}, + { LDBL_MIN, false}, + { LDBL_MAX, false}, + { -LDBL_MAX, true}, +}; +#endif + +ATF_TC(signbit); +ATF_TC_HEAD(signbit, tc) +{ + atf_tc_set_md_var(tc, "descr","Check that signbit functions correctly"); +} + +ATF_TC_BODY(signbit, tc) +{ + double iterator_d; + float iterator_f; + + for (unsigned int i = 0; i < __arraycount(values); i++) { + iterator_d = values[i].input; + iterator_f = (float) values[i].input; + if (signbit(iterator_f) != values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbitf is wrong" + " about the sign of %f", __func__, + __LINE__, i, iterator_f); + if (signbit(iterator_d) != values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbit is wrong" + "about the sign of %f", __func__, + __LINE__,i, iterator_d); + +#ifdef __HAVE_LONG_DOUBLE + long double iterator_l = values[i].input; + if (signbit(iterator_l) != values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbitl is wrong" + " about the sign of %Lf", __func__, + __LINE__, i, iterator_l); +#endif + } + +#ifdef __HAVE_LONG_DOUBLE + for (unsigned int i = 0; i < __arraycount(ldbl_values); i++) { + if (signbit(ldbl_values[i].input) != ldbl_values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbitl is" + "wrong about the sign of %Lf", + __func__, __LINE__, i, + ldbl_values[i].input); + } +#endif + +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, signbit); + + return atf_no_error(); +} diff --git a/contrib/netbsd-tests/lib/libm/t_cabsl.cxx b/contrib/netbsd-tests/lib/libm/t_cabsl.cxx new file mode 100644 index 000000000000..7dd119b1da3b --- /dev/null +++ b/contrib/netbsd-tests/lib/libm/t_cabsl.cxx @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Maya Rashish + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +/* + * Test that C++ "cabsl" is usable. PR lib/50646 + */ + +#include +#include + +ATF_TEST_CASE(cabsl); +ATF_TEST_CASE_HEAD(cabsl) +{ + set_md_var("descr", "Check that cabsl is usable from C++"); +} +ATF_TEST_CASE_BODY(cabsl) +{ + int sum = 0; + +#ifdef __HAVE_LONG_DOUBLE + std::complex cld(3.0,4.0); + sum += std::abs(cld); +#endif + std::complex cd(3.0,4.0); + sum += std::abs(cd); + + std::complex cf(3.0,4.0); + sum += std::abs(cf); + +#ifdef __HAVE_LONG_DOUBLE + ATF_REQUIRE_EQ(sum, 3*5); +#else + ATF_REQUIRE_EQ(sum, 2*5); +#endif +} + +ATF_INIT_TEST_CASES(tcs) +{ + ATF_ADD_TEST_CASE(tcs, cabsl); +} diff --git a/contrib/netbsd-tests/lib/libm/t_cbrt.c b/contrib/netbsd-tests/lib/libm/t_cbrt.c index 08e9faeb145c..639bc7e06517 100644 --- a/contrib/netbsd-tests/lib/libm/t_cbrt.c +++ b/contrib/netbsd-tests/lib/libm/t_cbrt.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_cbrt.c,v 1.3 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_cbrt.c,v 1.5 2018/11/15 05:14:20 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,9 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_cbrt.c,v 1.3 2014/03/03 10:39:08 martin Exp $"); +__RCSID("$NetBSD: t_cbrt.c,v 1.5 2018/11/15 05:14:20 riastradh Exp $"); #include +#include #include #include @@ -61,18 +62,26 @@ ATF_TC_HEAD(cbrt_pow, tc) ATF_TC_BODY(cbrt_pow, tc) { const double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 }; - const double eps = 1.0e-14; - double y, z; + /* Neither cbrt nor pow is required to be correctly rounded. */ + const double eps = 2*DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(x); i++) { - - y = cbrt(x[i]); - z = pow(x[i], 1.0 / 3.0); - - if (fabs(y - z) > eps) - atf_tc_fail_nonfatal("cbrt(%0.03f) != " - "pow(%0.03f, 1/3)\n", x[i], x[i]); + double x_cbrt = cbrt(x[i]); + double x_pow13 = pow(x[i], 1.0 / 3.0); + bool ok; + + if (x[i] == 0) { + ok = (x_cbrt == x_pow13); + } else { + ok = (fabs((x_cbrt - x_pow13)/x_cbrt) <= eps); + } + + if (!ok) { + atf_tc_fail_nonfatal("cbrt(%.17g) = %.17g != " + "pow(%.17g, 1/3) = %.17g\n", + x[i], x_cbrt, x[i], x_pow13); + } } } @@ -162,18 +171,27 @@ ATF_TC_HEAD(cbrtf_powf, tc) ATF_TC_BODY(cbrtf_powf, tc) { const float x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 }; - const float eps = 1.0e-5; - float y, z; + /* Neither cbrt nor pow is required to be correctly rounded. */ + const float eps = 2*FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(x); i++) { - - y = cbrtf(x[i]); - z = powf(x[i], 1.0 / 3.0); - - if (fabsf(y - z) > eps) - atf_tc_fail_nonfatal("cbrtf(%0.03f) != " - "powf(%0.03f, 1/3)\n", x[i], x[i]); + float x_cbrt = cbrtf(x[i]); + float x_pow13 = powf(x[i], 1.0 / 3.0); + bool ok; + + if (x[i] == 0) { + ok = (x_cbrt == x_pow13); + } else { + ok = (fabsf((x_cbrt - x_pow13)/x_cbrt) <= eps); + } + + if (!ok) { + atf_tc_fail_nonfatal("cbrtf(%.9g) = %.9g. != " + "powf(%.9g, 1/3) = %.9g\n", + (double)x[i], (double)x_cbrt, + (double)x[i], (double)x_pow13); + } } } @@ -264,27 +282,42 @@ ATF_TC_HEAD(cbrtl_powl, tc) ATF_TC_BODY(cbrtl_powl, tc) { const long double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 }; - const long double eps = 1.0e-15; - long double y, z; + /* Neither cbrt nor pow is required to be correctly rounded. */ + const long double eps = 2*LDBL_EPSILON; size_t i; #if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 && \ __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 atf_tc_expect_fail("test fails with clang 7-9 - bug 234040"); #endif - for (i = 0; i < __arraycount(x); i++) { - - y = cbrtl(x[i]); + long double x_cbrt = cbrtl(x[i]); #ifdef __FreeBSD__ - z = powl(x[i], (long double)1.0 / 3.0); + /* + * NetBSD doesn't have a real powl/cbrtl implementation, they + * just call the double version. On FreeBSD we have a real + * powl implementation so we have to cast the second argument + * to long double before dividing to get a more precise + * approximation of 1/3. + * TODO: upstream this diff. + */ + long double x_pow13 = powl(x[i], (long double)1.0 / 3.0); #else - z = powl(x[i], 1.0 / 3.0); + long double x_pow13 = powl(x[i], 1.0 / 3.0); #endif - - if (fabsl(y - z) > eps * fabsl(1 + x[i])) - atf_tc_fail_nonfatal("cbrtl(%0.03Lf) != " - "powl(%0.03Lf, 1/3)\n", x[i], x[i]); + bool ok; + + if (x[i] == 0) { + ok = (x_cbrt == x_pow13); + } else { + ok = (fabsl((x_cbrt - x_pow13)/x_cbrt) <= eps); + } + + if (!ok) { + atf_tc_fail_nonfatal("cbrtl(%.35Lg) = %.35Lg != " + "powl(%.35Lg, 1/3) = %.35Lg\n", + x[i], x_cbrt, x[i], x_pow13); + } } } diff --git a/contrib/netbsd-tests/lib/libm/t_cos.c b/contrib/netbsd-tests/lib/libm/t_cos.c index d99d60810eeb..ca5f0aab7ffa 100644 --- a/contrib/netbsd-tests/lib/libm/t_cos.c +++ b/contrib/netbsd-tests/lib/libm/t_cos.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_cos.c,v 1.4 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_cos.c,v 1.9 2019/05/27 00:10:36 maya Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,31 +29,138 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include +#include #include static const struct { int angle; double x; double y; + float fy; } angles[] = { - { -180, -3.141592653589793, -1.0000000000000000 }, - { -135, -2.356194490192345, -0.7071067811865476 }, - { -90, -1.570796326794897, 0.0000000000000000 }, - { -45, -0.785398163397448, 0.7071067811865476 }, - { 0, 0.000000000000000, 1.0000000000000000 }, - { 30, 0.523598775598299, 0.8660254037844386 }, - { 45, 0.785398163397448, 0.7071067811865476 }, - { 60, 1.047197551196598, 0.5000000000000000 }, - { 90, 1.570796326794897, 0.0000000000000000 }, - { 120, 2.094395102393195, -0.5000000000000000 }, - { 135, 2.356194490192345, -0.7071067811865476 }, - { 150, 2.617993877991494, -0.8660254037844386 }, - { 180, 3.141592653589793, -1.0000000000000000 }, - { 270, 4.712388980384690, 0.0000000000000000 }, - { 360, 6.283185307179586, 1.0000000000000000 } + { -180, -3.141592653589793, -1.0000000000000000, 999 }, + { -135, -2.356194490192345, -0.7071067811865476, 999 }, + { -90, -1.5707963267948966, 6.123233995736766e-17, -4.3711388e-08 }, + { -90, -1.5707963267948968, -1.6081226496766366e-16, -4.3711388e-08 }, + { -45, -0.785398163397448, 0.7071067811865478, 999 }, + { 0, 0.000000000000000, 1.0000000000000000, 999 }, + { 30, 0.523598775598299, 0.8660254037844386, 999 }, + { 45, 0.785398163397448, 0.7071067811865478, 999 }, + { 60, 1.0471975511965976, 0.5000000000000001, 999 }, + { 60, 1.0471975511965979, 0.4999999999999999, 999 }, + { 90, 1.570796326794897, -3.8285686989269494e-16, -4.3711388e-08 }, + { 120, 2.0943951023931953, -0.4999999999999998, 999 }, + { 120, 2.0943951023931957, -0.5000000000000002, 999 }, + { 135, 2.356194490192345, -0.7071067811865476, 999 }, + { 150, 2.617993877991494, -0.8660254037844386, 999 }, + { 180, 3.141592653589793, -1.0000000000000000, 999 }, + { 270, 4.712388980384690, -1.8369701987210297e-16, 1.1924881e-08 }, + { 360, 6.283185307179586, 1.0000000000000000, 999 }, }; +#ifdef __HAVE_LONG_DOUBLE +/* + * cosl(3) + */ +ATF_TC(cosl_angles); +ATF_TC_HEAD(cosl_angles, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test some selected angles"); +} + +ATF_TC_BODY(cosl_angles, tc) +{ + /* + * XXX The given data is for double, so take that + * into account and expect less precise results.. + */ + const long double eps = DBL_EPSILON; + size_t i; + + for (i = 0; i < __arraycount(angles); i++) { + int deg = angles[i].angle; + long double theta = angles[i].x; + long double cos_theta = angles[i].y; + + assert(cos_theta != 0); + if (!(fabsl((cosl(theta) - cos_theta)/cos_theta) <= eps)) { + atf_tc_fail_nonfatal("cos(%d deg = %.17Lg) = %.17Lg" + " != %.17Lg", + deg, theta, cosl(theta), cos_theta); + } + } +} + +ATF_TC(cosl_nan); +ATF_TC_HEAD(cosl_nan, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(NaN) == NaN"); +} + +ATF_TC_BODY(cosl_nan, tc) +{ + const long double x = 0.0L / 0.0L; + + ATF_CHECK(isnan(x) != 0); + ATF_CHECK(isnan(cosl(x)) != 0); +} + +ATF_TC(cosl_inf_neg); +ATF_TC_HEAD(cosl_inf_neg, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(-Inf) == NaN"); +} + +ATF_TC_BODY(cosl_inf_neg, tc) +{ + const long double x = -1.0L / 0.0L; + + ATF_CHECK(isnan(cosl(x)) != 0); +} + +ATF_TC(cosl_inf_pos); +ATF_TC_HEAD(cosl_inf_pos, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(+Inf) == NaN"); +} + +ATF_TC_BODY(cosl_inf_pos, tc) +{ + const long double x = 1.0L / 0.0L; + + ATF_CHECK(isnan(cosl(x)) != 0); +} + + +ATF_TC(cosl_zero_neg); +ATF_TC_HEAD(cosl_zero_neg, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(-0.0) == 1.0"); +} + +ATF_TC_BODY(cosl_zero_neg, tc) +{ + const long double x = -0.0L; + + ATF_CHECK(cosl(x) == 1.0); +} + +ATF_TC(cosl_zero_pos); +ATF_TC_HEAD(cosl_zero_pos, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(+0.0) == 1.0"); +} + +ATF_TC_BODY(cosl_zero_pos, tc) +{ + const long double x = 0.0L; + + ATF_CHECK(cosl(x) == 1.0); +} +#endif + /* * cos(3) */ @@ -65,14 +172,20 @@ ATF_TC_HEAD(cos_angles, tc) ATF_TC_BODY(cos_angles, tc) { - const double eps = 1.0e-15; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(angles); i++) { - - if (fabs(cos(angles[i].x) - angles[i].y) > eps) - atf_tc_fail_nonfatal("cos(%d deg) != %0.01f", - angles[i].angle, angles[i].y); + int deg = angles[i].angle; + double theta = angles[i].x; + double cos_theta = angles[i].y; + + assert(cos_theta != 0); + if (!(fabs((cos(theta) - cos_theta)/cos_theta) <= eps)) { + atf_tc_fail_nonfatal("cos(%d deg = %.17g) = %.17g" + " != %.17g", + deg, theta, cos(theta), cos_theta); + } } } @@ -154,18 +267,33 @@ ATF_TC_HEAD(cosf_angles, tc) ATF_TC_BODY(cosf_angles, tc) { - const float eps = 1.0e-7; - float x, y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(angles); i++) { - - x = angles[i].x; - y = angles[i].y; - - if (fabsf(cosf(x) - y) > eps) - atf_tc_fail_nonfatal("cosf(%d deg) != %0.01f", - angles[i].angle, angles[i].y); + int deg = angles[i].angle; + float theta = angles[i].x; + float cos_theta = angles[i].fy; + + /* + * Force rounding to float even if FLT_EVAL_METHOD=2, + * as is the case on i386. + * + * The volatile should not be necessary, by C99 Sec. + * 5.2.4.2.2. para. 8 on p. 24 which specifies that + * assignment and cast remove all extra range and precision, + * but seems to be needed to work around a compiler bug. + */ + volatile float result = cosf(theta); + + if (cos_theta == 999) + cos_theta = angles[i].y; + + assert(cos_theta != 0); + if (!(fabsf((result - cos_theta)/cos_theta) <= eps)) { + atf_tc_fail_nonfatal("cosf(%d deg = %.8g) = %.8g" + " != %.8g", deg, theta, result, cos_theta); + } } } @@ -244,6 +372,14 @@ ATF_TC_BODY(cosf_zero_pos, tc) ATF_TP_ADD_TCS(tp) { +#ifdef __HAVE_LONG_DOUBLE + ATF_TP_ADD_TC(tp, cosl_angles); + ATF_TP_ADD_TC(tp, cosl_nan); + ATF_TP_ADD_TC(tp, cosl_inf_neg); + ATF_TP_ADD_TC(tp, cosl_inf_pos); + ATF_TP_ADD_TC(tp, cosl_zero_neg); + ATF_TP_ADD_TC(tp, cosl_zero_pos); +#endif ATF_TP_ADD_TC(tp, cos_angles); ATF_TP_ADD_TC(tp, cos_nan); diff --git a/contrib/netbsd-tests/lib/libm/t_cosh.c b/contrib/netbsd-tests/lib/libm/t_cosh.c index 3f998de761bb..aac3a39b0236 100644 --- a/contrib/netbsd-tests/lib/libm/t_cosh.c +++ b/contrib/netbsd-tests/lib/libm/t_cosh.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_cosh.c,v 1.6 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_cosh.c,v 1.7 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,28 +29,28 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_cosh.c,v 1.6 2014/03/03 10:39:08 martin Exp $"); +__RCSID("$NetBSD: t_cosh.c,v 1.7 2018/11/07 03:59:36 riastradh Exp $"); #include +#include #include #include static const struct { double x; double y; - double e; } values[] = { - { -10, 11013.23292010332, 1e4, }, - { -2, 3.762195691083631, 1, }, - { -1, 1.543080634815244, 1, }, - { -0.05, 1.001250260438369, 1, }, - { -0.001, 1.000000500000042, 1, }, - { 0, 1, 1, }, - { 0.001, 1.000000500000042, 1, }, - { 0.05, 1.001250260438369, 1, }, - { 1, 1.543080634815244, 1, }, - { 2, 3.762195691083631, 1, }, - { 10, 11013.23292010332, 1e4, }, + { -10, 11013.232920103323, }, + { -2, 3.762195691083631, }, + { -1, 1.543080634815244, }, + { -0.05, 1.001250260438369, }, + { -0.001, 1.0000005000000418, }, + { 0, 1, }, + { 0.001, 1.0000005000000418, }, + { 0.05, 1.001250260438369, }, + { 1, 1.543080634815244, }, + { 2, 3.762195691083631, }, + { 10, 11013.232920103323, }, }; /* @@ -64,18 +64,17 @@ ATF_TC_HEAD(cosh_inrange, tc) ATF_TC_BODY(cosh_inrange, tc) { - double eps; - double x; - double y; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - x = values[i].x; - y = values[i].y; - eps = 1e-15 * values[i].e; + double x = values[i].x; + double cosh_x = values[i].y; - if (fabs(cosh(x) - y) > eps) - atf_tc_fail_nonfatal("cosh(%g) != %g\n", x, y); + if (!(fabs((cosh(x) - cosh_x)/cosh_x) <= eps)) { + atf_tc_fail_nonfatal("cosh(%.17g) = %.17g != %.17g\n", + x, cosh(x), cosh_x); + } } } @@ -162,18 +161,17 @@ ATF_TC_HEAD(coshf_inrange, tc) ATF_TC_BODY(coshf_inrange, tc) { - float eps; - float x; - float y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - x = values[i].x; - y = values[i].y; - eps = 1e-6 * values[i].e; + float x = values[i].x; + float cosh_x = values[i].y; - if (fabsf(coshf(x) - y) > eps) - atf_tc_fail_nonfatal("coshf(%g) != %g\n", x, y); + if (!(fabsf((coshf(x) - cosh_x)/cosh_x) <= eps)) { + atf_tc_fail_nonfatal("coshf(%.17g) = %.17g != %.17g\n", + x, coshf(x), cosh_x); + } } } diff --git a/contrib/netbsd-tests/lib/libm/t_exp.c b/contrib/netbsd-tests/lib/libm/t_exp.c index 0eb6412b566e..acef4c0e91de 100644 --- a/contrib/netbsd-tests/lib/libm/t_exp.c +++ b/contrib/netbsd-tests/lib/libm/t_exp.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_exp.c,v 1.8 2014/10/07 16:53:44 gson Exp $ */ +/* $NetBSD: t_exp.c,v 1.9 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -30,6 +30,7 @@ */ #include +#include #include #include "t_libm.h" @@ -37,17 +38,16 @@ static const struct { double x; double y; - double e; } exp_values[] = { - { -10, 0.4539992976248485e-4, 1e-4, }, - { -5, 0.6737946999085467e-2, 1e-2, }, - { -1, 0.3678794411714423, 1e-1, }, - { -0.1, 0.9048374180359595, 1e-1, }, - { 0, 1.0000000000000000, 1, }, - { 0.1, 1.1051709180756477, 1, }, - { 1, 2.7182818284590452, 1, }, - { 5, 148.41315910257660, 1e2, }, - { 10, 22026.465794806718, 1e4, }, + { -10, 0.4539992976248485e-4, }, + { -5, 0.6737946999085467e-2, }, + { -1, 0.3678794411714423, }, + { -0.1, 0.9048374180359595, }, + { 0, 1.0000000000000000, }, + { 0.1, 1.1051709180756477, }, + { 1, 2.7182818284590452, }, + { 5, 148.41315910257660, }, + { 10, 22026.465794806718, }, }; /* @@ -238,18 +238,17 @@ ATF_TC_HEAD(exp_product, tc) ATF_TC_BODY(exp_product, tc) { - double eps; - double x; - double y; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(exp_values); i++) { - x = exp_values[i].x; - y = exp_values[i].y; - eps = 1e-15 * exp_values[i].e; + double x = exp_values[i].x; + double e_x = exp_values[i].y; - if (fabs(exp(x) - y) > eps) - atf_tc_fail_nonfatal("exp(%0.01f) != %18.18e", x, y); + if (!(fabs((exp(x) - e_x)/e_x) <= eps)) { + atf_tc_fail_nonfatal("exp(%.17g) = %.17g != %.17g", + x, exp(x), e_x); + } } } @@ -336,18 +335,17 @@ ATF_TC_HEAD(expf_product, tc) ATF_TC_BODY(expf_product, tc) { - float eps; - float x; - float y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(exp_values); i++) { - x = exp_values[i].x; - y = exp_values[i].y; - eps = 1e-6 * exp_values[i].e; + float x = exp_values[i].x; + float e_x = exp_values[i].y; - if (fabsf(expf(x) - y) > eps) - atf_tc_fail_nonfatal("expf(%0.01f) != %18.18e", x, y); + if (!(fabsf((expf(x) - e_x)/e_x) <= eps)) { + atf_tc_fail_nonfatal("expf(%.8g) = %.8g != %.8g", + x, exp(x), e_x); + } } } diff --git a/contrib/netbsd-tests/lib/libm/t_fe_round.c b/contrib/netbsd-tests/lib/libm/t_fe_round.c index fe805b4f86b8..33da289eb156 100644 --- a/contrib/netbsd-tests/lib/libm/t_fe_round.c +++ b/contrib/netbsd-tests/lib/libm/t_fe_round.c @@ -89,7 +89,97 @@ ATF_TC_BODY(fe_round, tc) (fegetround() == values[i].round_mode), "Didn't get the same rounding mode out!\n" "(index %d) fed in %d rounding mode, got %d out\n", - i, fegetround(), values[i].round_mode); + i, values[i].round_mode, fegetround()); + } +} + +ATF_TC(fe_nearbyint); +ATF_TC_HEAD(fe_nearbyint, tc) +{ + atf_tc_set_md_var(tc, "descr","Checking IEEE 754 rounding modes using nearbyint"); +} + +ATF_TC_BODY(fe_nearbyint, tc) +{ + double received; + + for (unsigned int i = 0; i < __arraycount(values); i++) { + fesetround(values[i].round_mode); + + received = nearbyint(values[i].input); + ATF_CHECK_MSG( + (fabs(received - values[i].expected) < EPSILON), + "nearbyint rounding wrong, difference too large\n" + "input: %f (index %d): got %f, expected %ld\n", + values[i].input, i, received, values[i].expected); + + /* Do we get the same rounding mode out? */ + ATF_CHECK_MSG( + (fegetround() == values[i].round_mode), + "Didn't get the same rounding mode out!\n" + "(index %d) fed in %d rounding mode, got %d out\n", + i, values[i].round_mode, fegetround()); + } +} + +static const struct { + double input; + double toward; + double expected; +} values2[] = { + { 10.0, 11.0, 10.0 }, + { -5.0, -6.0, -5.0 }, +}; + +ATF_TC(fe_nextafter); +ATF_TC_HEAD(fe_nextafter, tc) +{ + atf_tc_set_md_var(tc, "descr", "Checking IEEE 754 rounding using nextafter()"); +} + +ATF_TC_BODY(fe_nextafter, tc) +{ + double received; + int res; + + for (unsigned int i = 0; i < __arraycount(values2); i++) { + received = nextafter(values2[i].input, values2[i].toward); + if (values2[i].input < values2[i].toward) { + res = (received > values2[i].input); + } else { + res = (received < values2[i].input); + } + ATF_CHECK_MSG( + res && (fabs(received - values2[i].expected) < EPSILON), + "nextafter() rounding wrong, difference too large\n" + "input: %f (index %d): got %f, expected %f, res %d\n", + values2[i].input, i, received, values2[i].expected, res); + } +} + *** 1053 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Feb 22 17:41:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C96465465FE; Mon, 22 Feb 2021 17:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DkqHK53L7z4SY7; Mon, 22 Feb 2021 17:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0A381D08; Mon, 22 Feb 2021 17:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11MHfXNF020206; Mon, 22 Feb 2021 17:41:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MHfX2s020205; Mon, 22 Feb 2021 17:41:33 GMT (envelope-from git) Date: Mon, 22 Feb 2021 17:41:33 GMT Message-Id: <202102221741.11MHfX2s020205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: c1b554c86819 - main - if_vtnet: Fix pointer-sign and used parameter warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1b554c868195ed10ac1eb25fa9ca4a5baae4638 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 17:41:33 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c1b554c868195ed10ac1eb25fa9ca4a5baae4638 commit c1b554c868195ed10ac1eb25fa9ca4a5baae4638 Author: Alex Richardson AuthorDate: 2021-02-22 17:26:21 +0000 Commit: Alex Richardson CommitDate: 2021-02-22 17:41:04 +0000 if_vtnet: Fix pointer-sign and used parameter warnings Reviewed By: grehan Differential Revision: https://reviews.freebsd.org/D28726 --- sys/dev/virtio/network/if_vtnet.c | 42 ++++++++++++++++++------------------ sys/dev/virtio/network/if_vtnetvar.h | 6 +++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index e64b7de113c8..09110183c30f 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -113,7 +113,7 @@ static void vtnet_free_rx_filters(struct vtnet_softc *); static int vtnet_alloc_virtqueues(struct vtnet_softc *); static int vtnet_alloc_interface(struct vtnet_softc *); static int vtnet_setup_interface(struct vtnet_softc *); -static int vtnet_ioctl_mtu(struct vtnet_softc *, int); +static int vtnet_ioctl_mtu(struct vtnet_softc *, u_int); static int vtnet_ioctl_ifflags(struct vtnet_softc *); static int vtnet_ioctl_multi(struct vtnet_softc *); static int vtnet_ioctl_ifcap(struct vtnet_softc *, struct ifreq *); @@ -206,9 +206,9 @@ static void vtnet_exec_ctrl_cmd(struct vtnet_softc *, void *, static int vtnet_ctrl_mac_cmd(struct vtnet_softc *, uint8_t *); static int vtnet_ctrl_guest_offloads(struct vtnet_softc *, uint64_t); static int vtnet_ctrl_mq_cmd(struct vtnet_softc *, uint16_t); -static int vtnet_ctrl_rx_cmd(struct vtnet_softc *, uint8_t, int); -static int vtnet_set_promisc(struct vtnet_softc *, int); -static int vtnet_set_allmulti(struct vtnet_softc *, int); +static int vtnet_ctrl_rx_cmd(struct vtnet_softc *, uint8_t, bool); +static int vtnet_set_promisc(struct vtnet_softc *, bool); +static int vtnet_set_allmulti(struct vtnet_softc *, bool); static void vtnet_rx_filter(struct vtnet_softc *); static void vtnet_rx_filter_mac(struct vtnet_softc *); static int vtnet_exec_vlan_filter(struct vtnet_softc *, int, uint16_t); @@ -373,7 +373,7 @@ MODULE_DEPEND(vtnet, netmap, 1, 1, 1); VIRTIO_SIMPLE_PNPINFO(vtnet, VIRTIO_ID_NETWORK, "VirtIO Networking Adapter"); static int -vtnet_modevent(module_t mod, int type, void *unused) +vtnet_modevent(module_t mod __unused, int type, void *unused __unused) { int error = 0; static int loaded = 0; @@ -1247,7 +1247,7 @@ vtnet_rx_cluster_size(struct vtnet_softc *sc, int mtu) } static int -vtnet_ioctl_mtu(struct vtnet_softc *sc, int mtu) +vtnet_ioctl_mtu(struct vtnet_softc *sc, u_int mtu) { struct ifnet *ifp; int clustersz; @@ -1808,7 +1808,7 @@ vtnet_rxq_csum_needs_csum(struct vtnet_rxq *rxq, struct mbuf *m, uint16_t etype, static int vtnet_rxq_csum_data_valid(struct vtnet_rxq *rxq, struct mbuf *m, - uint16_t etype, int hoff, struct virtio_net_hdr *hdr) + uint16_t etype, int hoff, struct virtio_net_hdr *hdr __unused) { struct vtnet_softc *sc; int protocol; @@ -1928,7 +1928,7 @@ vtnet_rxq_merged_eof(struct vtnet_rxq *rxq, struct mbuf *m_head, int nbufs) while (--nbufs > 0) { struct mbuf *m; - int len; + uint32_t len; m = virtqueue_dequeue(vq, &len); if (m == NULL) { @@ -2058,7 +2058,7 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) while (count-- > 0) { struct mbuf *m; - int len, nbufs, adjsz; + uint32_t len, nbufs, adjsz; m = virtqueue_dequeue(vq, &len); if (m == NULL) @@ -2158,7 +2158,7 @@ vtnet_rx_vq_process(struct vtnet_rxq *rxq, int tries) { struct vtnet_softc *sc; struct ifnet *ifp; - int more; + u_int more; #ifdef DEV_NETMAP int nmirq; #endif /* DEV_NETMAP */ @@ -2232,7 +2232,7 @@ vtnet_rx_vq_intr(void *xrxq) } static void -vtnet_rxq_tq_intr(void *xrxq, int pending) +vtnet_rxq_tq_intr(void *xrxq, int pending __unused) { struct vtnet_rxq *rxq; @@ -2749,7 +2749,7 @@ vtnet_txq_mq_start(struct ifnet *ifp, struct mbuf *m) } static void -vtnet_txq_tq_deferred(void *xtxq, int pending) +vtnet_txq_tq_deferred(void *xtxq, int pending __unused) { struct vtnet_softc *sc; struct vtnet_txq *txq; @@ -2784,7 +2784,7 @@ vtnet_txq_start(struct vtnet_txq *txq) } static void -vtnet_txq_tq_intr(void *xtxq, int pending) +vtnet_txq_tq_intr(void *xtxq, int pending __unused) { struct vtnet_softc *sc; struct vtnet_txq *txq; @@ -3619,7 +3619,7 @@ vtnet_ctrl_mq_cmd(struct vtnet_softc *sc, uint16_t npairs) } static int -vtnet_ctrl_rx_cmd(struct vtnet_softc *sc, uint8_t cmd, int on) +vtnet_ctrl_rx_cmd(struct vtnet_softc *sc, uint8_t cmd, bool on) { struct sglist_seg segs[3]; struct sglist sg; @@ -3637,7 +3637,7 @@ vtnet_ctrl_rx_cmd(struct vtnet_softc *sc, uint8_t cmd, int on) s.hdr.class = VIRTIO_NET_CTRL_RX; s.hdr.cmd = cmd; - s.onoff = !!on; + s.onoff = on; s.ack = VIRTIO_NET_ERR; sglist_init(&sg, nitems(segs), segs); @@ -3653,13 +3653,13 @@ vtnet_ctrl_rx_cmd(struct vtnet_softc *sc, uint8_t cmd, int on) } static int -vtnet_set_promisc(struct vtnet_softc *sc, int on) +vtnet_set_promisc(struct vtnet_softc *sc, bool on) { return (vtnet_ctrl_rx_cmd(sc, VIRTIO_NET_CTRL_RX_PROMISC, on)); } static int -vtnet_set_allmulti(struct vtnet_softc *sc, int on) +vtnet_set_allmulti(struct vtnet_softc *sc, bool on) { return (vtnet_ctrl_rx_cmd(sc, VIRTIO_NET_CTRL_RX_ALLMULTI, on)); } @@ -3781,9 +3781,9 @@ vtnet_rx_filter_mac(struct vtnet_softc *sc) if_printf(ifp, "error setting host MAC filter table\n"); out: - if (promisc != 0 && vtnet_set_promisc(sc, 1) != 0) + if (promisc != 0 && vtnet_set_promisc(sc, true) != 0) if_printf(ifp, "cannot enable promiscuous mode\n"); - if (allmulti != 0 && vtnet_set_allmulti(sc, 1) != 0) + if (allmulti != 0 && vtnet_set_allmulti(sc, true) != 0) if_printf(ifp, "cannot enable all-multicast mode\n"); } @@ -3912,7 +3912,7 @@ vtnet_update_speed_duplex(struct vtnet_softc *sc) /* BMV: Ignore duplex. */ speed = virtio_read_dev_config_4(sc->vtnet_dev, offsetof(struct virtio_net_config, speed)); - if (speed != -1) + if (speed != UINT32_MAX) ifp->if_baudrate = IF_Mbps(speed); } @@ -3952,7 +3952,7 @@ vtnet_update_link_status(struct vtnet_softc *sc) } static int -vtnet_ifmedia_upd(struct ifnet *ifp) +vtnet_ifmedia_upd(struct ifnet *ifp __unused) { return (EOPNOTSUPP); } diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h index d26f7240a67a..55e8a7267499 100644 --- a/sys/dev/virtio/network/if_vtnetvar.h +++ b/sys/dev/virtio/network/if_vtnetvar.h @@ -161,7 +161,7 @@ struct vtnet_softc { #define VTNET_FLAG_FIXUP_NEEDS_CSUM 0x2000 #define VTNET_FLAG_SW_LRO 0x4000 - int vtnet_hdr_size; + u_int vtnet_hdr_size; int vtnet_rx_nmbufs; int vtnet_rx_clustersz; int vtnet_rx_nsegs; @@ -172,7 +172,7 @@ struct vtnet_softc { int vtnet_max_vq_pairs; int vtnet_tx_nsegs; int vtnet_if_flags; - int vtnet_max_mtu; + u_int vtnet_max_mtu; int vtnet_lro_entry_count; int vtnet_lro_mbufq_depth; @@ -189,7 +189,7 @@ struct vtnet_softc { struct mtx vtnet_mtx; char vtnet_mtx_name[16]; - char vtnet_hwaddr[ETHER_ADDR_LEN]; + uint8_t vtnet_hwaddr[ETHER_ADDR_LEN]; }; static bool From owner-dev-commits-src-all@freebsd.org Mon Feb 22 17:44: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 09E9754677D; Mon, 22 Feb 2021 17:44: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 4DkqL86xnmz4TB0; Mon, 22 Feb 2021 17:44: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 E13021D1B; Mon, 22 Feb 2021 17:44: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 11MHi0tB020691; Mon, 22 Feb 2021 17:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MHi0LO020690; Mon, 22 Feb 2021 17:44:00 GMT (envelope-from git) Date: Mon, 22 Feb 2021 17:44:00 GMT Message-Id: <202102221744.11MHi0LO020690@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: 940415f20a78 - stable/13 - zfs: disable use of hardware crypto offload drivers 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: 940415f20a784156ec0e247989796385896f32a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 17:44:01 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=940415f20a784156ec0e247989796385896f32a8 commit 940415f20a784156ec0e247989796385896f32a8 Author: Martin Matuska AuthorDate: 2021-02-22 17:37:47 +0000 Commit: Martin Matuska CommitDate: 2021-02-22 17:42:33 +0000 zfs: disable use of hardware crypto offload drivers From openzfs-master e7adccf7f commit message: First, the crypto request completion handler contains a bug in that it fails to reset fs_done correctly after the request is completed. This is only a problem for asynchronous drivers. Second, some hardware drivers have input constraints which ZFS does not satisfy. For instance, ccp(4) apparently requires the AAD length for AES-GCM to be a multiple of the cipher block size, and with qat(4) the AES-GCM AAD length may not be longer than 240 bytes. FreeBSD's generic crypto framework doesn't have a mechanism to automatically fall back to a software implementation if a hardware driver cannot process a request, and ZFS does not tolerate such errors. Patch Author: Mark Johnston Obtained from: openzfs/zfs@e7adccf7f537a4d07281a2b74b360154bae367bc PR: 252981, 253595 MFS after: 3 days (direct commit) --- sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c index b86ffc59a21d..0a7241699842 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c @@ -293,8 +293,19 @@ freebsd_crypt_newsession(freebsd_crypt_session_t *sessp, error = ENOTSUP; goto bad; } - error = crypto_newsession(&sessp->fs_sid, &csp, - CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE); + + /* + * Disable the use of hardware drivers on FreeBSD 13 and later since + * common crypto offload drivers impose constraints on AES-GCM AAD + * lengths that make them unusable for ZFS, and we currently do not have + * a mechanism to fall back to a software driver for requests not + * handled by a hardware driver. + * + * On 12 we continue to permit the use of hardware drivers since + * CPU-accelerated drivers such as aesni(4) register themselves as + * hardware drivers. + */ + error = crypto_newsession(&sessp->fs_sid, &csp, CRYPTOCAP_F_SOFTWARE); mtx_init(&sessp->fs_lock, "FreeBSD Cryptographic Session Lock", NULL, MTX_DEF); crypt_sessions++; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 17:52: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 1A4915471D5; Mon, 22 Feb 2021 17:52: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 4DkqWS0Gfsz4VFX; Mon, 22 Feb 2021 17:52: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 F0BC21E2E; Mon, 22 Feb 2021 17:52: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 11MHq31k033246; Mon, 22 Feb 2021 17:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MHq3Jx033245; Mon, 22 Feb 2021 17:52:03 GMT (envelope-from git) Date: Mon, 22 Feb 2021 17:52:03 GMT Message-Id: <202102221752.11MHq3Jx033245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 6895f89fe54e - main - Coalesce socket reads in software iSCSI. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6895f89fe54e0858aea70d2bd2a9651f45d7998e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 17:52:04 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6895f89fe54e0858aea70d2bd2a9651f45d7998e commit 6895f89fe54e0858aea70d2bd2a9651f45d7998e Author: Alexander Motin AuthorDate: 2021-02-22 17:23:35 +0000 Commit: Alexander Motin CommitDate: 2021-02-22 17:51:59 +0000 Coalesce socket reads in software iSCSI. Instead of 2-4 socket reads per PDU this can do as low as one read per megabyte, dramatically reducing TCP overhead and lock contention. With this on iSCSI target I can write more than 4GB/s through a single connection. MFC after: 1 month --- sys/dev/iscsi/icl_soft.c | 258 ++++++++++++++++------------------------------- 1 file changed, 89 insertions(+), 169 deletions(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index a8986b3d4253..a5696647169a 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -165,68 +165,6 @@ icl_conn_fail(struct icl_conn *ic) (ic->ic_error)(ic); } -static struct mbuf * -icl_conn_receive(struct icl_conn *ic, size_t len) -{ - struct uio uio; - struct socket *so; - struct mbuf *m; - int error, flags; - - so = ic->ic_socket; - - memset(&uio, 0, sizeof(uio)); - uio.uio_resid = len; - - flags = MSG_DONTWAIT; - error = soreceive(so, NULL, &uio, &m, NULL, &flags); - if (error != 0) { - ICL_DEBUG("soreceive error %d", error); - return (NULL); - } - if (uio.uio_resid != 0) { - m_freem(m); - ICL_DEBUG("short read"); - return (NULL); - } - - return (m); -} - -static int -icl_conn_receive_buf(struct icl_conn *ic, void *buf, size_t len) -{ - struct iovec iov[1]; - struct uio uio; - struct socket *so; - int error, flags; - - so = ic->ic_socket; - - memset(&uio, 0, sizeof(uio)); - iov[0].iov_base = buf; - iov[0].iov_len = len; - uio.uio_iov = iov; - uio.uio_iovcnt = 1; - uio.uio_offset = 0; - uio.uio_resid = len; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_READ; - - flags = MSG_DONTWAIT; - error = soreceive(so, NULL, &uio, NULL, NULL, &flags); - if (error != 0) { - ICL_DEBUG("soreceive error %d", error); - return (-1); - } - if (uio.uio_resid != 0) { - ICL_DEBUG("short read"); - return (-1); - } - - return (0); -} - static void icl_soft_conn_pdu_free(struct icl_conn *ic, struct icl_pdu *ip) { @@ -384,37 +322,28 @@ icl_pdu_size(const struct icl_pdu *response) return (len); } -static int -icl_pdu_receive_bhs(struct icl_pdu *request, size_t *availablep) +static void +icl_soft_receive_buf(struct mbuf **r, size_t *rs, void *buf, size_t s) { - if (icl_conn_receive_buf(request->ip_conn, - request->ip_bhs, sizeof(struct iscsi_bhs))) { - ICL_DEBUG("failed to receive BHS"); - return (-1); - } - - *availablep -= sizeof(struct iscsi_bhs); - return (0); + m_copydata(*r, 0, s, buf); + m_adj(*r, s); + while ((*r) != NULL && (*r)->m_len == 0) + *r = m_free(*r); + *rs -= s; } -static int -icl_pdu_receive_ahs(struct icl_pdu *request, size_t *availablep) +static void +icl_pdu_receive_ahs(struct icl_pdu *request, struct mbuf **r, size_t *rs) { request->ip_ahs_len = icl_pdu_ahs_length(request); if (request->ip_ahs_len == 0) - return (0); - - request->ip_ahs_mbuf = icl_conn_receive(request->ip_conn, - request->ip_ahs_len); - if (request->ip_ahs_mbuf == NULL) { - ICL_DEBUG("failed to receive AHS"); - return (-1); - } + return; - *availablep -= request->ip_ahs_len; - return (0); + request->ip_ahs_mbuf = *r; + *r = m_split(request->ip_ahs_mbuf, request->ip_ahs_len, M_WAITOK); + *rs -= request->ip_ahs_len; } static uint32_t @@ -433,7 +362,7 @@ icl_mbuf_to_crc32c(const struct mbuf *m0) } static int -icl_pdu_check_header_digest(struct icl_pdu *request, size_t *availablep) +icl_pdu_check_header_digest(struct icl_pdu *request, struct mbuf **r, size_t *rs) { uint32_t received_digest, valid_digest; @@ -441,12 +370,7 @@ icl_pdu_check_header_digest(struct icl_pdu *request, size_t *availablep) return (0); CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE); - if (icl_conn_receive_buf(request->ip_conn, - &received_digest, ISCSI_HEADER_DIGEST_SIZE)) { - ICL_DEBUG("failed to receive header digest"); - return (-1); - } - *availablep -= ISCSI_HEADER_DIGEST_SIZE; + icl_soft_receive_buf(r, rs, &received_digest, ISCSI_HEADER_DIGEST_SIZE); /* Temporary attach AHS to BHS to calculate header digest. */ request->ip_bhs_mbuf->m_next = request->ip_ahs_mbuf; @@ -514,8 +438,8 @@ icl_pdu_data_segment_receive_len(const struct icl_pdu *request) } static int -icl_pdu_receive_data_segment(struct icl_pdu *request, - size_t *availablep, bool *more_neededp) +icl_pdu_receive_data_segment(struct icl_pdu *request, struct mbuf **r, + size_t *rs, bool *more_neededp) { struct icl_conn *ic; size_t len, padding = 0; @@ -539,7 +463,7 @@ icl_pdu_receive_data_segment(struct icl_pdu *request, KASSERT(len > request->ip_data_len, ("len <= request->ip_data_len")); len -= request->ip_data_len; - if (len + padding > *availablep) { + if (len + padding > *rs) { /* * Not enough data in the socket buffer. Receive as much * as we can. Don't receive padding, since, obviously, it's @@ -547,9 +471,9 @@ icl_pdu_receive_data_segment(struct icl_pdu *request, */ #if 0 ICL_DEBUG("limited from %zd to %zd", - len + padding, *availablep - padding)); + len + padding, *rs - padding)); #endif - len = *availablep - padding; + len = *rs - padding; *more_neededp = true; padding = 0; } @@ -559,11 +483,9 @@ icl_pdu_receive_data_segment(struct icl_pdu *request, * of actual data segment. */ if (len > 0) { - m = icl_conn_receive(request->ip_conn, len + padding); - if (m == NULL) { - ICL_DEBUG("failed to receive data segment"); - return (-1); - } + m = *r; + *r = m_split(m, len + padding, M_WAITOK); + *rs -= len + padding; if (request->ip_data_mbuf == NULL) request->ip_data_mbuf = m; @@ -571,7 +493,6 @@ icl_pdu_receive_data_segment(struct icl_pdu *request, m_cat(request->ip_data_mbuf, m); request->ip_data_len += len; - *availablep -= len + padding; } else ICL_DEBUG("len 0"); @@ -583,7 +504,7 @@ icl_pdu_receive_data_segment(struct icl_pdu *request, } static int -icl_pdu_check_data_digest(struct icl_pdu *request, size_t *availablep) +icl_pdu_check_data_digest(struct icl_pdu *request, struct mbuf **r, size_t *rs) { uint32_t received_digest, valid_digest; @@ -594,12 +515,7 @@ icl_pdu_check_data_digest(struct icl_pdu *request, size_t *availablep) return (0); CTASSERT(sizeof(received_digest) == ISCSI_DATA_DIGEST_SIZE); - if (icl_conn_receive_buf(request->ip_conn, - &received_digest, ISCSI_DATA_DIGEST_SIZE)) { - ICL_DEBUG("failed to receive data digest"); - return (-1); - } - *availablep -= ISCSI_DATA_DIGEST_SIZE; + icl_soft_receive_buf(r, rs, &received_digest, ISCSI_DATA_DIGEST_SIZE); /* * Note that ip_data_mbuf also contains padding; since digest @@ -621,16 +537,13 @@ icl_pdu_check_data_digest(struct icl_pdu *request, size_t *availablep) * "part" of PDU at a time; call it repeatedly until it returns non-NULL. */ static struct icl_pdu * -icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) +icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) { struct icl_pdu *request; - struct socket *so; size_t len; - int error; + int error = 0; bool more_needed; - so = ic->ic_socket; - if (ic->ic_receive_state == ICL_CONN_STATE_BHS) { KASSERT(ic->ic_receive_pdu == NULL, ("ic->ic_receive_pdu != NULL")); @@ -648,23 +561,11 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) request = ic->ic_receive_pdu; } - if (*availablep < ic->ic_receive_len) { -#if 0 - ICL_DEBUG("not enough data; need %zd, " - "have %zd", ic->ic_receive_len, *availablep); -#endif - return (NULL); - } - switch (ic->ic_receive_state) { case ICL_CONN_STATE_BHS: //ICL_DEBUG("receiving BHS"); - error = icl_pdu_receive_bhs(request, availablep); - if (error != 0) { - ICL_DEBUG("failed to receive BHS; " - "dropping connection"); - break; - } + icl_soft_receive_buf(r, rs, request->ip_bhs, + sizeof(struct iscsi_bhs)); /* * We don't enforce any limit for AHS length; @@ -686,12 +587,7 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) case ICL_CONN_STATE_AHS: //ICL_DEBUG("receiving AHS"); - error = icl_pdu_receive_ahs(request, availablep); - if (error != 0) { - ICL_DEBUG("failed to receive AHS; " - "dropping connection"); - break; - } + icl_pdu_receive_ahs(request, r, rs); ic->ic_receive_state = ICL_CONN_STATE_HEADER_DIGEST; if (ic->ic_header_crc32c == false) ic->ic_receive_len = 0; @@ -701,7 +597,7 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) case ICL_CONN_STATE_HEADER_DIGEST: //ICL_DEBUG("receiving header digest"); - error = icl_pdu_check_header_digest(request, availablep); + error = icl_pdu_check_header_digest(request, r, rs); if (error != 0) { ICL_DEBUG("header digest failed; " "dropping connection"); @@ -715,7 +611,7 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) case ICL_CONN_STATE_DATA: //ICL_DEBUG("receiving data segment"); - error = icl_pdu_receive_data_segment(request, availablep, + error = icl_pdu_receive_data_segment(request, r, rs, &more_needed); if (error != 0) { ICL_DEBUG("failed to receive data segment;" @@ -735,7 +631,7 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) case ICL_CONN_STATE_DATA_DIGEST: //ICL_DEBUG("receiving data digest"); - error = icl_pdu_check_data_digest(request, availablep); + error = icl_pdu_check_data_digest(request, r, rs); if (error != 0) { ICL_DEBUG("data digest failed; " "dropping connection"); @@ -767,44 +663,27 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) } static void -icl_conn_receive_pdus(struct icl_conn *ic, size_t available) +icl_conn_receive_pdus(struct icl_conn *ic, struct mbuf **r, size_t *rs) { struct icl_pdu *response; - struct socket *so; - - so = ic->ic_socket; - - /* - * This can never happen; we're careful to only mess with ic->ic_socket - * pointer when the send/receive threads are not running. - */ - KASSERT(so != NULL, ("NULL socket")); for (;;) { if (ic->ic_disconnecting) return; - if (so->so_error != 0) { - ICL_DEBUG("connection error %d; " - "dropping connection", so->so_error); - icl_conn_fail(ic); - return; - } - /* * Loop until we have a complete PDU or there is not enough * data in the socket buffer. */ - if (available < ic->ic_receive_len) { + if (*rs < ic->ic_receive_len) { #if 0 - ICL_DEBUG("not enough data; have %zd, " - "need %zd", available, - ic->ic_receive_len); + ICL_DEBUG("not enough data; have %zd, need %zd", + *rs, ic->ic_receive_len); #endif return; } - response = icl_conn_receive_pdu(ic, &available); + response = icl_conn_receive_pdu(ic, r, rs); if (response == NULL) continue; @@ -825,15 +704,19 @@ static void icl_receive_thread(void *arg) { struct icl_conn *ic; - size_t available; + size_t available, read = 0; struct socket *so; + struct mbuf *m, *r = NULL; + struct uio uio; + int error, flags; ic = arg; so = ic->ic_socket; for (;;) { + SOCKBUF_LOCK(&so->so_rcv); if (ic->ic_disconnecting) { - //ICL_DEBUG("terminating"); + SOCKBUF_UNLOCK(&so->so_rcv); break; } @@ -843,18 +726,50 @@ icl_receive_thread(void *arg) * to avoid unnecessary wakeups until there * is enough data received to read the PDU. */ - SOCKBUF_LOCK(&so->so_rcv); available = sbavail(&so->so_rcv); - if (available < ic->ic_receive_len) { - so->so_rcv.sb_lowat = ic->ic_receive_len; + if (read + available < ic->ic_receive_len) { + so->so_rcv.sb_lowat = ic->ic_receive_len - read; cv_wait(&ic->ic_receive_cv, &so->so_rcv.sb_mtx); - } else so->so_rcv.sb_lowat = so->so_rcv.sb_hiwat + 1; + available = sbavail(&so->so_rcv); + } SOCKBUF_UNLOCK(&so->so_rcv); - icl_conn_receive_pdus(ic, available); + if (available == 0) { + if (so->so_error != 0) { + ICL_DEBUG("connection error %d; " + "dropping connection", so->so_error); + icl_conn_fail(ic); + break; + } + continue; + } + + memset(&uio, 0, sizeof(uio)); + uio.uio_resid = available; + flags = MSG_DONTWAIT; + error = soreceive(so, NULL, &uio, &m, NULL, &flags); + if (error != 0) { + ICL_DEBUG("soreceive error %d", error); + break; + } + if (uio.uio_resid != 0) { + m_freem(m); + ICL_DEBUG("short read"); + break; + } + if (r) + m_cat(r, m); + else + r = m; + read += available; + + icl_conn_receive_pdus(ic, &r, &read); } + if (r) + m_freem(r); + ICL_CONN_LOCK(ic); ic->ic_receive_running = false; cv_signal(&ic->ic_send_cv); @@ -1440,12 +1355,17 @@ icl_soft_conn_close(struct icl_conn *ic) struct icl_pdu *pdu; struct socket *so; - ICL_CONN_LOCK(ic); - /* * Wake up the threads, so they can properly terminate. + * Receive thread sleeps on so->so_rcv lock, send on ic->ic_lock. */ - ic->ic_disconnecting = true; + ICL_CONN_LOCK(ic); + if (!ic->ic_disconnecting) { + so = ic->ic_socket; + SOCKBUF_LOCK(&so->so_rcv); + ic->ic_disconnecting = true; + SOCKBUF_UNLOCK(&so->so_rcv); + } while (ic->ic_receive_running || ic->ic_send_running) { cv_signal(&ic->ic_receive_cv); cv_signal(&ic->ic_send_cv); From owner-dev-commits-src-all@freebsd.org Mon Feb 22 17:57: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 660ED54788B; Mon, 22 Feb 2021 17:57: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 4DkqdP2VqVz4VSj; Mon, 22 Feb 2021 17:57: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 48AA51A4D; Mon, 22 Feb 2021 17:57: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 11MHvDWS034136; Mon, 22 Feb 2021 17:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MHvDdL034135; Mon, 22 Feb 2021 17:57:13 GMT (envelope-from git) Date: Mon, 22 Feb 2021 17:57:13 GMT Message-Id: <202102221757.11MHvDdL034135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: ba2cfa80e1f2 - main - Fix makefs bootstrap after d485c77f203fb0f4cdc08dea5ff81631b51d8809 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba2cfa80e1f2a7e8ffd383e615aa304afa349ed7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 17:57:13 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=ba2cfa80e1f2a7e8ffd383e615aa304afa349ed7 commit ba2cfa80e1f2a7e8ffd383e615aa304afa349ed7 Author: Alex Richardson AuthorDate: 2021-02-22 17:49:05 +0000 Commit: Alex Richardson CommitDate: 2021-02-22 17:55:45 +0000 Fix makefs bootstrap after d485c77f203fb0f4cdc08dea5ff81631b51d8809 The makefs msdosfs code includes fs/msdosfs/denode.h which directly uses struct buf from rather than the makefs struct m_buf. To work around this problem provide a local denode.h that includes ffs/buf.h and defines buf as an alias for m_buf. Reviewed By: kib, emaste Differential Revision: https://reviews.freebsd.org/D28835 --- lib/libprocstat/msdosfs.c | 1 + sys/fs/msdosfs/denode.h | 2 -- usr.sbin/makefs/msdos.c | 2 +- usr.sbin/makefs/msdos.h | 1 - usr.sbin/makefs/msdos/denode.h | 39 ++++++++++++++++++++++++++++++++++ usr.sbin/makefs/msdos/msdosfs_denode.c | 5 +---- usr.sbin/makefs/msdos/msdosfs_fat.c | 5 +---- usr.sbin/makefs/msdos/msdosfs_lookup.c | 5 +---- usr.sbin/makefs/msdos/msdosfs_vfsops.c | 5 +---- usr.sbin/makefs/msdos/msdosfs_vnops.c | 5 +---- usr.sbin/makefs/sys/buf.h | 30 ++++++++++++++++++++++++++ 11 files changed, 76 insertions(+), 24 deletions(-) diff --git a/lib/libprocstat/msdosfs.c b/lib/libprocstat/msdosfs.c index 87906423f9b6..3541f252c713 100644 --- a/lib/libprocstat/msdosfs.c +++ b/lib/libprocstat/msdosfs.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h index f06c11772621..7c838b5cc81c 100644 --- a/sys/fs/msdosfs/denode.h +++ b/sys/fs/msdosfs/denode.h @@ -52,8 +52,6 @@ #ifndef _FS_MSDOSFS_DENODE_H_ #define _FS_MSDOSFS_DENODE_H_ -#include - /* * This is the pc filesystem specific portion of the vnode structure. * diff --git a/usr.sbin/makefs/msdos.c b/usr.sbin/makefs/msdos.c index 567122c1db7e..74d55a7f490f 100644 --- a/usr.sbin/makefs/msdos.c +++ b/usr.sbin/makefs/msdos.c @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "msdos/direntry.h" -#include +#include "msdos/denode.h" #include #undef clrbuf diff --git a/usr.sbin/makefs/msdos.h b/usr.sbin/makefs/msdos.h index a51420de76e5..ea78e49648a3 100644 --- a/usr.sbin/makefs/msdos.h +++ b/usr.sbin/makefs/msdos.h @@ -41,7 +41,6 @@ } while (0); -struct vnode; struct denode; struct fsnode; struct msdosfsmount; diff --git a/usr.sbin/makefs/msdos/denode.h b/usr.sbin/makefs/msdos/denode.h new file mode 100644 index 000000000000..4590a76c3501 --- /dev/null +++ b/usr.sbin/makefs/msdos/denode.h @@ -0,0 +1,39 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This work was supported by Innovate UK project 105694, "Digital Security by + * Design (DSbD) Technology Platform Prototype". + * + * 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. + */ +#pragma once +/* Ensure that struct denode uses the local m_buf structure and not sys/buf.h */ +#define buf m_buf +struct vn_clusterw { + /* Not interesting for msdosfs makefs. */ +}; +#include "../ffs/buf.h" +/* struct direntry needs to be defined to included denode.h */ +#include "msdos/direntry.h" +#include diff --git a/usr.sbin/makefs/msdos/msdosfs_denode.c b/usr.sbin/makefs/msdos/msdosfs_denode.c index f2faed234228..48c305824793 100644 --- a/usr.sbin/makefs/msdos/msdosfs_denode.c +++ b/usr.sbin/makefs/msdos/msdosfs_denode.c @@ -62,13 +62,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include "msdos/denode.h" #include #include -#undef clrbuf -#include "ffs/buf.h" #include "makefs.h" #include "msdos.h" diff --git a/usr.sbin/makefs/msdos/msdosfs_fat.c b/usr.sbin/makefs/msdos/msdosfs_fat.c index a70b5741aa78..b5700d8c7d1d 100644 --- a/usr.sbin/makefs/msdos/msdosfs_fat.c +++ b/usr.sbin/makefs/msdos/msdosfs_fat.c @@ -60,13 +60,10 @@ #include #include -#include "msdos/direntry.h" -#include +#include "msdos/denode.h" #include #include -#undef clrbuf -#include "ffs/buf.h" #include "makefs.h" #include "msdos.h" diff --git a/usr.sbin/makefs/msdos/msdosfs_lookup.c b/usr.sbin/makefs/msdos/msdosfs_lookup.c index 3fca0532468b..a4db6ae1a4a2 100644 --- a/usr.sbin/makefs/msdos/msdosfs_lookup.c +++ b/usr.sbin/makefs/msdos/msdosfs_lookup.c @@ -58,13 +58,10 @@ #include #include -#include "msdos/direntry.h" -#include +#include "msdos/denode.h" #include #include -#undef clrbuf -#include "ffs/buf.h" #include "makefs.h" #include "msdos.h" diff --git a/usr.sbin/makefs/msdos/msdosfs_vfsops.c b/usr.sbin/makefs/msdos/msdosfs_vfsops.c index b6788f6876f9..dd933bb2be61 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vfsops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vfsops.c @@ -63,15 +63,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include "msdos/direntry.h" -#include +#include "msdos/denode.h" #include #include #include -#undef clrbuf -#include "ffs/buf.h" #include "makefs.h" #include "msdos.h" diff --git a/usr.sbin/makefs/msdos/msdosfs_vnops.c b/usr.sbin/makefs/msdos/msdosfs_vnops.c index 2233c4b35eb2..7e927b4b99c7 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vnops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c @@ -65,13 +65,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include "msdos/direntry.h" -#include +#include "msdos/denode.h" #include #include -#undef clrbuf -#include "ffs/buf.h" #include "makefs.h" #include "msdos.h" diff --git a/usr.sbin/makefs/sys/buf.h b/usr.sbin/makefs/sys/buf.h new file mode 100644 index 000000000000..4b640a98dd2c --- /dev/null +++ b/usr.sbin/makefs/sys/buf.h @@ -0,0 +1,30 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This work was supported by Innovate UK project 105694, "Digital Security by + * Design (DSbD) Technology Platform Prototype". + * + * 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. + */ +#error " should not be included by makefs" From owner-dev-commits-src-all@freebsd.org Mon Feb 22 18:25: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 20184549451; Mon, 22 Feb 2021 18:25: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 4DkrGV0NYYz4XcV; Mon, 22 Feb 2021 18:25: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 0003F2891; Mon, 22 Feb 2021 18:25: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 11MIPrH1074057; Mon, 22 Feb 2021 18:25:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MIPrac074056; Mon, 22 Feb 2021 18:25:53 GMT (envelope-from git) Date: Mon, 22 Feb 2021 18:25:53 GMT Message-Id: <202102221825.11MIPrac074056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: f3f042d850ba - releng/13.0 - MFS jail: Change both root and working directories in jail_attach(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f3f042d850baaeda1bed19e00c2b3b578644b7e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 18:25:54 -0000 The branch releng/13.0 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=f3f042d850baaeda1bed19e00c2b3b578644b7e9 commit f3f042d850baaeda1bed19e00c2b3b578644b7e9 Author: Jamie Gritton AuthorDate: 2021-02-19 22:13:35 +0000 Commit: Jamie Gritton CommitDate: 2021-02-22 18:25:23 +0000 MFS jail: Change both root and working directories in jail_attach(2) jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Reported by: mjg Approved by: re (gjb), markj, kib (cherry picked from commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5) (cherry picked from commit 5dbb407145c8128753fa30b695bc266dc671e433) --- lib/libc/sys/jail.2 | 5 ++++- sys/kern/kern_descrip.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- sys/kern/kern_jail.c | 2 +- sys/sys/filedesc.h | 1 + 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/jail.2 b/lib/libc/sys/jail.2 index 2e13a6c3a381..82c2e97d4a7b 100644 --- a/lib/libc/sys/jail.2 +++ b/lib/libc/sys/jail.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 19, 2021 .Dt JAIL 2 .Os .Sh NAME @@ -228,6 +228,9 @@ The system call attaches the current process to an existing jail, identified by .Fa jid . +It changes the process's root and current directories to the jail's +.Va path +directory. .Pp The .Fn jail_remove diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 059e5123c7b5..31c7d3bf2188 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3795,9 +3795,8 @@ pwd_drop(struct pwd *pwd) } /* -* Common routine for kern_chroot() and jail_attach(). The caller is -* responsible for invoking priv_check() and mac_vnode_check_chroot() to -* authorize this operation. +* The caller is responsible for invoking priv_check() and +* mac_vnode_check_chroot() to authorize this operation. */ int pwd_chroot(struct thread *td, struct vnode *vp) @@ -3859,6 +3858,46 @@ pwd_chdir(struct thread *td, struct vnode *vp) pwd_drop(oldpwd); } +/* + * jail_attach(2) changes both root and working directories. + */ +int +pwd_chroot_chdir(struct thread *td, struct vnode *vp) +{ + struct pwddesc *pdp; + struct filedesc *fdp; + struct pwd *newpwd, *oldpwd; + int error; + + fdp = td->td_proc->p_fd; + pdp = td->td_proc->p_pd; + newpwd = pwd_alloc(); + FILEDESC_SLOCK(fdp); + PWDDESC_XLOCK(pdp); + oldpwd = PWDDESC_XLOCKED_LOAD_PWD(pdp); + error = chroot_refuse_vdir_fds(fdp); + FILEDESC_SUNLOCK(fdp); + if (error != 0) { + PWDDESC_XUNLOCK(pdp); + pwd_drop(newpwd); + return (error); + } + + vrefact(vp); + newpwd->pwd_rdir = vp; + vrefact(vp); + newpwd->pwd_cdir = vp; + if (oldpwd->pwd_jdir == NULL) { + vrefact(vp); + newpwd->pwd_jdir = vp; + } + pwd_fill(oldpwd, newpwd); + pwd_set(pdp, newpwd); + PWDDESC_XUNLOCK(pdp); + pwd_drop(oldpwd); + return (0); +} + void pwd_ensure_dirs(void) { diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index b56c889eeb7e..90ab69a372d2 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2495,7 +2495,7 @@ do_jail_attach(struct thread *td, struct prison *pr) goto e_unlock; #endif VOP_UNLOCK(pr->pr_root); - if ((error = pwd_chroot(td, pr->pr_root))) + if ((error = pwd_chroot_chdir(td, pr->pr_root))) goto e_revert_osd; newcred = crget(); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 890232b7f160..8c5aa258ed28 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -333,6 +333,7 @@ void pdunshare(struct thread *td); void pwd_chdir(struct thread *td, struct vnode *vp); int pwd_chroot(struct thread *td, struct vnode *vp); +int pwd_chroot_chdir(struct thread *td, struct vnode *vp); void pwd_ensure_dirs(void); void pwd_set_rootvnode(void); From owner-dev-commits-src-all@freebsd.org Mon Feb 22 18:44: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 0C922549E3E; Mon, 22 Feb 2021 18:44:42 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dkrh93KF0z4YKs; Mon, 22 Feb 2021 18:44:41 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id D1AB525DEA; Mon, 22 Feb 2021 18:44:40 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.45.21011103 Date: Mon, 22 Feb 2021 10:44:31 -0800 Subject: Re: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 From: Ravi Pokala To: Martin Matuska , , , Message-ID: <00E1AC08-C734-4EBD-9ABA-2404CA93B926@panasas.com> Thread-Topic: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 References: <202102221202.11MC24EB071531@gitrepo.freebsd.org> In-Reply-To: <202102221202.11MC24EB071531@gitrepo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 18:44:42 -0000 -----Original Message----- From: on behalf of Martin Matuska Date: 2021-02-22, Monday at 04:02 To: , , Subject: git: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 commit ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 Merge: c02a28754bc2 0626917d0786 Author: Martin Matuska AuthorDate: 2021-02-22 11:35:56 +0000 Commit: Martin Matuska CommitDate: 2021-02-22 12:01:17 +0000 zfs: merge OpenZFS master-9312e0fd1 Notable upstream changes: 778869fa1 Fix reporting of mount progress e7adccf7f Disable use of hardware crypto offload drivers on FreeBSD Hi Martin, Why are we disabling hardware crypto offload? What impact will that have on performance? Thanks, Ravi (rpokala@) 03e02e5b5 Fix checksum errors not being counted on repeated repair 64e0fe14f Restore FreeBSD resource usage accounting 11f2e9a49 Fix panic if scrubbing after removing a slog device MFC after: 2 weeks From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19: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 BE21854B16C; Mon, 22 Feb 2021 19:01:05 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dks3551zWz4Zy9; Mon, 22 Feb 2021 19:01:05 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 1A7C525ECA; Mon, 22 Feb 2021 19:01:05 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.45.21011103 Date: Mon, 22 Feb 2021 11:01:01 -0800 Subject: Re: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template From: Ravi Pokala To: Ed Maste , , , Message-ID: Thread-Topic: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template Thread-Index: AQHXCUtojqFRyqO3C0iT7EBCZKiAiw== References: <202102221531.11MFVxQU048362@gitrepo.freebsd.org> In-Reply-To: <202102221531.11MFVxQU048362@gitrepo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 19:01:05 -0000 -----Original Message----- From: on behalf of Ed Maste Date: 2021-02-22, Monday at 07:31 To: , , Subject: git: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 commit aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 Author: Ed Maste AuthorDate: 2021-02-20 18:49:31 +0000 Commit: Ed Maste CommitDate: 2021-02-22 15:29:56 +0000 git hooks: add "Fixes" trailer to commit message template A number of projects use "Fixes: " to identify a commit that is fixed by a given change. Adopt that convention. Differential Revision: https://reviews.freebsd.org/D28693 --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 4d1072700af0..761b4443cfd8 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -48,6 +48,7 @@ $(awk '1;/^#$/{exit}' $1) # Tested by: # Approved by: # Obtained from: +# Fixes: Hi Ed, To be clear, that's "${HASH} ${TITLE}" ; space-separated, not colon- or tab-separated? If that's the case, it would be clearer to say that it's the output of `git log --oneline' for the commit in question. (Interestingly, I can't seem to figure out how to get `git log --oneline' to print *only* the commit in question; I have to pipe through `grep -m1 ${HASH}'.) Thanks, Ravi (rpokala@) # MFC after: # MFH: # Relnotes: From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19:02: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 35DB354B43B; Mon, 22 Feb 2021 19:02: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 4Dks4v15fPz4bRj; Mon, 22 Feb 2021 19:02: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 185302ED2; Mon, 22 Feb 2021 19:02: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 11MJ2cLv026577; Mon, 22 Feb 2021 19:02:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MJ2ctQ026576; Mon, 22 Feb 2021 19:02:38 GMT (envelope-from git) Date: Mon, 22 Feb 2021 19:02:38 GMT Message-Id: <202102221902.11MJ2ctQ026576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: ca9ab8ea1774 - stable/12 - MFC jail: Change both root and working directories in jail_attach(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ca9ab8ea17748a1758701fde262cb272fb757989 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 19:02:39 -0000 The branch stable/12 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=ca9ab8ea17748a1758701fde262cb272fb757989 commit ca9ab8ea17748a1758701fde262cb272fb757989 Author: Jamie Gritton AuthorDate: 2021-02-19 22:13:35 +0000 Commit: Jamie Gritton CommitDate: 2021-02-22 19:02:21 +0000 MFC jail: Change both root and working directories in jail_attach(2) jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Reported by: mjg Approved by: markj, kib (cherry picked from commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5) --- lib/libc/sys/jail.2 | 5 ++++- sys/kern/kern_descrip.c | 40 ++++++++++++++++++++++++++++++++++++---- sys/kern/kern_jail.c | 2 +- sys/sys/filedesc.h | 1 + 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/lib/libc/sys/jail.2 b/lib/libc/sys/jail.2 index 2e13a6c3a381..82c2e97d4a7b 100644 --- a/lib/libc/sys/jail.2 +++ b/lib/libc/sys/jail.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 19, 2021 .Dt JAIL 2 .Os .Sh NAME @@ -228,6 +228,9 @@ The system call attaches the current process to an existing jail, identified by .Fa jid . +It changes the process's root and current directories to the jail's +.Va path +directory. .Pp The .Fn jail_remove diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index bfa67c64f265..8614656990c0 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3242,10 +3242,9 @@ chroot_refuse_vdir_fds(struct filedesc *fdp) } /* - * Common routine for kern_chroot() and jail_attach(). The caller is - * responsible for invoking priv_check() and mac_vnode_check_chroot() to - * authorize this operation. - */ +* The caller is responsible for invoking priv_check() and +* mac_vnode_check_chroot() to authorize this operation. +*/ int pwd_chroot(struct thread *td, struct vnode *vp) { @@ -3291,6 +3290,39 @@ pwd_chdir(struct thread *td, struct vnode *vp) vrele(oldvp); } +/* + * jail_attach(2) changes both root and working directories. + */ +int +pwd_chroot_chdir(struct thread *td, struct vnode *vp) +{ + struct filedesc *fdp; + struct vnode *oldvrp, *oldvcp; + int error; + + fdp = td->td_proc->p_fd; + FILEDESC_XLOCK(fdp); + error = chroot_refuse_vdir_fds(fdp); + if (error != 0) { + FILEDESC_XUNLOCK(fdp); + return (error); + } + oldvrp = fdp->fd_rdir; + vrefact(vp); + fdp->fd_rdir = vp; + oldvcp = fdp->fd_cdir; + vrefact(vp); + fdp->fd_cdir = vp; + if (fdp->fd_jdir == NULL) { + vrefact(vp); + fdp->fd_jdir = vp; + } + FILEDESC_XUNLOCK(fdp); + vrele(oldvrp); + vrele(oldvcp); + return (0); +} + /* * Scan all active processes and prisons to see if any of them have a current * or root directory of `olddp'. If so, replace them with the new mount point. diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index b4a20b4d29e9..46b43fa7bbc2 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2437,7 +2437,7 @@ do_jail_attach(struct thread *td, struct prison *pr) goto e_unlock; #endif VOP_UNLOCK(pr->pr_root, 0); - if ((error = pwd_chroot(td, pr->pr_root))) + if ((error = pwd_chroot_chdir(td, pr->pr_root))) goto e_revert_osd; newcred = crget(); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index db5debcfe7c8..ca85f49d7997 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -243,6 +243,7 @@ fd_modified(struct filedesc *fdp, int fd, seq_t seq) /* cdir/rdir/jdir manipulation functions. */ void pwd_chdir(struct thread *td, struct vnode *vp); int pwd_chroot(struct thread *td, struct vnode *vp); +int pwd_chroot_chdir(struct thread *td, struct vnode *vp); void pwd_ensure_dirs(void); #endif /* _KERNEL */ From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19: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 55C0354B46B; Mon, 22 Feb 2021 19:04:27 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (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 4Dks6z1kgjz4bpn; Mon, 22 Feb 2021 19:04:26 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x835.google.com with SMTP id s15so247425qtq.0; Mon, 22 Feb 2021 11:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=TA37faqmRJgnOvZM65+h32X8I4jVZElHED9BZm/yrsY=; b=KRTlZQOt7faN2LdTxTbUZTyaOwy6uOJ5SxSaN/5fbrs4aopqhiLox6cV3SgNku7C+c QASbFdwSbmPzy+SGTZcVjlkPxFMe4anK7reAQzVMNgPow+ys0ohDkqqZiSaRLIqls3RO xV6f1EBHENr0laA/i8ORcYxCqWXz/vs79QIo4KvTxK0TttIER+D1qww7BOs6fsQTS/9b V7DAjPKGA54Est3bNOwASPSa5+KArXWtPGgnHi0Khcd+fKId+ORDD5DhNpaQnj5VrKoo ZMnWihJAKRcygIC3C3C9WcAYVCNHSyunIMnA7Z4ziveRJS6nZWkk/28R6Jik2MqBnCsD j3IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=TA37faqmRJgnOvZM65+h32X8I4jVZElHED9BZm/yrsY=; b=EuLTkW+rtpM2BzlRCpdgZun5nvPuDraQxrEKRXv1gsQc74PDV0RJKUOYC+TbCrljHb tLIZtr1z2ivn1lPaQz/OJlVrlI/V1XUvJj/aRhtoAmHz3tIlUNt+8i/ICsvEoTeD1prf lWrt3/QgaZC2f9QdWvgR9u5k+jwE/xRcsa+oBorbwBbSR6YW61ctUAgdfTTD/wMH9+nX epU/Ys30ucluFlnp6LpHRT9d5GowF20LDTyFLrFUCMZ+qE3Iblh5HXNB/+2DZoadLGAw BXEpWCMgS1IgKU8QXP+NdWjwatYuTDGPnqO9YrNhN3Dvx442J0TtvjxkTYTnQJ7Mt+aN wHOw== X-Gm-Message-State: AOAM533FMjykvuRRFXVEW0VOEJmHuJfXBdelzXVrdi5OEqVGVJyim7+n CHfZq22WN+jMAyC5fzM+D3pIMe6Xmuk= X-Google-Smtp-Source: ABdhPJwwivWKynUKuPma7OZ4OKMkrWTzvQTNwIYQu6/hb1CkR3M/uehvcASg3HirJ4OmX37mY4bgWw== X-Received: by 2002:a05:622a:28d:: with SMTP id z13mr21490870qtw.87.1614020665946; Mon, 22 Feb 2021 11:04:25 -0800 (PST) Received: from nuc ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id d1sm11057530qtq.94.2021.02.22.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 11:04:25 -0800 (PST) Sender: Mark Johnston Date: Mon, 22 Feb 2021 14:04:26 -0500 From: Mark Johnston To: Ravi Pokala Cc: Martin Matuska , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 Message-ID: References: <202102221202.11MC24EB071531@gitrepo.freebsd.org> <00E1AC08-C734-4EBD-9ABA-2404CA93B926@panasas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00E1AC08-C734-4EBD-9ABA-2404CA93B926@panasas.com> X-Rspamd-Queue-Id: 4Dks6z1kgjz4bpn 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: Mon, 22 Feb 2021 19:04:27 -0000 On Mon, Feb 22, 2021 at 10:44:31AM -0800, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Martin Matuska > Date: 2021-02-22, Monday at 04:02 > To: , , > Subject: git: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 > > The branch main has been updated by mm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 > > commit ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 > Merge: c02a28754bc2 0626917d0786 > Author: Martin Matuska > AuthorDate: 2021-02-22 11:35:56 +0000 > Commit: Martin Matuska > CommitDate: 2021-02-22 12:01:17 +0000 > > zfs: merge OpenZFS master-9312e0fd1 > > Notable upstream changes: > 778869fa1 Fix reporting of mount progress > e7adccf7f Disable use of hardware crypto offload drivers on FreeBSD > > Hi Martin, > > Why are we disabling hardware crypto offload? What impact will that have on performance? See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252981 Basically, some hardware offload drivers don't work correctly with ZFS, and the opencrypto shims in ZFS don't work properly with hardware offload drivers. For 13.0 the best solution is to just disable that support. Note that this doesn't apply to software-accelerated crypto drivers like aesni(4). From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19:04: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 D5DCD54B79F; Mon, 22 Feb 2021 19:04: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 4Dks796pt7z4byV; Mon, 22 Feb 2021 19:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14D463107; Mon, 22 Feb 2021 19:04: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 11MJ4Z7t026981; Mon, 22 Feb 2021 19:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MJ4ZFH026980; Mon, 22 Feb 2021 19:04:35 GMT (envelope-from git) Date: Mon, 22 Feb 2021 19:04:35 GMT Message-Id: <202102221904.11MJ4ZFH026980@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: 519496a59855 - main - openssh: document two changes that are now upstream 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: 519496a5985549d2935cf296a709b1e726b1b5e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 19:04:40 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=519496a5985549d2935cf296a709b1e726b1b5e5 commit 519496a5985549d2935cf296a709b1e726b1b5e5 Author: Ed Maste AuthorDate: 2021-02-22 19:03:28 +0000 Commit: Ed Maste CommitDate: 2021-02-22 19:03:28 +0000 openssh: document two changes that are now upstream These patches can be removed once we update to 8.5p1 or later. --- crypto/openssh/FREEBSD-upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index 0a62d6fa1e2c..bde003a1d183 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -103,6 +103,14 @@ An overview of FreeBSD changes to OpenSSH-portable ================================================== +* don't free string returned by login_getcapstr(3) + + Committed upstream as f060c2bc85d59d111fa18a12eb3872ee4b9f7e97 + +* Use login_getpwclass() instead of login_getclass() + + Committed upstream as 3d05e5881ceb2e48e1948ba14292216b56ed792e + 0) VersionAddendum The SSH protocol allows for a human-readable version string of up From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19:07: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 894F554BA37; Mon, 22 Feb 2021 19:07: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 4DksC02x27z4cJ7; Mon, 22 Feb 2021 19:07: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 5792F310D; Mon, 22 Feb 2021 19:07: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 11MJ7u8U027620; Mon, 22 Feb 2021 19:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MJ7urE027619; Mon, 22 Feb 2021 19:07:56 GMT (envelope-from git) Date: Mon, 22 Feb 2021 19:07:56 GMT Message-Id: <202102221907.11MJ7urE027619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 570121808a76 - stable/11 - MFC jail: Change both root and working directories in jail_attach(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 570121808a76b85b2709502fb15618dd1e5296f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 19:07:56 -0000 The branch stable/11 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=570121808a76b85b2709502fb15618dd1e5296f1 commit 570121808a76b85b2709502fb15618dd1e5296f1 Author: Jamie Gritton AuthorDate: 2021-02-19 22:13:35 +0000 Commit: Jamie Gritton CommitDate: 2021-02-22 19:07:44 +0000 MFC jail: Change both root and working directories in jail_attach(2) jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Reported by: mjg Approved by: markj, kib (cherry picked from commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5) --- lib/libc/sys/jail.2 | 5 ++++- sys/kern/kern_descrip.c | 40 ++++++++++++++++++++++++++++++++++++---- sys/kern/kern_jail.c | 2 +- sys/sys/filedesc.h | 1 + 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/lib/libc/sys/jail.2 b/lib/libc/sys/jail.2 index 2e13a6c3a381..82c2e97d4a7b 100644 --- a/lib/libc/sys/jail.2 +++ b/lib/libc/sys/jail.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 19, 2021 .Dt JAIL 2 .Os .Sh NAME @@ -228,6 +228,9 @@ The system call attaches the current process to an existing jail, identified by .Fa jid . +It changes the process's root and current directories to the jail's +.Va path +directory. .Pp The .Fn jail_remove diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 26b059c0a4b6..17f773d2b7de 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3052,10 +3052,9 @@ chroot_refuse_vdir_fds(struct filedesc *fdp) } /* - * Common routine for kern_chroot() and jail_attach(). The caller is - * responsible for invoking priv_check() and mac_vnode_check_chroot() to - * authorize this operation. - */ +* The caller is responsible for invoking priv_check() and +* mac_vnode_check_chroot() to authorize this operation. +*/ int pwd_chroot(struct thread *td, struct vnode *vp) { @@ -3101,6 +3100,39 @@ pwd_chdir(struct thread *td, struct vnode *vp) vrele(oldvp); } +/* + * jail_attach(2) changes both root and working directories. + */ +int +pwd_chroot_chdir(struct thread *td, struct vnode *vp) +{ + struct filedesc *fdp; + struct vnode *oldvrp, *oldvcp; + int error; + + fdp = td->td_proc->p_fd; + FILEDESC_XLOCK(fdp); + error = chroot_refuse_vdir_fds(fdp); + if (error != 0) { + FILEDESC_XUNLOCK(fdp); + return (error); + } + oldvrp = fdp->fd_rdir; + vrefact(vp); + fdp->fd_rdir = vp; + oldvcp = fdp->fd_cdir; + vrefact(vp); + fdp->fd_cdir = vp; + if (fdp->fd_jdir == NULL) { + vrefact(vp); + fdp->fd_jdir = vp; + } + FILEDESC_XUNLOCK(fdp); + vrele(oldvrp); + vrele(oldvcp); + return (0); +} + /* * Scan all active processes and prisons to see if any of them have a current * or root directory of `olddp'. If so, replace them with the new mount point. diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 0bb9c76a25c9..836bc4e4f8b7 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2418,7 +2418,7 @@ do_jail_attach(struct thread *td, struct prison *pr) goto e_unlock; #endif VOP_UNLOCK(pr->pr_root, 0); - if ((error = pwd_chroot(td, pr->pr_root))) + if ((error = pwd_chroot_chdir(td, pr->pr_root))) goto e_revert_osd; newcred = crget(); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index b9ad9fe363e9..5bbc5a3e6fa8 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -239,6 +239,7 @@ fd_modified(struct filedesc *fdp, int fd, seq_t seq) /* cdir/rdir/jdir manipulation functions. */ void pwd_chdir(struct thread *td, struct vnode *vp); int pwd_chroot(struct thread *td, struct vnode *vp); +int pwd_chroot_chdir(struct thread *td, struct vnode *vp); void pwd_ensure_dirs(void); #endif /* _KERNEL */ From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19:22: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 404D154BD88; Mon, 22 Feb 2021 19:22: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 4DksWZ1Nzlz4dF3; Mon, 22 Feb 2021 19:22: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 22B182FDB; Mon, 22 Feb 2021 19:22: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 11MJMIZL052345; Mon, 22 Feb 2021 19:22:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MJMIw3052344; Mon, 22 Feb 2021 19:22:18 GMT (envelope-from git) Date: Mon, 22 Feb 2021 19:22:18 GMT Message-Id: <202102221922.11MJMIw3052344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: dd250d3def37 - releng/13.0 - ktls(4): Mention WITH_OPENSSL_KTLS in the ktls(4) manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: dd250d3def37eb6f053c9239a0ef7a1f4200abd5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 19:22:18 -0000 The branch releng/13.0 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=dd250d3def37eb6f053c9239a0ef7a1f4200abd5 commit dd250d3def37eb6f053c9239a0ef7a1f4200abd5 Author: Gordon Bergling AuthorDate: 2021-02-08 20:21:26 +0000 Commit: Gordon Bergling CommitDate: 2021-02-22 19:21:46 +0000 ktls(4): Mention WITH_OPENSSL_KTLS in the ktls(4) manual page Since we ship a ktls(4) enabled OpenSSL version, mention the src.conf(5) option WITH_OPENSSL_KTLS in the manual page. Approved by: re (gjb) Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28435 (cherry picked from commit 6c34d8ce11cb73e718fc23d85b6fbfab07ee15b4) --- share/man/man4/ktls.4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 9a8dccfb8afe..21e1a1bdb6ca 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2020 +.Dd February 8, 2021 .Dt KTLS 4 .Os .Sh NAME @@ -237,7 +237,9 @@ port may also be built with support for .Nm by enabling the .Dv KTLS -option . +option. +OpenSSL in the base system includes KTLS support when built with +.Dv WITH_OPENSSL_KTLS . .Pp Applications using a supported library should generally work with .Nm @@ -256,6 +258,7 @@ As a result, it is only supported on architectures with a direct map. .Xr cxgbe 4 , .Xr mlx5en 4 , .Xr tcp 4 , +.Xr src.conf 5 , .Xr ifconfig 8 , .Xr sysctl 8 , .Xr crypto 9 From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19:22: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 595DE54BC41; Mon, 22 Feb 2021 19:22: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 4DksWp17qzz4dJ8; Mon, 22 Feb 2021 19:22: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 DA49836DF; Mon, 22 Feb 2021 19:22: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 11MJMTkS053341; Mon, 22 Feb 2021 19:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MJMTux053340; Mon, 22 Feb 2021 19:22:29 GMT (envelope-from git) Date: Mon, 22 Feb 2021 19:22:29 GMT Message-Id: <202102221922.11MJMTux053340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: a805ffbcbce8 - main - ipfilter: Make LARGE_NAT a tunable. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a805ffbcbce85872e71d825fd405a4a30e2ab4bc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 19:22:30 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a805ffbcbce85872e71d825fd405a4a30e2ab4bc commit a805ffbcbce85872e71d825fd405a4a30e2ab4bc Author: Cy Schubert AuthorDate: 2021-02-16 15:44:07 +0000 Commit: Cy Schubert CommitDate: 2021-02-22 19:20:18 +0000 ipfilter: Make LARGE_NAT a tunable. LARGE_NAT is a C macro that increases NAT_SIZE from 127 to 2047, RDR_SIZE from 127 to 2047, HOSTMAP_SIZE from 2047 to 8191, NAT_TABLE_MAX from 30000 to 180000, and NAT_TABLE_SZ from 2047 to 16383. These values can be altered at runtime using the ipf -T command however some adminstrators of large firewalls rebuild the kernel to enable LARGE_NAT at boot. This revision adds the tunable net.inet.ipf.large_nat which allows an administrator to set this option at boot instead of build time. Setting the LARGE_NAT macro to 1 is unaffected allowing build-time users to continue using the old way. --- sys/contrib/ipfilter/netinet/fil.c | 5 +++ sys/contrib/ipfilter/netinet/ip_fil.h | 2 + sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 7 ++++ sys/contrib/ipfilter/netinet/ip_nat.c | 28 +++++++------ sys/contrib/ipfilter/netinet/ip_nat.h | 60 +++++++++++++-------------- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 7 +++- 6 files changed, 65 insertions(+), 44 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 09b4c27a1cb4..c04015c2b41e 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -9338,6 +9338,11 @@ ipf_main_soft_create(arg) softc->ipf_icmpminfragmtu = 68; softc->ipf_flags = IPF_LOGGING; +#ifdef LARGE_NAT + softc->ipf_large_nat = 1; +#endif + ipf_fbsd_kenv_get(softc); + return softc; } diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 8cb988e1fd17..7e976d88cc0f 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -1547,6 +1547,7 @@ typedef struct ipf_main_softc_s { u_int ipf_icmptimeout; u_int ipf_icmpacktimeout; u_int ipf_iptimeout; + u_int ipf_large_nat; u_long ipf_ticks; u_long ipf_userifqs; u_long ipf_rb_no_mem; @@ -1653,6 +1654,7 @@ extern int ipf_pfil_hook(void); extern int ipf_pfil_unhook(void); extern void ipf_event_reg(void); extern void ipf_event_dereg(void); +extern void ipf_fbsd_kenv_get(ipf_main_softc_t *); # endif # if defined(INSTANCES) diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index bac73cee4e8b..072ab8bcd4e5 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -1487,3 +1487,10 @@ ipf_pcksum6(m, ip6, off, len) #endif } #endif + +void +ipf_fbsd_kenv_get(ipf_main_softc_t *softc) +{ + TUNABLE_INT_FETCH("net.inet.ipf.large_nat", + &softc->ipf_large_nat); +} diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 33d190c61a0a..9ce6063eb7f3 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -321,11 +321,19 @@ ipf_nat_soft_create(softc) softn->ipf_nat_list_tail = &softn->ipf_nat_list; - softn->ipf_nat_table_max = NAT_TABLE_MAX; - softn->ipf_nat_table_sz = NAT_TABLE_SZ; - softn->ipf_nat_maprules_sz = NAT_SIZE; - softn->ipf_nat_rdrrules_sz = RDR_SIZE; - softn->ipf_nat_hostmap_sz = HOSTMAP_SIZE; + if (softc->ipf_large_nat) { + softn->ipf_nat_table_max = NAT_TABLE_MAX_LARGE; + softn->ipf_nat_table_sz = NAT_TABLE_SZ_LARGE; + softn->ipf_nat_maprules_sz = NAT_SIZE_LARGE; + softn->ipf_nat_rdrrules_sz = RDR_SIZE_LARGE; + softn->ipf_nat_hostmap_sz = HOSTMAP_SIZE_LARGE; + } else { + softn->ipf_nat_table_max = NAT_TABLE_MAX_NORMAL; + softn->ipf_nat_table_sz = NAT_TABLE_SZ_NORMAL; + softn->ipf_nat_maprules_sz = NAT_SIZE_NORMAL; + softn->ipf_nat_rdrrules_sz = RDR_SIZE_NORMAL; + softn->ipf_nat_hostmap_sz = HOSTMAP_SIZE_NORMAL; + } softn->ipf_nat_doflush = 0; #ifdef IPFILTER_LOG softn->ipf_nat_logging = 1; @@ -492,10 +500,8 @@ ipf_nat_soft_init(softc, arg) for (i = 0, tq = softn->ipf_nat_tcptq; i < IPF_TCP_NSTATES; i++, tq++) { if (tq->ifq_ttl < softn->ipf_nat_deficmpage) tq->ifq_ttl = softn->ipf_nat_deficmpage; -#ifdef LARGE_NAT - else if (tq->ifq_ttl > softn->ipf_nat_defage) + else if (tq->ifq_ttl > softn->ipf_nat_defage && softc->ipf_large_nat) tq->ifq_ttl = softn->ipf_nat_defage; -#endif } /* @@ -6141,10 +6147,8 @@ ipf_nat_log(softc, softn, nat, action) u_int action; { #ifdef IPFILTER_LOG -# ifndef LARGE_NAT struct ipnat *np; int rulen; -# endif struct natlog natl; void *items[1]; size_t sizes[1]; @@ -6180,8 +6184,7 @@ ipf_nat_log(softc, softn, nat, action) bcopy(nat->nat_ifnames[1], natl.nl_ifnames[1], sizeof(nat->nat_ifnames[1])); -# ifndef LARGE_NAT - if (nat->nat_ptr != NULL) { + if (softc->ipf_large_nat && nat->nat_ptr != NULL) { for (rulen = 0, np = softn->ipf_nat_list; np != NULL; np = np->in_next, rulen++) if (np == nat->nat_ptr) { @@ -6189,7 +6192,6 @@ ipf_nat_log(softc, softn, nat, action) break; } } -# endif items[0] = &natl; sizes[0] = sizeof(natl); types[0] = 0; diff --git a/sys/contrib/ipfilter/netinet/ip_nat.h b/sys/contrib/ipfilter/netinet/ip_nat.h index bcec72f21f8b..aac8c326aa05 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.h +++ b/sys/contrib/ipfilter/netinet/ip_nat.h @@ -34,44 +34,44 @@ * appropriate sizes. The figures below were used for * a setup with 1000-2000 networks to NAT. */ -#ifndef NAT_SIZE -# ifdef LARGE_NAT -# define NAT_SIZE 2047 -# else -# define NAT_SIZE 127 -# endif +#ifdef NAT_SIZE +# define NAT_SIZE_LARGE NAT_SIZE +# define NAT_SIZE_NORMAL NAT_SIZE +#else +# define NAT_SIZE_LARGE 2047 +# define NAT_SIZE_NORMAL 127 #endif -#ifndef RDR_SIZE -# ifdef LARGE_NAT -# define RDR_SIZE 2047 -# else -# define RDR_SIZE 127 -# endif +#ifdef RDR_SIZE +# define RDR_SIZE_LARGE RDR_SIZE +# define RDR_SIZE_NORMAL RDR_SIZE +#else +# define RDR_SIZE_LARGE 2047 +# define RDR_SIZE_NORMAL 127 #endif -#ifndef HOSTMAP_SIZE -# ifdef LARGE_NAT -# define HOSTMAP_SIZE 8191 -# else -# define HOSTMAP_SIZE 2047 -# endif +#ifdef HOSTMAP_SIZE +# define HOSTMAP_SIZE_LARGE HOSTMAP_SIZE +# define HOSTMAP_SIZE_NORMAL HOSTMAP_SIZE +#else +# define HOSTMAP_SIZE_LARGE 8191 +# define HOSTMAP_SIZE_NORMAL 2047 #endif -#ifndef NAT_TABLE_MAX /* * This is newly introduced and for the sake of "least surprise", the numbers * present aren't what we'd normally use for creating a proper hash table. */ -# ifdef LARGE_NAT -# define NAT_TABLE_MAX 180000 -# else -# define NAT_TABLE_MAX 30000 -# endif +#ifdef NAT_TABLE_MAX +# define NAT_TABLE_MAX_LARGE NAT_TABLE_MAX +# define NAT_TABLE_MAX_NORMAL NAT_TABLE_MAX +#else +# define NAT_TABLE_MAX_LARGE 180000 +# define NAT_TABLE_MAX_NORMAL 30000 #endif -#ifndef NAT_TABLE_SZ -# ifdef LARGE_NAT -# define NAT_TABLE_SZ 16383 -# else -# define NAT_TABLE_SZ 2047 -# endif +#ifdef NAT_TABLE_SZ +# define NAT_TABLE_SZ_LARGE NAT_TABLE_SZ +# define NAT_TABLE_SZ_NORMAL NAT_TABLE_SZ +#else +# define NAT_TABLE_SZ_LARGE 16383 +# define NAT_TABLE_SZ_NORMAL 2047 #endif #ifndef APR_LABELLEN #define APR_LABELLEN 16 diff --git a/sys/contrib/ipfilter/netinet/mlfk_ipl.c b/sys/contrib/ipfilter/netinet/mlfk_ipl.c index 6e49ef77b486..64beb1448858 100644 --- a/sys/contrib/ipfilter/netinet/mlfk_ipl.c +++ b/sys/contrib/ipfilter/netinet/mlfk_ipl.c @@ -80,6 +80,11 @@ static int ipfread(dev_t, struct uio *, int); static int ipfwrite(dev_t, struct uio *, int); #endif +#ifdef LARGE_NAT +#define IPF_LARGE_NAT 1 +#else +#define IPF_LARGE_NAT 0 +#endif SYSCTL_DECL(_net_inet); #define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \ @@ -132,6 +137,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_chksrc), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_minttl), 0, ""); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, large_nat, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_large_nat), 0, "large_nat"); #define CDEV_MAJOR 79 #include @@ -646,4 +652,3 @@ ipf_fbsd_sysctl_destroy(void) } return 0; } - From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19:22: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 486D654BC40; Mon, 22 Feb 2021 19:22: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 4DksWn3Mrjz4d03; Mon, 22 Feb 2021 19: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 8AE2733A9; Mon, 22 Feb 2021 19: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 11MJMSY3052569; Mon, 22 Feb 2021 19:22:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MJMSaa052556; Mon, 22 Feb 2021 19:22:28 GMT (envelope-from git) Date: Mon, 22 Feb 2021 19:22:28 GMT Message-Id: <202102221922.11MJMSaa052556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: e2ad10e84792 - main - Remove the redundant ipfilter IPv6 rc rules load. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2ad10e84792e8dcfb0e03a9b5cb19cd3d93ddf8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 19:22:30 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e2ad10e84792e8dcfb0e03a9b5cb19cd3d93ddf8 commit e2ad10e84792e8dcfb0e03a9b5cb19cd3d93ddf8 Author: Cy Schubert AuthorDate: 2021-02-12 15:17:32 +0000 Commit: Cy Schubert CommitDate: 2021-02-22 19:20:18 +0000 Remove the redundant ipfilter IPv6 rc rules load. As of ipfilter 5.1.2 the IPv4 and IPv6 rules tables have been merged. The ipf(8) -6 option has been a NOP since then. Currently the additional ipf -6 load statement in rc.d/ipfilter simply added the second ipfilter rules file to the table already populated by the previous ipf command. Plenty of time has passed since ipfilter 5.1.2 was imported. It is time to remove the option from rc.conf and the rc script. Differential Revision: https://reviews.freebsd.org/D28615 --- libexec/rc/rc.conf | 3 --- libexec/rc/rc.d/ipfilter | 13 +------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 55a7112b15ea..998cd3fd14d6 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -546,9 +546,6 @@ stf_interface_ipv6_ifid="0:0:0:1" # IPv6 interface id for stf0. stf_interface_ipv6_slaid="0000" # IPv6 Site Level Aggregator for stf0 ipv6_ipv4mapping="NO" # Set to "YES" to enable IPv4 mapped IPv6 addr # communication. (like ::ffff:a.b.c.d) -ipv6_ipfilter_rules="/etc/ipf6.rules" # rules definition file for ipfilter, - # see /usr/src/contrib/ipfilter/rules - # for examples ip6addrctl_enable="YES" # Set to YES to enable default address selection ip6addrctl_verbose="NO" # Set to YES to enable verbose configuration messages ip6addrctl_policy="AUTO" # A pre-defined address selection policy diff --git a/libexec/rc/rc.d/ipfilter b/libexec/rc/rc.d/ipfilter index fe328308e622..abe49c919656 100755 --- a/libexec/rc/rc.d/ipfilter +++ b/libexec/rc/rc.d/ipfilter @@ -14,7 +14,7 @@ name="ipfilter" desc="IP packet filter" rcvar="ipfilter_enable" load_rc_config $name -stop_precmd="test -f ${ipfilter_rules} -o -f ${ipv6_ipfilter_rules}" +stop_precmd="test -f ${ipfilter_rules}" start_precmd="$stop_precmd" start_cmd="ipfilter_start" @@ -39,10 +39,6 @@ ipfilter_start() ${ipfilter_program:-/sbin/ipf} \ -f "${ipfilter_rules}" ${ipfilter_flags} fi - if [ -r "${ipv6_ipfilter_rules}" ]; then - ${ipfilter_program:-/sbin/ipf} -6 \ - -f "${ipv6_ipfilter_rules}" ${ipfilter_flags} - fi } ipfilter_stop() @@ -67,13 +63,6 @@ ipfilter_reload() err 1 'Load of rules into alternate set failed; aborting reload' fi fi - if [ -r "${ipv6_ipfilter_rules}" ]; then - ${ipfilter_program:-/sbin/ipf} -I -6 \ - -f "${ipv6_ipfilter_rules}" ${ipfilter_flags} - if [ $? -ne 0 ]; then - err 1 'Load of IPv6 rules into alternate set failed; aborting reload' - fi - fi ${ipfilter_program:-/sbin/ipf} -s } From owner-dev-commits-src-all@freebsd.org Mon Feb 22 19:57: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 B79C954C995; Mon, 22 Feb 2021 19:57:25 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "vtr.rulingia.com", Issuer "R3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DktJ51XZ3z4fpq; Mon, 22 Feb 2021 19:57:24 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.16.1/8.15.2) with ESMTPS id 11MJv9dh081968 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Feb 2021 06:57:15 +1100 (AEDT) (envelope-from peter@rulingia.com) DKIM-Filter: OpenDKIM Filter v2.10.3 vtr.rulingia.com 11MJv9dh081968 X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.16.1/8.16.1) with ESMTPS id 11MJv3tt089629 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 23 Feb 2021 06:57:03 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.16.1/8.16.1/Submit) id 11MJv3Nh089628; Tue, 23 Feb 2021 06:57:03 +1100 (AEDT) (envelope-from peter) Date: Tue, 23 Feb 2021 06:57:03 +1100 From: Peter Jeremy To: Martin Matuska Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, "O. Hartmann" Subject: Re: git: ba27dd8be821 - main - zfs: merge OpenZFS master-9312e0fd1 Message-ID: References: <202102221202.11MC24EB071531@gitrepo.freebsd.org> <20210222150142.4b76b7c6@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KY3kFhJ1LTUOry6o" Content-Disposition: inline In-Reply-To: <20210222150142.4b76b7c6@thor.intern.walstatt.dynvpn.de> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp X-Rspamd-Queue-Id: 4DktJ51XZ3z4fpq X-Spamd-Bar: ---- 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: Mon, 22 Feb 2021 19:57:25 -0000 --KY3kFhJ1LTUOry6o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-Feb-22 15:01:15 +0100, "O. Hartmann" wrote: >Am Mon, 22 Feb 2021 12:02:04 GMT >Martin Matuska schrieb: > >> The branch main has been updated by mm: >>=20 >> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dba27dd8be821792e15bdabfac= 69fd6cab0cf9dd3 >>=20 >> commit ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 >> Merge: c02a28754bc2 0626917d0786 >> Author: Martin Matuska >> AuthorDate: 2021-02-22 11:35:56 +0000 >> Commit: Martin Matuska >> CommitDate: 2021-02-22 12:01:17 +0000 >>=20 >> zfs: merge OpenZFS master-9312e0fd1 >> =20 >> Notable upstream changes: >> 778869fa1 Fix reporting of mount progress >> e7adccf7f Disable use of hardware crypto offload drivers on FreeBSD >> 03e02e5b5 Fix checksum errors not being counted on repeated repair >> 64e0fe14f Restore FreeBSD resource usage accounting >> 11f2e9a49 Fix panic if scrubbing after removing a slog device =2E.. >On FreeBSD 14-CURRENT, with ZFS statically builtin the kernel, this commit= renders "make >buildkernel" to fail: > >[...] > >=3D=3D=3D> cam (all) >--- kernel --- >ld: error: undefined symbol: zfs_racct_read >>>> referenced by arc.c >>>> arc.o:(arc_read) >--- modules-all --- >--- all_subdir_cardbus --- >=3D=3D=3D> cardbus (all) >--- kernel --- > >ld: error: undefined symbol: zfs_racct_write >>>> referenced by dmu.c >>>> dmu.o:(dmu_buf_hold_array_by_dnode) >>>> referenced by dmu.c >>>> dmu.o:(dmu_assign_arcbuf_by_dnode) >*** [kernel] Error code 1 I can reproduce this as well. This commit has omitted the following line =66rom sys/conf/files and therefore broken building ZFS into the kernel: contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c optional zfs compile-with= "${ZFS_C}" --=20 Peter Jeremy --KY3kFhJ1LTUOry6o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmA0DIRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQ17A//anEHvLTFLe9/Japuop7tzxul7pGLHePUTbWcTKNO3dJEq3uAueFzkTCN c9c+Aq9eMd8Bas7JYY/gqVsmuwfDNyAK8H0s3r379IrNFCdt61rz9iMg1+byeLk1 GyfGp/CAJ0rd/SuCDp+cm4rIs5ZKm0YHnxVQSNUJIde3OjYda9hDeIiK1RZ0bHcm xkKrByP1Izm8Tv/nla8btQxaolnTCSrn/PtG15ULAqipawmxTPDdz9k4Jt/fAzVf 7t/7qaP+lPdcjXkdMkaJW7arYfLUgQEtZk10EuViqaUgfVx+3OFgunOonuJ97q8E jQGLPGvj3tHGktTAh4Mbt8iiKIA4NgSIr/NLWQgv2HSUFp6ZKO5CrWKS22/FDJGJ MM9bv5cLRt+PYtZBcRLusVGmklBwH2AHKrQ1WgELtS74jJBoT3zJBsY9M8LZTJSX KVsU8ay9BUB15gUvSr/f7ijA+gc8OUjNHW8m2IUYWwp6FyrRdMzAXsnXlUBhnOXd 6ZYiB/zn+lqlcHtkqYpxqwBVrYvQ6AoqEbUricri37XzO5WZ62J5Ol+SiX9TRlut i4dUgoewP7QTrIOvIf7I6D8Csu6uPoauQvFq/UmWfS9K9KBQfN40RKPrEDDRj5Ao wZueWxcmY7uZf2zK80gqZEoqgrAIJN8mxsFmty/Z/2oQ223oAF4= =Pe8y -----END PGP SIGNATURE----- --KY3kFhJ1LTUOry6o-- From owner-dev-commits-src-all@freebsd.org Mon Feb 22 20:07: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 6511554CE6C; Mon, 22 Feb 2021 20:07: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 4DktX72F9Xz4gTp; Mon, 22 Feb 2021 20:07: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 3D5F73E1E; Mon, 22 Feb 2021 20:07: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 11MK7ppe007163; Mon, 22 Feb 2021 20:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MK7pj2007162; Mon, 22 Feb 2021 20:07:51 GMT (envelope-from git) Date: Mon, 22 Feb 2021 20:07:51 GMT Message-Id: <202102222007.11MK7pj2007162@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: d149877758f1 - main - Fix possibly unitialized variables in __cxa_demangle_gnu3() 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: d149877758f162f0c777e7760164bf2c1f7a1bc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 20:07:51 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d149877758f162f0c777e7760164bf2c1f7a1bc1 commit d149877758f162f0c777e7760164bf2c1f7a1bc1 Author: Dimitry Andric AuthorDate: 2021-02-22 20:01:09 +0000 Commit: Dimitry Andric CommitDate: 2021-02-22 20:01:09 +0000 Fix possibly unitialized variables in __cxa_demangle_gnu3() After 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 where I imported a more recent libcxxrt snapshot, the variables 'rtn' and 'has_ret' could in some cases be used while still uninitialized. Most obviously this would lead to a jemalloc complaint about a bad free(), aborting the program. Fix this by initializing a bunch variables in their declarations. This change has also been sent upstream, with some additional changes to be used in their testing framework. PR: 253226 MFC after: 3 days --- contrib/libcxxrt/libelftc_dem_gnu3.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/contrib/libcxxrt/libelftc_dem_gnu3.c b/contrib/libcxxrt/libelftc_dem_gnu3.c index 6e88f7b4bb4c..93e1c41fa034 100644 --- a/contrib/libcxxrt/libelftc_dem_gnu3.c +++ b/contrib/libcxxrt/libelftc_dem_gnu3.c @@ -538,8 +538,8 @@ __cxa_demangle_gnu3(const char *org) struct type_delimit td; ssize_t org_len; unsigned int limit; - char *rtn; - bool has_ret, more_type; + char *rtn = NULL; + bool has_ret = false, more_type = false; if (org == NULL) return (NULL); @@ -562,13 +562,9 @@ __cxa_demangle_gnu3(const char *org) return (rtn); } - if (!cpp_demangle_data_init(&ddata, org + 2)) return (NULL); - rtn = NULL; - has_ret = more_type = false; - if (!cpp_demangle_read_encoding(&ddata)) goto clean; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 20:21:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6893E54D159; Mon, 22 Feb 2021 20:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dktqx0rQzz4hDQ; Mon, 22 Feb 2021 20:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FB6D43BB; Mon, 22 Feb 2021 20:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11MKLW6l031842; Mon, 22 Feb 2021 20:21:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MKLWc4031841; Mon, 22 Feb 2021 20:21:32 GMT (envelope-from git) Date: Mon, 22 Feb 2021 20:21:32 GMT Message-Id: <202102222021.11MKLWc4031841@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: ab77cc9e7bf6 - main - Remove incorrect statement about EFI environment variables being unsupported. 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: ab77cc9e7bf6d0c2d862dfd514539b81ae248dfd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 20:21:33 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ab77cc9e7bf6d0c2d862dfd514539b81ae248dfd commit ab77cc9e7bf6d0c2d862dfd514539b81ae248dfd Author: Warner Losh AuthorDate: 2021-02-22 20:19:21 +0000 Commit: Warner Losh CommitDate: 2021-02-22 20:20:58 +0000 Remove incorrect statement about EFI environment variables being unsupported. Our uefi support has included environment variable support for several years now. Remove the bogus blanket statement saying we don't support them. MFC After: 3 days --- share/man/man8/uefi.8 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 4224af835738..05c74caa6c20 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2020 +.Dd February 22, 2021 .Dt UEFI 8 .Os .Sh NAME @@ -143,7 +143,3 @@ boot support for amd64 first appeared in .Fx 10.1 and for arm64 in .Fx 11.0 . -.Sh CAVEATS -EFI environment variables are not supported by -.Xr loader 8 -or the kernel. From owner-dev-commits-src-all@freebsd.org Mon Feb 22 20:27: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 EC38E54D479; Mon, 22 Feb 2021 20:27: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 4DktzJ2mz1z4jHk; Mon, 22 Feb 2021 20:27: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 A58C2412F; Mon, 22 Feb 2021 20:27: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 11MKRtXM033617; Mon, 22 Feb 2021 20:27:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MKRtcl033616; Mon, 22 Feb 2021 20:27:55 GMT (envelope-from git) Date: Mon, 22 Feb 2021 20:27:55 GMT Message-Id: <202102222027.11MKRtcl033616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 811e27fa3c44 - main - jail: Add PD_KILL to remove a prison in prison_deref(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 811e27fa3c445664e36071a7d08228fc7fb85676 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 20:27:57 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=811e27fa3c445664e36071a7d08228fc7fb85676 commit 811e27fa3c445664e36071a7d08228fc7fb85676 Author: Jamie Gritton AuthorDate: 2021-02-22 20:27:44 +0000 Commit: Jamie Gritton CommitDate: 2021-02-22 20:27:44 +0000 jail: Add PD_KILL to remove a prison in prison_deref(). Add the PD_KILL flag that instructs prison_deref() to take steps to actively kill a prison and its descendents, namely marking it PRISON_STATE_DYING, clearing its PR_PERSIST flag, and killing any attached processes. This replaces a similar loop in sys_jail_remove(), bringing the operation under the same single hold on allprison_lock that it already has. It is also used to clean up failed jail (re-)creations in kern_jail_set(), which didn't generally take all the proper steps. Differential Revision: https://reviews.freebsd.org/D28473 --- sys/kern/kern_jail.c | 258 ++++++++++++++++++++++++++++++++------------------- sys/sys/jail.h | 13 +++ 2 files changed, 178 insertions(+), 93 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 1ddfe3c3df5f..01724e41955c 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -141,12 +141,13 @@ static int get_next_prid(struct prison **insprp); static int do_jail_attach(struct thread *td, struct prison *pr, int drflags); static void prison_complete(void *context, int pending); static void prison_deref(struct prison *pr, int flags); +static void prison_deref_kill(struct prison *pr, struct prisonlist *freeprison); static int prison_lock_xlock(struct prison *pr, int flags); static void prison_free_not_last(struct prison *pr); +static void prison_proc_free_not_last(struct prison *pr); static void prison_set_allow_locked(struct prison *pr, unsigned flag, int enable); static char *prison_path(struct prison *pr1, struct prison *pr2); -static void prison_remove_one(struct prison *pr); #ifdef RACCT static void prison_racct_attach(struct prison *pr); static void prison_racct_modify(struct prison *pr); @@ -156,9 +157,10 @@ static void prison_racct_detach(struct prison *pr); /* Flags for prison_deref */ #define PD_DEREF 0x01 /* Decrement pr_ref */ #define PD_DEUREF 0x02 /* Decrement pr_uref */ -#define PD_LOCKED 0x04 /* pr_mtx is held */ -#define PD_LIST_SLOCKED 0x08 /* allprison_lock is held shared */ -#define PD_LIST_XLOCKED 0x10 /* allprison_lock is held exclusive */ +#define PD_KILL 0x04 /* Remove jail, kill processes, etc */ +#define PD_LOCKED 0x10 /* pr_mtx is held */ +#define PD_LIST_SLOCKED 0x20 /* allprison_lock is held shared */ +#define PD_LIST_XLOCKED 0x40 /* allprison_lock is held exclusive */ /* * Parameter names corresponding to PR_* flag values. Size values are for kvm @@ -1756,6 +1758,12 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags; mtx_unlock(&pr->pr_mtx); drflags &= ~PD_LOCKED; + /* + * Any errors past this point will need to de-persist newly created + * prisons, as well as call remove methods. + */ + if (born) + drflags |= PD_KILL; #ifdef RACCT if (racct_enable && created) @@ -1815,17 +1823,12 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) /* Let the modules do their work. */ if (born) { error = osd_jail_call(pr, PR_METHOD_CREATE, opts); - if (error) { - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + if (error) goto done_deref; - } } error = osd_jail_call(pr, PR_METHOD_SET, opts); - if (error) { - if (born) - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + if (error) goto done_deref; - } /* * A new prison is now ready to be seen; either it has gained a user @@ -1856,6 +1859,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } #endif + drflags &= ~PD_KILL; td->td_retval[0] = pr->pr_id; done_deref: @@ -2279,8 +2283,8 @@ kern_jail_get(struct thread *td, struct uio *optuio, int flags) int sys_jail_remove(struct thread *td, struct jail_remove_args *uap) { - struct prison *pr, *cpr, *lpr; - int descend, error; + struct prison *pr; + int error; error = priv_check(td, PRIV_JAIL_REMOVE); if (error) @@ -2292,90 +2296,16 @@ sys_jail_remove(struct thread *td, struct jail_remove_args *uap) sx_xunlock(&allprison_lock); return (EINVAL); } - - /* Remove all descendants of this prison, then remove this prison. */ - prison_hold(pr); - if (!LIST_EMPTY(&pr->pr_children)) { + if (!prison_isalive(pr)) { + /* Silently ignore already-dying prisons. */ mtx_unlock(&pr->pr_mtx); - lpr = NULL; - FOREACH_PRISON_DESCENDANT(pr, cpr, descend) { - prison_hold(cpr); - if (lpr != NULL) { - mtx_lock(&lpr->pr_mtx); - prison_remove_one(lpr); - sx_xlock(&allprison_lock); - } - lpr = cpr; - } - if (lpr != NULL) { - mtx_lock(&lpr->pr_mtx); - prison_remove_one(lpr); - sx_xlock(&allprison_lock); - } - mtx_lock(&pr->pr_mtx); + sx_xunlock(&allprison_lock); + return (0); } - prison_remove_one(pr); + prison_deref(pr, PD_KILL | PD_LOCKED | PD_LIST_XLOCKED); return (0); } -static void -prison_remove_one(struct prison *pr) -{ - struct proc *p; - int was_alive, drflags; - - drflags = PD_DEREF | PD_LOCKED | PD_LIST_XLOCKED; - - /* - * Mark the prison as doomed, so it doesn't accidentally come back - * to life. It may still be explicitly brought back by jail_set(2). - */ - was_alive = pr->pr_state == PRISON_STATE_ALIVE; - pr->pr_state = PRISON_STATE_DYING; - - /* If the prison was persistent, it is not anymore. */ - if (pr->pr_flags & PR_PERSIST) { - drflags |= PD_DEUREF; - prison_free_not_last(pr); - pr->pr_flags &= ~PR_PERSIST; - } - - /* - * jail_remove added a reference. If that's the only one, remove - * the prison now. refcount(9) doesn't guarantee the cache coherence - * of non-zero counters, so force it here. - */ - KASSERT(refcount_load(&pr->pr_ref) > 0, - ("prison_remove_one removing a dead prison (jid=%d)", pr->pr_id)); - if (atomic_load_acq_int(&pr->pr_ref) == 1) { - prison_deref(pr, drflags); - return; - } - - /* Tell modules this prison has died. */ - mtx_unlock(&pr->pr_mtx); - drflags &= ~PD_LOCKED; - if (was_alive) - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); - - sx_xunlock(&allprison_lock); - drflags &= ~PD_LIST_XLOCKED; - /* - * Kill all processes unfortunate enough to be attached to this prison. - */ - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_state != PRS_NEW && p->p_ucred && - p->p_ucred->cr_prison == pr) - kern_psignal(p, SIGKILL); - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); - /* Remove the temporary reference added by jail_remove. */ - prison_deref(pr, drflags); -} - /* * struct jail_attach_args { * int jid; @@ -2727,6 +2657,24 @@ prison_proc_free(struct prison *pr) } } +static void +prison_proc_free_not_last(struct prison *pr) +{ +#ifdef INVARIANTS + int lastref; + + KASSERT(refcount_load(&pr->pr_uref) > 0, + ("Trying to free dead prison %p (jid=%d).", + pr, pr->pr_id)); + lastref = refcount_release(&pr->pr_uref); + KASSERT(!lastref, + ("prison_proc_free_not_last freed last uref on prison %p (jid=%d).", + pr, pr->pr_id)); +#else + refcount_release(&pr->pr_uref); +#endif +} + /* * Complete a call to either prison_free or prison_proc_free. */ @@ -2760,14 +2708,25 @@ static void prison_deref(struct prison *pr, int flags) { struct prisonlist freeprison; - struct prison *rpr, *ppr, *tpr; + struct prison *killpr, *rpr, *ppr, *tpr; + struct proc *p; + killpr = NULL; TAILQ_INIT(&freeprison); /* * Release this prison as requested, which may cause its parent * to be released, and then maybe its grandparent, etc. */ for (;;) { + if (flags & PD_KILL) { + /* Kill the prison and its descendents. */ + if (!(flags & PD_DEREF)) { + prison_hold(pr); + flags |= PD_DEREF; + } + flags = prison_lock_xlock(pr, flags); + prison_deref_kill(pr, &freeprison); + } if (flags & PD_DEUREF) { /* Drop a user reference. */ KASSERT(refcount_load(&pr->pr_uref) > 0, @@ -2796,6 +2755,16 @@ prison_deref(struct prison *pr, int flags) } } } + if (flags & PD_KILL) { + flags &= ~PD_KILL; + /* + * Any remaining user references are probably processes + * that need to be killed, either in this prison or its + * descendants. + */ + if (refcount_load(&pr->pr_uref) > 0) + killpr = pr; + } if (flags & PD_DEREF) { /* Drop a reference. */ KASSERT(refcount_load(&pr->pr_ref) > 0, @@ -2848,6 +2817,25 @@ prison_deref(struct prison *pr, int flags) else if (flags & PD_LIST_XLOCKED) sx_xunlock(&allprison_lock); + /* Kill any processes attached to a killed prison. */ + if (killpr != NULL) { + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state != PRS_NEW && p->p_ucred != NULL) { + for (ppr = p->p_ucred->cr_prison; + ppr != &prison0; + ppr = ppr->pr_parent) + if (ppr == killpr) { + kern_psignal(p, SIGKILL); + break; + } + } + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); + } + /* * Finish removing any unreferenced prisons, which couldn't happen * while allprison_lock was held (to avoid a LOR on vrele). @@ -2878,6 +2866,90 @@ prison_deref(struct prison *pr, int flags) } } +/* + * Kill the prison and its descendants. Mark them as dying, clear the + * persist flag, and call module remove methods. + */ +static void +prison_deref_kill(struct prison *pr, struct prisonlist *freeprison) +{ + struct prison *cpr, *ppr, *rpr; + bool descend; + + /* + * Unlike the descendants, the target prison can be killed + * even if it is currently dying. This is useful for failed + * creation in jail_set(2). + */ + KASSERT(refcount_load(&pr->pr_ref) > 0, + ("Trying to kill dead prison %p (jid=%d).", + pr, pr->pr_id)); + refcount_acquire(&pr->pr_uref); + pr->pr_state = PRISON_STATE_DYING; + mtx_unlock(&pr->pr_mtx); + + rpr = NULL; + FOREACH_PRISON_DESCENDANT_PRE_POST(pr, cpr, descend) { + if (descend) { + if (!prison_isalive(cpr)) { + descend = false; + continue; + } + prison_hold(cpr); + prison_proc_hold(cpr); + mtx_lock(&cpr->pr_mtx); + cpr->pr_state = PRISON_STATE_DYING; + cpr->pr_flags |= PR_REMOVE; + mtx_unlock(&cpr->pr_mtx); + } + if (!(cpr->pr_flags & PR_REMOVE)) + continue; + (void)osd_jail_call(cpr, PR_METHOD_REMOVE, NULL); + mtx_lock(&cpr->pr_mtx); + cpr->pr_flags &= ~PR_REMOVE; + if (cpr->pr_flags & PR_PERSIST) { + cpr->pr_flags &= ~PR_PERSIST; + prison_proc_free_not_last(cpr); + prison_free_not_last(cpr); + } + (void)refcount_release(&cpr->pr_uref); + if (refcount_release(&cpr->pr_ref)) { + /* + * When the last reference goes, unlink the prison + * and set it aside for prison_deref() to handle. + * Delay unlinking the sibling list to keep the loop + * safe. + */ + if (rpr != NULL) + LIST_REMOVE(rpr, pr_sibling); + rpr = cpr; + rpr->pr_state = PRISON_STATE_INVALID; + TAILQ_REMOVE(&allprison, rpr, pr_list); + TAILQ_INSERT_TAIL(freeprison, rpr, pr_list); + /* + * Removing a prison frees references from its parent. + */ + ppr = rpr->pr_parent; + prison_proc_free_not_last(ppr); + prison_free_not_last(ppr); + for (; ppr != NULL; ppr = ppr->pr_parent) + ppr->pr_childcount--; + } + mtx_unlock(&cpr->pr_mtx); + } + if (rpr != NULL) + LIST_REMOVE(rpr, pr_sibling); + + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + mtx_lock(&pr->pr_mtx); + if (pr->pr_flags & PR_PERSIST) { + pr->pr_flags &= ~PR_PERSIST; + prison_proc_free_not_last(pr); + prison_free_not_last(pr); + } + (void)refcount_release(&pr->pr_uref); +} + /* * Given the current locking state in the flags, make sure allprison_lock * is held exclusive, and the prison is locked. Return flags indicating diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 723a1fff0b82..c9d4c65e4d9e 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -341,6 +341,19 @@ prison_unlock(struct prison *pr) ; \ else +/* + * Traverse a prison's descendants, visiting both preorder and postorder. + */ +#define FOREACH_PRISON_DESCENDANT_PRE_POST(ppr, cpr, descend) \ + for ((cpr) = (ppr), (descend) = 1; \ + ((cpr) = (descend) \ + ? ((descend) = !LIST_EMPTY(&(cpr)->pr_children)) \ + ? LIST_FIRST(&(cpr)->pr_children) \ + : (cpr) \ + : ((descend) = LIST_NEXT(cpr, pr_sibling) != NULL) \ + ? LIST_NEXT(cpr, pr_sibling) \ + : cpr->pr_parent) != (ppr);) + /* * Attributes of the physical system, and the root of the jail tree. */ From owner-dev-commits-src-all@freebsd.org Mon Feb 22 20:31: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 25A3754D9B7; Mon, 22 Feb 2021 20:31: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 4Dkv3r0c40z4jnL; Mon, 22 Feb 2021 20:31: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 069D243F2; Mon, 22 Feb 2021 20:31: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 11MKVpwu044178; Mon, 22 Feb 2021 20:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MKVpiK044164; Mon, 22 Feb 2021 20:31:51 GMT (envelope-from git) Date: Mon, 22 Feb 2021 20:31:51 GMT Message-Id: <202102222031.11MKVpiK044164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: bc1df392499d - stable/12 - MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table 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/stable/12 X-Git-Reftype: branch X-Git-Commit: bc1df392499ddf3ca5f089b850b898078267bd40 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 20:31:52 -0000 The branch stable/12 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=bc1df392499ddf3ca5f089b850b898078267bd40 commit bc1df392499ddf3ca5f089b850b898078267bd40 Author: Michal Krawczyk AuthorDate: 2021-02-18 09:00:58 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-22 20:31:16 +0000 MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table In the new ENA-based instances like c6gn, the vector table moved to a new PCIe bar - BAR1. Previously it was always located on the BAR0, so the resources were already allocated together with the registers. As the FreeBSD isn't doing any resource allocation behind the scenes, the driver is responsible to allocate them explicitly, before other parts of the OS (like the PCI code allocating MSIx) will be able to access them. To determine dynamically BAR on which the MSIx vector table is present the pci_msix_table_bar() is being used and the new BAR is allocated if needed. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc (cherry picked from commit 1c808fcd859f5ce24132a903a4c7c9996e0513b1) --- sys/dev/ena/ena.c | 21 +++++++++++++++++++++ sys/dev/ena/ena.h | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 306d5dc1fd1c..0079f5354c33 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -299,6 +299,11 @@ ena_free_pci_resources(struct ena_adapter *adapter) bus_release_resource(pdev, SYS_RES_MEMORY, PCIR_BAR(ENA_REG_BAR), adapter->registers); } + + if (adapter->msix != NULL) { + bus_release_resource(pdev, SYS_RES_MEMORY, + adapter->msix_rid, adapter->msix); + } } static int @@ -3536,6 +3541,7 @@ ena_attach(device_t pdev) struct ena_adapter *adapter; struct ena_com_dev *ena_dev = NULL; uint32_t max_num_io_queues; + int msix_rid; int rid, rc; adapter = device_get_softc(pdev); @@ -3574,6 +3580,20 @@ ena_attach(device_t pdev) goto err_dev_free; } + /* MSIx vector table may reside on BAR0 with registers or on BAR1. */ + msix_rid = pci_msix_table_bar(pdev); + if (msix_rid != rid) { + adapter->msix = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, + &msix_rid, RF_ACTIVE); + if (unlikely(adapter->msix == NULL)) { + device_printf(pdev, + "unable to allocate bus resource: msix!\n"); + rc = ENOMEM; + goto err_pci_free; + } + adapter->msix_rid = msix_rid; + } + ena_dev->bus = malloc(sizeof(struct ena_bus), M_DEVBUF, M_WAITOK | M_ZERO); @@ -3739,6 +3759,7 @@ err_com_free: ena_com_mmio_reg_read_request_destroy(ena_dev); err_bus_free: free(ena_dev->bus, M_DEVBUF); +err_pci_free: ena_free_pci_resources(adapter); err_dev_free: free(ena_dev, M_DEVBUF); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index b3036eb16b2e..c8607a6d558d 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 2 #define DRV_MODULE_VER_MINOR 3 -#define DRV_MODULE_VER_SUBMINOR 0 +#define DRV_MODULE_VER_SUBMINOR 1 #define DRV_MODULE_NAME "ena" @@ -397,6 +397,8 @@ struct ena_adapter { /* OS resources */ struct resource *memory; struct resource *registers; + struct resource *msix; + int msix_rid; struct sx global_lock; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 20:34: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 39BC154D97E; Mon, 22 Feb 2021 20:34: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 4Dkv6L180dz4kR6; Mon, 22 Feb 2021 20:34: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 1A0EA43FF; Mon, 22 Feb 2021 20:34: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 11MKY2ad046146; Mon, 22 Feb 2021 20:34:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MKY2af046145; Mon, 22 Feb 2021 20:34:02 GMT (envelope-from git) Date: Mon, 22 Feb 2021 20:34:02 GMT Message-Id: <202102222034.11MKY2af046145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 5ce2d4a1c292 - main - bhyve/snapshot: drop mkdir when creating the unix domain socket 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/main X-Git-Reftype: branch X-Git-Commit: 5ce2d4a1c2922821b9940473213c0d75469755fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 20:34:02 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=5ce2d4a1c2922821b9940473213c0d75469755fc commit 5ce2d4a1c2922821b9940473213c0d75469755fc Author: Robert Wing AuthorDate: 2021-02-19 02:48:40 +0000 Commit: Robert Wing CommitDate: 2021-02-22 20:31:07 +0000 bhyve/snapshot: drop mkdir when creating the unix domain socket Add /var/run/bhyve/ to BSD.var.dist so we don't have to call mkdir when creating the unix domain socket for a given bhyve vm. The path to the unix domain socket for a bhyve vm will now be /var/run/bhyve/vmname instead of /var/run/bhyve/checkpoint/vmname Move BHYVE_RUN_DIR from snapshot.c to snapshot.h so it can be shared to bhyvectl(8). Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28783 --- etc/mtree/BSD.var.dist | 2 ++ share/man/man7/hier.7 | 4 +++- usr.sbin/bhyve/snapshot.c | 32 ++------------------------------ usr.sbin/bhyve/snapshot.h | 1 + usr.sbin/bhyvectl/bhyvectl.c | 3 +-- 5 files changed, 9 insertions(+), 33 deletions(-) diff --git a/etc/mtree/BSD.var.dist b/etc/mtree/BSD.var.dist index 6483df4a297d..f0d6f8694449 100644 --- a/etc/mtree/BSD.var.dist +++ b/etc/mtree/BSD.var.dist @@ -74,6 +74,8 @@ preserve .. run + bhyve + .. dhclient .. ppp gname=network mode=0770 diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 845c4a8a8f7c..d134e84f4c48 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 9, 2021 +.Dd February 22, 2021 .Dt HIER 7 .Os .Sh NAME @@ -832,6 +832,8 @@ system information files describing various info about system since it was booted .Pp .Bl -tag -width Fl -compact +.It Pa bhyve/ +bhyve vm unix domain sockets .It Pa ppp/ writable by the .Dq network diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c index 4ffdb315883c..11ff963ae1fd 100644 --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -115,8 +115,6 @@ static sig_t old_winch_handler; #define SNAPSHOT_CHUNK (4 * MB) #define PROG_BUF_SZ (8192) -#define BHYVE_RUN_DIR "/var/run/bhyve" -#define CHECKPOINT_RUN_DIR BHYVE_RUN_DIR "/checkpoint" #define MAX_VMNAME 100 #define MAX_MSG_SIZE 1024 @@ -1505,26 +1503,6 @@ checkpoint_thread(void *param) return (NULL); } -/* - * Create directory tree to store runtime specific information: - * i.e. UNIX sockets for IPC with bhyvectl. - */ -static int -make_checkpoint_dir(void) -{ - int err; - - err = mkdir(BHYVE_RUN_DIR, 0755); - if (err < 0 && errno != EEXIST) - return (err); - - err = mkdir(CHECKPOINT_RUN_DIR, 0755); - if (err < 0 && errno != EEXIST) - return (err); - - return 0; -} - /* * Create the listening socket for IPC with bhyvectl */ @@ -1556,12 +1534,6 @@ init_checkpoint_thread(struct vmctx *ctx) goto fail; } - err = make_checkpoint_dir(); - if (err < 0) { - perror("Failed to create checkpoint runtime directory"); - goto fail; - } - addr.sun_family = AF_UNIX; err = vm_get_name(ctx, vmname_buf, MAX_VMNAME - 1); @@ -1570,8 +1542,8 @@ init_checkpoint_thread(struct vmctx *ctx) goto fail; } - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s", - CHECKPOINT_RUN_DIR, vmname_buf); + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s%s", + BHYVE_RUN_DIR, vmname_buf); addr.sun_len = SUN_LEN(&addr); unlink(addr.sun_path); diff --git a/usr.sbin/bhyve/snapshot.h b/usr.sbin/bhyve/snapshot.h index eba46c497ab2..caa7256ffbfa 100644 --- a/usr.sbin/bhyve/snapshot.h +++ b/usr.sbin/bhyve/snapshot.h @@ -42,6 +42,7 @@ #include #include +#define BHYVE_RUN_DIR "/var/run/bhyve/" #define MAX_SNAPSHOT_VMNAME 100 struct vmctx; diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index b404f9f3c255..7b3a73cc3668 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #define NO_ARG no_argument #define OPT_ARG optional_argument -#define CHECKPOINT_RUN_DIR "/var/run/bhyve/checkpoint" #define MAX_VMNAME 100 static const char *progname; @@ -1708,7 +1707,7 @@ send_checkpoint_op_req(struct vmctx *ctx, struct checkpoint_op *op) goto done; } - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s", CHECKPOINT_RUN_DIR, vmname_buf); + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s%s", BHYVE_RUN_DIR, vmname_buf); if (connect(socket_fd, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) != 0) { From owner-dev-commits-src-all@freebsd.org Mon Feb 22 20:46: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 44B7B54DDE0; Mon, 22 Feb 2021 20:46: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 4DkvNP1WyZz4kvw; Mon, 22 Feb 2021 20:46: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 22E094A06; Mon, 22 Feb 2021 20:46: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 11MKkCQt059353; Mon, 22 Feb 2021 20:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MKkCDF059352; Mon, 22 Feb 2021 20:46:12 GMT (envelope-from git) Date: Mon, 22 Feb 2021 20:46:12 GMT Message-Id: <202102222046.11MKkCDF059352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: 79474cbd9bc4 - stable/11 - MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table 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/stable/11 X-Git-Reftype: branch X-Git-Commit: 79474cbd9bc4c72dd8d75028aedc104af562623c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 20:46:13 -0000 The branch stable/11 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=79474cbd9bc4c72dd8d75028aedc104af562623c commit 79474cbd9bc4c72dd8d75028aedc104af562623c Author: Michal Krawczyk AuthorDate: 2021-02-18 09:00:58 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-22 20:44:45 +0000 MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table In the new ENA-based instances like c6gn, the vector table moved to a new PCIe bar - BAR1. Previously it was always located on the BAR0, so the resources were already allocated together with the registers. As the FreeBSD isn't doing any resource allocation behind the scenes, the driver is responsible to allocate them explicitly, before other parts of the OS (like the PCI code allocating MSIx) will be able to access them. To determine dynamically BAR on which the MSIx vector table is present the pci_msix_table_bar() is being used and the new BAR is allocated if needed. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc (cherry picked from commit 1c808fcd859f5ce24132a903a4c7c9996e0513b1) --- sys/dev/ena/ena.c | 21 +++++++++++++++++++++ sys/dev/ena/ena.h | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 70989b7a36b9..3c6b500f9fd9 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -294,6 +294,11 @@ ena_free_pci_resources(struct ena_adapter *adapter) bus_release_resource(pdev, SYS_RES_MEMORY, PCIR_BAR(ENA_REG_BAR), adapter->registers); } + + if (adapter->msix != NULL) { + bus_release_resource(pdev, SYS_RES_MEMORY, + adapter->msix_rid, adapter->msix); + } } static int @@ -3516,6 +3521,7 @@ ena_attach(device_t pdev) struct ena_adapter *adapter; struct ena_com_dev *ena_dev = NULL; uint32_t max_num_io_queues; + int msix_rid; int rid, rc; adapter = device_get_softc(pdev); @@ -3554,6 +3560,20 @@ ena_attach(device_t pdev) goto err_dev_free; } + /* MSIx vector table may reside on BAR0 with registers or on BAR1. */ + msix_rid = pci_msix_table_bar(pdev); + if (msix_rid != rid) { + adapter->msix = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, + &msix_rid, RF_ACTIVE); + if (unlikely(adapter->msix == NULL)) { + device_printf(pdev, + "unable to allocate bus resource: msix!\n"); + rc = ENOMEM; + goto err_pci_free; + } + adapter->msix_rid = msix_rid; + } + ena_dev->bus = malloc(sizeof(struct ena_bus), M_DEVBUF, M_WAITOK | M_ZERO); @@ -3727,6 +3747,7 @@ err_com_free: ena_com_mmio_reg_read_request_destroy(ena_dev); err_bus_free: free(ena_dev->bus, M_DEVBUF); +err_pci_free: ena_free_pci_resources(adapter); err_dev_free: free(ena_dev, M_DEVBUF); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 28da047e2e1b..f3e92f31341a 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 2 #define DRV_MODULE_VER_MINOR 3 -#define DRV_MODULE_VER_SUBMINOR 0 +#define DRV_MODULE_VER_SUBMINOR 1 #define DRV_MODULE_NAME "ena" @@ -398,6 +398,8 @@ struct ena_adapter { /* OS resources */ struct resource *memory; struct resource *registers; + struct resource *msix; + int msix_rid; struct sx global_lock; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:11: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 6C90254E9A6; Mon, 22 Feb 2021 21:11: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 4Dkvx32hSbz4mKC; Mon, 22 Feb 2021 21:11: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 4F1544E0A; Mon, 22 Feb 2021 21:11: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 11MLB3SQ096901; Mon, 22 Feb 2021 21:11:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLB3g1096900; Mon, 22 Feb 2021 21:11:03 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:11:03 GMT Message-Id: <202102222111.11MLB3g1096900@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: 23e875fd97fb - main - vm_kern: Avoid sign extension in the KVA_QUANTUM definition 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: 23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:11:03 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f commit 23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f Author: Mark Johnston AuthorDate: 2021-02-22 20:50:09 +0000 Commit: Mark Johnston CommitDate: 2021-02-22 20:50:09 +0000 vm_kern: Avoid sign extension in the KVA_QUANTUM definition Otherwise, on a powerpc64 NUMA system with hashed page tables, the first-level superpage reservation size is large enough that the value of the kernel KVA arena import quantum, KVA_NUMA_IMPORT_QUANTUM, is negative and gets sign-extended when passed to vmem_set_import(). This results in a boot-time hang on such platforms. Reported by: bdragon MFC after: 3 days --- sys/vm/vm_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index e8e24c3ca8a3..637298eb2caa 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -127,7 +127,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, /* On non-superpage architectures we want large import sizes. */ #define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) #endif -#define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) +#define KVA_QUANTUM (1ul << KVA_QUANTUM_SHIFT) #define KVA_NUMA_IMPORT_QUANTUM (KVA_QUANTUM * 128) extern void uma_startup2(void); From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:15: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 25BD154E462; Mon, 22 Feb 2021 21:15: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 4Dkw1w0HvQz4mJd; Mon, 22 Feb 2021 21:15: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 F12984CC1; Mon, 22 Feb 2021 21:15: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 11MLFFai099291; Mon, 22 Feb 2021 21:15:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLFFoJ099289; Mon, 22 Feb 2021 21:15:15 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:15:15 GMT Message-Id: <202102222115.11MLFFoJ099289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 80cb372e2ad8 - stable/13 - lex: Do not let input() return 0 when end-of-file is reached MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 80cb372e2ad847c4093f9cf7ddfe4b6355520c1b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:15:16 -0000 The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=80cb372e2ad847c4093f9cf7ddfe4b6355520c1b commit 80cb372e2ad847c4093f9cf7ddfe4b6355520c1b Author: Jung-uk Kim AuthorDate: 2021-02-17 07:22:47 +0000 Commit: Jung-uk Kim CommitDate: 2021-02-22 21:13:50 +0000 lex: Do not let input() return 0 when end-of-file is reached Importing flex 2.6.4 has introduced a regression: input() now returns 0 instead of EOF to indicate that the end of input was reached, just like traditional AT&T and POSIX lex. Note the behavior contradicts flex(1). See "INCOMPATIBILITIES WITH LEX AND POSIX" section for information. This incompatibility traces back to the original version and documented in its manual page by the Vern Paxson. Apparently, it has been reported in a few places, e.g., https://github.com/westes/flex/issues/448 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911415 Unfortunately, this also breaks the scanner used by libdtrace and dtrace is unable to resolve some probe argument types as a result. See PR253440 for more information. Note the regression was introduced by the following upstream commit without any explanation or documentation change: https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10745ff Now we restore the traditional flex behavior unless lex-compatibility mode is set with "-l" option because I believe the author originally wanted to make it more lex and POSIX compatible. PR: 253440 Reported by: markj (cherry picked from commit 6b7e592c215fb76ea027f25030ddc9a697184fbe) --- contrib/flex/src/flex.skl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/flex/src/flex.skl b/contrib/flex/src/flex.skl index 242645f53245..c23b944ea473 100644 --- a/contrib/flex/src/flex.skl +++ b/contrib/flex/src/flex.skl @@ -1863,7 +1863,11 @@ m4_ifdef( [[M4_YY_USE_LINENO]], case EOB_ACT_END_OF_FILE: { if ( yywrap( M4_YY_CALL_ONLY_ARG ) ) +#ifdef YY_FLEX_LEX_COMPAT return 0; +#else + return EOF; +#endif if ( ! YY_G(yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:16: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 12E2F54EB71; Mon, 22 Feb 2021 21:16:47 +0000 (UTC) (envelope-from rpokala@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 4Dkw3f64Cwz4mvN; Mon, 22 Feb 2021 21:16:46 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 45DD326773; Mon, 22 Feb 2021 21:16:46 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.45.21011103 Date: Mon, 22 Feb 2021 13:16:45 -0800 Subject: Re: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template From: Ravi Pokala To: Ed Maste , , , Message-ID: <4BE4FCF8-FA65-45B7-93A5-2E2D659CEAF8@panasas.com> Thread-Topic: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template References: <202102221531.11MFVxQU048362@gitrepo.freebsd.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:16:47 -0000 -----Original Message----- From: Ravi Pokala Date: 2021-02-22, Monday at 10:48 To: Ed Maste , , , Subject: Re: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template -----Original Message----- From: on behalf of Ed Maste Date: 2021-02-22, Monday at 07:31 To: , , Subject: git: aa8ae5fe17eb - main - git hooks: add "Fixes" trailer to commit message template The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 commit aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 Author: Ed Maste AuthorDate: 2021-02-20 18:49:31 +0000 Commit: Ed Maste CommitDate: 2021-02-22 15:29:56 +0000 git hooks: add "Fixes" trailer to commit message template A number of projects use "Fixes: " to identify a commit that is fixed by a given change. Adopt that convention. Differential Revision: https://reviews.freebsd.org/D28693 --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 4d1072700af0..761b4443cfd8 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -48,6 +48,7 @@ $(awk '1;/^#$/{exit}' $1) # Tested by: # Approved by: # Obtained from: +# Fixes: Hi Ed, To be clear, that's "${HASH} ${TITLE}" ; space-separated, not colon- or tab-separated? If that's the case, it would be clearer to say that it's the output of `git log --oneline' for the commit in question. (Interestingly, I can't seem to figure out how to get `git log --oneline' to print *only* the commit in question; I have to pipe through `grep -m1 ${HASH}'.) Thanks to avg@, I think we should explicitly say `git log --oneline -decorate=no -1 ${HASH}', to remove any ambiguity about the format. Thanks, Ravi (rpokala@) Thanks, Ravi (rpokala@) # MFC after: # MFH: # Relnotes: From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:21: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 C16A154F49E; Mon, 22 Feb 2021 21:21: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 4Dkw8q2gYLz4nRC; Mon, 22 Feb 2021 21:21: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 4BC284C71; Mon, 22 Feb 2021 21:21: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 11MLLFoO008649; Mon, 22 Feb 2021 21:21:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLLFxf008648; Mon, 22 Feb 2021 21:21:15 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:21:15 GMT Message-Id: <202102222121.11MLLFxf008648@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: 21269625733f - stable/13 - zfs: restore FreeBSD resource usage accounting 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: 21269625733f591c998f7d26790179e922ffbde0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:21:15 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=21269625733f591c998f7d26790179e922ffbde0 commit 21269625733f591c998f7d26790179e922ffbde0 Author: Martin Matuska AuthorDate: 2021-02-22 20:57:22 +0000 Commit: Martin Matuska CommitDate: 2021-02-22 21:20:28 +0000 zfs: restore FreeBSD resource usage accounting With the switch to OpenZFS 2.0 the platform-dependent resource usage accounting code got missing. Patch author: Ryan Moeller Obtained from: openzfs/zfs@64e0fe14fff465604952d576051ca80c2f1be898 MFS after: 3 days (direct commit) --- cddl/lib/libzpool/Makefile | 1 + sys/conf/files | 1 + sys/contrib/openzfs/include/sys/Makefile.am | 1 + sys/contrib/openzfs/include/sys/zfs_racct.h | 37 +++++++++++++++ sys/contrib/openzfs/lib/libzpool/Makefile.am | 1 + sys/contrib/openzfs/module/Makefile.bsd | 1 + .../openzfs/module/os/freebsd/zfs/zfs_racct.c | 55 ++++++++++++++++++++++ .../openzfs/module/os/linux/zfs/Makefile.in | 1 + .../openzfs/module/os/linux/zfs/zfs_racct.c | 36 ++++++++++++++ sys/contrib/openzfs/module/zfs/arc.c | 2 + sys/contrib/openzfs/module/zfs/dmu.c | 5 ++ sys/modules/zfs/Makefile | 1 + 12 files changed, 142 insertions(+) diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index 0e2cc9456faa..2cb1b0446ade 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -161,6 +161,7 @@ KERNEL_C = \ zfs_debug.c \ zfs_fm.c \ zfs_fuid.c \ + zfs_racct.c \ zfs_sa.c \ zfs_znode.c \ zfs_ratelimit.c \ diff --git a/sys/conf/files b/sys/conf/files index f0bf574b3236..1c52f16ff2e1 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -217,6 +217,7 @@ contrib/openzfs/module/os/freebsd/zfs/zfs_dir.c optional zfs compile-with "${ZF contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}" diff --git a/sys/contrib/openzfs/include/sys/Makefile.am b/sys/contrib/openzfs/include/sys/Makefile.am index c3ebf17b5288..385c82c926ae 100644 --- a/sys/contrib/openzfs/include/sys/Makefile.am +++ b/sys/contrib/openzfs/include/sys/Makefile.am @@ -111,6 +111,7 @@ COMMON_H = \ zfs_fuid.h \ zfs_project.h \ zfs_quota.h \ + zfs_racct.h \ zfs_ratelimit.h \ zfs_refcount.h \ zfs_rlock.h \ diff --git a/sys/contrib/openzfs/include/sys/zfs_racct.h b/sys/contrib/openzfs/include/sys/zfs_racct.h new file mode 100644 index 000000000000..cfcdd336ea42 --- /dev/null +++ b/sys/contrib/openzfs/include/sys/zfs_racct.h @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Portions Copyright 2021 iXsystems, Inc. + */ + +#ifndef _SYS_ZFS_RACCT_H +#define _SYS_ZFS_RACCT_H + +#include + +/* + * Platform-dependent resource accounting hooks + */ +void zfs_racct_read(uint64_t size, uint64_t iops); +void zfs_racct_write(uint64_t size, uint64_t iops); + +#endif /* _SYS_ZFS_RACCT_H */ diff --git a/sys/contrib/openzfs/lib/libzpool/Makefile.am b/sys/contrib/openzfs/lib/libzpool/Makefile.am index 7aa7e80985aa..b66e933657ab 100644 --- a/sys/contrib/openzfs/lib/libzpool/Makefile.am +++ b/sys/contrib/openzfs/lib/libzpool/Makefile.am @@ -163,6 +163,7 @@ KERNEL_C = \ zfs_debug.c \ zfs_fm.c \ zfs_fuid.c \ + zfs_racct.c \ zfs_sa.c \ zfs_znode.c \ zfs_ratelimit.c \ diff --git a/sys/contrib/openzfs/module/Makefile.bsd b/sys/contrib/openzfs/module/Makefile.bsd index e7cddcc5bb5e..8aa4ed22275e 100644 --- a/sys/contrib/openzfs/module/Makefile.bsd +++ b/sys/contrib/openzfs/module/Makefile.bsd @@ -153,6 +153,7 @@ SRCS+= abd_os.c \ zfs_dir.c \ zfs_ioctl_compat.c \ zfs_ioctl_os.c \ + zfs_racct.c \ zfs_vfsops.c \ zfs_vnops_os.c \ zfs_znode.c \ diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c new file mode 100644 index 000000000000..b46cc046268e --- /dev/null +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 iXsystems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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 + +void +zfs_racct_read(uint64_t size, uint64_t iops) +{ + curthread->td_ru.ru_inblock += iops; +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_force(curproc, RACCT_READBPS, size); + racct_add_force(curproc, RACCT_READIOPS, iops); + PROC_UNLOCK(curproc); + } +#endif /* RACCT */ +} + +void +zfs_racct_write(uint64_t size, uint64_t iops) +{ + curthread->td_ru.ru_oublock += iops; +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_force(curproc, RACCT_WRITEBPS, size); + racct_add_force(curproc, RACCT_WRITEIOPS, iops); + PROC_UNLOCK(curproc); + } +#endif /* RACCT */ +} diff --git a/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in b/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in index 75bec52c94e2..fa990776db83 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in +++ b/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in @@ -22,6 +22,7 @@ $(MODULE)-objs += ../os/linux/zfs/zfs_debug.o $(MODULE)-objs += ../os/linux/zfs/zfs_dir.o $(MODULE)-objs += ../os/linux/zfs/zfs_file_os.o $(MODULE)-objs += ../os/linux/zfs/zfs_ioctl_os.o +$(MODULE)-objs += ../os/linux/zfs/zfs_racct.o $(MODULE)-objs += ../os/linux/zfs/zfs_sysfs.o $(MODULE)-objs += ../os/linux/zfs/zfs_uio.o $(MODULE)-objs += ../os/linux/zfs/zfs_vfsops.o diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c b/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c new file mode 100644 index 000000000000..7897e0f9edc1 --- /dev/null +++ b/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 iXsystems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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 + +void +zfs_racct_read(uint64_t size, uint64_t iops) +{ +} + +void +zfs_racct_write(uint64_t size, uint64_t iops) +{ +} diff --git a/sys/contrib/openzfs/module/zfs/arc.c b/sys/contrib/openzfs/module/zfs/arc.c index fecc752e16ff..b01ccd13a0db 100644 --- a/sys/contrib/openzfs/module/zfs/arc.c +++ b/sys/contrib/openzfs/module/zfs/arc.c @@ -308,6 +308,7 @@ #include #include #include +#include #include #ifndef _KERNEL @@ -6296,6 +6297,7 @@ top: ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr), demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data, metadata, misses); + zfs_racct_read(size, 1); } /* Check if the spa even has l2 configured */ diff --git a/sys/contrib/openzfs/module/zfs/dmu.c b/sys/contrib/openzfs/module/zfs/dmu.c index a02f43df13fd..5d6e98d245da 100644 --- a/sys/contrib/openzfs/module/zfs/dmu.c +++ b/sys/contrib/openzfs/module/zfs/dmu.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #ifdef _KERNEL #include @@ -551,6 +552,9 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length, dbp[i] = &db->db; } + if (!read) + zfs_racct_write(length, nblks); + if ((flags & DMU_READ_NO_PREFETCH) == 0 && DNODE_META_IS_CACHEABLE(dn) && length <= zfetch_array_rd_sz) { dmu_zfetch(&dn->dn_zfetch, blkid, nblks, @@ -1448,6 +1452,7 @@ dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, arc_buf_t *buf, * same size as the dbuf. */ if (offset == db->db.db_offset && blksz == db->db.db_size) { + zfs_racct_write(blksz, 1); dbuf_assign_arcbuf(db, buf, tx); dbuf_rele(db, FTAG); } else { diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 49256609b549..0fab9f552314 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -126,6 +126,7 @@ SRCS+= abd_os.c \ zfs_ioctl_compat.c \ zfs_ioctl_os.c \ zfs_log.c \ + zfs_racct.c \ zfs_replay.c \ zfs_vfsops.c \ zfs_vnops_os.c \ From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:21: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 279D954F452; Mon, 22 Feb 2021 21:21: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 4Dkw980RKWz4np2; Mon, 22 Feb 2021 21:21: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 0045E50C1; Mon, 22 Feb 2021 21:21: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 11MLLVUV008794; Mon, 22 Feb 2021 21:21:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLLVfE008793; Mon, 22 Feb 2021 21:21:31 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:21:31 GMT Message-Id: <202102222121.11MLLVfE008793@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: 8c09ecb2e251 - main - uefi: add historical details 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: 8c09ecb2e25155b4f1490a177826608d52b1bd1b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:21:32 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8c09ecb2e25155b4f1490a177826608d52b1bd1b commit 8c09ecb2e25155b4f1490a177826608d52b1bd1b Author: Warner Losh AuthorDate: 2021-02-22 21:20:00 +0000 Commit: Warner Losh CommitDate: 2021-02-22 21:20:44 +0000 uefi: add historical details Add details about when armv6 and armv7 support was added. --- share/man/man8/uefi.8 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 05c74caa6c20..dfc144718f7b 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -140,6 +140,8 @@ EFI boot support for the ia64 architecture first appeared in .Fx 5.0 . .Nm boot support for amd64 first appeared in -.Fx 10.1 -and for arm64 in -.Fx 11.0 . +.Fx 10.1 ; +for arm64 +.Fx 11.0 ; +and for armv6 and armv7 in +.Fx 12.0 . From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:34: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 1906E54FEE1; Mon, 22 Feb 2021 21:34: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 4DkwRr0BDlz4prR; Mon, 22 Feb 2021 21:34: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 ED4BE5487; Mon, 22 Feb 2021 21:34: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 11MLYFDP025786; Mon, 22 Feb 2021 21:34:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLYFK0025785; Mon, 22 Feb 2021 21:34:15 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:34:15 GMT Message-Id: <202102222134.11MLYFK0025785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 4e3fa977a14f - releng/13.0 - lex: Do not let input() return 0 when end-of-file is reached MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 4e3fa977a14f7c69a39aacd8788a437527767dac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:34:16 -0000 The branch releng/13.0 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=4e3fa977a14f7c69a39aacd8788a437527767dac commit 4e3fa977a14f7c69a39aacd8788a437527767dac Author: Jung-uk Kim AuthorDate: 2021-02-17 07:22:47 +0000 Commit: Jung-uk Kim CommitDate: 2021-02-22 21:28:53 +0000 lex: Do not let input() return 0 when end-of-file is reached Importing flex 2.6.4 has introduced a regression: input() now returns 0 instead of EOF to indicate that the end of input was reached, just like traditional AT&T and POSIX lex. Note the behavior contradicts flex(1). See "INCOMPATIBILITIES WITH LEX AND POSIX" section for information. This incompatibility traces back to the original version and documented in its manual page by the Vern Paxson. Apparently, it has been reported in a few places, e.g., https://github.com/westes/flex/issues/448 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911415 Unfortunately, this also breaks the scanner used by libdtrace and dtrace is unable to resolve some probe argument types as a result. See PR253440 for more information. Note the regression was introduced by the following upstream commit without any explanation or documentation change: https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10745ff Now we restore the traditional flex behavior unless lex-compatibility mode is set with "-l" option because I believe the author originally wanted to make it more lex and POSIX compatible. PR: 253440 Reported by: markj Approved by: re (gjb) (cherry picked from commit 6b7e592c215fb76ea027f25030ddc9a697184fbe) --- contrib/flex/src/flex.skl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/flex/src/flex.skl b/contrib/flex/src/flex.skl index 242645f53245..c23b944ea473 100644 --- a/contrib/flex/src/flex.skl +++ b/contrib/flex/src/flex.skl @@ -1863,7 +1863,11 @@ m4_ifdef( [[M4_YY_USE_LINENO]], case EOB_ACT_END_OF_FILE: { if ( yywrap( M4_YY_CALL_ONLY_ARG ) ) +#ifdef YY_FLEX_LEX_COMPAT return 0; +#else + return EOF; +#endif if ( ! YY_G(yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:40: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 521E55500E3; Mon, 22 Feb 2021 21:40: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 4Dkwb81Ygxz4q4R; Mon, 22 Feb 2021 21:40: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 2886C548D; Mon, 22 Feb 2021 21:40: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 11MLeaWs034192; Mon, 22 Feb 2021 21:40:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLeaD6034190; Mon, 22 Feb 2021 21:40:36 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:40:36 GMT Message-Id: <202102222140.11MLeaD6034190@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: f11e9f325aee - main - Restore missing word 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: f11e9f325aee3459fee94f3a660a8e6c1a25c2ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:40:36 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f11e9f325aee3459fee94f3a660a8e6c1a25c2ac commit f11e9f325aee3459fee94f3a660a8e6c1a25c2ac Author: Warner Losh AuthorDate: 2021-02-22 21:39:04 +0000 Commit: Warner Losh CommitDate: 2021-02-22 21:39:04 +0000 Restore missing word "in" got dropped when I shuffled things around. Noticed by: rpokala@ MFC After: 3 days --- share/man/man8/uefi.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index dfc144718f7b..3ecfe05ac1c4 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -141,7 +141,7 @@ EFI boot support for the ia64 architecture first appeared in .Nm boot support for amd64 first appeared in .Fx 10.1 ; -for arm64 +for arm64 in .Fx 11.0 ; and for armv6 and armv7 in .Fx 12.0 . From owner-dev-commits-src-all@freebsd.org Mon Feb 22 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 CAE41550506; Mon, 22 Feb 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 4DkwcN5Rfpz4qD6; Mon, 22 Feb 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 A3135515F; Mon, 22 Feb 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 11MLfejj035391; Mon, 22 Feb 2021 21:41:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLfeK7035390; Mon, 22 Feb 2021 21:41:40 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:41:40 GMT Message-Id: <202102222141.11MLfeK7035390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 61c50cbc096d - main - loader: autoload_font will hung loader when there is no local console MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61c50cbc096d28e44cb8b627e524ae58158c423a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:41:40 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=61c50cbc096d28e44cb8b627e524ae58158c423a commit 61c50cbc096d28e44cb8b627e524ae58158c423a Author: Toomas Soome AuthorDate: 2021-02-21 10:32:18 +0000 Commit: Toomas Soome CommitDate: 2021-02-21 10:45:36 +0000 loader: autoload_font will hung loader when there is no local console If we start with console set to comconsole, the local console (vidconsole, efi) is never initialized and attempt to use the data can render the loader hung. Reported by: Kamigishi Rei MFC after: 3 days --- stand/efi/libefi/efi_console.c | 3 +++ stand/i386/libi386/vidconsole.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 7024f9c8b2f2..3cbd121c41da 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -886,6 +886,9 @@ cons_update_mode(bool use_gfx_mode) EFI_STATUS status; char env[10], *ptr; + if (!efi_started) + return (false); + /* * Despite the use_gfx_mode, we want to make sure we call * efi_find_framebuffer(). This will populate the fb data, diff --git a/stand/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c index f94ed2d26712..b933a7807687 100644 --- a/stand/i386/libi386/vidconsole.c +++ b/stand/i386/libi386/vidconsole.c @@ -53,7 +53,7 @@ static int vidc_getchar(void); static int vidc_ischar(void); static void cons_draw_frame(teken_attr_t *); -static int vidc_started; +static bool vidc_started; static uint16_t *vgatext; static tf_bell_t vidc_cons_bell; @@ -877,6 +877,10 @@ cons_update_mode(bool use_gfx_mode) char env[10], *ptr; int format, roff, goff, boff; + /* vidc_init() is not called yet. */ + if (!vidc_started) + return (false); + gfx_state.tg_tp.tp_row = TEXT_ROWS; gfx_state.tg_tp.tp_col = TEXT_COLS; @@ -996,7 +1000,7 @@ vidc_init(int arg) if (vidc_started && arg == 0) return (0); - vidc_started = 1; + vidc_started = true; vbe_init(); /* From owner-dev-commits-src-all@freebsd.org Mon Feb 22 21:59: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 42C5E550BCF; Mon, 22 Feb 2021 21:59: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 4Dkx1K15Fwz4rj2; Mon, 22 Feb 2021 21:59: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 1800D54EB; Mon, 22 Feb 2021 21:59: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 11MLxmU5052645; Mon, 22 Feb 2021 21:59:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MLxmto052644; Mon, 22 Feb 2021 21:59:48 GMT (envelope-from git) Date: Mon, 22 Feb 2021 21:59:48 GMT Message-Id: <202102222159.11MLxmto052644@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: ae093a0614f3 - releng/13.0 - libdtrace: Stop relying on lex compatibility 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: ae093a0614f30d4cdffb853e4eba93322e8ed8f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 21:59:49 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ae093a0614f30d4cdffb853e4eba93322e8ed8f4 commit ae093a0614f30d4cdffb853e4eba93322e8ed8f4 Author: Mark Johnston AuthorDate: 2021-02-17 15:49:38 +0000 Commit: Mark Johnston CommitDate: 2021-02-22 21:59:36 +0000 libdtrace: Stop relying on lex compatibility It does not appear to be required, and as of commit 6b7e592c215f ("lex: Do not let input() return 0 when end-of-file is reached") it causes input to return 0 instead of EOF when end-of-input is reached. Approved by: re (gjb) PR: 253440 Sponsored by: The FreeBSD Foundation (cherry picked from commit 8ba333e02eaa59337a4e1d5534d4e894344c8226) (cherry picked from commit af80731179386cf019463e392370b6478a714aea) --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h | 2 +- cddl/lib/libdtrace/Makefile | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h index f2c60a2b07d4..b3f69bb6329d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h @@ -717,7 +717,7 @@ extern dt_pcb_t *yypcb; /* pointer to current parser control block */ extern char yyintprefix; /* int token prefix for macros (+/-) */ extern char yyintsuffix[4]; /* int token suffix ([uUlL]*) */ extern int yyintdecimal; /* int token is decimal (1) or octal/hex (0) */ -extern char yytext[]; /* lex input buffer */ +extern char *yytext; /* lex input buffer */ extern int yylineno; /* lex line number */ extern int yydebug; /* lex debugging */ extern dt_node_t *yypragma; /* lex token list for control lines */ diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile index efd73751e2c0..45ca1692cf48 100644 --- a/cddl/lib/libdtrace/Makefile +++ b/cddl/lib/libdtrace/Makefile @@ -129,8 +129,6 @@ SRCS+= dis_tables.c DSRCS+= regs_x86.d .endif -LFLAGS+=-l - YFLAGS+=-d LIBADD= ctf elf proc pthread rtld_db From owner-dev-commits-src-all@freebsd.org Mon Feb 22 22:03: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 6286C5508FF; Mon, 22 Feb 2021 22:03: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 4Dkx5k2GDFz4s8k; Mon, 22 Feb 2021 22:03: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 409175361; Mon, 22 Feb 2021 22:03: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 11MM3cNW065406; Mon, 22 Feb 2021 22:03:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MM3cSs065405; Mon, 22 Feb 2021 22:03:38 GMT (envelope-from git) Date: Mon, 22 Feb 2021 22:03:38 GMT Message-Id: <202102222203.11MM3cSs065405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 57d6e82d1f69 - stable/13 - loader_lua: consider userboot console as serial MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57d6e82d1f69f40bda1d744b90e1fdcf761a3d29 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 22:03:38 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=57d6e82d1f69f40bda1d744b90e1fdcf761a3d29 commit 57d6e82d1f69f40bda1d744b90e1fdcf761a3d29 Author: Toomas Soome AuthorDate: 2021-02-14 08:28:29 +0000 Commit: Toomas Soome CommitDate: 2021-02-21 11:07:12 +0000 loader_lua: consider userboot console as serial We use ascii box chars with serial console because we do not know if terminal can draw unixode box chars. Same problem is about userboot console. (cherry picked from commit 5d8c062fe3ee7b2d6aed0b46d22f62c7771c0af8) --- stand/lua/core.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index a119c3c258f8..55c26e0d6d39 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -403,7 +403,10 @@ end function core.isSerialConsole() local c = loader.getenv("console") if c ~= nil then - if c:find("comconsole") ~= nil then + -- serial console is comconsole, but also userboot. + -- userboot is there, because we have no way to know + -- if the user terminal can draw unicode box chars or not. + if c:find("comconsole") ~= nil or c:find("userboot") ~= nil then return true end end From owner-dev-commits-src-all@freebsd.org Mon Feb 22 22:27: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 507845515BB; Mon, 22 Feb 2021 22:27: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 4DkxdC1g8Lz4t10; Mon, 22 Feb 2021 22:27: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 2BE145C66; Mon, 22 Feb 2021 22:27: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 11MMRROQ092402; Mon, 22 Feb 2021 22:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MMRRk3092401; Mon, 22 Feb 2021 22:27:27 GMT (envelope-from git) Date: Mon, 22 Feb 2021 22:27:27 GMT Message-Id: <202102222227.11MMRRk3092401@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: 963cf6cb0fd7 - main - uefi: Add riscv to historical details 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: 963cf6cb0fd7e8708c455ecf567fbc34fe2a7156 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 22:27:27 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=963cf6cb0fd7e8708c455ecf567fbc34fe2a7156 commit 963cf6cb0fd7e8708c455ecf567fbc34fe2a7156 Author: Jessica Clarke AuthorDate: 2021-02-22 22:27:00 +0000 Commit: Jessica Clarke CommitDate: 2021-02-22 22:27:00 +0000 uefi: Add riscv to historical details --- share/man/man8/uefi.8 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 3ecfe05ac1c4..64bc30139f97 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -143,5 +143,7 @@ boot support for amd64 first appeared in .Fx 10.1 ; for arm64 in .Fx 11.0 ; -and for armv6 and armv7 in -.Fx 12.0 . +for armv6 and armv7 in +.Fx 12.0 ; +and for riscv in +.Fx 13.0 . From owner-dev-commits-src-all@freebsd.org Mon Feb 22 22:33: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 A54795517F9; Mon, 22 Feb 2021 22:33: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 4DkxmV4KTKz4tcy; Mon, 22 Feb 2021 22:33: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 875D55EBB; Mon, 22 Feb 2021 22:33: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 11MMXk7b004869; Mon, 22 Feb 2021 22:33:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MMXkdW004868; Mon, 22 Feb 2021 22:33:46 GMT (envelope-from git) Date: Mon, 22 Feb 2021 22:33:46 GMT Message-Id: <202102222233.11MMXkdW004868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: d510bf133d04 - main - cxgb(4): Rework my commit 9dc7c250. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d510bf133d045d6c83742aeda6949bec150f6cbf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 22:33:46 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=d510bf133d045d6c83742aeda6949bec150f6cbf commit d510bf133d045d6c83742aeda6949bec150f6cbf Author: Alexander Motin AuthorDate: 2021-02-22 22:21:05 +0000 Commit: Alexander Motin CommitDate: 2021-02-22 22:33:43 +0000 cxgb(4): Rework my commit 9dc7c250. The previous implementation was reported to try to coalesce packets in situations when it should not, that resulted in assertion later. This implementation better checks the first packet of the chain for the coallescing elligibility. MFC after: 3 days --- sys/dev/cxgb/cxgb_sge.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 491d1a751f4a..f13d2f03180c 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -312,20 +312,22 @@ set_wr_hdr(struct work_request_hdr *wrp, uint32_t wr_hi, uint32_t wr_lo) struct coalesce_info { int count; int nbytes; + int noncoal; }; static int coalesce_check(struct mbuf *m, void *arg) { struct coalesce_info *ci = arg; - int *count = &ci->count; - int *nbytes = &ci->nbytes; - - if ((*nbytes == 0) || ((*nbytes + m->m_len <= 10500) && - (*count < 7) && (m->m_next == NULL) && - ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE))) { - *count += 1; - *nbytes += m->m_len; + + if ((m->m_next != NULL) || + ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len > PAGE_SIZE)) + ci->noncoal = 1; + + if ((ci->count == 0) || (ci->noncoal == 0 && (ci->count < 7) && + (ci->nbytes + m->m_len <= 10500))) { + ci->count++; + ci->nbytes += m->m_len; return (1); } return (0); @@ -342,7 +344,7 @@ cxgb_dequeue(struct sge_qset *qs) return TXQ_RING_DEQUEUE(qs); m_head = m_tail = NULL; - ci.count = ci.nbytes = 0; + ci.count = ci.nbytes = ci.noncoal = 0; do { m = TXQ_RING_DEQUEUE_COND(qs, coalesce_check, &ci); if (m_head == NULL) { From owner-dev-commits-src-all@freebsd.org Mon Feb 22 23:22: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 4CA77552C07; Mon, 22 Feb 2021 23:22: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 4DkysC1jGnz3Ccp; Mon, 22 Feb 2021 23:22: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 2C7A36A7A; Mon, 22 Feb 2021 23:22: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 11MNMtiQ070351; Mon, 22 Feb 2021 23:22:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MNMt78070350; Mon, 22 Feb 2021 23:22:55 GMT (envelope-from git) Date: Mon, 22 Feb 2021 23:22:55 GMT Message-Id: <202102222322.11MNMt78070350@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: 537f92cd3510 - main - uma: Update the comment above startup_alloc() to reflect reality 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: 537f92cd351090c09b178a1749cd1d0326f74dc7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 23:22:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=537f92cd351090c09b178a1749cd1d0326f74dc7 commit 537f92cd351090c09b178a1749cd1d0326f74dc7 Author: Mark Johnston AuthorDate: 2021-02-22 23:21:49 +0000 Commit: Mark Johnston CommitDate: 2021-02-22 23:22:51 +0000 uma: Update the comment above startup_alloc() to reflect reality The scheme used for early slab allocations changed in commit a81c400e75. Reported by: alc Reviewed by: alc MFC after: 1 week --- sys/vm/uma_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 0b6e02861785..8cbd1216678a 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1642,9 +1642,9 @@ fail: } /* - * This function is intended to be used early on in place of page_alloc() so - * that we may use the boot time page cache to satisfy allocations before - * the VM is ready. + * This function is intended to be used early on in place of page_alloc(). It + * performs contiguous physical memory allocations and uses a bump allocator for + * KVA, so is usable before the kernel map is initialized. */ static void * startup_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, From owner-dev-commits-src-all@freebsd.org Mon Feb 22 23: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 4C422552DFB; Mon, 22 Feb 2021 23: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 4DkzBq1gpmz3Dg4; Mon, 22 Feb 2021 23: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 21B116BAE; Mon, 22 Feb 2021 23: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 11MNcBRw084740; Mon, 22 Feb 2021 23: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 11MNcBem084739; Mon, 22 Feb 2021 23:38:11 GMT (envelope-from git) Date: Mon, 22 Feb 2021 23:38:11 GMT Message-Id: <202102222338.11MNcBem084739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7563019bc693 - main - Add if_try_ref() to simplify refcount handling inside epoch. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7563019bc69301a382abefbac3b0fea1d876410e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 23:38:11 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7563019bc69301a382abefbac3b0fea1d876410e commit 7563019bc69301a382abefbac3b0fea1d876410e Author: Alexander V. Chernikov AuthorDate: 2021-02-22 21:37:55 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-22 23:37:59 +0000 Add if_try_ref() to simplify refcount handling inside epoch. When we have an ifp pointer and the code is running inside epoch, epoch guarantees the pointer will not be freed. However, the following case can still happen: * in thread 1 we drop to refcount=0 for ifp and schedule its deletion. * in thread 2 we use this ifp and reference it * destroy callout kicks in * unhappy user reports a bug This can happen with the current implementation of ifnet_byindex_ref(), as we're not holding any locks preventing ifnet deletion by a parallel thread. To address it, add if_try_ref(), allowing to return failure when referencing ifp with refcount=0. Additionally, enforce existing if_ref() is with KASSERT to provide a cleaner error in such scenarios. Finally, fix ifnet_byindex_ref() by using if_try_ref() and returning NULL if the latter fails. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28836 --- sys/net/if.c | 14 ++++++++++++-- sys/net/if_var.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 948be6876b65..9d5e9e26b4bb 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -359,7 +359,8 @@ ifnet_byindex_ref(u_short idx) ifp = ifnet_byindex(idx); if (ifp == NULL || (ifp->if_flags & IFF_DYING)) return (NULL); - if_ref(ifp); + if (!if_try_ref(ifp)) + return (NULL); return (ifp); } @@ -738,9 +739,18 @@ if_free(struct ifnet *ifp) void if_ref(struct ifnet *ifp) { + u_int old; /* We don't assert the ifnet list lock here, but arguably should. */ - refcount_acquire(&ifp->if_refcount); + old = refcount_acquire(&ifp->if_refcount); + KASSERT(old > 0, ("%s: ifp %p has 0 refs", __func__, ifp)); +} + +bool +if_try_ref(struct ifnet *ifp) +{ + NET_EPOCH_ASSERT(); + return (refcount_acquire_if_not_zero(&ifp->if_refcount)); } void diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 291a7781d73c..33a737880a8d 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -661,6 +661,7 @@ void if_link_state_change(struct ifnet *, int); int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); void if_ref(struct ifnet *); void if_rele(struct ifnet *); +bool if_try_ref(struct ifnet *); int if_setlladdr(struct ifnet *, const u_char *, int); int if_tunnel_check_nesting(struct ifnet *, struct mbuf *, uint32_t, int); void if_up(struct ifnet *); From owner-dev-commits-src-all@freebsd.org Mon Feb 22 23:38: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 6AC36552F61; Mon, 22 Feb 2021 23:38: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 4DkzBr2fGFz3DZH; Mon, 22 Feb 2021 23:38: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 4DADE6943; Mon, 22 Feb 2021 23:38: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 11MNcCg2084762; Mon, 22 Feb 2021 23:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MNcCCn084761; Mon, 22 Feb 2021 23:38:12 GMT (envelope-from git) Date: Mon, 22 Feb 2021 23:38:12 GMT Message-Id: <202102222338.11MNcCCn084761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 596417283722 - main - Simplify ifa/ifp refcounting in the routing stack. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 596417283722ee62ed17aed1c875ad90c01cbb0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 23:38:12 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=596417283722ee62ed17aed1c875ad90c01cbb0e commit 596417283722ee62ed17aed1c875ad90c01cbb0e Author: Alexander V. Chernikov AuthorDate: 2021-02-22 21:42:27 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-22 23:37:59 +0000 Simplify ifa/ifp refcounting in the routing stack. The routing stack control depends on quite a tree of functions to determine the proper attributes of a route such as a source address (ifa) or transmit ifp of a route. When actually inserting a route, the stack needs to ensure that ifa and ifp points to the entities that are still valid. Validity means slightly more than just pointer validity - stack need guarantee that the provided objects are not scheduled for deletion. Currently, callers either ignore it (most ifp parts, historically) or try to use refcounting (ifa parts). Even in case of ifa refcounting it's not always implemented in fully-safe manner. For example, some codepaths inside rt_getifa_fib() are referencing ifa while not holding any locks, resulting in possibility of referencing scheduled-for-deletion ifa. Instead of trying to fix all of the callers by enforcing proper refcounting, switch to a different model. As the rib_action() already requires epoch, do not require any stability guarantees other than the epoch-provided one. Use newly-added conditional versions of the refcounting functions (ifa_try_ref(), if_try_ref()) and fail if any of these fails. Reviewed by: donner MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28837 --- sys/net/route.c | 14 +++-------- sys/net/route/nhop_ctl.c | 58 ++++++++++++++++++++++++++----------------- sys/net/route/route_ctl.c | 17 ++----------- sys/net/route/route_ifaddrs.c | 12 ++------- 4 files changed, 42 insertions(+), 59 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index a68e46c37861..d2b405fafcbf 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -207,7 +207,6 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, /* Get the best ifa for the given interface and gateway. */ if ((ifa = ifaof_ifpforaddr(gateway, ifp)) == NULL) return (ENETUNREACH); - ifa_ref(ifa); bzero(&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; @@ -224,7 +223,6 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, info.rti_rmx = &rti_rmx; error = rib_action(fibnum, RTM_ADD, &info, &rc); - ifa_free(ifa); if (error != 0) { /* TODO: add per-fib redirect stats. */ @@ -518,8 +516,7 @@ rt_flushifroutes(struct ifnet *ifp) } /* - * Look up rt_addrinfo for a specific fib. Note that if rti_ifa is defined, - * it will be referenced so the caller must free it. + * Look up rt_addrinfo for a specific fib. * * Assume basic consistency checks are executed by callers: * RTAX_DST exists, if RTF_GATEWAY is set, RTAX_GATEWAY exists as well. @@ -528,8 +525,7 @@ int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) { const struct sockaddr *dst, *gateway, *ifpaddr, *ifaaddr; - struct epoch_tracker et; - int needref, error, flags; + int error, flags; dst = info->rti_info[RTAX_DST]; gateway = info->rti_info[RTAX_GATEWAY]; @@ -542,8 +538,6 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) * when protocol address is ambiguous. */ error = 0; - needref = (info->rti_ifa == NULL); - NET_EPOCH_ENTER(et); /* If we have interface specified by the ifindex in the address, use it */ if (info->rti_ifp == NULL && ifpaddr != NULL && @@ -598,13 +592,11 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) info->rti_ifa = ifa_ifwithroute(flags, sa, sa, fibnum); } - if (needref && info->rti_ifa != NULL) { + if (info->rti_ifa != NULL) { if (info->rti_ifp == NULL) info->rti_ifp = info->rti_ifa->ifa_ifp; - ifa_ref(info->rti_ifa); } else error = ENETUNREACH; - NET_EPOCH_EXIT(et); return (error); } diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 7de553799fab..92b43871d604 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -84,7 +84,7 @@ static int get_nhop(struct rib_head *rnh, struct rt_addrinfo *info, struct nhop_priv **pnh_priv); static int finalize_nhop(struct nh_control *ctl, struct rt_addrinfo *info, struct nhop_priv *nh_priv); -static struct ifnet *get_aifp(const struct nhop_object *nh, int reference); +static struct ifnet *get_aifp(const struct nhop_object *nh); static void fill_sdl_from_ifp(struct sockaddr_dl_short *sdl, const struct ifnet *ifp); static void destroy_nhop_epoch(epoch_context_t ctx); @@ -120,12 +120,10 @@ nhops_init(void) * this interface ifp instead of loopback. This is needed to support * link-local IPv6 loopback communications. * - * If @reference is non-zero, found ifp is referenced. - * * Returns found ifp. */ static struct ifnet * -get_aifp(const struct nhop_object *nh, int reference) +get_aifp(const struct nhop_object *nh) { struct ifnet *aifp = NULL; @@ -138,21 +136,15 @@ get_aifp(const struct nhop_object *nh, int reference) */ if ((nh->nh_ifp->if_flags & IFF_LOOPBACK) && nh->gw_sa.sa_family == AF_LINK) { - if (reference) - aifp = ifnet_byindex_ref(nh->gwl_sa.sdl_index); - else - aifp = ifnet_byindex(nh->gwl_sa.sdl_index); + aifp = ifnet_byindex(nh->gwl_sa.sdl_index); if (aifp == NULL) { DPRINTF("unable to get aifp for %s index %d", if_name(nh->nh_ifp), nh->gwl_sa.sdl_index); } } - if (aifp == NULL) { + if (aifp == NULL) aifp = nh->nh_ifp; - if (reference) - if_ref(aifp); - } return (aifp); } @@ -297,7 +289,7 @@ fill_nhop_from_info(struct nhop_priv *nh_priv, struct rt_addrinfo *info) nh->nh_ifp = info->rti_ifa->ifa_ifp; nh->nh_ifa = info->rti_ifa; /* depends on the gateway */ - nh->nh_aifp = get_aifp(nh, 0); + nh->nh_aifp = get_aifp(nh); /* * Note some of the remaining data is set by the @@ -438,7 +430,7 @@ alter_nhop_from_info(struct nhop_object *nh, struct rt_addrinfo *info) nh->nh_ifa = info->rti_ifa; if (info->rti_ifp != NULL) nh->nh_ifp = info->rti_ifp; - nh->nh_aifp = get_aifp(nh, 0); + nh->nh_aifp = get_aifp(nh); return (0); } @@ -512,6 +504,26 @@ alloc_nhop_structure() return (nh_priv); } +static bool +reference_nhop_deps(struct nhop_object *nh) +{ + if (!ifa_try_ref(nh->nh_ifa)) + return (false); + nh->nh_aifp = get_aifp(nh); + if (!if_try_ref(nh->nh_aifp)) { + ifa_free(nh->nh_ifa); + return (false); + } + DPRINTF("AIFP: %p nh_ifp %p", nh->nh_aifp, nh->nh_ifp); + if (!if_try_ref(nh->nh_ifp)) { + ifa_free(nh->nh_ifa); + if_rele(nh->nh_aifp); + return (false); + } + + return (true); +} + /* * Alocates/references the remaining bits of nexthop data and links * it to the hash table. @@ -522,9 +534,7 @@ static int finalize_nhop(struct nh_control *ctl, struct rt_addrinfo *info, struct nhop_priv *nh_priv) { - struct nhop_object *nh; - - nh = nh_priv->nh; + struct nhop_object *nh = nh_priv->nh; /* Allocate per-cpu packet counter */ nh->nh_pksent = counter_u64_alloc(M_NOWAIT); @@ -535,15 +545,17 @@ finalize_nhop(struct nh_control *ctl, struct rt_addrinfo *info, return (ENOMEM); } + if (!reference_nhop_deps(nh)) { + counter_u64_free(nh->nh_pksent); + uma_zfree(nhops_zone, nh); + RTSTAT_INC(rts_nh_alloc_failure); + DPRINTF("nh_alloc_finalize failed - reference failure"); + return (EAGAIN); + } + /* Save vnet to ease destruction */ nh_priv->nh_vnet = curvnet; - /* Reference external objects and calculate (referenced) ifa */ - if_ref(nh->nh_ifp); - ifa_ref(nh->nh_ifa); - nh->nh_aifp = get_aifp(nh, 1); - DPRINTF("AIFP: %p nh_ifp %p", nh->nh_aifp, nh->nh_ifp); - refcount_init(&nh_priv->nh_refcnt, 1); /* Please see nhop_free() comments on the initial value */ diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 9aedfb9d5855..e07a94295b89 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -589,12 +589,9 @@ create_rtentry(struct rib_head *rnh, struct rt_addrinfo *info, error = rt_getifa_fib(info, rnh->rib_fibnum); if (error) return (error); - } else { - ifa_ref(info->rti_ifa); } error = nhop_create_from_info(rnh, info, &nh); - ifa_free(info->rti_ifa); if (error != 0) return (error); @@ -912,7 +909,6 @@ static int change_nhop(struct rib_head *rnh, struct rt_addrinfo *info, struct nhop_object *nh_orig, struct nhop_object **nh_new) { - int free_ifa = 0; int error; /* @@ -926,24 +922,15 @@ change_nhop(struct rib_head *rnh, struct rt_addrinfo *info, (info->rti_info[RTAX_IFA] != NULL && !sa_equal(info->rti_info[RTAX_IFA], nh_orig->nh_ifa->ifa_addr))) { error = rt_getifa_fib(info, rnh->rib_fibnum); - if (info->rti_ifa != NULL) - free_ifa = 1; if (error != 0) { - if (free_ifa) { - ifa_free(info->rti_ifa); - info->rti_ifa = NULL; - } - + info->rti_ifa = NULL; return (error); } } error = nhop_create_from_nhop(rnh, nh_orig, info, nh_new); - if (free_ifa) { - ifa_free(info->rti_ifa); - info->rti_ifa = NULL; - } + info->rti_ifa = NULL; return (error); } diff --git a/sys/net/route/route_ifaddrs.c b/sys/net/route/route_ifaddrs.c index 6e264327d66d..e6d97f3c74f0 100644 --- a/sys/net/route/route_ifaddrs.c +++ b/sys/net/route/route_ifaddrs.c @@ -143,7 +143,6 @@ ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, struct rt_addrinfo info; struct sockaddr_dl null_sdl; struct ifnet *ifp; - struct ifaddr *rti_ifa = NULL; ifp = ifa->ifa_ifp; @@ -153,12 +152,8 @@ ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, info.rti_ifp = V_loif; if (cmd == RTM_ADD) { /* explicitly specify (loopback) ifa */ - if (info.rti_ifp != NULL) { - rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); - if (rti_ifa != NULL) - ifa_ref(rti_ifa); - info.rti_ifa = rti_ifa; - } + if (info.rti_ifp != NULL) + info.rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); } info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; info.rti_info[RTAX_DST] = ia; @@ -168,9 +163,6 @@ ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, error = rib_action(ifp->if_fib, cmd, &info, &rc); NET_EPOCH_EXIT(et); - if (rti_ifa != NULL) - ifa_free(rti_ifa); - if (error == 0 || (cmd == RTM_ADD && error == EEXIST) || (cmd == RTM_DELETE && (error == ENOENT || error == ESRCH))) From owner-dev-commits-src-all@freebsd.org Mon Feb 22 23:54: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 C29F155362C; Mon, 22 Feb 2021 23:54: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 4DkzY958dqz3Fwj; Mon, 22 Feb 2021 23:54: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 9929B6C72; Mon, 22 Feb 2021 23:54: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 11MNs5CN009976; Mon, 22 Feb 2021 23:54:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MNs5eC009975; Mon, 22 Feb 2021 23:54:05 GMT (envelope-from git) Date: Mon, 22 Feb 2021 23:54:05 GMT Message-Id: <202102222354.11MNs5eC009975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: c930816b7671 - stable/13 - cxgbe(4): Save proper zone index on low memory in refill_fl(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c930816b76713623ccdef09d682e41266c1d724f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 23:54:05 -0000 The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c930816b76713623ccdef09d682e41266c1d724f commit c930816b76713623ccdef09d682e41266c1d724f Author: Alexander Motin AuthorDate: 2021-02-17 02:15:28 +0000 Commit: Navdeep Parhar CommitDate: 2021-02-22 23:51:58 +0000 cxgbe(4): Save proper zone index on low memory in refill_fl(). When refill_fl() fails to allocate large (9/16KB) mbuf cluster, it falls back to safe (4KB) ones. But it still saved into sd->zidx the original fl->zidx instead of fl->safe_zidx. It caused problems with the later use of that cluster, including memory and/or data corruption. While there, make refill_fl() to use the safe zone for all following clusters for the call, since it is unlikely that large succeed. MFC after: 3 days Sponsored by: iXsystems, Inc. Reviewed by: np, jhb Differential Revision: https://reviews.freebsd.org/D28716 (cherry picked from commit 294e62bebf36f873fd083d2fe8edd78919dda4e8) --- sys/dev/cxgbe/t4_sge.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 45f07358f0db..d16f17c45614 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4524,7 +4524,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) caddr_t cl; struct rx_buf_info *rxb; struct cluster_metadata *clm; - uint16_t max_pidx; + uint16_t max_pidx, zidx = fl->zidx; uint16_t hw_cidx = fl->hw_cidx; /* stable snapshot */ FL_LOCK_ASSERT_OWNED(fl); @@ -4540,6 +4540,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) d = &fl->desc[fl->pidx]; sd = &fl->sdesc[fl->pidx]; + rxb = &sc->sge.rx_buf_info[zidx]; while (n > 0) { @@ -4573,11 +4574,11 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) sd->cl = NULL; /* gave up my reference */ } MPASS(sd->cl == NULL); - rxb = &sc->sge.rx_buf_info[fl->zidx]; cl = uma_zalloc(rxb->zone, M_NOWAIT); if (__predict_false(cl == NULL)) { - if (fl->zidx != fl->safe_zidx) { - rxb = &sc->sge.rx_buf_info[fl->safe_zidx]; + if (zidx != fl->safe_zidx) { + zidx = fl->safe_zidx; + rxb = &sc->sge.rx_buf_info[zidx]; cl = uma_zalloc(rxb->zone, M_NOWAIT); } if (cl == NULL) @@ -4588,7 +4589,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) pa = pmap_kextract((vm_offset_t)cl); sd->cl = cl; - sd->zidx = fl->zidx; + sd->zidx = zidx; if (fl->flags & FL_BUF_PACKING) { *d = htobe64(pa | rxb->hwidx2); From owner-dev-commits-src-all@freebsd.org Mon Feb 22 23:54: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 2ABE255344D; Mon, 22 Feb 2021 23:54: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 4DkzYR0CPWz3GD0; Mon, 22 Feb 2021 23:54: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 EB8797020; Mon, 22 Feb 2021 23:54: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 11MNsIAI010112; Mon, 22 Feb 2021 23:54:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MNsIvA010111; Mon, 22 Feb 2021 23:54:18 GMT (envelope-from git) Date: Mon, 22 Feb 2021 23:54:18 GMT Message-Id: <202102222354.11MNsIvA010111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 701d6b50ae7b - main - jail: Fix a LOR introduced in 1158508a8086 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 701d6b50ae7b0b2b50fbd191c2dbd646ef3b4a67 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 23:54:19 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=701d6b50ae7b0b2b50fbd191c2dbd646ef3b4a67 commit 701d6b50ae7b0b2b50fbd191c2dbd646ef3b4a67 Author: Jamie Gritton AuthorDate: 2021-02-22 23:51:10 +0000 Commit: Jamie Gritton CommitDate: 2021-02-22 23:51:10 +0000 jail: Fix a LOR introduced in 1158508a8086 --- sys/kern/kern_jail.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 01724e41955c..89dd039685a8 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1851,6 +1851,10 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) #ifdef RACCT if (racct_enable && !created) { + if (drflags & PD_LOCKED) { + mtx_unlock(&pr->pr_mtx); + drflags &= ~PD_LOCKED; + } if (drflags & PD_LIST_XLOCKED) { sx_xunlock(&allprison_lock); drflags &= ~PD_LIST_XLOCKED; From owner-dev-commits-src-all@freebsd.org Mon Feb 22 23:56: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 41CA05538A2; Mon, 22 Feb 2021 23:56: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 4DkzcJ1Nvvz3GS3; Mon, 22 Feb 2021 23:56: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 22AF56C75; Mon, 22 Feb 2021 23:56: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 11MNum6v010600; Mon, 22 Feb 2021 23:56:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11MNum8a010599; Mon, 22 Feb 2021 23:56:48 GMT (envelope-from git) Date: Mon, 22 Feb 2021 23:56:48 GMT Message-Id: <202102222356.11MNum8a010599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: ab88a1ff14ef - stable/12 - cxgbe(4): Save proper zone index on low memory in refill_fl(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ab88a1ff14ef1db0296af1d2be648b784ba4e614 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 22 Feb 2021 23:56:48 -0000 The branch stable/12 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=ab88a1ff14ef1db0296af1d2be648b784ba4e614 commit ab88a1ff14ef1db0296af1d2be648b784ba4e614 Author: Alexander Motin AuthorDate: 2021-02-17 02:15:28 +0000 Commit: Navdeep Parhar CommitDate: 2021-02-22 23:55:19 +0000 cxgbe(4): Save proper zone index on low memory in refill_fl(). When refill_fl() fails to allocate large (9/16KB) mbuf cluster, it falls back to safe (4KB) ones. But it still saved into sd->zidx the original fl->zidx instead of fl->safe_zidx. It caused problems with the later use of that cluster, including memory and/or data corruption. While there, make refill_fl() to use the safe zone for all following clusters for the call, since it is unlikely that large succeed. MFC after: 3 days Sponsored by: iXsystems, Inc. Reviewed by: np, jhb Differential Revision: https://reviews.freebsd.org/D28716 (cherry picked from commit 294e62bebf36f873fd083d2fe8edd78919dda4e8) --- sys/dev/cxgbe/t4_sge.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 335fd28644d2..4489d40e9fe4 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4530,7 +4530,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) caddr_t cl; struct rx_buf_info *rxb; struct cluster_metadata *clm; - uint16_t max_pidx; + uint16_t max_pidx, zidx = fl->zidx; uint16_t hw_cidx = fl->hw_cidx; /* stable snapshot */ FL_LOCK_ASSERT_OWNED(fl); @@ -4546,6 +4546,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) d = &fl->desc[fl->pidx]; sd = &fl->sdesc[fl->pidx]; + rxb = &sc->sge.rx_buf_info[zidx]; while (n > 0) { @@ -4579,11 +4580,11 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) sd->cl = NULL; /* gave up my reference */ } MPASS(sd->cl == NULL); - rxb = &sc->sge.rx_buf_info[fl->zidx]; cl = uma_zalloc(rxb->zone, M_NOWAIT); if (__predict_false(cl == NULL)) { - if (fl->zidx != fl->safe_zidx) { - rxb = &sc->sge.rx_buf_info[fl->safe_zidx]; + if (zidx != fl->safe_zidx) { + zidx = fl->safe_zidx; + rxb = &sc->sge.rx_buf_info[zidx]; cl = uma_zalloc(rxb->zone, M_NOWAIT); } if (cl == NULL) @@ -4594,7 +4595,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) pa = pmap_kextract((vm_offset_t)cl); sd->cl = cl; - sd->zidx = fl->zidx; + sd->zidx = zidx; if (fl->flags & FL_BUF_PACKING) { *d = htobe64(pa | rxb->hwidx2); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:10: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 E23FB5548F8; Tue, 23 Feb 2021 00:10: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 4DkzwV61Ggz3HZy; Tue, 23 Feb 2021 00:10: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 C16ED73F0; Tue, 23 Feb 2021 00:10: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 11N0Ao98032783; Tue, 23 Feb 2021 00:10:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0Aoac032782; Tue, 23 Feb 2021 00:10:50 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:10:50 GMT Message-Id: <202102230010.11N0Aoac032782@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: 7f06b217c53c - main - amd64: import asm strlen into libc 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: 7f06b217c53c3f5e4ac81eb11125adfb71359ac6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:10:50 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7f06b217c53c3f5e4ac81eb11125adfb71359ac6 commit 7f06b217c53c3f5e4ac81eb11125adfb71359ac6 Author: Mateusz Guzik AuthorDate: 2021-02-21 21:20:04 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-23 00:09:55 +0000 amd64: import asm strlen into libc Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28845 --- lib/libc/amd64/string/Makefile.inc | 1 + lib/libc/amd64/string/strlen.S | 81 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/lib/libc/amd64/string/Makefile.inc b/lib/libc/amd64/string/Makefile.inc index db88ac723539..cb370bc6be1c 100644 --- a/lib/libc/amd64/string/Makefile.inc +++ b/lib/libc/amd64/string/Makefile.inc @@ -8,4 +8,5 @@ MDSRCS+= \ memset.S \ strcat.S \ strcmp.S \ + strlen.S \ stpcpy.S diff --git a/lib/libc/amd64/string/strlen.S b/lib/libc/amd64/string/strlen.S new file mode 100644 index 000000000000..1d2428e3420e --- /dev/null +++ b/lib/libc/amd64/string/strlen.S @@ -0,0 +1,81 @@ +/* + * Written by Mateusz Guzik + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Note: this routine was written with kernel use in mind (read: no simd), + * it is only present in userspace as a temporary measure until something + * better gets imported. + */ + +#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ + +/* + * strlen(string) + * %rdi + * + * Uses the ((x - 0x01....01) & ~x & 0x80....80) trick. + * + * 0x01....01 is replaced with 0x0 - 0x01....01 so that it can be added + * with leaq. + * + * For a description see either: + * - "Hacker's Delight" by Henry S. Warren, Jr. + * - "Optimizing subroutines in assembly language: An optimization guide for x86 platforms" + * by Agner Fog + * + * The latter contains a 32-bit variant of the same algorithm coded in assembly for i386. + */ +ENTRY(strlen) + movabsq $0xfefefefefefefeff,%r8 + movabsq $0x8080808080808080,%r9 + + movq %rdi,%r10 + movq %rdi,%rcx + testb $7,%dil + jz 2f + + /* + * Handle misaligned reads: align to 8 and fill + * the spurious bytes. + */ + andq $~7,%rdi + movq (%rdi),%r11 + shlq $3,%rcx + movq $-1,%rdx + shlq %cl,%rdx + notq %rdx + orq %rdx,%r11 + + leaq (%r11,%r8),%rcx + notq %r11 + andq %r11,%rcx + andq %r9,%rcx + jnz 3f + + /* + * Main loop. + */ + ALIGN_TEXT +1: + leaq 8(%rdi),%rdi +2: + movq (%rdi),%r11 + leaq (%r11,%r8),%rcx + notq %r11 + andq %r11,%rcx + andq %r9,%rcx + jz 1b +3: + bsfq %rcx,%rcx + shrq $3,%rcx + leaq (%rcx,%rdi),%rax + subq %r10,%rax + ret +END(strlen) + + .section .note.GNU-stack,"",%progbits From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:32: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 E3A8E554C30; Tue, 23 Feb 2021 00:32: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 4Dl0P867J3z3JCP; Tue, 23 Feb 2021 00:32: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 C52F7788E; Tue, 23 Feb 2021 00:32: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 11N0WC67062491; Tue, 23 Feb 2021 00:32:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0WCYo062490; Tue, 23 Feb 2021 00:32:12 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:32:12 GMT Message-Id: <202102230032.11N0WCYo062490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: c8169618a730 - stable/13 - Exclude reserved iSCSI Target Transfer Tag. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8169618a7300bf41dad37b0ce107a4be5d9f8b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:32:12 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c8169618a7300bf41dad37b0ce107a4be5d9f8b0 commit c8169618a7300bf41dad37b0ce107a4be5d9f8b0 Author: Alexander Motin AuthorDate: 2021-01-24 18:58:29 +0000 Commit: Alexander Motin CommitDate: 2021-02-23 00:31:52 +0000 Exclude reserved iSCSI Target Transfer Tag. RFC 7143 (11.7.4): The Target Transfer Tag values are not specified by this protocol, except that the value 0xffffffff is reserved and means that the Target Transfer Tag is not supplied. MFC after: 1 month --- sys/cam/ctl/ctl_frontend_iscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index 996ab4e44fc0..8b0effcaf393 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -2693,6 +2693,10 @@ cfiscsi_datamove_out(union ctl_io *io) target_transfer_tag = atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); + if (target_transfer_tag == 0xffffffff) { + target_transfer_tag = + atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); + } cdw = cfiscsi_data_wait_new(cs, io, bhssc->bhssc_initiator_task_tag, &target_transfer_tag); if (cdw == NULL) { From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:32: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 16C98554C31; Tue, 23 Feb 2021 00:32: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 4Dl0P970x8z3J6Y; Tue, 23 Feb 2021 00:32: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 DDBAF72FA; Tue, 23 Feb 2021 00:32: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 11N0WDsR062514; Tue, 23 Feb 2021 00:32:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0WDdc062513; Tue, 23 Feb 2021 00:32:13 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:32:13 GMT Message-Id: <202102230032.11N0WDdc062513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 49f4b33f9e16 - stable/13 - Exclude reserved iSCSI Initiator Task Tag. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 49f4b33f9e1667f51a2d55e39785ce50c2cda950 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:32:14 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=49f4b33f9e1667f51a2d55e39785ce50c2cda950 commit 49f4b33f9e1667f51a2d55e39785ce50c2cda950 Author: Alexander Motin AuthorDate: 2021-01-24 19:23:04 +0000 Commit: Alexander Motin CommitDate: 2021-02-23 00:31:52 +0000 Exclude reserved iSCSI Initiator Task Tag. RFC 7143 (11.2.1.8): An ITT value of 0xffffffff is reserved and MUST NOT be assigned for a task by the initiator. The only instance in which it may be seen on the wire is in a target-initiated NOP-In PDU (Section 11.19) and in the initiator response to that PDU, if necessary. MFC after: 1 month --- sys/dev/iscsi/iscsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index eaaf84de9594..5e6c80255bff 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -2194,6 +2194,8 @@ iscsi_action_abort(struct iscsi_session *is, union ccb *ccb) } initiator_task_tag = is->is_initiator_task_tag++; + if (initiator_task_tag == 0xffffffff) + initiator_task_tag = is->is_initiator_task_tag++; io = iscsi_outstanding_add(is, request, NULL, &initiator_task_tag); if (io == NULL) { @@ -2254,6 +2256,9 @@ iscsi_action_scsiio(struct iscsi_session *is, union ccb *ccb) } initiator_task_tag = is->is_initiator_task_tag++; + if (initiator_task_tag == 0xffffffff) + initiator_task_tag = is->is_initiator_task_tag++; + io = iscsi_outstanding_add(is, request, ccb, &initiator_task_tag); if (io == NULL) { icl_pdu_free(request); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:33: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 73CC0554EA6; Tue, 23 Feb 2021 00:33: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 4Dl0QX2wlPz3Jrx; Tue, 23 Feb 2021 00:33: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 57763787C; Tue, 23 Feb 2021 00:33: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 11N0XONF062853; Tue, 23 Feb 2021 00:33:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0XO9x062852; Tue, 23 Feb 2021 00:33:24 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:33:24 GMT Message-Id: <202102230033.11N0XO9x062852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 7cc6daf122e5 - stable/12 - Exclude reserved iSCSI Target Transfer Tag. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7cc6daf122e53859ba786716090d1d536249a793 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:33:24 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7cc6daf122e53859ba786716090d1d536249a793 commit 7cc6daf122e53859ba786716090d1d536249a793 Author: Alexander Motin AuthorDate: 2021-01-24 18:58:29 +0000 Commit: Alexander Motin CommitDate: 2021-02-23 00:33:19 +0000 Exclude reserved iSCSI Target Transfer Tag. RFC 7143 (11.7.4): The Target Transfer Tag values are not specified by this protocol, except that the value 0xffffffff is reserved and means that the Target Transfer Tag is not supplied. MFC after: 1 month --- sys/cam/ctl/ctl_frontend_iscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index dfe1a347844b..9b55574590ff 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -2659,6 +2659,10 @@ cfiscsi_datamove_out(union ctl_io *io) target_transfer_tag = atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); + if (target_transfer_tag == 0xffffffff) { + target_transfer_tag = + atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); + } cdw = cfiscsi_data_wait_new(cs, io, bhssc->bhssc_initiator_task_tag, &target_transfer_tag); if (cdw == NULL) { From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:33: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 9D72455528E; Tue, 23 Feb 2021 00:33: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 4Dl0QY3ztgz3Jbd; Tue, 23 Feb 2021 00:33: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 79D1D7894; Tue, 23 Feb 2021 00:33: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 11N0XPM4062876; Tue, 23 Feb 2021 00:33:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0XPjC062875; Tue, 23 Feb 2021 00:33:25 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:33:25 GMT Message-Id: <202102230033.11N0XPjC062875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 0004227346d0 - stable/12 - Exclude reserved iSCSI Initiator Task Tag. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0004227346d0ceea713b456300794d55e787a5e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:33:25 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=0004227346d0ceea713b456300794d55e787a5e6 commit 0004227346d0ceea713b456300794d55e787a5e6 Author: Alexander Motin AuthorDate: 2021-01-24 19:23:04 +0000 Commit: Alexander Motin CommitDate: 2021-02-23 00:33:20 +0000 Exclude reserved iSCSI Initiator Task Tag. RFC 7143 (11.2.1.8): An ITT value of 0xffffffff is reserved and MUST NOT be assigned for a task by the initiator. The only instance in which it may be seen on the wire is in a target-initiated NOP-In PDU (Section 11.19) and in the initiator response to that PDU, if necessary. MFC after: 1 month --- sys/dev/iscsi/iscsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index f0ba48fa7a67..0c891a32feea 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -2194,6 +2194,8 @@ iscsi_action_abort(struct iscsi_session *is, union ccb *ccb) } initiator_task_tag = is->is_initiator_task_tag++; + if (initiator_task_tag == 0xffffffff) + initiator_task_tag = is->is_initiator_task_tag++; io = iscsi_outstanding_add(is, request, NULL, &initiator_task_tag); if (io == NULL) { @@ -2254,6 +2256,9 @@ iscsi_action_scsiio(struct iscsi_session *is, union ccb *ccb) } initiator_task_tag = is->is_initiator_task_tag++; + if (initiator_task_tag == 0xffffffff) + initiator_task_tag = is->is_initiator_task_tag++; + io = iscsi_outstanding_add(is, request, ccb, &initiator_task_tag); if (io == NULL) { icl_pdu_free(request); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:47: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 D9A7155561F; Tue, 23 Feb 2021 00:47: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 4Dl0kT5ctKz3KHv; Tue, 23 Feb 2021 00:47: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 A15917A20; Tue, 23 Feb 2021 00:47: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 11N0lDJ5076424; Tue, 23 Feb 2021 00: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 11N0lDTD076423; Tue, 23 Feb 2021 00:47:13 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:47:13 GMT Message-Id: <202102230047.11N0lDTD076423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: d7296b893969 - releng/13.0 - cxgbe(4): Save proper zone index on low memory in refill_fl(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: d7296b893969c3e77df8bdd001b008050d974c11 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:47:13 -0000 The branch releng/13.0 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=d7296b893969c3e77df8bdd001b008050d974c11 commit d7296b893969c3e77df8bdd001b008050d974c11 Author: Alexander Motin AuthorDate: 2021-02-17 02:15:28 +0000 Commit: Navdeep Parhar CommitDate: 2021-02-23 00:46:10 +0000 cxgbe(4): Save proper zone index on low memory in refill_fl(). When refill_fl() fails to allocate large (9/16KB) mbuf cluster, it falls back to safe (4KB) ones. But it still saved into sd->zidx the original fl->zidx instead of fl->safe_zidx. It caused problems with the later use of that cluster, including memory and/or data corruption. While there, make refill_fl() to use the safe zone for all following clusters for the call, since it is unlikely that large succeed. Approved by: re@ (gjb@) Sponsored by: iXsystems, Inc. Reviewed by: np, jhb Differential Revision: https://reviews.freebsd.org/D28716 (cherry picked from commit 294e62bebf36f873fd083d2fe8edd78919dda4e8) (cherry picked from commit c930816b76713623ccdef09d682e41266c1d724f) --- sys/dev/cxgbe/t4_sge.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 45f07358f0db..d16f17c45614 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4524,7 +4524,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) caddr_t cl; struct rx_buf_info *rxb; struct cluster_metadata *clm; - uint16_t max_pidx; + uint16_t max_pidx, zidx = fl->zidx; uint16_t hw_cidx = fl->hw_cidx; /* stable snapshot */ FL_LOCK_ASSERT_OWNED(fl); @@ -4540,6 +4540,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) d = &fl->desc[fl->pidx]; sd = &fl->sdesc[fl->pidx]; + rxb = &sc->sge.rx_buf_info[zidx]; while (n > 0) { @@ -4573,11 +4574,11 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) sd->cl = NULL; /* gave up my reference */ } MPASS(sd->cl == NULL); - rxb = &sc->sge.rx_buf_info[fl->zidx]; cl = uma_zalloc(rxb->zone, M_NOWAIT); if (__predict_false(cl == NULL)) { - if (fl->zidx != fl->safe_zidx) { - rxb = &sc->sge.rx_buf_info[fl->safe_zidx]; + if (zidx != fl->safe_zidx) { + zidx = fl->safe_zidx; + rxb = &sc->sge.rx_buf_info[zidx]; cl = uma_zalloc(rxb->zone, M_NOWAIT); } if (cl == NULL) @@ -4588,7 +4589,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n) pa = pmap_kextract((vm_offset_t)cl); sd->cl = cl; - sd->zidx = fl->zidx; + sd->zidx = zidx; if (fl->flags & FL_BUF_PACKING) { *d = htobe64(pa | rxb->hwidx2); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:55: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 DBBFE555954; Tue, 23 Feb 2021 00:55: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 4Dl0wL5qH3z3M0v; Tue, 23 Feb 2021 00:55: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 BAC7A7C5E; Tue, 23 Feb 2021 00:55: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 11N0tkH8089681; Tue, 23 Feb 2021 00:55:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0tkh6089680; Tue, 23 Feb 2021 00:55:46 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:55:46 GMT Message-Id: <202102230055.11N0tkh6089680@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: ab3e1bd3c22a - stable/13 - xen-blkback: fix leak of grant maps on ring setup 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: ab3e1bd3c22a222520c23c2793cc39e3a23c9b46 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:55:46 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ab3e1bd3c22a222520c23c2793cc39e3a23c9b46 commit ab3e1bd3c22a222520c23c2793cc39e3a23c9b46 Author: Roger Pau Monné AuthorDate: 2021-01-20 18:40:51 +0000 Commit: Ed Maste CommitDate: 2021-02-23 00:55:14 +0000 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Sponsored by: Citrix Systems R&D (cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45) --- sys/dev/xen/blkback/blkback.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index 762f25302c00..678472cc2ab8 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -2893,10 +2893,31 @@ xbb_connect_ring(struct xbb_softc *xbb) ring_idx < xbb->ring_config.ring_pages; ring_idx++, gnt++) { if (gnt->status != 0) { + struct gnttab_unmap_grant_ref unmap[XBB_MAX_RING_PAGES]; + unsigned int i, j; + xbb->ring_config.va = 0; xenbus_dev_fatal(xbb->dev, EACCES, "Ring shared page mapping failed. " "Status %d.", gnt->status); + + /* Unmap everything to avoid leaking grant table maps */ + for (i = 0, j = 0; i < xbb->ring_config.ring_pages; + i++) { + if (gnts[i].status != GNTST_okay) + continue; + + unmap[j].host_addr = gnts[i].host_addr; + unmap[j].dev_bus_addr = gnts[i].dev_bus_addr; + unmap[j++].handle = gnts[i].handle; + } + if (j != 0) { + error = HYPERVISOR_grant_table_op( + GNTTABOP_unmap_grant_ref, unmap, j); + if (error != 0) + panic("Unable to unmap grants (%d)", + error); + } return (EACCES); } xbb->ring_config.handle[ring_idx] = gnt->handle; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:57: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 AD6CB555AF2; Tue, 23 Feb 2021 00:57: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 4Dl0yH4Q4Nz3MC0; Tue, 23 Feb 2021 00:57: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 8A48E7B30; Tue, 23 Feb 2021 00:57: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 11N0vRJu090057; Tue, 23 Feb 2021 00:57:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0vRh7090056; Tue, 23 Feb 2021 00:57:27 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:57:27 GMT Message-Id: <202102230057.11N0vRh7090056@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: dfb372f5d38c - stable/12 - xen-blkback: fix leak of grant maps on ring setup 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/12 X-Git-Reftype: branch X-Git-Commit: dfb372f5d38c302953a6a4e2838179cd0a1a6438 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:57:27 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dfb372f5d38c302953a6a4e2838179cd0a1a6438 commit dfb372f5d38c302953a6a4e2838179cd0a1a6438 Author: Roger Pau Monné AuthorDate: 2021-01-20 18:40:51 +0000 Commit: Ed Maste CommitDate: 2021-02-23 00:57:03 +0000 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Sponsored by: Citrix Systems R&D (cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45) --- sys/dev/xen/blkback/blkback.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index d935ba965b00..b98ccb6e2595 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -2912,10 +2912,31 @@ xbb_connect_ring(struct xbb_softc *xbb) ring_idx < xbb->ring_config.ring_pages; ring_idx++, gnt++) { if (gnt->status != 0) { + struct gnttab_unmap_grant_ref unmap[XBB_MAX_RING_PAGES]; + unsigned int i, j; + xbb->ring_config.va = 0; xenbus_dev_fatal(xbb->dev, EACCES, "Ring shared page mapping failed. " "Status %d.", gnt->status); + + /* Unmap everything to avoid leaking grant table maps */ + for (i = 0, j = 0; i < xbb->ring_config.ring_pages; + i++) { + if (gnts[i].status != GNTST_okay) + continue; + + unmap[j].host_addr = gnts[i].host_addr; + unmap[j].dev_bus_addr = gnts[i].dev_bus_addr; + unmap[j++].handle = gnts[i].handle; + } + if (j != 0) { + error = HYPERVISOR_grant_table_op( + GNTTABOP_unmap_grant_ref, unmap, j); + if (error != 0) + panic("Unable to unmap grants (%d)", + error); + } return (EACCES); } xbb->ring_config.handle[ring_idx] = gnt->handle; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 00:58: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 1157B555A69; Tue, 23 Feb 2021 00:58: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 4Dl0zH005Rz3MFk; Tue, 23 Feb 2021 00:58: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 E697579E4; Tue, 23 Feb 2021 00:58: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 11N0wIfk090285; Tue, 23 Feb 2021 00:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N0wI2B090284; Tue, 23 Feb 2021 00:58:18 GMT (envelope-from git) Date: Tue, 23 Feb 2021 00:58:18 GMT Message-Id: <202102230058.11N0wI2B090284@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: 89238773a37f - stable/11 - xen-blkback: fix leak of grant maps on ring setup 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/11 X-Git-Reftype: branch X-Git-Commit: 89238773a37f4fc8f0bf3ccca3aa03874478f194 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 00:58:19 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=89238773a37f4fc8f0bf3ccca3aa03874478f194 commit 89238773a37f4fc8f0bf3ccca3aa03874478f194 Author: Roger Pau Monné AuthorDate: 2021-01-20 18:40:51 +0000 Commit: Ed Maste CommitDate: 2021-02-23 00:57:35 +0000 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Sponsored by: Citrix Systems R&D (cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45) --- sys/dev/xen/blkback/blkback.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index 4b6eeb0cf62f..5fb5cdbe6ea1 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -2911,10 +2911,31 @@ xbb_connect_ring(struct xbb_softc *xbb) ring_idx < xbb->ring_config.ring_pages; ring_idx++, gnt++) { if (gnt->status != 0) { + struct gnttab_unmap_grant_ref unmap[XBB_MAX_RING_PAGES]; + unsigned int i, j; + xbb->ring_config.va = 0; xenbus_dev_fatal(xbb->dev, EACCES, "Ring shared page mapping failed. " "Status %d.", gnt->status); + + /* Unmap everything to avoid leaking grant table maps */ + for (i = 0, j = 0; i < xbb->ring_config.ring_pages; + i++) { + if (gnts[i].status != GNTST_okay) + continue; + + unmap[j].host_addr = gnts[i].host_addr; + unmap[j].dev_bus_addr = gnts[i].dev_bus_addr; + unmap[j++].handle = gnts[i].handle; + } + if (j != 0) { + error = HYPERVISOR_grant_table_op( + GNTTABOP_unmap_grant_ref, unmap, j); + if (error != 0) + panic("Unable to unmap grants (%d)", + error); + } return (EACCES); } xbb->ring_config.handle[ring_idx] = gnt->handle; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 01:04: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 3FDC2555CE1; Tue, 23 Feb 2021 01:04: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 4Dl16Z1PzDz3N0c; Tue, 23 Feb 2021 01:04: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 236637A6F; Tue, 23 Feb 2021 01:04: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 11N14cRX003616; Tue, 23 Feb 2021 01:04:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N14caN003615; Tue, 23 Feb 2021 01:04:38 GMT (envelope-from git) Date: Tue, 23 Feb 2021 01:04:38 GMT Message-Id: <202102230104.11N14caN003615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 0a2a96f35a4c - main - jail: Don't allow jails under dying parents MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a2a96f35a4c2dab3486438680fa289e12971e4b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 01:04:38 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=0a2a96f35a4c2dab3486438680fa289e12971e4b commit 0a2a96f35a4c2dab3486438680fa289e12971e4b Author: Jamie Gritton AuthorDate: 2021-02-23 01:04:06 +0000 Commit: Jamie Gritton CommitDate: 2021-02-23 01:04:06 +0000 jail: Don't allow jails under dying parents If a jail is created with jail_set(...JAIL_DYING), and it has a parent currently in a dying state, that will bring the parent jail back to life. Restrict that to require that the parent itself be explicitly brought back first, and not implicitly created along with the new child jail. Differential Revision: https://reviews.freebsd.org/D28515 --- sys/kern/kern_jail.c | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 89dd039685a8..4f434637ccfa 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -990,7 +990,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) * This abuses the file error codes ENOENT and EEXIST. */ pr = NULL; - ppr = mypr; inspr = NULL; if (cuflags == JAIL_CREATE && jid == 0 && name != NULL) { namelc = strrchr(name, '.'); @@ -999,6 +998,12 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) jid = 0; } sx_xlock(&allprison_lock); + ppr = mypr; + if (!prison_isalive(ppr)) { + /* This jail is dying. This process will surely follow. */ + error = EAGAIN; + goto done_deref; + } drflags = PD_LIST_XLOCKED; if (jid != 0) { if (jid < 0) { @@ -1022,7 +1027,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) break; } if (pr != NULL) { - ppr = pr->pr_parent; /* Create: jid must not exist. */ if (cuflags == JAIL_CREATE) { /* @@ -1044,6 +1048,13 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) vfs_opterror(opts, "jail %d not found", jid); goto done_deref; } + ppr = pr->pr_parent; + if (!prison_isalive(ppr)) { + error = ENOENT; + vfs_opterror(opts, "jail %d is dying", + ppr->pr_id); + goto done_deref; + } if (!prison_isalive(pr)) { if (!(flags & JAIL_DYING)) { error = ENOENT; @@ -1109,15 +1120,13 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) "jail \"%s\" not found", name); goto done_deref; } - if (!(flags & JAIL_DYING) && - !prison_isalive(ppr)) { - mtx_unlock(&ppr->pr_mtx); + mtx_unlock(&ppr->pr_mtx); + if (!prison_isalive(ppr)) { error = ENOENT; vfs_opterror(opts, "jail \"%s\" is dying", name); goto done_deref; } - mtx_unlock(&ppr->pr_mtx); *namelc = '.'; } namelc++; @@ -1196,26 +1205,9 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) vfs_opterror(opts, "prison limit exceeded"); goto done_deref; } - prison_hold(ppr); - if (!refcount_acquire_if_not_zero(&ppr->pr_uref)) { - /* This brings the parent back to life. */ - mtx_lock(&ppr->pr_mtx); - refcount_acquire(&ppr->pr_uref); - ppr->pr_state = PRISON_STATE_ALIVE; - mtx_unlock(&ppr->pr_mtx); - error = osd_jail_call(ppr, PR_METHOD_CREATE, opts); - if (error) { - pr = ppr; - drflags |= PD_DEREF | PD_DEUREF; - goto done_deref; - } - } - if (jid == 0 && (jid = get_next_prid(&inspr)) == 0) { error = EAGAIN; vfs_opterror(opts, "no available jail IDs"); - pr = ppr; - drflags |= PD_DEREF | PD_DEUREF; goto done_deref; } @@ -1235,6 +1227,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) TAILQ_INSERT_TAIL(&allprison, pr, pr_list); pr->pr_parent = ppr; + prison_hold(ppr); + prison_proc_hold(ppr); LIST_INSERT_HEAD(&ppr->pr_children, pr, pr_sibling); for (tpr = ppr; tpr != NULL; tpr = tpr->pr_parent) tpr->pr_childcount++; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 01:30: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 DDBED557246; Tue, 23 Feb 2021 01:30: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 4Dl1hf607mz3QHM; Tue, 23 Feb 2021 01:30: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 C08911044C; Tue, 23 Feb 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 11N1Ugj5037632; Tue, 23 Feb 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 11N1Uges037631; Tue, 23 Feb 2021 01:30:42 GMT (envelope-from git) Date: Tue, 23 Feb 2021 01:30:42 GMT Message-Id: <202102230130.11N1Uges037631@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: 3df2766a6916 - stable/13 - linux: Unmap the VDSO page when unloading 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: 3df2766a691679ac383aabc8409a1a84433c15e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 01:30:42 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3df2766a691679ac383aabc8409a1a84433c15e6 commit 3df2766a691679ac383aabc8409a1a84433c15e6 Author: Mark Johnston AuthorDate: 2021-02-16 14:30:21 +0000 Commit: Mark Johnston CommitDate: 2021-02-23 01:29:55 +0000 linux: Unmap the VDSO page when unloading linux_shared_page_init() creates an object and grabs and maps a single page to back the VDSO. When destroying the VDSO object, we failed to destroy the mapping and free KVA. Fix this. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28696 (cherry picked from commit 0fc8a796722846d0d676548aa0f5cc660199db73) --- sys/amd64/linux/linux_sysvec.c | 3 ++- sys/amd64/linux32/linux32_sysvec.c | 3 ++- sys/arm64/linux/linux_sysvec.c | 3 ++- sys/compat/linux/linux_vdso.c | 6 +++++- sys/compat/linux/linux_vdso.h | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index dbfc650a916e..abc750c63682 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -818,7 +818,8 @@ static void linux_vdso_deinstall(void *param) { - __elfN(linux_shared_page_fini)(linux_shared_page_obj); + __elfN(linux_shared_page_fini)(linux_shared_page_obj, + linux_shared_page_mapping); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_deinstall, NULL); diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index d06a1fb17d9b..bb86baefaec4 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -961,7 +961,8 @@ static void linux_vdso_deinstall(void *param) { - __elfN(linux_shared_page_fini)(linux_shared_page_obj); + __elfN(linux_shared_page_fini)(linux_shared_page_obj, + linux_shared_page_mapping); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_deinstall, NULL); diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 366fe7c2dc44..1d628ffe6ecb 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -461,7 +461,8 @@ linux_vdso_deinstall(const void *param) { LIN_SDT_PROBE0(sysvec, linux_vdso_deinstall, todo); - __elfN(linux_shared_page_fini)(linux_shared_page_obj); + __elfN(linux_shared_page_fini)(linux_shared_page_obj, + linux_shared_page_mapping); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_deinstall, NULL); diff --git a/sys/compat/linux/linux_vdso.c b/sys/compat/linux/linux_vdso.c index 096f2e424850..a05c0b01ff40 100644 --- a/sys/compat/linux/linux_vdso.c +++ b/sys/compat/linux/linux_vdso.c @@ -93,9 +93,13 @@ __elfN(linux_shared_page_init)(char **mapping) } void -__elfN(linux_shared_page_fini)(vm_object_t obj) +__elfN(linux_shared_page_fini)(vm_object_t obj, void *mapping) { + vm_offset_t va; + va = (vm_offset_t)mapping; + pmap_qremove(va, 1); + kva_free(va, PAGE_SIZE); vm_object_deallocate(obj); } diff --git a/sys/compat/linux/linux_vdso.h b/sys/compat/linux/linux_vdso.h index 542efef9cb82..073c51696387 100644 --- a/sys/compat/linux/linux_vdso.h +++ b/sys/compat/linux/linux_vdso.h @@ -39,7 +39,7 @@ struct linux_vdso_sym { }; vm_object_t __elfN(linux_shared_page_init)(char **); -void __elfN(linux_shared_page_fini)(vm_object_t); +void __elfN(linux_shared_page_fini)(vm_object_t, void *); void __elfN(linux_vdso_fixup)(struct sysentvec *); void __elfN(linux_vdso_reloc)(struct sysentvec *); void __elfN(linux_vdso_sym_init)(struct linux_vdso_sym *); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 01:30: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 40A2D557415; Tue, 23 Feb 2021 01:30: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 4Dl1hg6fq9z3QDy; Tue, 23 Feb 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 D738510668; Tue, 23 Feb 2021 01:30: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 11N1UhVb037654; Tue, 23 Feb 2021 01:30:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N1Uh1w037653; Tue, 23 Feb 2021 01:30:43 GMT (envelope-from git) Date: Tue, 23 Feb 2021 01:30:43 GMT Message-Id: <202102230130.11N1Uh1w037653@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: ddfa5b011ca6 - stable/13 - linux: Update the i386/linux vdso deinitialization routine 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: ddfa5b011ca665711fa11926715614c993ee110d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 01:30:44 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ddfa5b011ca665711fa11926715614c993ee110d commit ddfa5b011ca665711fa11926715614c993ee110d Author: Mark Johnston AuthorDate: 2021-02-16 22:06:20 +0000 Commit: Mark Johnston CommitDate: 2021-02-23 01:30:01 +0000 linux: Update the i386/linux vdso deinitialization routine This was missed in commit 0fc8a796722 ("linux: Unmap the VDSO page when unloading"). Reported by: Mark Millard MFC with: 0fc8a796722 (cherry picked from commit aa5fef60bf663d31cddf53d7a8c6856d5e4672c0) --- sys/i386/linux/linux_sysvec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 10229d8af57e..ef845675aaa4 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -938,7 +938,8 @@ static void linux_vdso_deinstall(void *param) { - __elfN(linux_shared_page_fini)(linux_shared_page_obj); + __elfN(linux_shared_page_fini)(linux_shared_page_obj, + linux_shared_page_mapping); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_deinstall, NULL); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 02:03: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 E37AA559665; Tue, 23 Feb 2021 02:03: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 4Dl2R268kQz3kX6; Tue, 23 Feb 2021 02:03: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 C61DE10F29; Tue, 23 Feb 2021 02:03: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 11N23wvQ082117; Tue, 23 Feb 2021 02:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N23wVU082116; Tue, 23 Feb 2021 02:03:58 GMT (envelope-from git) Date: Tue, 23 Feb 2021 02:03:58 GMT Message-Id: <202102230203.11N23wVU082116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: a7ac518bff64 - main - ice_ddp: Update package file to 1.3.19.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7ac518bff64d48cf262c60c4dc57eef34e74a07 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 02:03:59 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a7ac518bff64d48cf262c60c4dc57eef34e74a07 commit a7ac518bff64d48cf262c60c4dc57eef34e74a07 Author: Eric Joyner AuthorDate: 2021-02-23 01:43:54 +0000 Commit: Eric Joyner CommitDate: 2021-02-23 02:02:19 +0000 ice_ddp: Update package file to 1.3.19.0 This package is intended to be used with ice(4) version 0.28.1-k. That update will happen in a forthcoming commit. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation --- sys/conf/files.amd64 | 6 +++--- sys/conf/files.arm64 | 6 +++--- sys/contrib/dev/ice/LICENSE | 2 +- .../dev/ice/{ice-1.3.16.0.pkg => ice-1.3.19.0.pkg} | Bin 659716 -> 614660 bytes sys/modules/ice_ddp/Makefile | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 395f501198f8..f0c863e0bd2f 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -190,7 +190,7 @@ dev/ice/ice_sriov.c optional ice pci \ dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -199,8 +199,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.19.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.19.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index c1e5b40db3f9..3ca830f64f05 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -202,7 +202,7 @@ dev/ice/ice_sriov.c optional ice pci \ dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -211,8 +211,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.19.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.19.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" diff --git a/sys/contrib/dev/ice/LICENSE b/sys/contrib/dev/ice/LICENSE index 7daf627fc7a0..7faadfc55aac 100644 --- a/sys/contrib/dev/ice/LICENSE +++ b/sys/contrib/dev/ice/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2006-2018, Intel Corporation. +Copyright (c) 2006-2021, Intel Corporation. All rights reserved. Redistribution. Redistribution and use in binary form, without diff --git a/sys/contrib/dev/ice/ice-1.3.16.0.pkg b/sys/contrib/dev/ice/ice-1.3.19.0.pkg similarity index 79% rename from sys/contrib/dev/ice/ice-1.3.16.0.pkg rename to sys/contrib/dev/ice/ice-1.3.19.0.pkg index ec5caecb3a72..32e2603bc131 100644 Binary files a/sys/contrib/dev/ice/ice-1.3.16.0.pkg and b/sys/contrib/dev/ice/ice-1.3.19.0.pkg differ diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index e6f45ae3820b..38337a106368 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ KMOD= ice_ddp -FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.16.0.pkg:ice_ddp:0x01031000 +FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.19.0.pkg:ice_ddp:0x01031300 .include From owner-dev-commits-src-all@freebsd.org Tue Feb 23 07:27: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 77C9F56005B; Tue, 23 Feb 2021 07:27: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 4Dl9cF2w8Yz4XX7; Tue, 23 Feb 2021 07:27: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 56D4614FF2; Tue, 23 Feb 2021 07:27: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 11N7RPvE004195; Tue, 23 Feb 2021 07:27:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N7RP9Y004194; Tue, 23 Feb 2021 07:27:25 GMT (envelope-from git) Date: Tue, 23 Feb 2021 07:27:25 GMT Message-Id: <202102230727.11N7RP9Y004194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: b7f1582221f5 - stable/13 - loader: start kernel in text mode when there is no vbefb vt driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b7f1582221f5259f75564886355ce4106eafd081 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 07:27:25 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=b7f1582221f5259f75564886355ce4106eafd081 commit b7f1582221f5259f75564886355ce4106eafd081 Author: Toomas Soome AuthorDate: 2021-01-26 22:47:56 +0000 Commit: Toomas Soome CommitDate: 2021-02-21 20:31:38 +0000 loader: start kernel in text mode when there is no vbefb vt driver If kernel is built without VT vbefb driver, make sure we start kernel in text mode. (cherry picked from commit 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd) --- stand/common/gfx_fb.h | 1 + stand/common/load_elf.c | 63 ++++++++++++++++++++++++++++++++++++------- stand/i386/libi386/bootinfo.c | 10 +++++++ stand/loader.mk | 9 +++++++ 4 files changed, 74 insertions(+), 9 deletions(-) diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index c62c6441f8ad..04076a2c6d38 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -216,6 +216,7 @@ typedef struct teken_gfx { struct gen_fb tg_fb; teken_funcs_t *tg_functions; void *tg_private; + bool tg_kernel_supported; /* Loaded kernel is supported */ } teken_gfx_t; extern font_list_t fonts; diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index cb542718fe2f..62fdb560ecff 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #define FREEBSD_ELF #include +#include #include "bootstrap.h" @@ -84,12 +85,14 @@ typedef struct elf_file { static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, uint64_t loadaddr); -static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, - const char* name, Elf_Sym* sym); +static int __elfN(lookup_symbol)(elf_file_t ef, const char* name, + Elf_Sym *sym, unsigned char type); static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p, void *val, size_t len); static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p_start, Elf_Addr p_end); +static bool __elfN(parse_vt_drv_set)(struct preloaded_file *mp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end); static symaddr_fn __elfN(symaddr); static char *fake_modname(const char *name); @@ -872,12 +875,24 @@ nosyms: ef->buckets = ef->hashtab + 2; ef->chains = ef->buckets + ef->nbuckets; - if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", - &sym) != 0) + gfx_state.tg_kernel_supported = false; + if (__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, + STT_NOTYPE) == 0) { + p_start = sym.st_value + ef->off; + if (__elfN(lookup_symbol)(ef, "__stop_set_vt_drv_set", &sym, + STT_NOTYPE) == 0) { + p_end = sym.st_value + ef->off; + gfx_state.tg_kernel_supported = + __elfN(parse_vt_drv_set)(fp, ef, p_start, p_end); + } + } + + if (__elfN(lookup_symbol)(ef, "__start_set_modmetadata_set", &sym, + STT_NOTYPE) != 0) return 0; p_start = sym.st_value + ef->off; - if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", - &sym) != 0) + if (__elfN(lookup_symbol)(ef, "__stop_set_modmetadata_set", &sym, + STT_NOTYPE) != 0) return ENOENT; p_end = sym.st_value + ef->off; @@ -1072,6 +1087,36 @@ out: return (err); } +/* + * Walk through vt_drv_set, each vt driver structure starts with + * static 16 chars for driver name. If we have "vbefb", return true. + */ +static bool +__elfN(parse_vt_drv_set)(struct preloaded_file *fp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end) +{ + Elf_Addr v, p; + char vd_name[16]; + int error; + + p = p_start; + while (p < p_end) { + COPYOUT(p, &v, sizeof(v)); + + error = __elfN(reloc_ptr)(fp, ef, p, &v, sizeof(v)); + if (error == EOPNOTSUPP) + v += ef->off; + else if (error != 0) + return (false); + COPYOUT(v, &vd_name, sizeof(vd_name)); + if (strncmp(vd_name, "vbefb", sizeof(vd_name)) == 0) + return (true); + p += sizeof(Elf_Addr); + } + + return (false); +} + int __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef, Elf_Addr p_start, Elf_Addr p_end) @@ -1185,8 +1230,8 @@ elf_hash(const char *name) static const char __elfN(bad_symtable)[] = "elf" __XSTRING(__ELF_WORD_SIZE) "_lookup_symbol: corrupt symbol table\n"; int -__elfN(lookup_symbol)(struct preloaded_file *fp, elf_file_t ef, - const char* name, Elf_Sym *symp) +__elfN(lookup_symbol)(elf_file_t ef, const char* name, Elf_Sym *symp, + unsigned char type) { Elf_Hashelt symnum; Elf_Sym sym; @@ -1213,7 +1258,7 @@ __elfN(lookup_symbol)(struct preloaded_file *fp, elf_file_t ef, free(strp); if (sym.st_shndx != SHN_UNDEF || (sym.st_value != 0 && - ELF_ST_TYPE(sym.st_info) == STT_FUNC)) { + ELF_ST_TYPE(sym.st_info) == type)) { *symp = sym; return 0; } diff --git a/stand/i386/libi386/bootinfo.c b/stand/i386/libi386/bootinfo.c index 71e07cfb9702..57f926b76589 100644 --- a/stand/i386/libi386/bootinfo.c +++ b/stand/i386/libi386/bootinfo.c @@ -41,6 +41,16 @@ __FBSDID("$FreeBSD$"); void bi_load_vbe_data(struct preloaded_file *kfp) { + if (!gfx_state.tg_kernel_supported) { + /* + * Loaded kernel does not have vt/vbe backend, + * switch console to text mode. + */ + if (vbe_available()) + bios_set_text_mode(VGA_TEXT_MODE); + return; + } + if (vbe_available()) { file_addmetadata(kfp, MODINFOMD_VBE_FB, sizeof(gfx_state.tg_fb), &gfx_state.tg_fb); diff --git a/stand/loader.mk b/stand/loader.mk index cde7a31dca7e..3a38a9bc9e63 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -17,23 +17,32 @@ CFLAGS.pnglite.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "aarch64" SRCS+= load_elf64.c reloc_elf64.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c SRCS+= metadata.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "riscv" SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" From owner-dev-commits-src-all@freebsd.org Tue Feb 23 07:27: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 3DDB6560323; Tue, 23 Feb 2021 07:27: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 4Dl9cX1Bdsz4XsX; Tue, 23 Feb 2021 07:27: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 1C09E15154; Tue, 23 Feb 2021 07:27: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 11N7RedH004343; Tue, 23 Feb 2021 07:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N7RefG004342; Tue, 23 Feb 2021 07:27:40 GMT (envelope-from git) Date: Tue, 23 Feb 2021 07:27:40 GMT Message-Id: <202102230727.11N7RefG004342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 1714029b8a9c - stable/13 - Fix loader detection of vbefb support on !amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1714029b8a9c069f2f35f5c4ec2df453f0fd3f08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 07:27:40 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=1714029b8a9c069f2f35f5c4ec2df453f0fd3f08 commit 1714029b8a9c069f2f35f5c4ec2df453f0fd3f08 Author: Dimitry Andric AuthorDate: 2021-01-27 21:28:43 +0000 Commit: Toomas Soome CommitDate: 2021-02-21 20:31:56 +0000 Fix loader detection of vbefb support on !amd64 On i386, after 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd, the vbefb vt driver was no longer detected by the loader, if any kernel module was loaded after the kernel itself. This was caused by the parse_vt_drv_set() function being called multiple times, resetting the detection flag. (It was called multiple times, becuase i386 .ko files are shared objects like the kernel proper, while this is not the case on amd64.) Fix this by skipping the set_vt_drv_set lookup if vbefb was already detected. Reviewed by: tsoome (cherry picked from commit 6e26189be406a9a3799074b16925e6cd63cc703b) --- stand/common/load_elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index 62fdb560ecff..8bb780ef34df 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -875,8 +875,8 @@ nosyms: ef->buckets = ef->hashtab + 2; ef->chains = ef->buckets + ef->nbuckets; - gfx_state.tg_kernel_supported = false; - if (__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, + if (!gfx_state.tg_kernel_supported && + __elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, STT_NOTYPE) == 0) { p_start = sym.st_value + ef->off; if (__elfN(lookup_symbol)(ef, "__stop_set_vt_drv_set", &sym, From owner-dev-commits-src-all@freebsd.org Tue Feb 23 07: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 CFB755601D9; Tue, 23 Feb 2021 07: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 4Dl9cv43gnz4XWV; Tue, 23 Feb 2021 07: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 7E4F414FF3; Tue, 23 Feb 2021 07: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 11N7Rxa7004509; Tue, 23 Feb 2021 07:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N7RxHg004508; Tue, 23 Feb 2021 07:27:59 GMT (envelope-from git) Date: Tue, 23 Feb 2021 07:27:59 GMT Message-Id: <202102230727.11N7RxHg004508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: debcf835b16b - stable/13 - loader: unload command should reset tg_kernel_supported in gfx_state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: debcf835b16be30b51ec8bc0951ec0af79036074 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 07:27:59 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=debcf835b16be30b51ec8bc0951ec0af79036074 commit debcf835b16be30b51ec8bc0951ec0af79036074 Author: Toomas Soome AuthorDate: 2021-01-28 07:45:47 +0000 Commit: Toomas Soome CommitDate: 2021-02-21 20:32:14 +0000 loader: unload command should reset tg_kernel_supported in gfx_state While loading kernel, we check if vt/vbe backend support is included in kernel and set the tg_kernel_supported flag in gfx_state. unload command needs to reset this flag to allow next load to perform this check with new kernel. Reported by: jhb (cherry picked from commit 9b388ac30375ad4e0259b264a006753edcb2bd3c) --- stand/common/module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/common/module.c b/stand/common/module.c index 247fc54b6021..34ffc10cded3 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -271,6 +271,8 @@ unload(void) } loadaddr = 0; unsetenv("kernelname"); + /* Reset tg_kernel_supported to allow next load to check it again. */ + gfx_state.tg_kernel_supported = false; } COMMAND_SET(unload, "unload", "unload all modules", command_unload); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 09:09: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 145E35632F8; Tue, 23 Feb 2021 09:09: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 4DlCtR06fyz4fVb; Tue, 23 Feb 2021 09:09: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 EB1EF16857; Tue, 23 Feb 2021 09:09: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 11N99oEZ036512; Tue, 23 Feb 2021 09:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N99ogG036511; Tue, 23 Feb 2021 09:09:50 GMT (envelope-from git) Date: Tue, 23 Feb 2021 09:09:50 GMT Message-Id: <202102230909.11N99ogG036511@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: 1c23f70aeb29 - stable/13 - pgcache read: protect against reads past end of the vm object size 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: 1c23f70aeb299e672a4fc483c45c721548ae1047 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 09:09:51 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1c23f70aeb299e672a4fc483c45c721548ae1047 commit 1c23f70aeb299e672a4fc483c45c721548ae1047 Author: Konstantin Belousov AuthorDate: 2021-02-15 03:34:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-23 08:50:22 +0000 pgcache read: protect against reads past end of the vm object size PR: 253158 (cherry picked from commit c61fae1475f1864dc4bba667b642f279afd44855) --- sys/kern/vfs_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 6c6727c7f372..1e52a797a1f7 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -951,6 +951,10 @@ vn_read_from_obj(struct vnode *vp, struct uio *uio) #else vsz = atomic_load_64(&obj->un_pager.vnp.vnp_size); #endif + if (uio->uio_offset >= vsz) { + error = EJUSTRETURN; + goto out; + } if (uio->uio_offset + resid > vsz) resid = vsz - uio->uio_offset; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 09:46: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 777AF564C05; Tue, 23 Feb 2021 09:46: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 4DlDhg2xMtz4jWK; Tue, 23 Feb 2021 09:46: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 57C6C17168; Tue, 23 Feb 2021 09:46: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 11N9kRPG088152; Tue, 23 Feb 2021 09:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11N9kRKX088151; Tue, 23 Feb 2021 09:46:27 GMT (envelope-from git) Date: Tue, 23 Feb 2021 09:46:27 GMT Message-Id: <202102230946.11N9kRKX088151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: f3f7b0dc065c - main - lib/msun/ctrig_test: Print the mismatched values on failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3f7b0dc065ce30f29b221788c58079d78931a77 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 09:46:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f3f7b0dc065ce30f29b221788c58079d78931a77 commit f3f7b0dc065ce30f29b221788c58079d78931a77 Author: Alex Richardson AuthorDate: 2021-02-23 09:38:57 +0000 Commit: Alex Richardson CommitDate: 2021-02-23 09:39:40 +0000 lib/msun/ctrig_test: Print the mismatched values on failure This test fails on aarch64 but debugging it is difficult without the results being printed. Now the failing AArch64 test prints: root@freebsd-aarch64:/nfsroot/usr/tests/lib/msun # kyua debug ctrig_test:test_nan_inputs *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + -1 I) != expected (-0 + -1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + 1 I) != expected (-0 + 1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + -1 I) != expected (-0 + -1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + 1 I) != expected (-0 + 1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (1 + 0 I) != expected (1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (1 + 0 I) != expected (1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (-1 + 0 I) != expected (-1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (-1 + 0 I) != expected (-1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 ctrig_test:test_nan_inputs -> failed: 16 checks failed; see output for more details Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28788 --- lib/msun/tests/ctrig_test.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index b40373fed29b..2499e53ab4d5 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -58,14 +58,22 @@ __FBSDID("$FreeBSD$"); * XXX The volatile here is to avoid gcc's bogus constant folding and work * around the lack of support for the FENV_ACCESS pragma. */ -#define test_p(func, z, result, exceptmask, excepts, checksign) do { \ - volatile long double complex _d = z; \ - debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ - creall(_d), cimagl(_d), creall(result), cimagl(result)); \ - ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK(cfpequal_cs((func)(_d), (result), (checksign))); \ - ATF_CHECK(((void)(func), fetestexcept(exceptmask) == (excepts))); \ -} while (0) +#define test_p(func, z, result, exceptmask, excepts, checksign) \ + do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ + volatile long double complex _r = (func)(_d); \ + ATF_CHECK_MSG(cfpequal_cs(_r, (result), (checksign)), \ + "%s (%Lg + %Lg I) != expected (%Lg + %Lg I)", \ + __XSTRING((func)(_d)), creall(_r), cimagl(_r), \ + creall(result), cimagl(result)); \ + volatile int _e = fetestexcept(exceptmask); \ + ATF_CHECK_MSG(_e == (excepts), \ + "%s fetestexcept(%s) (%#x) != %#x", __XSTRING(func), \ + __XSTRING(exceptmask), _e, (excepts)); \ + } while (0) /* * Test within a given tolerance. The tolerance indicates relative error From owner-dev-commits-src-all@freebsd.org Tue Feb 23 10:27: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 7477F5660B9; Tue, 23 Feb 2021 10:27: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 4DlFc62wc7z4lrL; Tue, 23 Feb 2021 10:27: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 4CA9317A29; Tue, 23 Feb 2021 10:27: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 11NARYIr041281; Tue, 23 Feb 2021 10:27:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NARYYE041280; Tue, 23 Feb 2021 10:27:34 GMT (envelope-from git) Date: Tue, 23 Feb 2021 10:27:34 GMT Message-Id: <202102231027.11NARYYE041280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 77e1ccbee3ed - main - rc: implement parallel boot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 10:27:34 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=77e1ccbee3ed6c837929e4e232fd07f95bfc8294 commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 Author: Rick Parrish AuthorDate: 2021-02-07 06:15:21 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-23 10:16:53 +0000 rc: implement parallel boot take advantage of the rcorder -p argument to implement parallel booting in rc. According to the author non scientific tests: on a Core 2 Duo with spinning disk: | Services enabled | before | after | saving | | 0 | 8s | 8s | 0 | | 1 | 13s | 13s | 0 | | 2 | 17s | 13s | 5 | | 3 | 23s | 13s | 10 | | 4 | 28s | 13s | 15 | | 5 | 33s | 13s | 20 | PR: 249192 MFC after: 3 weeks --- libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 35db4a850516..722d7fe35884 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then skip_firstboot="-s firstboot" fi +# rc_parallel_start default is "NO" +rc_parallel_start=${rc_parallel_start:-NO} +_rc_parallel='' +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" +checkyesno rc_parallel_start && _rc_parallel='-p' + # Do a first pass to get everything up to $early_late_divider so that # we can do a second pass that includes $local_startup directories # -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` +files=`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/* 2>/dev/null` _rc_elem_done=' ' -for _rc_elem in ${files}; do - run_rc_script ${_rc_elem} ${_boot} - _rc_elem_done="${_rc_elem_done}${_rc_elem} " - - case "$_rc_elem" in - */${early_late_divider}) break ;; - esac +IFS=$'\n' +for _rc_group in ${files}; do + IFS=$' ' + for _rc_elem in ${_rc_group}; do + run_rc_script ${_rc_elem} ${_boot} & + _rc_elem_done="${_rc_elem_done}${_rc_elem} " + + case "$_rc_elem" in + */${early_late_divider}) break ;; + esac + done + wait + IFS=$'\n' done unset files local_rc @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then skip_firstboot="" fi -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` -for _rc_elem in ${files}; do - case "$_rc_elem_done" in - *" $_rc_elem "*) continue ;; - esac - - run_rc_script ${_rc_elem} ${_boot} +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_rc_parallel} 2>/dev/null` +IFS=$'\n' +for _rc_group in ${files}; do + IFS=$' ' + for _rc_elem in ${_rc_group}; do + case "$_rc_elem_done" in + *" $_rc_elem "*) continue ;; + esac + + run_rc_script ${_rc_elem} ${_boot} & + done + wait + IFS=$'\n' done +unset IFS # Remove the firstboot sentinel, and reboot if it was requested. # Be a bit paranoid about removing it to handle the common failure From owner-dev-commits-src-all@freebsd.org Tue Feb 23 11:25: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 8827A5678BA; Tue, 23 Feb 2021 11:25: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 4DlGvW3PTDz4qMn; Tue, 23 Feb 2021 11:25: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 67CA718820; Tue, 23 Feb 2021 11:25: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 11NBPxY8020047; Tue, 23 Feb 2021 11:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NBPxso020046; Tue, 23 Feb 2021 11:25:59 GMT (envelope-from git) Date: Tue, 23 Feb 2021 11:25:59 GMT Message-Id: <202102231125.11NBPxso020046@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: 4b737a9c58ca - releng/13.0 - pgcache read: protect against reads past end of the vm object size 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 4b737a9c58cac69008f189cc44e7d1a81a0b601c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 11:25:59 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4b737a9c58cac69008f189cc44e7d1a81a0b601c commit 4b737a9c58cac69008f189cc44e7d1a81a0b601c Author: Konstantin Belousov AuthorDate: 2021-02-15 03:34:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-23 11:21:00 +0000 pgcache read: protect against reads past end of the vm object size PR: 253158 Approved by: re (gjb) (cherry picked from commit c61fae1475f1864dc4bba667b642f279afd44855) --- sys/kern/vfs_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 6c6727c7f372..1e52a797a1f7 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -951,6 +951,10 @@ vn_read_from_obj(struct vnode *vp, struct uio *uio) #else vsz = atomic_load_64(&obj->un_pager.vnp.vnp_size); #endif + if (uio->uio_offset >= vsz) { + error = EJUSTRETURN; + goto out; + } if (uio->uio_offset + resid > vsz) resid = vsz - uio->uio_offset; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 11:50: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 8103D567E76; Tue, 23 Feb 2021 11:50: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 4DlHRy3GtFz4rvQ; Tue, 23 Feb 2021 11:50: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 6364F18BD4; Tue, 23 Feb 2021 11:50: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 11NBoc6X054543; Tue, 23 Feb 2021 11:50:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NBoc2f054542; Tue, 23 Feb 2021 11:50:38 GMT (envelope-from git) Date: Tue, 23 Feb 2021 11:50:38 GMT Message-Id: <202102231150.11NBoc2f054542@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: 5d3b3e47a68b - stable/13 - pf: duplicate frames only once when using dup-to pf rule 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: 5d3b3e47a68bf16b054add5f696d80789d1cb738 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 11:50:38 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d3b3e47a68bf16b054add5f696d80789d1cb738 commit 5d3b3e47a68bf16b054add5f696d80789d1cb738 Author: Yannis Planus AuthorDate: 2021-01-28 13:59:07 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 11:46:24 +0000 pf: duplicate frames only once when using dup-to pf rule When using DUP-TO rule, frames are duplicated 3 times on both output interfaces and duplication interface. Add a flag to not duplicate a duplicated frame. Inspired by a patch from Miłosz Kaniewski milosz.kaniewski at gmail.com https://lists.freebsd.org/pipermail/freebsd-pf/2015-November/007886.html Reviewed by: kp@ Differential Revision: https://reviews.freebsd.org/D27018 (cherry picked from commit 0c458752ceee14818034df7bfcdfb04129dceeda) --- sys/netpfil/pf/pf.c | 50 ++++++++++++++++++++++++++++++++++++++++++------ sys/netpfil/pf/pf_mtag.h | 1 + 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4cccb0101650..86354e69d11f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5488,10 +5488,29 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, } if (r->rt == PF_DUPTO) { - if ((m0 = m_dup(*m, M_NOWAIT)) == NULL) { - if (s) + if ((pd->pf_mtag->flags & PF_DUPLICATED)) { + if (s == NULL) { + ifp = r->rpool.cur->kif ? + r->rpool.cur->kif->pfik_ifp : NULL; + } else { + ifp = s->rt_kif ? s->rt_kif->pfik_ifp : NULL; PF_STATE_UNLOCK(s); - return; + } + if (ifp == oifp) { + /* When the 2nd interface is not skipped */ + return; + } else { + m0 = *m; + *m = NULL; + goto bad; + } + } else { + pd->pf_mtag->flags |= PF_DUPLICATED; + if (((m0 = m_dup(*m, M_NOWAIT)) == NULL)) { + if (s) + PF_STATE_UNLOCK(s); + return; + } } } else { if ((r->rt == PF_REPLYTO) == (r->direction == dir)) { @@ -5649,10 +5668,29 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, } if (r->rt == PF_DUPTO) { - if ((m0 = m_dup(*m, M_NOWAIT)) == NULL) { - if (s) + if ((pd->pf_mtag->flags & PF_DUPLICATED)) { + if (s == NULL) { + ifp = r->rpool.cur->kif ? + r->rpool.cur->kif->pfik_ifp : NULL; + } else { + ifp = s->rt_kif ? s->rt_kif->pfik_ifp : NULL; PF_STATE_UNLOCK(s); - return; + } + if (ifp == oifp) { + /* When the 2nd interface is not skipped */ + return; + } else { + m0 = *m; + *m = NULL; + goto bad; + } + } else { + pd->pf_mtag->flags |= PF_DUPLICATED; + if (((m0 = m_dup(*m, M_NOWAIT)) == NULL)) { + if (s) + PF_STATE_UNLOCK(s); + return; + } } } else { if ((r->rt == PF_REPLYTO) == (r->direction == dir)) { diff --git a/sys/netpfil/pf/pf_mtag.h b/sys/netpfil/pf/pf_mtag.h index 67c79350e8eb..ad28ab7a7c30 100644 --- a/sys/netpfil/pf/pf_mtag.h +++ b/sys/netpfil/pf/pf_mtag.h @@ -42,6 +42,7 @@ #define PF_PACKET_LOOPED 0x08 #define PF_FASTFWD_OURS_PRESENT 0x10 #define PF_REASSEMBLED 0x20 +#define PF_DUPLICATED 0x40 struct pf_mtag { void *hdr; /* saved hdr pos in mbuf, for ECN */ From owner-dev-commits-src-all@freebsd.org Tue Feb 23 11:50: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 E3838540160; Tue, 23 Feb 2021 11:50: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 4DlHS05t6Qz4rvS; Tue, 23 Feb 2021 11:50: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 A5E5618D09; Tue, 23 Feb 2021 11:50: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 11NBoedY054587; Tue, 23 Feb 2021 11:50:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NBoe3Z054586; Tue, 23 Feb 2021 11:50:40 GMT (envelope-from git) Date: Tue, 23 Feb 2021 11:50:40 GMT Message-Id: <202102231150.11NBoe3Z054586@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: 04535d6a572a - stable/13 - pf tests: Test unicast reverse path forwarding check 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: 04535d6a572ac63b448a5def4525947bd00d9f8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 11:50:41 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=04535d6a572ac63b448a5def4525947bd00d9f8a commit 04535d6a572ac63b448a5def4525947bd00d9f8a Author: Kristof Provost AuthorDate: 2021-02-15 21:16:36 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 11:46:25 +0000 pf tests: Test unicast reverse path forwarding check Ensure that pf's urpf-failed keyword works as expected. PR: 253479 MFC after: 1 week Reviewed by: melifaro@ Differential Revision: https://reviews.freebsd.org/D28694 (cherry picked from commit 6b52139eb8e8eda0ea263b24735556194f918642) --- tests/sys/netpfil/common/pft_ping.py | 52 ++++++++++++++++++++++++++++ tests/sys/netpfil/pf/pass_block.sh | 67 ++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 812250803309..957123e4f6f8 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -115,6 +115,35 @@ def check_ping6_request(args, packet): return True +def check_ping_reply(args, packet): + return check_ping4_reply(args, packet) + +def check_ping4_reply(args, packet): + """ + Check that this is a reply to the ping request we sent + """ + dst_ip = args.to[0] + + ip = packet.getlayer(sp.IP) + if not ip: + return False + if ip.src != dst_ip: + return False + + icmp = packet.getlayer(sp.ICMP) + if not icmp: + return False + if sp.icmptypes[icmp.type] != 'echo-reply': + return False + + raw = packet.getlayer(sp.Raw) + if not raw: + return False + if raw.load != PAYLOAD_MAGIC: + return False + + return True + def ping(send_if, dst_ip, args): ether = sp.Ether() ip = sp.IP(dst=dst_ip) @@ -124,6 +153,9 @@ def ping(send_if, dst_ip, args): if args.send_tos: ip.tos = int(args.send_tos[0]) + if args.fromaddr: + ip.src = args.fromaddr[0] + req = ether / ip / icmp / raw sp.sendp(req, iface=send_if, verbose=False) @@ -132,6 +164,9 @@ def ping6(send_if, dst_ip, args): ip6 = sp.IPv6(dst=dst_ip) icmp = sp.ICMPv6EchoRequest(data=sp.raw(PAYLOAD_MAGIC)) + if args.fromaddr: + ip.src = args.fromaddr[0] + req = ether / ip6 / icmp sp.sendp(req, iface=send_if, verbose=False) @@ -189,6 +224,8 @@ def main(): required=True, help='The interface through which the packet(s) will be sent') parser.add_argument('--recvif', nargs=1, + help='The interface on which to expect the ICMP echo request') + parser.add_argument('--replyif', nargs=1, help='The interface on which to expect the ICMP echo response') parser.add_argument('--checkdup', nargs=1, help='The interface on which to expect the duplicated ICMP packets') @@ -197,6 +234,8 @@ def main(): parser.add_argument('--to', nargs=1, required=True, help='The destination IP address for the ICMP echo request') + parser.add_argument('--fromaddr', nargs=1, + help='The source IP address for the ICMP echo request') # TCP options parser.add_argument('--tcpsyn', action='store_true', @@ -225,6 +264,11 @@ def main(): sniffer = Sniffer(args, checkfn) + replysniffer = None + if not args.replyif is None: + checkfn=check_ping_reply + replysniffer = Sniffer(args, checkfn, recvif=args.replyif[0]) + dupsniffer = None if args.checkdup is not None: dupsniffer = Sniffer(args, check_dup, recvif=args.checkdup[0]) @@ -250,5 +294,13 @@ def main(): else: sys.exit(1) + if replysniffer: + replysniffer.join() + + if replysniffer.foundCorrectPacket: + sys.exit(0) + else: + sys.exit(1) + if __name__ == '__main__': main() diff --git a/tests/sys/netpfil/pf/pass_block.sh b/tests/sys/netpfil/pf/pass_block.sh index 139adb43bddd..589b89891729 100644 --- a/tests/sys/netpfil/pf/pass_block.sh +++ b/tests/sys/netpfil/pf/pass_block.sh @@ -27,6 +27,8 @@ . $(atf_get_srcdir)/utils.subr +common_dir=$(atf_get_srcdir)/../common + atf_test_case "v4" "cleanup" v4_head() { @@ -189,10 +191,75 @@ nested_inline_cleanup() pft_cleanup } +atf_test_case "urpf" "cleanup" +urpf_head() +{ + atf_set descr "Test unicast reverse path forwarding check" + atf_set require.user root + atf_set require.progs scapy +} + +urpf_body() +{ + pft_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair_one}b ${epair_two}b + + ifconfig ${epair_one}a 192.0.2.2/24 up + ifconfig ${epair_two}a 198.51.100.2/24 up + + jexec alcatraz ifconfig ${epair_one}b 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair_two}b 198.51.100.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + # Sanity checks + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.1 + atf_check -s exit:0 -o ignore ping -c 1 -t 1 198.51.100.1 + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_one}a \ + --to 192.0.2.1 \ + --fromaddr 198.51.100.2 \ + --replyif ${epair_two}a + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_two}a \ + --to 198.51.100.1 \ + --fromaddr 192.0.2.2 \ + --replyif ${epair_one}a + + pft_set_rules alcatraz \ + "block quick from urpf-failed" + jexec alcatraz pfctl -e + + # Correct source still works + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.1 + atf_check -s exit:0 -o ignore ping -c 1 -t 1 198.51.100.1 + + # Unexpected source interface is blocked + atf_check -s exit:1 ${common_dir}/pft_ping.py \ + --sendif ${epair_one}a \ + --to 192.0.2.1 \ + --fromaddr 198.51.100.2 \ + --replyif ${epair_two}a + atf_check -s exit:1 ${common_dir}/pft_ping.py \ + --sendif ${epair_two}a \ + --to 198.51.100.1 \ + --fromaddr 192.0.2.2 \ + --replyif ${epair_one}a +} + +urpf_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" atf_add_test_case "v6" atf_add_test_case "noalias" atf_add_test_case "nested_inline" + atf_add_test_case "urpf" } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 11:50: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 A1BBD54033F; Tue, 23 Feb 2021 11:50: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 4DlHRz4FKfz4rxs; Tue, 23 Feb 2021 11:50: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 8534C18D07; Tue, 23 Feb 2021 11:50: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 11NBodis054565; Tue, 23 Feb 2021 11:50:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NBodLL054564; Tue, 23 Feb 2021 11:50:39 GMT (envelope-from git) Date: Tue, 23 Feb 2021 11:50:39 GMT Message-Id: <202102231150.11NBodLL054564@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: 46b600875685 - stable/13 - pf tests: Test that dup-to doesn't produce extra duplicate packets 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: 46b6008756858eae5bef28fe0fa4d87e8913ab38 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 11:50:39 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=46b6008756858eae5bef28fe0fa4d87e8913ab38 commit 46b6008756858eae5bef28fe0fa4d87e8913ab38 Author: Kristof Provost AuthorDate: 2021-01-28 10:02:20 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 11:46:25 +0000 pf tests: Test that dup-to doesn't produce extra duplicate packets (cherry picked from commit cd579b6fba46b9f5005358d1e82def7b26703224) --- tests/sys/netpfil/common/pft_ping.py | 32 ++++++++++++++ tests/sys/netpfil/common/sniffer.py | 7 +++- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/dup.sh | 81 ++++++++++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index d960426e4b42..812250803309 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -34,6 +34,27 @@ from sniffer import Sniffer PAYLOAD_MAGIC = bytes.fromhex('42c0ffee') +dup_found = 0 + +def check_dup(args, packet): + """ + Verify that this is an ICMP packet, and that we only see one + """ + global dup_found + + icmp = packet.getlayer(sp.ICMP) + if not icmp: + return False + + raw = packet.getlayer(sp.Raw) + if not raw: + return False + if raw.load != PAYLOAD_MAGIC: + return False + + dup_found = dup_found + 1 + return False + def check_ping_request(args, packet): if args.ip6: return check_ping6_request(args, packet) @@ -169,6 +190,8 @@ def main(): help='The interface through which the packet(s) will be sent') parser.add_argument('--recvif', nargs=1, help='The interface on which to expect the ICMP echo response') + parser.add_argument('--checkdup', nargs=1, + help='The interface on which to expect the duplicated ICMP packets') parser.add_argument('--ip6', action='store_true', help='Use IPv6') parser.add_argument('--to', nargs=1, @@ -202,6 +225,10 @@ def main(): sniffer = Sniffer(args, checkfn) + dupsniffer = None + if args.checkdup is not None: + dupsniffer = Sniffer(args, check_dup, recvif=args.checkdup[0]) + if args.tcpsyn: tcpsyn(args.sendif[0], args.to[0], args) else: @@ -210,6 +237,11 @@ def main(): else: ping(args.sendif[0], args.to[0], args) + if dupsniffer: + dupsniffer.join() + if dup_found != 1: + sys.exit(1) + if sniffer: sniffer.join() diff --git a/tests/sys/netpfil/common/sniffer.py b/tests/sys/netpfil/common/sniffer.py index 58df32cce276..200ac750dd7f 100644 --- a/tests/sys/netpfil/common/sniffer.py +++ b/tests/sys/netpfil/common/sniffer.py @@ -30,11 +30,14 @@ import threading import scapy.all as sp class Sniffer(threading.Thread): - def __init__(self, args, check_function): + def __init__(self, args, check_function, recvif=None): threading.Thread.__init__(self) self._args = args - self._recvif = args.recvif[0] + if recvif is not None: + self._recvif = recvif + else: + self._recvif = args.recvif[0] self._check_function = check_function self.foundCorrectPacket = False diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 68f54c801297..6b1e34b69a6d 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -7,6 +7,7 @@ TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= anchor \ checksum \ + dup \ forward \ fragmentation \ icmp \ diff --git a/tests/sys/netpfil/pf/dup.sh b/tests/sys/netpfil/pf/dup.sh new file mode 100644 index 000000000000..7b9a91804e96 --- /dev/null +++ b/tests/sys/netpfil/pf/dup.sh @@ -0,0 +1,81 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Kristof Provost +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "dup_to" "cleanup" +do_to_head() +{ + atf_set descr 'dup-to test' + atf_set require.user root +} + +dup_to_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + epair_recv=$(vnet_mkepair) + ifconfig ${epair_recv}a up + + epair_dupto=$(vnet_mkepair) + ifconfig ${epair_dupto}a up + + vnet_mkjail alcatraz ${epair_send}b ${epair_recv}b ${epair_dupto}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_recv}b 198.51.100.2/24 up + jexec alcatraz ifconfig ${epair_dupto}b 203.0.113.2/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + jexec alcatraz arp -s 198.51.100.3 00:01:02:03:04:05 + jexec alcatraz arp -s 203.0.113.3 01:02:03:04:05:06 + route add -net 198.51.100.0/24 192.0.2.2 + + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "pass out on { ${epair_recv}b } \ + dup-to (${epair_dupto}b 203.0.113.3)" + + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recv ${epair_recv}a \ + --checkdup ${epair_dupto}a +} + +dup_to_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "dup_to" +} From owner-dev-commits-src-all@freebsd.org Tue Feb 23 13:16: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 910A95436BC; Tue, 23 Feb 2021 13:16:05 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 4DlKLY3L9yz3Dwx; Tue, 23 Feb 2021 13:16:05 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f51.google.com with SMTP id do6so34518088ejc.3; Tue, 23 Feb 2021 05:16:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yLKmLe9U51rA5x3Dbp56Fu2iC4m6hj8bW3+ZKX9xSZ0=; b=XyJnuOEujj4WUbBVG2kbNaN9ODZOegpcAweeJDQZv2a3idRc209l/qS+BvAjizF0Hp ApeDrpS/4q4LDx1jBLlt7u7N7DVSKXkVRsiZgTVbjRZaF3czYYG33H0MPKns0aoxlPMS UHPm3P0wzz4Hf3ANeS8a4lbhQ/Skinmzj+lR/2hXzf6rnDVjmrTinsEjForZ9wHkw8V9 JVNUL9OYJYgyDArum0lgC7Qnegq9m9V4zrxeZxmrOaK+2gLNBFyeWnMBYLRDWpKSiTAm hbrlUNaalZsw9Hbr2m3j73PPl7yAzm14fd/wGpwC+o2kyohX4jJh5m4kcLvAAdd23pmy IKQg== X-Gm-Message-State: AOAM532YPyPRVLSufePT9Mx5szydzLcvj/rUEdZscyRDHvf+JITrHnBW xIjXiP4kwQOf1wdW90EUaS1vDGBjV7DVqA== X-Google-Smtp-Source: ABdhPJx0gz9DuiHXY4ZuZSA2wBrgz0HAuqLDMjfrChveZ1h0X+serxGmHpVGi4eF9gGWV5DW+Q6spA== X-Received: by 2002:a17:906:d0c3:: with SMTP id bq3mr25465743ejb.424.1614086162979; Tue, 23 Feb 2021 05:16:02 -0800 (PST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id lf18sm7813987ejb.42.2021.02.23.05.16.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Feb 2021 05:16:02 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id c7so5796129wru.8; Tue, 23 Feb 2021 05:16:02 -0800 (PST) X-Received: by 2002:adf:f484:: with SMTP id l4mr15624687wro.409.1614086162346; Tue, 23 Feb 2021 05:16:02 -0800 (PST) MIME-Version: 1.0 References: <202102222027.11MKRtcl033616@gitrepo.freebsd.org> In-Reply-To: <202102222027.11MKRtcl033616@gitrepo.freebsd.org> From: Alexander Richardson Date: Tue, 23 Feb 2021 13:15:51 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 811e27fa3c44 - main - jail: Add PD_KILL to remove a prison in prison_deref(). To: Jamie Gritton Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DlKLY3L9yz3Dwx 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)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 13:16:05 -0000 On Mon, 22 Feb 2021 at 20:28, Jamie Gritton wrote: > > The branch main has been updated by jamie: > > URL: https://cgit.FreeBSD.org/src/commit/?id=811e27fa3c445664e36071a7d08228fc7fb85676 > > commit 811e27fa3c445664e36071a7d08228fc7fb85676 > Author: Jamie Gritton > AuthorDate: 2021-02-22 20:27:44 +0000 > Commit: Jamie Gritton > CommitDate: 2021-02-22 20:27:44 +0000 > > jail: Add PD_KILL to remove a prison in prison_deref(). > > Add the PD_KILL flag that instructs prison_deref() to take steps > to actively kill a prison and its descendents, namely marking it > PRISON_STATE_DYING, clearing its PR_PERSIST flag, and killing any > attached processes. > > This replaces a similar loop in sys_jail_remove(), bringing the > operation under the same single hold on allprison_lock that it already > has. It is also used to clean up failed jail (re-)creations in > kern_jail_set(), which didn't generally take all the proper steps. > > Differential Revision: https://reviews.freebsd.org/D28473 > --- > sys/kern/kern_jail.c | 258 ++++++++++++++++++++++++++++++++------------------- > sys/sys/jail.h | 13 +++ > 2 files changed, 178 insertions(+), 93 deletions(-) > > diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c > index 1ddfe3c3df5f..01724e41955c 100644 > --- a/sys/kern/kern_jail.c > +++ b/sys/kern/kern_jail.c > @@ -141,12 +141,13 @@ static int get_next_prid(struct prison **insprp); > static int do_jail_attach(struct thread *td, struct prison *pr, int drflags); > static void prison_complete(void *context, int pending); > static void prison_deref(struct prison *pr, int flags); > +static void prison_deref_kill(struct prison *pr, struct prisonlist *freeprison); > static int prison_lock_xlock(struct prison *pr, int flags); > static void prison_free_not_last(struct prison *pr); > +static void prison_proc_free_not_last(struct prison *pr); > static void prison_set_allow_locked(struct prison *pr, unsigned flag, > int enable); > static char *prison_path(struct prison *pr1, struct prison *pr2); > -static void prison_remove_one(struct prison *pr); > #ifdef RACCT > static void prison_racct_attach(struct prison *pr); > static void prison_racct_modify(struct prison *pr); > @@ -156,9 +157,10 @@ static void prison_racct_detach(struct prison *pr); > /* Flags for prison_deref */ > #define PD_DEREF 0x01 /* Decrement pr_ref */ > #define PD_DEUREF 0x02 /* Decrement pr_uref */ > -#define PD_LOCKED 0x04 /* pr_mtx is held */ > -#define PD_LIST_SLOCKED 0x08 /* allprison_lock is held shared */ > -#define PD_LIST_XLOCKED 0x10 /* allprison_lock is held exclusive */ > +#define PD_KILL 0x04 /* Remove jail, kill processes, etc */ > +#define PD_LOCKED 0x10 /* pr_mtx is held */ > +#define PD_LIST_SLOCKED 0x20 /* allprison_lock is held shared */ > +#define PD_LIST_XLOCKED 0x40 /* allprison_lock is held exclusive */ > > /* > * Parameter names corresponding to PR_* flag values. Size values are for kvm > @@ -1756,6 +1758,12 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) > pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags; > mtx_unlock(&pr->pr_mtx); > drflags &= ~PD_LOCKED; > + /* > + * Any errors past this point will need to de-persist newly created > + * prisons, as well as call remove methods. > + */ > + if (born) > + drflags |= PD_KILL; > > #ifdef RACCT > if (racct_enable && created) > @@ -1815,17 +1823,12 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) > /* Let the modules do their work. */ > if (born) { > error = osd_jail_call(pr, PR_METHOD_CREATE, opts); > - if (error) { > - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); > + if (error) > goto done_deref; > - } > } > error = osd_jail_call(pr, PR_METHOD_SET, opts); > - if (error) { > - if (born) > - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); > + if (error) > goto done_deref; > - } > > /* > * A new prison is now ready to be seen; either it has gained a user > @@ -1856,6 +1859,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) > } > #endif > > + drflags &= ~PD_KILL; > td->td_retval[0] = pr->pr_id; > > done_deref: > @@ -2279,8 +2283,8 @@ kern_jail_get(struct thread *td, struct uio *optuio, int flags) > int > sys_jail_remove(struct thread *td, struct jail_remove_args *uap) > { > - struct prison *pr, *cpr, *lpr; > - int descend, error; > + struct prison *pr; > + int error; > > error = priv_check(td, PRIV_JAIL_REMOVE); > if (error) > @@ -2292,90 +2296,16 @@ sys_jail_remove(struct thread *td, struct jail_remove_args *uap) > sx_xunlock(&allprison_lock); > return (EINVAL); > } > - > - /* Remove all descendants of this prison, then remove this prison. */ > - prison_hold(pr); > - if (!LIST_EMPTY(&pr->pr_children)) { > + if (!prison_isalive(pr)) { > + /* Silently ignore already-dying prisons. */ > mtx_unlock(&pr->pr_mtx); > - lpr = NULL; > - FOREACH_PRISON_DESCENDANT(pr, cpr, descend) { > - prison_hold(cpr); > - if (lpr != NULL) { > - mtx_lock(&lpr->pr_mtx); > - prison_remove_one(lpr); > - sx_xlock(&allprison_lock); > - } > - lpr = cpr; > - } > - if (lpr != NULL) { > - mtx_lock(&lpr->pr_mtx); > - prison_remove_one(lpr); > - sx_xlock(&allprison_lock); > - } > - mtx_lock(&pr->pr_mtx); > + sx_xunlock(&allprison_lock); > + return (0); > } > - prison_remove_one(pr); > + prison_deref(pr, PD_KILL | PD_LOCKED | PD_LIST_XLOCKED); > return (0); > } > > -static void > -prison_remove_one(struct prison *pr) > -{ > - struct proc *p; > - int was_alive, drflags; > - > - drflags = PD_DEREF | PD_LOCKED | PD_LIST_XLOCKED; > - > - /* > - * Mark the prison as doomed, so it doesn't accidentally come back > - * to life. It may still be explicitly brought back by jail_set(2). > - */ > - was_alive = pr->pr_state == PRISON_STATE_ALIVE; > - pr->pr_state = PRISON_STATE_DYING; > - > - /* If the prison was persistent, it is not anymore. */ > - if (pr->pr_flags & PR_PERSIST) { > - drflags |= PD_DEUREF; > - prison_free_not_last(pr); > - pr->pr_flags &= ~PR_PERSIST; > - } > - > - /* > - * jail_remove added a reference. If that's the only one, remove > - * the prison now. refcount(9) doesn't guarantee the cache coherence > - * of non-zero counters, so force it here. > - */ > - KASSERT(refcount_load(&pr->pr_ref) > 0, > - ("prison_remove_one removing a dead prison (jid=%d)", pr->pr_id)); > - if (atomic_load_acq_int(&pr->pr_ref) == 1) { > - prison_deref(pr, drflags); > - return; > - } > - > - /* Tell modules this prison has died. */ > - mtx_unlock(&pr->pr_mtx); > - drflags &= ~PD_LOCKED; > - if (was_alive) > - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); > - > - sx_xunlock(&allprison_lock); > - drflags &= ~PD_LIST_XLOCKED; > - /* > - * Kill all processes unfortunate enough to be attached to this prison. > - */ > - sx_slock(&allproc_lock); > - FOREACH_PROC_IN_SYSTEM(p) { > - PROC_LOCK(p); > - if (p->p_state != PRS_NEW && p->p_ucred && > - p->p_ucred->cr_prison == pr) > - kern_psignal(p, SIGKILL); > - PROC_UNLOCK(p); > - } > - sx_sunlock(&allproc_lock); > - /* Remove the temporary reference added by jail_remove. */ > - prison_deref(pr, drflags); > -} > - > /* > * struct jail_attach_args { > * int jid; > @@ -2727,6 +2657,24 @@ prison_proc_free(struct prison *pr) > } > } > > +static void > +prison_proc_free_not_last(struct prison *pr) > +{ > +#ifdef INVARIANTS > + int lastref; > + > + KASSERT(refcount_load(&pr->pr_uref) > 0, > + ("Trying to free dead prison %p (jid=%d).", > + pr, pr->pr_id)); > + lastref = refcount_release(&pr->pr_uref); > + KASSERT(!lastref, > + ("prison_proc_free_not_last freed last uref on prison %p (jid=%d).", > + pr, pr->pr_id)); > +#else > + refcount_release(&pr->pr_uref); > +#endif > +} > + > /* > * Complete a call to either prison_free or prison_proc_free. > */ > @@ -2760,14 +2708,25 @@ static void > prison_deref(struct prison *pr, int flags) > { > struct prisonlist freeprison; > - struct prison *rpr, *ppr, *tpr; > + struct prison *killpr, *rpr, *ppr, *tpr; > + struct proc *p; > > + killpr = NULL; > TAILQ_INIT(&freeprison); > /* > * Release this prison as requested, which may cause its parent > * to be released, and then maybe its grandparent, etc. > */ > for (;;) { > + if (flags & PD_KILL) { > + /* Kill the prison and its descendents. */ > + if (!(flags & PD_DEREF)) { > + prison_hold(pr); > + flags |= PD_DEREF; > + } > + flags = prison_lock_xlock(pr, flags); > + prison_deref_kill(pr, &freeprison); > + } > if (flags & PD_DEUREF) { > /* Drop a user reference. */ > KASSERT(refcount_load(&pr->pr_uref) > 0, > @@ -2796,6 +2755,16 @@ prison_deref(struct prison *pr, int flags) > } > } > } > + if (flags & PD_KILL) { > + flags &= ~PD_KILL; > + /* > + * Any remaining user references are probably processes > + * that need to be killed, either in this prison or its > + * descendants. > + */ > + if (refcount_load(&pr->pr_uref) > 0) > + killpr = pr; > + } > if (flags & PD_DEREF) { > /* Drop a reference. */ > KASSERT(refcount_load(&pr->pr_ref) > 0, > @@ -2848,6 +2817,25 @@ prison_deref(struct prison *pr, int flags) > else if (flags & PD_LIST_XLOCKED) > sx_xunlock(&allprison_lock); > > + /* Kill any processes attached to a killed prison. */ > + if (killpr != NULL) { > + sx_slock(&allproc_lock); > + FOREACH_PROC_IN_SYSTEM(p) { > + PROC_LOCK(p); > + if (p->p_state != PRS_NEW && p->p_ucred != NULL) { > + for (ppr = p->p_ucred->cr_prison; > + ppr != &prison0; > + ppr = ppr->pr_parent) > + if (ppr == killpr) { > + kern_psignal(p, SIGKILL); > + break; > + } > + } > + PROC_UNLOCK(p); > + } > + sx_sunlock(&allproc_lock); > + } > + > /* > * Finish removing any unreferenced prisons, which couldn't happen > * while allprison_lock was held (to avoid a LOR on vrele). > @@ -2878,6 +2866,90 @@ prison_deref(struct prison *pr, int flags) > } > } > > +/* > + * Kill the prison and its descendants. Mark them as dying, clear the > + * persist flag, and call module remove methods. > + */ > +static void > +prison_deref_kill(struct prison *pr, struct prisonlist *freeprison) > +{ > + struct prison *cpr, *ppr, *rpr; > + bool descend; > + > + /* > + * Unlike the descendants, the target prison can be killed > + * even if it is currently dying. This is useful for failed > + * creation in jail_set(2). > + */ > + KASSERT(refcount_load(&pr->pr_ref) > 0, > + ("Trying to kill dead prison %p (jid=%d).", > + pr, pr->pr_id)); > + refcount_acquire(&pr->pr_uref); > + pr->pr_state = PRISON_STATE_DYING; > + mtx_unlock(&pr->pr_mtx); > + > + rpr = NULL; > + FOREACH_PRISON_DESCENDANT_PRE_POST(pr, cpr, descend) { > + if (descend) { > + if (!prison_isalive(cpr)) { > + descend = false; > + continue; > + } > + prison_hold(cpr); > + prison_proc_hold(cpr); > + mtx_lock(&cpr->pr_mtx); > + cpr->pr_state = PRISON_STATE_DYING; > + cpr->pr_flags |= PR_REMOVE; > + mtx_unlock(&cpr->pr_mtx); > + } > + if (!(cpr->pr_flags & PR_REMOVE)) > + continue; > + (void)osd_jail_call(cpr, PR_METHOD_REMOVE, NULL); > + mtx_lock(&cpr->pr_mtx); > + cpr->pr_flags &= ~PR_REMOVE; > + if (cpr->pr_flags & PR_PERSIST) { > + cpr->pr_flags &= ~PR_PERSIST; > + prison_proc_free_not_last(cpr); > + prison_free_not_last(cpr); > + } > + (void)refcount_release(&cpr->pr_uref); > + if (refcount_release(&cpr->pr_ref)) { > + /* > + * When the last reference goes, unlink the prison > + * and set it aside for prison_deref() to handle. > + * Delay unlinking the sibling list to keep the loop > + * safe. > + */ > + if (rpr != NULL) > + LIST_REMOVE(rpr, pr_sibling); > + rpr = cpr; > + rpr->pr_state = PRISON_STATE_INVALID; > + TAILQ_REMOVE(&allprison, rpr, pr_list); > + TAILQ_INSERT_TAIL(freeprison, rpr, pr_list); > + /* > + * Removing a prison frees references from its parent. > + */ > + ppr = rpr->pr_parent; > + prison_proc_free_not_last(ppr); > + prison_free_not_last(ppr); > + for (; ppr != NULL; ppr = ppr->pr_parent) > + ppr->pr_childcount--; > + } > + mtx_unlock(&cpr->pr_mtx); > + } > + if (rpr != NULL) > + LIST_REMOVE(rpr, pr_sibling); > + > + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); > + mtx_lock(&pr->pr_mtx); > + if (pr->pr_flags & PR_PERSIST) { > + pr->pr_flags &= ~PR_PERSIST; > + prison_proc_free_not_last(pr); > + prison_free_not_last(pr); > + } > + (void)refcount_release(&pr->pr_uref); > +} > + > /* > * Given the current locking state in the flags, make sure allprison_lock > * is held exclusive, and the prison is locked. Return flags indicating > diff --git a/sys/sys/jail.h b/sys/sys/jail.h > index 723a1fff0b82..c9d4c65e4d9e 100644 > --- a/sys/sys/jail.h > +++ b/sys/sys/jail.h > @@ -341,6 +341,19 @@ prison_unlock(struct prison *pr) > ; \ > else > > +/* > + * Traverse a prison's descendants, visiting both preorder and postorder. > + */ > +#define FOREACH_PRISON_DESCENDANT_PRE_POST(ppr, cpr, descend) \ > + for ((cpr) = (ppr), (descend) = 1; \ > + ((cpr) = (descend) \ > + ? ((descend) = !LIST_EMPTY(&(cpr)->pr_children)) \ > + ? LIST_FIRST(&(cpr)->pr_children) \ > + : (cpr) \ > + : ((descend) = LIST_NEXT(cpr, pr_sibling) != NULL) \ > + ? LIST_NEXT(cpr, pr_sibling) \ > + : cpr->pr_parent) != (ppr);) > + > /* > * Attributes of the physical system, and the root of the jail tree. > */ Hi Jamie, After this commit running cd /usr/tests/lib/libc/sys && kyua test cpuset_test renders the entire system unusable: all exec calls afterwards seem to fail. In Jenkins it's triggering a kernel panic: https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17630/consoleFull Reverting this commit fixes the issue. Thanks, Alex From owner-dev-commits-src-all@freebsd.org Tue Feb 23 13:20: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 79F52543B35; Tue, 23 Feb 2021 13:20: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 4DlKRF30VCz3F1f; Tue, 23 Feb 2021 13:20: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 556DB19D44; Tue, 23 Feb 2021 13:20: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 11NDK93k068041; Tue, 23 Feb 2021 13:20:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NDK9ft068038; Tue, 23 Feb 2021 13:20:09 GMT (envelope-from git) Date: Tue, 23 Feb 2021 13:20:09 GMT Message-Id: <202102231320.11NDK9ft068038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chris Rees Subject: git: d27999e51396 - main - Create dhclient pid directory if it doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: crees X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d27999e51396b301d83bb7d6cdd51f6d6f4fff2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 13:20:09 -0000 The branch main has been updated by crees (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d27999e51396b301d83bb7d6cdd51f6d6f4fff2d commit d27999e51396b301d83bb7d6cdd51f6d6f4fff2d Author: Chris Rees AuthorDate: 2021-02-21 18:56:56 +0000 Commit: Chris Rees CommitDate: 2021-02-23 13:19:44 +0000 Create dhclient pid directory if it doesn't exist - Upgrading from older FreeBSD versions can result in errors - /var/run can be a tmpfs, and this should be handled correctly Approved by: markj Differential Revision: https://reviews.freebsd.org/D28843 MFC after: 2 weeks --- libexec/rc/rc.d/dhclient | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rc/rc.d/dhclient b/libexec/rc/rc.d/dhclient index 520a0850ccbc..765e38266408 100755 --- a/libexec/rc/rc.d/dhclient +++ b/libexec/rc/rc.d/dhclient @@ -49,6 +49,11 @@ dhclient_prestart() rc_flags="${rc_flags} -b" fi + + # /var/run/dhclient is not guaranteed to exist, + # e.g. if /var/run is a tmpfs + install -d -o root -g wheel -m 755 ${pidfile%/*} + rc_flags="${rc_flags} ${ifn}" } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 13:55: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 78C6F544B07; Tue, 23 Feb 2021 13:55: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 4DlLCX2dynz3HCk; Tue, 23 Feb 2021 13:55: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 4D7CD1A439; Tue, 23 Feb 2021 13:55: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 11NDt4mK017702; Tue, 23 Feb 2021 13:55:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NDt4aR017701; Tue, 23 Feb 2021 13:55:04 GMT (envelope-from git) Date: Tue, 23 Feb 2021 13:55:04 GMT Message-Id: <202102231355.11NDt4aR017701@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: 711ed156b945 - main - bridge: Support STP on VLAN devices 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: 711ed156b94562c3dcb2ee9c1b3f240f960a75d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 13:55:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=711ed156b94562c3dcb2ee9c1b3f240f960a75d2 commit 711ed156b94562c3dcb2ee9c1b3f240f960a75d2 Author: Kristof Provost AuthorDate: 2021-02-20 09:11:30 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 12:54:06 +0000 bridge: Support STP on VLAN devices VLAN devices have type IFT_L2VLAN, so the STP code mistakenly believed they couldn't be used for STP. That's not the case, so add the ITF_L2VLAN to the check. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28857 --- sys/net/bridgestp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index a8bb51c11f51..c36dc61d1397 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -2232,6 +2232,7 @@ bstp_enable(struct bstp_port *bp) switch (ifp->if_type) { case IFT_ETHER: /* These can do spanning tree. */ + case IFT_L2VLAN: break; default: /* Nothing else can. */ From owner-dev-commits-src-all@freebsd.org Tue Feb 23 13:55: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 8E8205440A1; Tue, 23 Feb 2021 13:55: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 4DlLCY3cg9z3HBC; Tue, 23 Feb 2021 13:55: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 6EE701A43A; Tue, 23 Feb 2021 13:55: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 11NDt5AI017720; Tue, 23 Feb 2021 13:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NDt5sE017719; Tue, 23 Feb 2021 13:55:05 GMT (envelope-from git) Date: Tue, 23 Feb 2021 13:55:05 GMT Message-Id: <202102231355.11NDt5sE017719@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: 89fa9c34d76b - main - bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic 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: 89fa9c34d76bbf85cd7cda60c1868f5e3dba4ec7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 13:55:05 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=89fa9c34d76bbf85cd7cda60c1868f5e3dba4ec7 commit 89fa9c34d76bbf85cd7cda60c1868f5e3dba4ec7 Author: Kristof Provost AuthorDate: 2021-02-21 20:18:46 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 12:54:07 +0000 bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28858 --- sys/net/bridgestp.c | 9 +++++++++ sys/net/if_bridge.c | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index c36dc61d1397..82524440c241 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -154,6 +154,8 @@ static void bstp_reinit(struct bstp_state *); static void bstp_transmit(struct bstp_state *bs, struct bstp_port *bp) { + NET_EPOCH_ASSERT(); + if (bs->bs_running == 0) return; @@ -346,6 +348,7 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp, struct ether_header *eh; BSTP_LOCK_ASSERT(bs); + NET_EPOCH_ASSERT(); ifp = bp->bp_ifp; @@ -923,6 +926,8 @@ bstp_update_state(struct bstp_state *bs, struct bstp_port *bp) static void bstp_update_roles(struct bstp_state *bs, struct bstp_port *bp) { + NET_EPOCH_ASSERT(); + switch (bp->bp_role) { case BSTP_ROLE_DISABLED: /* Clear any flags if set */ @@ -1862,6 +1867,7 @@ bstp_disable_port(struct bstp_state *bs, struct bstp_port *bp) static void bstp_tick(void *arg) { + struct epoch_tracker et; struct bstp_state *bs = arg; struct bstp_port *bp; @@ -1870,6 +1876,7 @@ bstp_tick(void *arg) if (bs->bs_running == 0) return; + NET_EPOCH_ENTER(et); CURVNET_SET(bs->bs_vnet); /* poll link events on interfaces that do not support linkstate */ @@ -1908,6 +1915,7 @@ bstp_tick(void *arg) } CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); callout_reset(&bs->bs_bstpcallout, hz, bstp_tick, bs); } @@ -2229,6 +2237,7 @@ bstp_enable(struct bstp_port *bp) struct ifnet *ifp = bp->bp_ifp; KASSERT(bp->bp_active == 0, ("already a bstp member")); + NET_EPOCH_ASSERT(); /* Because bstp_update_roles() causes traffic. */ switch (ifp->if_type) { case IFT_ETHER: /* These can do spanning tree. */ diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 7c4e48ff04c6..3dba672aa0fe 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1326,6 +1326,7 @@ bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg) static int bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) { + struct epoch_tracker et; struct ifbreq *req = arg; struct bridge_iflist *bif; struct bstp_port *bp; @@ -1340,11 +1341,15 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) /* SPAN is readonly */ return (EINVAL); + NET_EPOCH_ENTER(et); + if (req->ifbr_ifsflags & IFBIF_STP) { if ((bif->bif_flags & IFBIF_STP) == 0) { error = bstp_enable(&bif->bif_stp); - if (error) + if (error) { + NET_EPOCH_EXIT(et); return (error); + } } } else { if ((bif->bif_flags & IFBIF_STP) != 0) @@ -1360,6 +1365,8 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) /* Save the bits relating to the bridge */ bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK; + NET_EPOCH_EXIT(et); + return (0); } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 13:55: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 885CB544AB8; Tue, 23 Feb 2021 13:55: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 4DlLCc0DhCz3HCt; Tue, 23 Feb 2021 13:55: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 C00791A15F; Tue, 23 Feb 2021 13:55: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 11NDt7sc017765; Tue, 23 Feb 2021 13:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NDt7RP017764; Tue, 23 Feb 2021 13:55:07 GMT (envelope-from git) Date: Tue, 23 Feb 2021 13:55:07 GMT Message-Id: <202102231355.11NDt7RP017764@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: c139b3c19b52 - main - arp/nd: Cope with late calls to iflladdr_event 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: c139b3c19b52abe3b5ba23a8175e58e70c7a528d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 13:55:09 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c139b3c19b52abe3b5ba23a8175e58e70c7a528d commit c139b3c19b52abe3b5ba23a8175e58e70c7a528d Author: Kristof Provost AuthorDate: 2021-02-22 07:19:43 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 12:54:07 +0000 arp/nd: Cope with late calls to iflladdr_event When tearing down vnet jails we can move an if_bridge out (as part of the normal vnet_if_return()). This can, when it's clearing out its list of member interfaces, change its link layer address. That sends an iflladdr_event, but at that point we've already freed the AF_INET/AF_INET6 if_afdata pointers. In other words: when the iflladdr_event callbacks fire we can't assume that ifp->if_afdata[AF_INET] will be set. Reviewed by: donner@, melifaro@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28860 --- sys/netinet/if_ether.c | 4 ++++ sys/netinet6/nd6.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index e09ad3d47382..ef50ec9ca964 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1479,6 +1479,10 @@ arp_handle_ifllchange(struct ifnet *ifp) static void arp_iflladdr(void *arg __unused, struct ifnet *ifp) { + /* if_bridge can update its lladdr during if_vmove(), after we've done + * if_detach_internal()/dom_ifdetach(). */ + if (ifp->if_afdata[AF_INET] == NULL) + return; lltable_update_ifaddr(LLTABLE(ifp)); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 497c0bfc10e8..62f0ac733a23 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -208,6 +208,8 @@ nd6_lle_event(void *arg __unused, struct llentry *lle, int evt) static void nd6_iflladdr(void *arg __unused, struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return; lltable_update_ifaddr(LLTABLE6(ifp)); } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 13:55: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 A6A79544B32; Tue, 23 Feb 2021 13:55: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 4DlLCd75H4z3HD3; Tue, 23 Feb 2021 13:55: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 DE8E41A3B3; Tue, 23 Feb 2021 13:55: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 11NDt8hT017783; Tue, 23 Feb 2021 13:55:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NDt8cq017782; Tue, 23 Feb 2021 13:55:08 GMT (envelope-from git) Date: Tue, 23 Feb 2021 13:55:08 GMT Message-Id: <202102231355.11NDt8cq017782@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: 26492ba2716f - main - bridge tests: Test STP on top of VLAN devices 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: 26492ba2716f8b839f743bb663ce47405990fdf0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 13:55:13 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=26492ba2716f8b839f743bb663ce47405990fdf0 commit 26492ba2716f8b839f743bb663ce47405990fdf0 Author: Kristof Provost AuthorDate: 2021-02-20 09:13:33 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 12:54:07 +0000 bridge tests: Test STP on top of VLAN devices This is basically the same test as the existing STP test, but now on top of VLAN interfaces instead of directly using the epair devices. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28861 --- tests/sys/net/if_bridge_test.sh | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index b848a03b273d..bc9add68ce25 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -124,6 +124,71 @@ stp_cleanup() vnet_cleanup } +atf_test_case "stp_vlan" "cleanup" +stp_vlan_head() +{ + atf_set descr 'Spanning tree on VLAN test' + atf_set require.user root +} + +stp_vlan_body() +{ + vnet_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + bridge_a=$(vnet_mkbridge) + bridge_b=$(vnet_mkbridge) + + vnet_mkjail a ${bridge_a} ${epair_one}a ${epair_two}a + vnet_mkjail b ${bridge_b} ${epair_one}b ${epair_two}b + + jexec a ifconfig ${epair_one}a up + jexec a ifconfig ${epair_two}a up + vlan_a_one=$(jexec a ifconfig vlan create vlandev ${epair_one}a vlan 42) + vlan_a_two=$(jexec a ifconfig vlan create vlandev ${epair_two}a vlan 42) + jexec a ifconfig ${vlan_a_one} up + jexec a ifconfig ${vlan_a_two} up + jexec a ifconfig ${bridge_a} addm ${vlan_a_one} + jexec a ifconfig ${bridge_a} addm ${vlan_a_two} + + jexec b ifconfig ${epair_one}b up + jexec b ifconfig ${epair_two}b up + vlan_b_one=$(jexec b ifconfig vlan create vlandev ${epair_one}b vlan 42) + vlan_b_two=$(jexec b ifconfig vlan create vlandev ${epair_two}b vlan 42) + jexec b ifconfig ${vlan_b_one} up + jexec b ifconfig ${vlan_b_two} up + jexec b ifconfig ${bridge_b} addm ${vlan_b_one} + jexec b ifconfig ${bridge_b} addm ${vlan_b_two} + + jexec a ifconfig ${bridge_a} 192.0.2.1/24 + + # Enable spanning tree + jexec a ifconfig ${bridge_a} stp ${vlan_a_one} + jexec a ifconfig ${bridge_a} stp ${vlan_a_two} + jexec b ifconfig ${bridge_b} stp ${vlan_b_one} + jexec b ifconfig ${bridge_b} stp ${vlan_b_two} + + jexec b ifconfig ${bridge_b} up + jexec a ifconfig ${bridge_a} up + + # Give STP time to do its thing + sleep 5 + + a_discard=$(jexec a ifconfig ${bridge_a} | grep discarding) + b_discard=$(jexec b ifconfig ${bridge_b} | grep discarding) + + if [ -z "${a_discard}" ] && [ -z "${b_discard}" ] + then + atf_fail "STP failed to detect bridging loop" + fi +} + +stp_vlan_cleanup() +{ + vnet_cleanup +} + atf_test_case "static" "cleanup" static_head() { @@ -329,6 +394,7 @@ atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" + atf_add_test_case "stp_vlan" atf_add_test_case "static" atf_add_test_case "span" atf_add_test_case "inherit_mac" From owner-dev-commits-src-all@freebsd.org Tue Feb 23 13:55: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 E985B544836; Tue, 23 Feb 2021 13:55: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 4DlLCZ4rl5z3HP5; Tue, 23 Feb 2021 13:55: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 968B81A15E; Tue, 23 Feb 2021 13:55: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 11NDt6CB017743; Tue, 23 Feb 2021 13:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NDt6m7017742; Tue, 23 Feb 2021 13:55:06 GMT (envelope-from git) Date: Tue, 23 Feb 2021 13:55:06 GMT Message-Id: <202102231355.11NDt6m7017742@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: 38c0951386d8 - main - bridge: Remove members when assigned to a new vnet 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: 38c0951386d82f4c51cf4e245253cdef18d2254a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 13:55:07 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=38c0951386d82f4c51cf4e245253cdef18d2254a commit 38c0951386d82f4c51cf4e245253cdef18d2254a Author: Kristof Provost AuthorDate: 2021-02-21 20:20:32 +0000 Commit: Kristof Provost CommitDate: 2021-02-23 12:54:07 +0000 bridge: Remove members when assigned to a new vnet When the bridge is moved to a different vnet we must remove all of its member interfaces (and span interfaces), because we don't know if those will be moved along with it. We don't want to hold references to interfaces not in our vnet. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28859 --- sys/net/ethernet.h | 4 ++++ sys/net/if_bridge.c | 25 +++++++++++++++++++++++++ sys/net/if_ethersubr.c | 3 --- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index 38c0aa249272..f174ca9eb143 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -437,6 +437,10 @@ extern uint32_t ether_crc32_be(const uint8_t *, size_t); extern void ether_demux(struct ifnet *, struct mbuf *); extern void ether_ifattach(struct ifnet *, const u_int8_t *); extern void ether_ifdetach(struct ifnet *); +#ifdef VIMAGE +struct vnet; +extern void ether_reassign(struct ifnet *, struct vnet *, char *); +#endif extern int ether_ioctl(struct ifnet *, u_long, caddr_t); extern int ether_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 3dba672aa0fe..3e6b5ba8e0c2 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -670,6 +670,28 @@ SYSCTL_PROC(_net_link_bridge, OID_AUTO, ipfw, &VNET_NAME(pfil_ipfw), 0, &sysctl_pfil_ipfw, "I", "Layer2 filter with IPFW"); +#ifdef VIMAGE +static void +bridge_reassign(struct ifnet *ifp, struct vnet *newvnet, char *arg) +{ + struct bridge_softc *sc = ifp->if_softc; + struct bridge_iflist *bif; + + BRIDGE_LOCK(sc); + + while ((bif = CK_LIST_FIRST(&sc->sc_iflist)) != NULL) + bridge_delete_member(sc, bif, 0); + + while ((bif = CK_LIST_FIRST(&sc->sc_spanlist)) != NULL) { + bridge_delete_span(sc, bif); + } + + BRIDGE_UNLOCK(sc); + + ether_reassign(ifp, newvnet, arg); +} +#endif + /* * bridge_clone_create: * @@ -716,6 +738,9 @@ bridge_clone_create(struct if_clone *ifc, int unit, caddr_t params) /* Now undo some of the damage... */ ifp->if_baudrate = 0; ifp->if_type = IFT_BRIDGE; +#ifdef VIMAGE + ifp->if_reassign = bridge_reassign; +#endif BRIDGE_LIST_LOCK(); LIST_INSERT_HEAD(&V_bridge_list, sc, sc_list); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 77c138d7a092..01c2d2f7b3e8 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -117,9 +117,6 @@ static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = static int ether_resolvemulti(struct ifnet *, struct sockaddr **, struct sockaddr *); -#ifdef VIMAGE -static void ether_reassign(struct ifnet *, struct vnet *, char *); -#endif static int ether_requestencap(struct ifnet *, struct if_encap_req *); #define senderr(e) do { error = (e); goto bad;} while (0) From owner-dev-commits-src-all@freebsd.org Tue Feb 23 14:35: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 2E575545EA9; Tue, 23 Feb 2021 14:35: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 4DlM6C0jd1z3LT6; Tue, 23 Feb 2021 14:35: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 0B5D01AFAF; Tue, 23 Feb 2021 14:35: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 11NEZUjq070698; Tue, 23 Feb 2021 14:35:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NEZUk2070697; Tue, 23 Feb 2021 14:35:30 GMT (envelope-from git) Date: Tue, 23 Feb 2021 14:35:30 GMT Message-Id: <202102231435.11NEZUk2070697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 0a223cf980b5 - stable/13 - ddb: fix show devmap output on 32-bit arm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0a223cf980b5ef8bea726a843fe5a7faf2278330 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 14:35:31 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=0a223cf980b5ef8bea726a843fe5a7faf2278330 commit 0a223cf980b5ef8bea726a843fe5a7faf2278330 Author: Thomas Skibo AuthorDate: 2021-01-11 20:58:12 +0000 Commit: Mitchell Horne CommitDate: 2021-02-23 14:30:14 +0000 ddb: fix show devmap output on 32-bit arm The output has been broken since 1b6dd6d772ca. Casting to uintmax_t before the call to printf is necessary to ensure that 32-bit addresses are interpreted correctly. PR: 243236 (cherry picked from commit 9976b42b697ce203b1d257b2a6fe64c8a2961645) --- sys/kern/subr_devmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_devmap.c b/sys/kern/subr_devmap.c index 8e07199b7f73..23baceb05129 100644 --- a/sys/kern/subr_devmap.c +++ b/sys/kern/subr_devmap.c @@ -74,7 +74,9 @@ devmap_dump_table(int (*prfunc)(const char *, ...)) prfunc("Static device mappings:\n"); for (pd = devmap_table; pd->pd_size != 0; ++pd) { prfunc(" 0x%08jx - 0x%08jx mapped at VA 0x%08jx\n", - pd->pd_pa, pd->pd_pa + pd->pd_size - 1, pd->pd_va); + (uintmax_t)pd->pd_pa, + (uintmax_t)(pd->pd_pa + pd->pd_size - 1), + (uintmax_t)pd->pd_va); } } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 14:35: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 49EAC545EAA; Tue, 23 Feb 2021 14:35: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 4DlM6D1QhPz3LWp; Tue, 23 Feb 2021 14:35: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 1D5A81AFB0; Tue, 23 Feb 2021 14:35: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 11NEZWdT070719; Tue, 23 Feb 2021 14:35:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NEZWkL070718; Tue, 23 Feb 2021 14:35:32 GMT (envelope-from git) Date: Tue, 23 Feb 2021 14:35:32 GMT Message-Id: <202102231435.11NEZWkL070718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 007101f87ddf - stable/13 - cgem: improve usage of busdma(9) KPI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 007101f87ddf679cbcdbff40882a89dbba0e0cf3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 14:35:32 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=007101f87ddf679cbcdbff40882a89dbba0e0cf3 commit 007101f87ddf679cbcdbff40882a89dbba0e0cf3 Author: Mitchell Horne AuthorDate: 2021-01-20 15:07:53 +0000 Commit: Mitchell Horne CommitDate: 2021-02-23 14:31:43 +0000 cgem: improve usage of busdma(9) KPI BUS_DMA_NOCACHE should only be used when one needs to guarantee the created mapping has uncached memory attributes, usually as a result of buggy hardware. Normal use cases should pass BUS_DMA_COHERENT, to create an appropriate mapping based on the flags passed to bus_dma_tag_create(). This should have no functional change, since the DMA tags in this driver are created without the BUS_DMA_COHERENT flag. Reported by: mmel Reviewed by: mmel, Thomas Skibo (cherry picked from commit 04d2d2d7fd22bba638ccb5a0b2e0805087a70cd3) --- sys/dev/cadence/if_cgem.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/dev/cadence/if_cgem.c b/sys/dev/cadence/if_cgem.c index 81fc39b831af..0583e846458a 100644 --- a/sys/dev/cadence/if_cgem.c +++ b/sys/dev/cadence/if_cgem.c @@ -443,17 +443,13 @@ cgem_setup_descs(struct cgem_softc *sc) return (err); /* - * Allocate DMA memory in non-cacheable space. We allocate transmit, - * receive and null descriptor queues all at once because the - * hardware only provides one register for the upper 32 bits of - * rx and tx descriptor queues hardware addresses. + * Allocate DMA memory. We allocate transmit, receive and null + * descriptor queues all at once because the hardware only provides + * one register for the upper 32 bits of rx and tx descriptor queues + * hardware addresses. */ err = bus_dmamem_alloc(sc->desc_dma_tag, (void **)&sc->rxring, -#ifdef __arm__ BUS_DMA_NOWAIT | BUS_DMA_COHERENT | BUS_DMA_ZERO, -#else - BUS_DMA_NOWAIT | BUS_DMA_NOCACHE | BUS_DMA_ZERO, -#endif &sc->rxring_dma_map); if (err) return (err); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 15:08: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 6B702546FB1; Tue, 23 Feb 2021 15:08: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 4DlMqg6HkJz3NVC; Tue, 23 Feb 2021 15:07: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 8966B1B561; Tue, 23 Feb 2021 15:07: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 11NF7xbV011355; Tue, 23 Feb 2021 15:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NF7x7a011354; Tue, 23 Feb 2021 15:07:59 GMT (envelope-from git) Date: Tue, 23 Feb 2021 15:07:59 GMT Message-Id: <202102231507.11NF7x7a011354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: ab379c15af6f - main - stand/multiboot2: fix error message format MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab379c15af6fd7c2b94f0e91769fe7e1a4102e25 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 15:08:00 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=ab379c15af6fd7c2b94f0e91769fe7e1a4102e25 commit ab379c15af6fd7c2b94f0e91769fe7e1a4102e25 Author: Roger Pau Monné AuthorDate: 2021-02-23 14:51:58 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-23 15:04:58 +0000 stand/multiboot2: fix error message format Add a missing space in one error message. Sponsored by: Citrix Systems R&D MFC after: 3 days Fixes: adda2797eb2a ('stand/multiboot2: add support for booting a Xen dom0 in UEFI mode') --- stand/efi/loader/arch/amd64/multiboot2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/efi/loader/arch/amd64/multiboot2.c b/stand/efi/loader/arch/amd64/multiboot2.c index e4589bc8b0bb..6ee36afcb881 100644 --- a/stand/efi/loader/arch/amd64/multiboot2.c +++ b/stand/efi/loader/arch/amd64/multiboot2.c @@ -115,8 +115,8 @@ loadfile(char *filename, uint64_t dest, struct preloaded_file **result) /* Valid multiboot header has been found, validate checksum */ if (header->magic + header->architecture + header->header_length + header->checksum != 0) { - printf("Multiboot checksum failed, magic: %#x architecture: %#x" - "header_length %#x checksum: %#x\n", + printf("Multiboot checksum failed, magic: %#x " + "architecture: %#x header_length %#x checksum: %#x\n", header->magic, header->architecture, header->header_length, header->checksum); error = EFTYPE; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 15:08: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 AD17F547221; Tue, 23 Feb 2021 15:08: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 4DlMqh4YWBz3NvF; Tue, 23 Feb 2021 15:08: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 8F9001B794; Tue, 23 Feb 2021 15:08: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 11NF80qk011378; Tue, 23 Feb 2021 15:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NF80BZ011377; Tue, 23 Feb 2021 15:08:00 GMT (envelope-from git) Date: Tue, 23 Feb 2021 15:08:00 GMT Message-Id: <202102231508.11NF80BZ011377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau Monné Subject: git: 0eaa97f0e862 - main - stand/multiboot2: fix header length check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0eaa97f0e8629bcf678ff4de2678e4cba00f1c91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 15:08:00 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=0eaa97f0e8629bcf678ff4de2678e4cba00f1c91 commit 0eaa97f0e8629bcf678ff4de2678e4cba00f1c91 Author: Roger Pau Monné AuthorDate: 2021-02-23 14:56:27 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-23 15:05:03 +0000 stand/multiboot2: fix header length check Check whether we have reached the end of the buffer using search_size instead of MULTIBOOT_SEARCH, which is the maximum defined by the specification, but the file can be shorter than that. This prevents printing a harmless error message when loading a file that is smaller than MULTIBOOT_SEARCH. Sponsored by: Citrix Systems R&D MFC after: 3 days Fixes: adda2797eb2a ('stand/multiboot2: add support for booting a Xen dom0 in UEFI mode') --- stand/efi/loader/arch/amd64/multiboot2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/efi/loader/arch/amd64/multiboot2.c b/stand/efi/loader/arch/amd64/multiboot2.c index 6ee36afcb881..4d7b2713685d 100644 --- a/stand/efi/loader/arch/amd64/multiboot2.c +++ b/stand/efi/loader/arch/amd64/multiboot2.c @@ -107,7 +107,7 @@ loadfile(char *filename, uint64_t dest, struct preloaded_file **result) break; } - if (i >= MULTIBOOT_SEARCH) { + if (i >= search_size) { error = EFTYPE; goto out; } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 16:03:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0892F548E05; Tue, 23 Feb 2021 16:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlP3r6sKWz3kmn; Tue, 23 Feb 2021 16: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 DE45A1C399; Tue, 23 Feb 2021 16:03: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 11NG3aeg089039; Tue, 23 Feb 2021 16:03:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NG3auF089038; Tue, 23 Feb 2021 16:03:36 GMT (envelope-from git) Date: Tue, 23 Feb 2021 16:03:36 GMT Message-Id: <202102231603.11NG3auF089038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 7d4c444374d5 - main - Bump CTL block backend threads from 14 to 32 per LUN. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d4c444374d53e54ce197138df64bf40c1fb05a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 16:03:37 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7d4c444374d53e54ce197138df64bf40c1fb05a3 commit 7d4c444374d53e54ce197138df64bf40c1fb05a3 Author: Alexander Motin AuthorDate: 2021-02-23 15:58:56 +0000 Commit: Alexander Motin CommitDate: 2021-02-23 16:03:32 +0000 Bump CTL block backend threads from 14 to 32 per LUN. This makes random read benchmarks look better on a wide ZFS pools. I am not sure where the original value goes from, but it is there for too long now. MFC after: 1 week --- sys/cam/ctl/ctl_backend_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 7ec8e32f7338..f50e47a2a6c1 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -226,7 +226,7 @@ struct ctl_be_block_io { extern struct ctl_softc *control_softc; -static int cbb_num_threads = 14; +static int cbb_num_threads = 32; SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CAM Target Layer Block Backend"); SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN, From owner-dev-commits-src-all@freebsd.org Tue Feb 23 16:16: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 49172549535; Tue, 23 Feb 2021 16:16: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 4DlPLt0SL9z3lj8; Tue, 23 Feb 2021 16:16: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 EC4FF1C373; Tue, 23 Feb 2021 16:16: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 11NGGb5j003307; Tue, 23 Feb 2021 16:16:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NGGb1E003306; Tue, 23 Feb 2021 16:16:37 GMT (envelope-from git) Date: Tue, 23 Feb 2021 16:16:37 GMT Message-Id: <202102231616.11NGGb1E003306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: 75e6f664c469 - main - find(1): Mark -not as an extensions to POSIX MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75e6f664c469927ca73ecd7b16a8058bc292a451 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 16:16:38 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=75e6f664c469927ca73ecd7b16a8058bc292a451 commit 75e6f664c469927ca73ecd7b16a8058bc292a451 Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-23 15:23:09 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-23 16:15:35 +0000 find(1): Mark -not as an extensions to POSIX While here, change mdoc macro from Ic to Fl. PR: 253499 Reported by: Michael Siegel --- usr.bin/find/find.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index ce7a231c3c7d..43b1262352a6 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 18, 2020 +.Dd February 23, 2021 .Dt FIND 1 .Os .Sh NAME @@ -1016,9 +1016,9 @@ and as well as .Ic -amin , -anewer , -cmin , -cnewer , -delete , -empty , -fstype , .Ic -iname , -inum , -iregex , -ls , -maxdepth , -mindepth , -mmin , -.Ic -path , -print0 , -regex , -sparse +.Ic -not , -path , -print0 , -regex , -sparse and all of the -.Ic -B* +.Fl B* birthtime related primaries are extensions to .St -p1003.1-2001 . .Pp From owner-dev-commits-src-all@freebsd.org Tue Feb 23 16:40: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 46F76549BFE; Tue, 23 Feb 2021 16:40:31 +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 4DlPtR01PDz3nBf; Tue, 23 Feb 2021 16:40:30 +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 11NGeMsV017774; Tue, 23 Feb 2021 08:40:22 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 11NGeMsl017773; Tue, 23 Feb 2021 08:40:22 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202102231640.11NGeMsl017773@gndrsh.dnsmgr.net> Subject: Re: git: 7d4c444374d5 - main - Bump CTL block backend threads from 14 to 32 per LUN. In-Reply-To: <202102231603.11NG3auF089038@gitrepo.freebsd.org> To: Alexander Motin Date: Tue, 23 Feb 2021 08:40:22 -0800 (PST) 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: 4DlPtR01PDz3nBf 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, 23 Feb 2021 16:40:31 -0000 > The branch main has been updated by mav: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7d4c444374d53e54ce197138df64bf40c1fb05a3 > > commit 7d4c444374d53e54ce197138df64bf40c1fb05a3 > Author: Alexander Motin > AuthorDate: 2021-02-23 15:58:56 +0000 > Commit: Alexander Motin > CommitDate: 2021-02-23 16:03:32 +0000 > > Bump CTL block backend threads from 14 to 32 per LUN. > > This makes random read benchmarks look better on a wide ZFS pools. > I am not sure where the original value goes from, but it is there > for too long now. I would think this should be bounded by the number of cores/threads in the system. What happens on a 4 thread system with this value? > > MFC after: 1 week > --- > sys/cam/ctl/ctl_backend_block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c > index 7ec8e32f7338..f50e47a2a6c1 100644 > --- a/sys/cam/ctl/ctl_backend_block.c > +++ b/sys/cam/ctl/ctl_backend_block.c > @@ -226,7 +226,7 @@ struct ctl_be_block_io { > > extern struct ctl_softc *control_softc; > > -static int cbb_num_threads = 14; > +static int cbb_num_threads = 32; > SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, > "CAM Target Layer Block Backend"); > SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN, > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Feb 23 17: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 E391E54A3CE; Tue, 23 Feb 2021 17:01:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) 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 4DlQL85V20z3pGQ; Tue, 23 Feb 2021 17:01:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qt1-x82b.google.com with SMTP id c1so12390966qtc.1; Tue, 23 Feb 2021 09:01:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/yBvXi/5pEfzGf02BPka5E3vydo5poXt8IV1c5q5u4Q=; b=rh+ffamo/zN8jJ+n5JoZ0dxHaCRt9YHNhzaLpUTGomngwq6JOLGaac4UzjFARk4nEn O9G9QVVV/zTM3bqw5k0TOVbYvUk+PYwnsWBQW4QaQtsak6ea/XI7UNaH9ZhxroY10PsY 4403FrMR+6l7SbOsS1brWDnsc/cX7pN9Tq97t18cQZLvzeqFWmxttuMXkrZJCn7cBNei LWQ7dRB0V9JrKZjZrluo8evmgK5evWNmZaVhua75IUS460Uc9n1nqKNbArIdg4YG+xdk m2dAehtlMp8Y1ITSgV8OPkVYOMWeirp56XIT/iZ44jRmvRiZBihiH3yUdAx4+XdyHEIy 6dFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/yBvXi/5pEfzGf02BPka5E3vydo5poXt8IV1c5q5u4Q=; b=DaedA2yLRlZ7cl9mRUZb1GckkhYIdpucldUq9ibu+IgAf7Z1H91dMA9fGopRzmoZYU 90vLweqec6FQK1WjRD9W5T7lIaa/jOpn1AcPEewC8SVTz4Y6C6fd8Zg0+zNnskiB/lmA eV49HwlJ3v8OG2tTMFEXcusMBnZkzw1FGStypI9UgyFEhMVqUpTgHkJFTocnDvAbAMAX XDYjFKOiv2HK7u+3seCPW3WwQhgSz68mRUfNrHbdB5PaQro4aaK3ocTK0eTwiM3E3kF3 wKrC46N3CrzogE3uUmcZCLehpEP7kVSguuXIRLvEVkfufz9+NRKD/Z6Be4SYv5roue2/ b9JA== X-Gm-Message-State: AOAM532r9Ou7Tjx7XulquYpuZTVvJMthvo8cmBS7Oil4c3N4b5wHDdnh caMhBvCfQ4d1WViKiRguCEeC8XMMAjid8w== X-Google-Smtp-Source: ABdhPJymYYfgeL5OzVTEF4v7w6I4usMwLOK+5+J0UjQkEAd2KboLAiUMr7z2n9+of+KFBnvl5AdWuA== X-Received: by 2002:ac8:5d45:: with SMTP id g5mr25467553qtx.247.1614099662978; Tue, 23 Feb 2021 09:01:02 -0800 (PST) Received: from mavoffice.ixsystems.com ([38.32.73.2]) by smtp.gmail.com with ESMTPSA id p6sm15015947qkg.36.2021.02.23.09.01.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Feb 2021 09:01:01 -0800 (PST) Sender: Alexander Motin Subject: Re: git: 7d4c444374d5 - main - Bump CTL block backend threads from 14 to 32 per LUN. To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102231640.11NGeMsl017773@gndrsh.dnsmgr.net> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <9a722455-7bc0-c10c-9a42-1650952475eb@FreeBSD.org> Date: Tue, 23 Feb 2021 12:01:00 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <202102231640.11NGeMsl017773@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DlQL85V20z3pGQ 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, 23 Feb 2021 17:01:05 -0000 On 23.02.2021 11:40, Rodney W. Grimes wrote: >> The branch main has been updated by mav: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=7d4c444374d53e54ce197138df64bf40c1fb05a3 >> >> commit 7d4c444374d53e54ce197138df64bf40c1fb05a3 >> Author: Alexander Motin >> AuthorDate: 2021-02-23 15:58:56 +0000 >> Commit: Alexander Motin >> CommitDate: 2021-02-23 16:03:32 +0000 >> >> Bump CTL block backend threads from 14 to 32 per LUN. >> >> This makes random read benchmarks look better on a wide ZFS pools. >> I am not sure where the original value goes from, but it is there >> for too long now. > > I would think this should be bounded by the number of cores/threads > in the system. What happens on a 4 thread system with this value? Since our VFS layer is still synchronous, the primary goal of these threads is to wait for disk I/O. And 4 thread system with HDDs should still benefit from higher value. For SSD system CPUs may become a bottleneck, but it would just speak about under-powered system. My biggest worry is a random locks contention from double number of threads. Not many algorithms scale to 32 threads on small I/Os and very high IOP. But that is theoretical, while on wide pool of slower HDDs I do see double performance from this right now. -- Alexander Motin From owner-dev-commits-src-all@freebsd.org Tue Feb 23 17:44: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 2D71754BD1B; Tue, 23 Feb 2021 17:44: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 4DlRHj0mH1z3sQ7; Tue, 23 Feb 2021 17:44: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 0CDF11D4E0; Tue, 23 Feb 2021 17:44: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 11NHi0ec021199; Tue, 23 Feb 2021 17:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NHi08p021198; Tue, 23 Feb 2021 17:44:00 GMT (envelope-from git) Date: Tue, 23 Feb 2021 17:44:00 GMT Message-Id: <202102231744.11NHi08p021198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 3775ddcf5a12 - main - tests/sys/netgraph: Tell kyua that perl is required MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3775ddcf5a12c8e23970e94b7b165bf23c92aeba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 17:44:01 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=3775ddcf5a12c8e23970e94b7b165bf23c92aeba commit 3775ddcf5a12c8e23970e94b7b165bf23c92aeba Author: Alex Richardson AuthorDate: 2021-02-23 17:02:31 +0000 Commit: Alex Richardson CommitDate: 2021-02-23 17:43:31 +0000 tests/sys/netgraph: Tell kyua that perl is required Otherwise these tests fail with incomprehensible error messages. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28894 --- tests/sys/netgraph/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile index e370fad97df4..aef190bbe178 100644 --- a/tests/sys/netgraph/Makefile +++ b/tests/sys/netgraph/Makefile @@ -7,7 +7,8 @@ BINDIR= ${TESTSDIR} TAP_TESTS_SH+= ng_macfilter_test -TEST_METADATA.runtests+= required_user="root" +TEST_METADATA.ng_macfilter_test+= required_user="root" +TEST_METADATA.ng_macfilter_test+= required_programs="perl" MAN= From owner-dev-commits-src-all@freebsd.org Tue Feb 23 17:59: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 4D5CC54C3A6; Tue, 23 Feb 2021 17:59: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 4DlRdR1n68z3tK1; Tue, 23 Feb 2021 17:59: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 2FFBC1DC55; Tue, 23 Feb 2021 17:59: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 11NHxN77035549; Tue, 23 Feb 2021 17:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NHxN7b035548; Tue, 23 Feb 2021 17:59:23 GMT (envelope-from git) Date: Tue, 23 Feb 2021 17:59:23 GMT Message-Id: <202102231759.11NHxN7b035548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: fa32350347b4 - main - close_range: add audit support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa32350347b4e351a144b5423f0fb2ca9d67f4ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 17:59:23 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=fa32350347b4e351a144b5423f0fb2ca9d67f4ca commit fa32350347b4e351a144b5423f0fb2ca9d67f4ca Author: Alex Richardson AuthorDate: 2021-02-23 17:47:07 +0000 Commit: Alex Richardson CommitDate: 2021-02-23 17:47:07 +0000 close_range: add audit support This fixes the closefrom test in sys/audit. Includes cherry-picks of the following commits from openbsm: https://github.com/openbsm/openbsm/commit/4dfc628aafe589d68848f7033f3d3488c4d979e0 https://github.com/openbsm/openbsm/commit/99ff6fe32aebc5a4b8d40d60062b8574697df557 https://github.com/openbsm/openbsm/commit/da48a0399e95448693d3fa2be48454ca564c1be8 Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28388 --- contrib/openbsm/etc/audit_event | 2 ++ contrib/openbsm/sys/bsm/audit_kevents.h | 2 ++ sys/kern/kern_descrip.c | 4 ++++ sys/security/audit/audit_bsm.c | 15 +++++++++++++++ tests/sys/audit/file-close.c | 4 ++-- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/contrib/openbsm/etc/audit_event b/contrib/openbsm/etc/audit_event index b397674564c6..be3557597eee 100644 --- a/contrib/openbsm/etc/audit_event +++ b/contrib/openbsm/etc/audit_event @@ -614,6 +614,8 @@ 43261:AUE_LGETUUID:lgetuuid(2):ip 43262:AUE_EXECVEAT:execveat(2):pc,ex 43263:AUE_SHMRENAME:shm_rename(2):ip +43264:AUE_REALPATHAT:realpathat(2):fa +43265:AUE_CLOSERANGE:close_range(2):cl # # Solaris userspace events. # diff --git a/contrib/openbsm/sys/bsm/audit_kevents.h b/contrib/openbsm/sys/bsm/audit_kevents.h index afa8c0f37a31..ec51f501e3a7 100644 --- a/contrib/openbsm/sys/bsm/audit_kevents.h +++ b/contrib/openbsm/sys/bsm/audit_kevents.h @@ -653,6 +653,8 @@ #define AUE_LGETUUID 43261 /* CADETS. */ #define AUE_EXECVEAT 43262 /* FreeBSD/Linux. */ #define AUE_SHMRENAME 43263 /* FreeBSD-specific. */ +#define AUE_REALPATHAT 43264 /* FreeBSD-specific. */ +#define AUE_CLOSERANGE 43265 /* FreeBSD-specific. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 0813b6c8f3b8..67350f4ad71e 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1422,6 +1422,10 @@ int sys_close_range(struct thread *td, struct close_range_args *uap) { + AUDIT_ARG_FD(uap->lowfd); + AUDIT_ARG_CMD(uap->highfd); + AUDIT_ARG_FFLAGS(uap->flags); + /* No flags currently defined */ if (uap->flags != 0) return (EINVAL); diff --git a/sys/security/audit/audit_bsm.c b/sys/security/audit/audit_bsm.c index 6742470c9578..d350ef3cf3c2 100644 --- a/sys/security/audit/audit_bsm.c +++ b/sys/security/audit/audit_bsm.c @@ -941,6 +941,21 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_record **pau) } break; + case AUE_CLOSERANGE: + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "lowfd", ar->ar_arg_fd); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_CMD)) { + tok = au_to_arg32(2, "highfd", ar->ar_arg_cmd); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_FFLAGS)) { + tok = au_to_arg32(3, "flags", ar->ar_arg_fflags); + kau_write(rec, tok); + } + break; + case AUE_CORE: if (ARG_IS_VALID(kar, ARG_SIGNUM)) { tok = au_to_arg32(1, "signal", ar->ar_arg_signum); diff --git a/tests/sys/audit/file-close.c b/tests/sys/audit/file-close.c index 54d0e60977e3..f85a8e39b67d 100644 --- a/tests/sys/audit/file-close.c +++ b/tests/sys/audit/file-close.c @@ -154,10 +154,10 @@ ATF_TC_HEAD(closefrom_success, tc) ATF_TC_BODY(closefrom_success, tc) { - const char *regex = "closefrom.*return,success"; + const char *regex = "close_range\\(2\\),.*,0x7fffffff,lowfd,.*" + "0xffffffff,highfd,.*return,success"; FILE *pipefd = setup(fds, auclass); - atf_tc_expect_fail("closefrom was converted to close_range"); /* closefrom(2) returns 'void' */ closefrom(INT_MAX); check_audit(fds, regex, pipefd); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 18:07: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 DE81A54C4D8; Tue, 23 Feb 2021 18:07: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 4DlRpt5yYLz3tWF; Tue, 23 Feb 2021 18:07: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 BF34B1E08B; Tue, 23 Feb 2021 18:07: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 11NI7Yw5049071; Tue, 23 Feb 2021 18:07:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NI7YgM049070; Tue, 23 Feb 2021 18:07:34 GMT (envelope-from git) Date: Tue, 23 Feb 2021 18:07:34 GMT Message-Id: <202102231807.11NI7YgM049070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: f695e960672d - main - release(7): Remove stray references to DOC* variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f695e960672ddc45744aca085c1e22c80928f447 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 18:07:34 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f695e960672ddc45744aca085c1e22c80928f447 commit f695e960672ddc45744aca085c1e22c80928f447 Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-23 18:06:36 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-23 18:06:36 +0000 release(7): Remove stray references to DOC* variables We now live in the world of git, and release(7) should reflect that. As of the commit referenced below, release images also no longer include (stale) documentation, as the documentation has moved to AsciiDoctor. This means that a few environment variables no longer make sense, so remove them from their sections and mention them in the compatibility section instead. While here, also pet mandoc. PR: 253615 MFC after: 3 days MFC with: f61e92ca5a23 release: permanently remove the 'reldoc' target and associates Reviewed by: gjb, lwhsu, yuripv Differential Revision: https://reviews.freebsd.org/D28881 --- share/man/man7/release.7 | 72 ++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 54 deletions(-) diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 02ee2dfc0e5e..493c90cc1f44 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2020 +.Dd February 23, 2021 .Dt RELEASE 7 .Os .Sh NAME @@ -143,24 +143,18 @@ Additional .Xr make 1 arguments to pass through, which directly affect the tuning of the build chroot. -.It Va SVNROOT +.It Va GITROOT The -.Xr svn 1 +.Xr git 1 host used to check out the various trees. Defaults to -.Pa svn://svn.FreeeBSD.org . +.Pa https://git.FreeeBSD.org . .It Va SRCBRANCH The .Li src/ branch to use. Defaults to -.Va head/@rHEAD . -.It Va DOCBRANCH -The -.Li doc/ -branch to use. -Defaults to -.Va head/@rHEAD . +.Fl b Va main . .It Va PORTBRANCH The .Li ports/ @@ -226,15 +220,6 @@ Defaults to setting the number of jobs .Pq Ar -j to half the number of CPUs available on a SMP-capable system. -.It Va NODOC -Set to a non-empty value to skip the -.Li doc/ -tree checkout. -When set, -.Va NODOC -will prevent the -.Fa doc.txz -distribution package from being created. .It Va NOPORTS Set to a non-empty value to skip the .Li ports/ @@ -244,8 +229,6 @@ When set, will prevent the .Fa ports.txz distribution package from being created. -Setting this also sets -.Va NODOC . .It Va WITH_DVD Set to a non-empty value to include the .Cm dvdrom @@ -268,7 +251,7 @@ which uses all available cores on the system. .It Va VCSCMD The command run to obtain the source trees. Defaults to -.Qq Cm svn checkout . +.Qq Cm git clone Fl q . .It Va CHROOTBUILD_SKIP If defined, the .Li buildworld , @@ -289,14 +272,6 @@ within the This is intended for use only when .Fa /usr/src is expected to exist by alternative means. -.It Va DOC_UPDATE_SKIP -Set to a non-empty value to prevent checkout or update of -.Fa /usr/doc -within the -.Xr chroot 8 . -This is intended for use only when -.Fa /usr/doc -is expected to exist by alternative means. .It Va PORTS_UPDATE_SKIP Set to a non-empty value to prevent checkout or update of .Fa /usr/ports @@ -317,9 +292,7 @@ release builds. .Pp When set, .Va WITH_DVD -is unset, and -.Va NODOC -is defined. +is unset. Additionally, .Va EMBEDDED_TARGET and @@ -587,27 +560,10 @@ Location of a directory containing the ports tree. By default, .Pa /usr/ports . If it is unset or cannot be found, ports will not be included in the release. -.It Ev DOCDIR -Location of a directory containing the doc tree. -By default, -.Pa /usr/doc . -If it is unset or cannot be found, most documentation will not be included in -the release; see -.Ev NODOC -below. .It Ev NOPORTS If defined, the Ports Collection will be omitted from the release. .It Ev NOSRC If set, do not include system source code in the release. -.It Ev NODOC -If defined, the XML-based documentation from the -.Fx -Documentation Project will not be built. -However, the -.Dq doc -distribution will still be created with the minimal documentation set -provided in -.Pa src/share/doc . .It Ev TARGET The target hardware platform. This is analogous to the @@ -657,7 +613,7 @@ The following sequence of commands can be used to build a .Dq "-CURRENT snapshot": .Bd -literal -offset indent cd /usr -svn co svn://svn.freebsd.org/base/head src +git clone https://git.freebsd.org/src.git src cd src make buildworld buildkernel cd release @@ -714,11 +670,19 @@ The target directory can be changed by specifying the .Va CHROOTDIR variable in .Li release.conf . +.Sh COMPATIBILITY +The reldoc target was removed in commit f61e92ca5a23, and +.Ev DOCDIR , +.Ev DOCBRANCH , +.Ev DOC_UPDATE_SKIP , +and +.Ev NODOC +are therefore no longer supported. .Sh SEE ALSO .Xr cc 1 , +.Xr git 1 Pq Pa ports/devel/git , .Xr install 1 , .Xr make 1 , -.Xr svn 1 Pq Pa ports/devel/subversion , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , @@ -771,7 +735,7 @@ is heavily based on the script. .Pp At near 1000 revisions spread over multiple branches, the -.Xr svn 1 +.Xr git 1 log of .Pa src/release/Makefile contains a vivid historical record of some From owner-dev-commits-src-all@freebsd.org Tue Feb 23 18:08: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 580DE54C8AB; Tue, 23 Feb 2021 18:08: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 4DlRqm5JBXz3v31; Tue, 23 Feb 2021 18:08: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 922C41DFE6; Tue, 23 Feb 2021 18:08: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 11NI8KfA049315; Tue, 23 Feb 2021 18:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NI8KRS049314; Tue, 23 Feb 2021 18:08:20 GMT (envelope-from git) Date: Tue, 23 Feb 2021 18:08:20 GMT Message-Id: <202102231808.11NI8KRS049314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3ae8d83d04a7 - main - Remove __NO_TLS. 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/main X-Git-Reftype: branch X-Git-Commit: 3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 18:08:21 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e commit 3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e Author: Konstantin Belousov AuthorDate: 2021-02-19 15:20:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-23 18:08:10 +0000 Remove __NO_TLS. All supported platforms support thread-local vars and __thread. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28796 --- include/runetype.h | 4 ++-- lib/libc/gen/getutxent.c | 5 ----- lib/libc/gen/utxdb.c | 4 ---- lib/libc/locale/setrunelocale.c | 4 ---- lib/libc/locale/xlocale.c | 15 +-------------- lib/libc/locale/xlocale_private.h | 5 +---- lib/libc/string/strerror.c | 5 ----- lib/libgssapi/gss_display_status.c | 10 ---------- sys/sys/cdefs.h | 4 ---- tests/sys/opencrypto/cryptodevh.py | 1 - 10 files changed, 4 insertions(+), 53 deletions(-) diff --git a/include/runetype.h b/include/runetype.h index 4aca128f8c8a..93007809dbf8 100644 --- a/include/runetype.h +++ b/include/runetype.h @@ -88,7 +88,7 @@ typedef struct { __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; extern const _RuneLocale *_CurrentRuneLocale; -#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) +#ifdef __RUNETYPE_INTERNAL extern const _RuneLocale *__getCurrentRuneLocale(void); #else extern _Thread_local const _RuneLocale *_ThreadRuneLocale; @@ -99,7 +99,7 @@ static __inline const _RuneLocale *__getCurrentRuneLocale(void) return _ThreadRuneLocale; return _CurrentRuneLocale; } -#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ +#endif /*__RUNETYPE_INTERNAL */ #define _CurrentRuneLocale (__getCurrentRuneLocale()) __END_DECLS diff --git a/lib/libc/gen/getutxent.c b/lib/libc/gen/getutxent.c index e0d993221e7e..664498126f13 100644 --- a/lib/libc/gen/getutxent.c +++ b/lib/libc/gen/getutxent.c @@ -40,13 +40,8 @@ __FBSDID("$FreeBSD$"); #include "utxdb.h" #include "un-namespace.h" -#ifdef __NO_TLS -static FILE *uf = NULL; -static int udb; -#else static _Thread_local FILE *uf = NULL; static _Thread_local int udb; -#endif int setutxdb(int db, const char *file) diff --git a/lib/libc/gen/utxdb.c b/lib/libc/gen/utxdb.c index f8dea105702c..3edccdbd2c2f 100644 --- a/lib/libc/gen/utxdb.c +++ b/lib/libc/gen/utxdb.c @@ -128,11 +128,7 @@ utx_to_futx(const struct utmpx *ut, struct futx *fu) struct utmpx * futx_to_utx(const struct futx *fu) { -#ifdef __NO_TLS - static struct utmpx *ut; -#else static _Thread_local struct utmpx *ut; -#endif if (ut == NULL) { ut = calloc(1, sizeof *ut); diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index 2e6fed9466e4..551d32b7ab6a 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -56,12 +56,10 @@ __FBSDID("$FreeBSD$"); #undef _CurrentRuneLocale extern _RuneLocale const *_CurrentRuneLocale; -#ifndef __NO_TLS /* * A cached version of the runes for this thread. Used by ctype.h */ _Thread_local const _RuneLocale *_ThreadRuneLocale; -#endif extern int __mb_sb_limit; @@ -199,7 +197,6 @@ __wrap_setrunelocale(const char *locale) return (_LDP_LOADED); } -#ifndef __NO_TLS void __set_thread_rune_locale(locale_t loc) { @@ -212,7 +209,6 @@ __set_thread_rune_locale(locale_t loc) _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; } } -#endif void * __ctype_load(const char *locale, locale_t unused __unused) diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c index fb674f86bbff..d64262da809e 100644 --- a/lib/libc/locale/xlocale.c +++ b/lib/libc/locale/xlocale.c @@ -55,12 +55,11 @@ extern struct xlocale_component __xlocale_global_messages; extern struct xlocale_component __xlocale_C_collate; extern struct xlocale_component __xlocale_C_ctype; -#ifndef __NO_TLS /* * The locale for this thread. */ _Thread_local locale_t __thread_locale; -#endif + /* * Flag indicating that one or more per-thread locales exist. */ @@ -143,16 +142,6 @@ get_thread_locale(void) pthread_getspecific(locale_info_key)); } -#ifdef __NO_TLS -locale_t -__get_locale(void) -{ - locale_t l = get_thread_locale(); - return (l ? l : &__xlocale_global_locale); - -} -#endif - static void set_thread_locale(locale_t loc) { @@ -172,10 +161,8 @@ set_thread_locale(locale_t loc) } else { pthread_setspecific(locale_info_key, l); } -#ifndef __NO_TLS __thread_locale = l; __set_thread_rune_locale(loc); -#endif } /** diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index 391e375bc03d..bc40f28fc9eb 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -185,7 +185,7 @@ void __set_thread_rune_locale(locale_t loc); * locale has ever been set, then we always use the global locale. */ extern int __has_thread_locale; -#ifndef __NO_TLS + /** * The per-thread locale. Avoids the need to use pthread lookup functions when * getting the per-thread locale. @@ -206,9 +206,6 @@ static inline locale_t __get_locale(void) } return (__thread_locale ? __thread_locale : &__xlocale_global_locale); } -#else -locale_t __get_locale(void); -#endif /** * Two magic values are allowed for locale_t objects. NULL and -1. This diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index 11b9701d968f..bb685e4f7dc9 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -128,16 +128,11 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen) char * strerror_l(int num, locale_t locale) { -#ifndef __NO_TLS static _Thread_local char ebuf[NL_TEXTMAX]; if (strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) errno = EINVAL; return (ebuf); -#else - errno = ENOTSUP; - return (NULL); -#endif } char * diff --git a/lib/libgssapi/gss_display_status.c b/lib/libgssapi/gss_display_status.c index 55ca83ce9aa8..d0c3453a0d6b 100644 --- a/lib/libgssapi/gss_display_status.c +++ b/lib/libgssapi/gss_display_status.c @@ -174,16 +174,6 @@ supplementary_error(OM_uint32 v) return msgs[v]; } -#if defined(__NO_TLS) - -/* - * These platforms don't support TLS on FreeBSD - threads will just - * have to step on each other's error values for now. - */ -#define __thread - -#endif - struct mg_thread_ctx { gss_OID mech; OM_uint32 maj_stat; diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index ff18911f6acf..1d1fe2965c69 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -768,10 +768,6 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) -#define __NO_TLS 1 -#endif - /* * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. diff --git a/tests/sys/opencrypto/cryptodevh.py b/tests/sys/opencrypto/cryptodevh.py index be853f496930..c5719e47c8c1 100644 --- a/tests/sys/opencrypto/cryptodevh.py +++ b/tests/sys/opencrypto/cryptodevh.py @@ -133,7 +133,6 @@ __POSIX_VISIBLE = 200809 __XSI_VISIBLE = 700 __BSD_VISIBLE = 1 __ISO_C_VISIBLE = 2011 -__NO_TLS = 1 CRYPTO_DRIVERS_INITIAL = 4 CRYPTO_SW_SESSIONS = 32 NULL_HASH_LEN = 16 From owner-dev-commits-src-all@freebsd.org Tue Feb 23 18:12: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 2669654D041; Tue, 23 Feb 2021 18:12: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 4DlRwH0Zynz3vpj; Tue, 23 Feb 2021 18:12: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 065E71E1CB; Tue, 23 Feb 2021 18:12: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 11NICEj6061289; Tue, 23 Feb 2021 18:12:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NICEWu061288; Tue, 23 Feb 2021 18:12:14 GMT (envelope-from git) Date: Tue, 23 Feb 2021 18:12:14 GMT Message-Id: <202102231812.11NICEWu061288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: ef1a1fc7e828 - main - release(7) Fix mistake noted in review MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef1a1fc7e828d640790fe849487221ef370a410a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 18:12:15 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ef1a1fc7e828d640790fe849487221ef370a410a commit ef1a1fc7e828d640790fe849487221ef370a410a Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-23 18:10:21 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-23 18:11:54 +0000 release(7) Fix mistake noted in review I missed this when doing the final pass. Fixes: f695e960 release(7): Remove stray references to DOC* variables --- share/man/man7/release.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 493c90cc1f44..f176251d89cc 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -613,7 +613,7 @@ The following sequence of commands can be used to build a .Dq "-CURRENT snapshot": .Bd -literal -offset indent cd /usr -git clone https://git.freebsd.org/src.git src +git clone -b main https://git.freebsd.org/src.git src cd src make buildworld buildkernel cd release From owner-dev-commits-src-all@freebsd.org Tue Feb 23 19:56: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 9112655072A; Tue, 23 Feb 2021 19:56:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlVDt3V1bz4Wyc; Tue, 23 Feb 2021 19:56:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 6500D17BD; Tue, 23 Feb 2021 19:56:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 0A5FB27C0054; Tue, 23 Feb 2021 14:56:46 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Tue, 23 Feb 2021 14:56:46 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeehgddufedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdluddtmdenucfjughrpefofg ggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfuehrrghnughonhcuuegv rhhgrhgvnhdfuceosggurhgrghhonheshfhrvggvuefuffdrohhrgheqnecuggftrfgrth htvghrnhephfdvgfettdeuvedujeeugffhkeekjeefgfelkeelvedvfeeuhfelveefleel uddtnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsggurhgrghhonhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddtgedvfeehkeeigedqudekuddtkeehuddqsggurh grghhonheppefhrhgvvgeuufffrdhorhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id AD0FFCA005D; Tue, 23 Feb 2021 14:56:45 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <8fde15b6-1cfc-4fa8-88a8-90d5cbe28f6d@www.fastmail.com> In-Reply-To: <202102231808.11NI8KRS049314@gitrepo.freebsd.org> References: <202102231808.11NI8KRS049314@gitrepo.freebsd.org> Date: Tue, 23 Feb 2021 13:55:26 -0600 From: "Brandon Bergren" To: "Konstantin Belousov" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 3ae8d83d04a7 - main - Remove __NO_TLS. Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 19:56:46 -0000 MFC to stable/13 only, as MFCing to 12 or below would be an ABI break. On Tue, Feb 23, 2021, at 12:08 PM, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e > > commit 3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e > Author: Konstantin Belousov > AuthorDate: 2021-02-19 15:20:29 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-02-23 18:08:10 +0000 > > Remove __NO_TLS. > > All supported platforms support thread-local vars and __thread. > > Reviewed by: emaste > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D28796 > --- -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Tue Feb 23 19:57: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 9A7A355098C; Tue, 23 Feb 2021 19:57: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 4DlVG8401zz4X9v; Tue, 23 Feb 2021 19:57: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 7BCE11F78B; Tue, 23 Feb 2021 19:57: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 11NJvqVp093203; Tue, 23 Feb 2021 19:57:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NJvqws093202; Tue, 23 Feb 2021 19:57:52 GMT (envelope-from git) Date: Tue, 23 Feb 2021 19:57:52 GMT Message-Id: <202102231957.11NJvqws093202@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: 6b7580f7b1b6 - main - camcontrol: change hueristic for I/O-less devtype 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: 6b7580f7b1b66134286813b971ab575862b95426 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 19:57:52 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b7580f7b1b66134286813b971ab575862b95426 commit 6b7580f7b1b66134286813b971ab575862b95426 Author: Warner Losh AuthorDate: 2021-02-23 19:33:26 +0000 Commit: Warner Losh CommitDate: 2021-02-23 19:56:15 +0000 camcontrol: change hueristic for I/O-less devtype Some SATA drives have 'config' set to 0 in the identify block. Rather than rely on it, use the strings windows uses to display the drive since they are supposed to be space padded and will always be non-zero. --- sbin/camcontrol/camcontrol.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index cc21a109343c..27d545d924b3 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -5520,9 +5520,14 @@ get_device_type(struct cam_device *dev, int retry_count, int timeout, * For a retry count of -1, used only the cached data to avoid * I/O to the drive. Sending the identify command to the drive * can cause issues for SATL attachaed drives since identify is - * not an NCQ command. + * not an NCQ command. We check for the strings that windows + * displays since those will not be NULs (they are supposed + * to be space padded). We could check other bits, but anything + * non-zero implies SATL. */ - if (cgd.ident_data.config != 0) + if (cgd.ident_data.serial[0] != 0 || + cgd.ident_data.revision[0] != 0 || + cgd.ident_data.model[0] != 0) *devtype = CC_DT_SATL; else *devtype = CC_DT_SCSI; From owner-dev-commits-src-all@freebsd.org Tue Feb 23 20:07: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 222C7550A3C; Tue, 23 Feb 2021 20:07: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 4DlVTl0J1jz4Xd1; Tue, 23 Feb 2021 20:07: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 F11A51F764; Tue, 23 Feb 2021 20:07: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 11NK7sbx007083; Tue, 23 Feb 2021 20:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NK7sYE007082; Tue, 23 Feb 2021 20:07:54 GMT (envelope-from git) Date: Tue, 23 Feb 2021 20:07:54 GMT Message-Id: <202102232007.11NK7sYE007082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: 11ba8488b863 - main - iicsmb: Request the bus recursively in bread() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11ba8488b8636a91668c0ee13d35d9e126dfba53 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 20:07:55 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=11ba8488b8636a91668c0ee13d35d9e126dfba53 commit 11ba8488b8636a91668c0ee13d35d9e126dfba53 Author: Allan Jude AuthorDate: 2021-02-23 20:06:16 +0000 Commit: Allan Jude CommitDate: 2021-02-23 20:06:16 +0000 iicsmb: Request the bus recursively in bread() ipmi_ssif will `smbus_request_bus()` to do multiple smbus requests (which requests the iicbus), and then here in `bread()` we also need to request the bus because `bread()` takes multiple transactions. This causes deadlock as it's waiting for the bus it already has without `IIC_RECURSIVE`. Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28742 --- sys/dev/iicbus/iicsmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c index 8e79452cf2a8..38e67c40d488 100644 --- a/sys/dev/iicbus/iicsmb.c +++ b/sys/dev/iicbus/iicsmb.c @@ -455,7 +455,7 @@ iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) int error; /* Have to do this because the command is split in two transfers. */ - error = iicbus_request_bus(parent, dev, IIC_WAIT); + error = iicbus_request_bus(parent, dev, IIC_WAIT | IIC_RECURSIVE); if (error == 0) error = TRANSFER_MSGS(dev, msgs); if (error == 0) { From owner-dev-commits-src-all@freebsd.org Tue Feb 23 20:10: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 E0C98550E9F; Tue, 23 Feb 2021 20:10: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 4DlVXZ65Kjz4Xqr; Tue, 23 Feb 2021 20:10: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 C432E1F9A4; Tue, 23 Feb 2021 20:10: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 11NKAM23014919; Tue, 23 Feb 2021 20:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NKAMFt014918; Tue, 23 Feb 2021 20:10:22 GMT (envelope-from git) Date: Tue, 23 Feb 2021 20:10:22 GMT Message-Id: <202102232010.11NKAMFt014918@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: cf97d2a1dab8 - main - Build lib/msun tests with compiler builtins disabled 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: cf97d2a1dab8f2cddc4466fe64d37818339c73be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 20:10:22 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=cf97d2a1dab8f2cddc4466fe64d37818339c73be commit cf97d2a1dab8f2cddc4466fe64d37818339c73be Author: Dimitry Andric AuthorDate: 2021-02-23 20:03:32 +0000 Commit: Dimitry Andric CommitDate: 2021-02-23 20:10:01 +0000 Build lib/msun tests with compiler builtins disabled This forces the compiler to emit calls to libm functions, instead of possibly substituting pre-calculated results at compile time, which should help to actually test those functions. Reviewed by: emaste, arichardson, ngie Differential Revision: https://reviews.freebsd.org/D28577 MFC after: 3 days --- lib/msun/tests/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index d58333271e9b..85a558bb0733 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -19,6 +19,10 @@ CFLAGS+= -I${TESTSRC:H}/libc/gen CFLAGS+= -D__HAVE_LONG_DOUBLE .endif +# Avoid builtins, to force the compiler to emit calls to the libm +# functions, and not calculate any results in advance. +CFLAGS+= -fno-builtin + NETBSD_ATF_TESTS_C= acos_test NETBSD_ATF_TESTS_C+= asin_test NETBSD_ATF_TESTS_C+= atan_test From owner-dev-commits-src-all@freebsd.org Tue Feb 23 21:07: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 4F182552E9C; Tue, 23 Feb 2021 21:07: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 4DlWpk1lnCz4d3v; Tue, 23 Feb 2021 21:07: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 2E4742059D; Tue, 23 Feb 2021 21:07: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 11NL7gkk086281; Tue, 23 Feb 2021 21:07:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NL7giB086280; Tue, 23 Feb 2021 21:07:42 GMT (envelope-from git) Date: Tue, 23 Feb 2021 21:07:42 GMT Message-Id: <202102232107.11NL7giB086280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 07656628fdbc - stable/13 - ofwfb: fix incorrect colors on powerpc* and add new tunable parameters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07656628fdbc813fb10ec6cf819649548fb8303b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 21:07:42 -0000 The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=07656628fdbc813fb10ec6cf819649548fb8303b commit 07656628fdbc813fb10ec6cf819649548fb8303b Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-19 06:22:25 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-24 00:00:56 +0000 ofwfb: fix incorrect colors on powerpc* and add new tunable parameters - Implements little-endian support (powerpc64le) - Adds 'hw.ofwfb.physaddr' kernel parameter so user can manually provide correct address if it's not detected correctly - Adds 'hw.ofwfb.argb32_pixel' so user can set it manually if colors are inverted due to incorrect pixel format (default = 1) - Automatically selects RGBA32 pixel format if NVidia graphic adapter is detected (sets hw.ofwfb.argb32_pixel=0) Machines equipped with NVidia graphic adapters tend to use RGBA32 pixel format. By default ARGB32 pixel format is used, proved to work on machines equipped with ATI graphic adapter and the onboard adapter used on Talos II and Blackbird machines from Raptor Computing Systems. Original patch developed by bdragon Reviewed by: bdragon, luporl MFC after: 3 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28604 (cherry picked from commit 50b7c1f530f174be720b83f7e1d13e0fd42c5974) --- sys/dev/vt/hw/ofwfb/ofwfb.c | 165 +++++++++++++++++++++++++++++++++----------- 1 file changed, 123 insertions(+), 42 deletions(-) diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c index 833b98b39f78..8a1b7b3688a7 100644 --- a/sys/dev/vt/hw/ofwfb/ofwfb.c +++ b/sys/dev/vt/hw/ofwfb/ofwfb.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct ofwfb_softc { struct fb_info fb; @@ -55,8 +56,13 @@ struct ofwfb_softc { ihandle_t sc_handle; bus_space_tag_t sc_memt; int iso_palette; + int argb; + int endian_flip; + uint32_t vendor_id; }; +#define PCI_VENDOR_ID_NVIDIA 0x10de + static void ofwfb_initialize(struct vt_device *vd); static vd_probe_t ofwfb_probe; static vd_init_t ofwfb_init; @@ -297,7 +303,6 @@ ofwfb_initialize(struct vt_device *vd) struct ofwfb_softc *sc = vd->vd_softc; int i, err; cell_t retval; - uint32_t oldpix; sc->fb.fb_cmsize = 16; @@ -311,6 +316,10 @@ ofwfb_initialize(struct vt_device *vd) sc->iso_palette = 0; switch (sc->fb.fb_bpp) { case 8: + /* + * No color format issues here, since we are passing the RGB + * components separately to Open Firmware. + */ vt_generate_cons_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); @@ -330,21 +339,38 @@ ofwfb_initialize(struct vt_device *vd) case 32: /* - * We bypass the usual bus_space_() accessors here, mostly - * for performance reasons. In particular, we don't want - * any barrier operations that may be performed and handle - * endianness slightly different. Figure out the host-view - * endianness of the frame buffer. + * There are two main color formats in use. + * ARGB32 is used mainly on hardware that was designed for + * LE systems, and RGBA32 is used mainly on hardware designed + * for BE systems. + * + * PowerMacs use either, depending on the video card option. + * NVidia cards tend to be RGBA32, and ATI cards tend to be ARGB32. + * + * There is no good way to determine the correct option, as this + * is independent of endian swapping. */ - oldpix = bus_space_read_4(sc->sc_memt, sc->fb.fb_vbase, 0); - bus_space_write_4(sc->sc_memt, sc->fb.fb_vbase, 0, 0xff000000); - if (*(uint8_t *)(sc->fb.fb_vbase) == 0xff) - vt_generate_cons_palette(sc->fb.fb_cmap, - COLOR_FORMAT_RGB, 255, 0, 255, 8, 255, 16); + if (sc->vendor_id == PCI_VENDOR_ID_NVIDIA) + sc->argb = 0; else - vt_generate_cons_palette(sc->fb.fb_cmap, - COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); - bus_space_write_4(sc->sc_memt, sc->fb.fb_vbase, 0, oldpix); + sc->argb = 1; + + TUNABLE_INT_FETCH("hw.ofwfb.argb32_pixel", &sc->argb); + if (sc->endian_flip) { + if (sc->argb) + vt_generate_cons_palette(sc->fb.fb_cmap, + COLOR_FORMAT_RGB, 255, 8, 255, 16, 255, 24); + else + vt_generate_cons_palette(sc->fb.fb_cmap, + COLOR_FORMAT_RGB, 255, 24, 255, 16, 255, 8); + } else { + if (sc->argb) + vt_generate_cons_palette(sc->fb.fb_cmap, + COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); + else + vt_generate_cons_palette(sc->fb.fb_cmap, + COLOR_FORMAT_RGB, 255, 0, 255, 8, 255, 16); + } break; default: @@ -361,8 +387,12 @@ ofwfb_init(struct vt_device *vd) phandle_t chosen; phandle_t node; uint32_t depth, height, width, stride; - uint32_t fb_phys; - int i, len; + uint32_t vendor_id = 0; + cell_t adr[2]; + uint64_t user_phys; + bus_addr_t fb_phys; + bus_size_t fb_phys_size; + int i, j, len; /* Initialize softc */ vd->vd_softc = sc = &ofwfb_conssoftc; @@ -391,6 +421,16 @@ ofwfb_init(struct vt_device *vd) if (strcmp(buf, "display") != 0) return (CN_DEAD); + /* + * Retrieve vendor-id from /chosen parent node, usually pointing to + * video card device. This is used to select pixel format later on + * ofwfb_initialize() + */ + if (OF_getencprop(OF_parent(node), "vendor-id", &vendor_id, + sizeof(vendor_id)) == sizeof(vendor_id)) + sc->vendor_id = vendor_id; + + /* Keep track of the OF node */ sc->sc_node = node; @@ -419,35 +459,69 @@ ofwfb_init(struct vt_device *vd) sizeof(stride)) stride = width*depth/8; + sc->fb.fb_height = height; sc->fb.fb_width = width; sc->fb.fb_stride = stride; sc->fb.fb_size = sc->fb.fb_height * sc->fb.fb_stride; + sc->endian_flip = 0; + +#if defined(__powerpc__) + if (OF_hasprop(node, "little-endian")) { + sc->sc_memt = &bs_le_tag; +#if BYTE_ORDER == BIG_ENDIAN + sc->endian_flip = 1; +#endif + } else if (OF_hasprop(node, "big-endian")) { + sc->sc_memt = &bs_be_tag; +#if BYTE_ORDER == LITTLE_ENDIAN + sc->endian_flip = 1; +#endif + } + else { + /* Assume the framebuffer is in native endian. */ +#if BYTE_ORDER == BIG_ENDIAN + sc->sc_memt = &bs_be_tag; +#else + sc->sc_memt = &bs_le_tag; +#endif + } +#elif defined(__arm__) + sc->sc_memt = fdtbus_bs_tag; +#else + #error Unsupported platform! +#endif + /* * Grab the physical address of the framebuffer, and then map it * into our memory space. If the MMU is not yet up, it will be * remapped for us when relocation turns on. */ - if (OF_getproplen(node, "address") == sizeof(fb_phys)) { - /* XXX We assume #address-cells is 1 at this point. */ - OF_getprop(node, "address", &fb_phys, sizeof(fb_phys)); - - #if defined(__powerpc__) - sc->sc_memt = &bs_be_tag; - bus_space_map(sc->sc_memt, fb_phys, sc->fb.fb_size, - BUS_SPACE_MAP_PREFETCHABLE, &sc->fb.fb_vbase); - #elif defined(__arm__) - sc->sc_memt = fdtbus_bs_tag; - bus_space_map(sc->sc_memt, sc->fb.fb_pbase, sc->fb.fb_size, - BUS_SPACE_MAP_PREFETCHABLE, - (bus_space_handle_t *)&sc->fb.fb_vbase); - #else - #error Unsupported platform! - #endif + user_phys = 0; + TUNABLE_UINT64_FETCH("hw.ofwfb.physaddr", &user_phys); + fb_phys = (bus_addr_t)user_phys; + if (fb_phys) + sc->fb.fb_pbase = (vm_paddr_t)fb_phys; + else if (OF_hasprop(node, "address")) { + + switch (OF_getproplen(node, "address")) { + case 4: + OF_getencprop(node, "address", adr, 4); + fb_phys = adr[0]; + break; + case 8: + OF_getencprop(node, "address", adr, 8); + fb_phys = ((uint64_t)adr[0] << 32) | adr[1]; + break; + default: + /* Bad property? */ + return (CN_DEAD); + } - sc->fb.fb_pbase = fb_phys; + sc->fb.fb_pbase = (vm_paddr_t)fb_phys; } else { +#if defined(__powerpc__) /* * Some IBM systems don't have an address property. Try to * guess the framebuffer region from the assigned addresses. @@ -473,7 +547,7 @@ ofwfb_init(struct vt_device *vd) len = 0; num_pciaddrs = len / sizeof(struct ofw_pci_register); - fb_phys = num_pciaddrs; + j = num_pciaddrs; for (i = 0; i < num_pciaddrs; i++) { /* If it is too small, not the framebuffer */ if (pciaddrs[i].size_lo < sc->fb.fb_stride * height) @@ -484,26 +558,33 @@ ofwfb_init(struct vt_device *vd) continue; /* This could be the framebuffer */ - fb_phys = i; + j = i; /* If it is prefetchable, it certainly is */ if (pciaddrs[i].phys_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) break; } - if (fb_phys == num_pciaddrs) /* No candidates found */ + if (j == num_pciaddrs) /* No candidates found */ return (CN_DEAD); - #if defined(__powerpc__) - OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase, - NULL); - sc->fb.fb_pbase = sc->fb.fb_vbase & ~DMAP_BASE_ADDRESS; - #else + if (ofw_reg_to_paddr(node, j, &fb_phys, &fb_phys_size, NULL) < 0) + return (CN_DEAD); + + sc->fb.fb_pbase = (vm_paddr_t)fb_phys; +#else /* No ability to interpret assigned-addresses otherwise */ return (CN_DEAD); - #endif +#endif } + if (!sc->fb.fb_pbase) + return (CN_DEAD); + + bus_space_map(sc->sc_memt, sc->fb.fb_pbase, sc->fb.fb_size, + BUS_SPACE_MAP_PREFETCHABLE, + (bus_space_handle_t *)&sc->fb.fb_vbase); + #if defined(__powerpc__) /* * If we are running on PowerPC in real mode (supported only on AIM From owner-dev-commits-src-all@freebsd.org Tue Feb 23 21:19: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 D80A0553406; Tue, 23 Feb 2021 21:19: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 4DlX4s5pVMz4dsg; Tue, 23 Feb 2021 21:19: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 B0200205E4; Tue, 23 Feb 2021 21:19: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 11NLJvmA099501; Tue, 23 Feb 2021 21:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NLJvvL099500; Tue, 23 Feb 2021 21:19:57 GMT (envelope-from git) Date: Tue, 23 Feb 2021 21:19:57 GMT Message-Id: <202102232119.11NLJvvL099500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: d0673fe160b0 - main - smbios: Move smbios driver out from x86 machdep code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0673fe160b04f8162f380926d455dfb966f08fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 21:19:57 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=d0673fe160b04f8162f380926d455dfb966f08fb commit d0673fe160b04f8162f380926d455dfb966f08fb Author: Allan Jude AuthorDate: 2021-02-23 21:14:18 +0000 Commit: Allan Jude CommitDate: 2021-02-23 21:17:09 +0000 smbios: Move smbios driver out from x86 machdep code Add it to the x86 GENERIC and MINIMAL kernels Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D28738 --- sys/amd64/conf/GENERIC | 1 + sys/amd64/conf/MINIMAL | 1 + sys/amd64/include/pc/bios.h | 32 ----------------- sys/conf/files | 1 + sys/conf/files.x86 | 1 - sys/dev/ipmi/ipmi_smbios.c | 3 ++ sys/{x86/bios => dev/smbios}/smbios.c | 22 ++++++++---- sys/dev/smbios/smbios.h | 67 +++++++++++++++++++++++++++++++++++ sys/i386/conf/GENERIC | 1 + sys/i386/conf/MINIMAL | 1 + sys/i386/include/pc/bios.h | 32 ----------------- sys/modules/bios/smbios/Makefile | 2 +- 12 files changed, 92 insertions(+), 72 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index cdee2a91554b..f5f4bdf49c5f 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -129,6 +129,7 @@ device cpufreq # Bus support. device acpi +device smbios options IOMMU device pci options PCI_HP # PCI-Express native HotPlug diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index 603fce8320bb..b4c58993748a 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -103,6 +103,7 @@ device cpufreq # Bus support. device acpi +device smbios options IOMMU device pci diff --git a/sys/amd64/include/pc/bios.h b/sys/amd64/include/pc/bios.h index 99e346a4a344..4b2d9af02558 100644 --- a/sys/amd64/include/pc/bios.h +++ b/sys/amd64/include/pc/bios.h @@ -64,38 +64,6 @@ struct bios_smap_xattr { u_int32_t xattr; } __packed; -/* - * System Management BIOS - */ -#define SMBIOS_START 0xf0000 -#define SMBIOS_STEP 0x10 -#define SMBIOS_OFF 0 -#define SMBIOS_LEN 4 -#define SMBIOS_SIG "_SM_" - -struct smbios_eps { - uint8_t anchor_string[4]; /* '_SM_' */ - uint8_t checksum; - uint8_t length; - uint8_t major_version; - uint8_t minor_version; - uint16_t maximum_structure_size; - uint8_t entry_point_revision; - uint8_t formatted_area[5]; - uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ - uint8_t intermediate_checksum; - uint16_t structure_table_length; - uint32_t structure_table_address; - uint16_t number_structures; - uint8_t BCD_revision; -}; - -struct smbios_structure_header { - uint8_t type; - uint8_t length; - uint16_t handle; -}; - #ifdef _KERNEL #define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) #define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE) diff --git a/sys/conf/files b/sys/conf/files index 58ec6f3caf2a..21990a4a762c 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3096,6 +3096,7 @@ dev/sge/if_sge.c optional sge pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci +dev/smbios/smbios.c optional smbios dev/smbus/smb.c optional smb dev/smbus/smbconf.c optional smbus dev/smbus/smbus.c optional smbus diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index cb7fabf44cfb..59ff39ca053d 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -293,7 +293,6 @@ x86/acpica/OsdEnvironment.c optional acpi x86/acpica/acpi_apm.c optional acpi x86/acpica/acpi_wakeup.c optional acpi x86/acpica/srat.c optional acpi -x86/bios/smbios.c optional smbios x86/bios/vpd.c optional vpd x86/cpufreq/est.c optional cpufreq x86/cpufreq/hwpstate_amd.c optional cpufreq diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index df0a7f70e9cd..308a3b076ef7 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -39,7 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(__amd64__) || defined(__i386__) #include +#endif +#include #ifdef LOCAL_MODULE #include diff --git a/sys/x86/bios/smbios.c b/sys/dev/smbios/smbios.c similarity index 93% rename from sys/x86/bios/smbios.c rename to sys/dev/smbios/smbios.c index 2e3a80c9c7e4..10589ed8d49d 100644 --- a/sys/x86/bios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -46,7 +46,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(__amd64__) || defined(__i386__) #include +#endif +#include /* * System Management BIOS Reference Specification, v2.4 Final @@ -62,7 +65,6 @@ struct smbios_softc { }; #define RES2EPS(res) ((struct smbios_eps *)rman_get_virtual(res)) -#define ADDR2EPS(addr) ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr)) static devclass_t smbios_devclass; @@ -77,25 +79,32 @@ static int smbios_cksum (struct smbios_eps *); static void smbios_identify (driver_t *driver, device_t parent) { + struct smbios_eps *eps; device_t child; - u_int32_t addr; + vm_paddr_t addr; int length; int rid; if (!device_is_alive(parent)) return; +#if defined(__amd64__) || defined(__i386__) addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, - SMBIOS_STEP, SMBIOS_OFF); + SMBIOS_STEP, SMBIOS_OFF); +#else + addr = 0; +#endif + if (addr != 0) { + eps = pmap_mapbios(addr, 0x1f); rid = 0; - length = ADDR2EPS(addr)->length; + length = eps->length; if (length != 0x1f) { u_int8_t major, minor; - major = ADDR2EPS(addr)->major_version; - minor = ADDR2EPS(addr)->minor_version; + major = eps->major_version; + minor = eps->minor_version; /* SMBIOS v2.1 implementation might use 0x1e. */ if (length == 0x1e && major == 2 && minor == 1) @@ -108,6 +117,7 @@ smbios_identify (driver_t *driver, device_t parent) device_set_driver(child, driver); bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length); device_set_desc(child, "System Management BIOS"); + pmap_unmapbios((vm_offset_t)eps, 0x1f); } return; diff --git a/sys/dev/smbios/smbios.h b/sys/dev/smbios/smbios.h new file mode 100644 index 000000000000..6503cdb73c4c --- /dev/null +++ b/sys/dev/smbios/smbios.h @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 1997 Michael Smith + * Copyright (c) 1998 Jonathan Lemon + * 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$ + */ + +#ifndef _SMBIOS_H_ +#define _SMBIOS_H_ + +/* + * System Management BIOS + */ +#define SMBIOS_START 0xf0000 +#define SMBIOS_STEP 0x10 +#define SMBIOS_OFF 0 +#define SMBIOS_LEN 4 +#define SMBIOS_SIG "_SM_" + +struct smbios_eps { + uint8_t anchor_string[4]; /* '_SM_' */ + uint8_t checksum; + uint8_t length; + uint8_t major_version; + uint8_t minor_version; + uint16_t maximum_structure_size; + uint8_t entry_point_revision; + uint8_t formatted_area[5]; + uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ + uint8_t intermediate_checksum; + uint16_t structure_table_length; + uint32_t structure_table_address; + uint16_t number_structures; + uint8_t BCD_revision; +}; + +struct smbios_structure_header { + uint8_t type; + uint8_t length; + uint16_t handle; +}; + +#endif /* _SMBIOS_H_ */ diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 7d4f195ba28a..874c3237ec77 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -115,6 +115,7 @@ device cpufreq # Bus support. device acpi +device smbios device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support diff --git a/sys/i386/conf/MINIMAL b/sys/i386/conf/MINIMAL index faebfeaf99a8..8eed963b8f0a 100644 --- a/sys/i386/conf/MINIMAL +++ b/sys/i386/conf/MINIMAL @@ -104,6 +104,7 @@ device cpufreq # Bus support. device acpi +device smbios device pci # atkbdc0 controls both the keyboard and the PS/2 mouse diff --git a/sys/i386/include/pc/bios.h b/sys/i386/include/pc/bios.h index aced9712e846..eec5983bee46 100644 --- a/sys/i386/include/pc/bios.h +++ b/sys/i386/include/pc/bios.h @@ -234,38 +234,6 @@ struct bios_smap_xattr { u_int32_t xattr; } __packed; -/* - * System Management BIOS - */ -#define SMBIOS_START 0xf0000 -#define SMBIOS_STEP 0x10 -#define SMBIOS_OFF 0 -#define SMBIOS_LEN 4 -#define SMBIOS_SIG "_SM_" - -struct smbios_eps { - uint8_t anchor_string[4]; /* '_SM_' */ - uint8_t checksum; - uint8_t length; - uint8_t major_version; - uint8_t minor_version; - uint16_t maximum_structure_size; - uint8_t entry_point_revision; - uint8_t formatted_area[5]; - uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ - uint8_t intermediate_checksum; - uint16_t structure_table_length; - uint32_t structure_table_address; - uint16_t number_structures; - uint8_t BCD_revision; -}; - -struct smbios_structure_header { - uint8_t type; - uint8_t length; - uint16_t handle; -}; - #ifdef _KERNEL #define BIOS_PADDRTOVADDR(x) ((x) + PMAP_MAP_LOW) #define BIOS_VADDRTOPADDR(x) ((x) - PMAP_MAP_LOW) diff --git a/sys/modules/bios/smbios/Makefile b/sys/modules/bios/smbios/Makefile index ff8d22b764aa..58301eca17d6 100644 --- a/sys/modules/bios/smbios/Makefile +++ b/sys/modules/bios/smbios/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ # -.PATH: ${SRCTOP}/sys/x86/bios +.PATH: ${SRCTOP}/sys/dev/smbios KMOD= smbios SRCS= smbios.c \ From owner-dev-commits-src-all@freebsd.org Tue Feb 23 21: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 0242055333F; Tue, 23 Feb 2021 21: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 4DlX4t6gjPz4dfX; Tue, 23 Feb 2021 21:19: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 D802C205E5; Tue, 23 Feb 2021 21:19: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 11NLJwKR099524; Tue, 23 Feb 2021 21:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NLJw17099523; Tue, 23 Feb 2021 21:19:58 GMT (envelope-from git) Date: Tue, 23 Feb 2021 21:19:58 GMT Message-Id: <202102232119.11NLJw17099523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: ba6e37e47f41 - main - ipmi_smbios: Deduplicate smbios entry point discovery logic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba6e37e47f41484fc61cc034619267b82ddd056c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 21:19:59 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=ba6e37e47f41484fc61cc034619267b82ddd056c commit ba6e37e47f41484fc61cc034619267b82ddd056c Author: Allan Jude AuthorDate: 2021-02-23 21:17:37 +0000 Commit: Allan Jude CommitDate: 2021-02-23 21:17:37 +0000 ipmi_smbios: Deduplicate smbios entry point discovery logic Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28743 --- sys/dev/ipmi/ipmi_isa.c | 1 + sys/dev/ipmi/ipmi_pci.c | 1 + sys/dev/ipmi/ipmi_smbios.c | 46 ++++++++++++++++------------------------------ sys/dev/ipmi/ipmi_smbus.c | 1 + sys/dev/smbios/smbios.c | 21 +++++++++++++++++++++ sys/dev/smbios/smbios.h | 2 ++ 6 files changed, 42 insertions(+), 30 deletions(-) diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c index cdff305b07ec..2831b53e4586 100644 --- a/sys/dev/ipmi/ipmi_isa.c +++ b/sys/dev/ipmi/ipmi_isa.c @@ -286,3 +286,4 @@ static driver_t ipmi_isa_driver = { }; DRIVER_MODULE(ipmi_isa, isa, ipmi_isa_driver, ipmi_devclass, 0, 0); +MODULE_DEPEND(ipmi_isa, smbios, 1, 1, 1); diff --git a/sys/dev/ipmi/ipmi_pci.c b/sys/dev/ipmi/ipmi_pci.c index d4598f9db873..1697a4c31c2a 100644 --- a/sys/dev/ipmi/ipmi_pci.c +++ b/sys/dev/ipmi/ipmi_pci.c @@ -179,6 +179,7 @@ static driver_t ipmi_pci_driver = { }; DRIVER_MODULE(ipmi_pci, pci, ipmi_pci_driver, ipmi_devclass, 0, 0); +MODULE_DEPEND(ipmi_pci, smbios, 1, 1, 1); /* Native IPMI on PCI driver. */ diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index 308a3b076ef7..735f404eec5f 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -88,7 +88,7 @@ MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF); static void ipmi_smbios_probe(struct ipmi_get_info *); static int smbios_cksum(struct smbios_eps *); -static void smbios_walk_table(uint8_t *, int, smbios_callback_t, +static void smbios_walk_table(uint8_t *, vm_size_t, smbios_callback_t, void *); static void smbios_ipmi_info(struct smbios_structure_header *, void *); @@ -147,11 +147,12 @@ smbios_ipmi_info(struct smbios_structure_header *h, void *arg) } static void -smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) +smbios_walk_table(uint8_t *table, vm_size_t size, smbios_callback_t cb, void *arg) { struct smbios_structure_header *s; + uint8_t *p; - while (entries--) { + for (p = table; p < table + size;) { s = (struct smbios_structure_header *)p; cb(s, arg); @@ -160,8 +161,11 @@ smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) * formatted area of this structure. */ p += s->length; - while (!(p[0] == 0 && p[1] == 0)) + while (!(p[0] == 0 && p[1] == 0)) { p++; + if (p >= table + size) + return; + } /* * Skip over the double-nul to the start of the next @@ -179,41 +183,23 @@ smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) static void ipmi_smbios_probe(struct ipmi_get_info *info) { - struct smbios_eps *header; void *table; - u_int32_t addr; + vm_paddr_t table_paddr; + vm_size_t table_size; + int err; bzero(info, sizeof(struct ipmi_get_info)); - /* Find the SMBIOS table header. */ - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, - SMBIOS_STEP, SMBIOS_OFF); - if (addr == 0) + err = smbios_get_structure_table(&table_paddr, &table_size); + if (err != 0) return; - /* - * Map the header. We first map a fixed size to get the actual - * length and then map it a second time with the actual length so - * we can verify the checksum. - */ - header = pmap_mapbios(addr, sizeof(struct smbios_eps)); - table = pmap_mapbios(addr, header->length); - pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_eps)); - header = table; - if (smbios_cksum(header) != 0) { - pmap_unmapbios((vm_offset_t)header, header->length); - return; - } + table = pmap_mapbios(table_paddr, table_size); - /* Now map the actual table and walk it looking for an IPMI entry. */ - table = pmap_mapbios(header->structure_table_address, - header->structure_table_length); - smbios_walk_table(table, header->number_structures, smbios_ipmi_info, - info); + smbios_walk_table(table, table_size, smbios_ipmi_info, info); /* Unmap everything. */ - pmap_unmapbios((vm_offset_t)table, header->structure_table_length); - pmap_unmapbios((vm_offset_t)header, header->length); + pmap_unmapbios((vm_offset_t)table, table_size); } /* diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c index 212248f0217e..bc7377e5aee8 100644 --- a/sys/dev/ipmi/ipmi_smbus.c +++ b/sys/dev/ipmi/ipmi_smbus.c @@ -131,3 +131,4 @@ static driver_t ipmi_smbus_driver = { DRIVER_MODULE(ipmi_smbus, smbus, ipmi_smbus_driver, ipmi_devclass, 0, 0); MODULE_DEPEND(ipmi_smbus, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +MODULE_DEPEND(ipmi_smbus, smbios, 1, 1, 1); diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 10589ed8d49d..00c7e2c98d2a 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #endif #include +static struct smbios_softc *smbios; + /* * System Management BIOS Reference Specification, v2.4 Final * http://www.dmtf.org/standards/published_documents/DSP0134.pdf @@ -179,6 +181,7 @@ smbios_attach (device_t dev) bcd2bin(sc->eps->BCD_revision & 0x0f)); printf("\n"); + smbios = sc; return (0); bad: if (sc->res) @@ -191,6 +194,7 @@ smbios_detach (device_t dev) { struct smbios_softc *sc; + smbios = NULL; sc = device_get_softc(dev); if (sc->res) @@ -199,6 +203,23 @@ smbios_detach (device_t dev) return (0); } +int +smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size) +{ + + if (smbios == NULL) + return (ENXIO); + if (smbios->eps_64bit) { + *table = smbios->eps3->structure_table_address; + *size = smbios->eps3->structure_table_max_size; + } else { + *table = smbios->eps->structure_table_address; + *size = smbios->eps->structure_table_length; + } + return (0); +} + + static int smbios_modevent (mod, what, arg) module_t mod; diff --git a/sys/dev/smbios/smbios.h b/sys/dev/smbios/smbios.h index 6503cdb73c4c..554b882f1da4 100644 --- a/sys/dev/smbios/smbios.h +++ b/sys/dev/smbios/smbios.h @@ -32,6 +32,8 @@ #ifndef _SMBIOS_H_ #define _SMBIOS_H_ +int smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size); + /* * System Management BIOS */ From owner-dev-commits-src-all@freebsd.org Tue Feb 23 21:24: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 51C3F5536A6; Tue, 23 Feb 2021 21:24: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 4DlXB60bN1z4fb8; Tue, 23 Feb 2021 21:24: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 01E18209CA; Tue, 23 Feb 2021 21:24: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 11NLOT76012355; Tue, 23 Feb 2021 21:24:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NLOT27012354; Tue, 23 Feb 2021 21:24:29 GMT (envelope-from git) Date: Tue, 23 Feb 2021 21:24:29 GMT Message-Id: <202102232124.11NLOT27012354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b7472b3d8d2f1e90fade5236b44fd98d8e396c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 21:24:30 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=0b7472b3d8d2f1e90fade5236b44fd98d8e396c2 commit 0b7472b3d8d2f1e90fade5236b44fd98d8e396c2 Author: Nathan Whitehorn AuthorDate: 2021-02-23 21:16:52 +0000 Commit: Nathan Whitehorn CommitDate: 2021-02-23 21:24:21 +0000 Mount the EFI system partition (ESP) on newly-installed systems. Per hier(7), the ESP will be mounted at /boot/efi. On UFS systems, any existing ESP will be reused and mounted there; otherwise, a new one will be made. On ZFS systems, space for an ESP is allocated on all disks in the root pool, but only the partition actually used to boot is set up and mounted. This makes future upgrades of the EFI loader easier (upgrade scripts can just change /boot/efi) and also greatly simplifies the parts of the installer involved in initialization of the ESP. It also makes the installer's behavior correspond to the documentation in hier(7). Reviewed by: imp, tsoome MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28897 --- usr.sbin/bsdinstall/partedit/gpart_ops.c | 12 +-- usr.sbin/bsdinstall/partedit/partedit_efi.c | 1 + usr.sbin/bsdinstall/partedit/partedit_x86.c | 4 +- usr.sbin/bsdinstall/scripts/bootconfig | 150 +++++----------------------- usr.sbin/bsdinstall/scripts/zfsboot | 19 +++- 5 files changed, 48 insertions(+), 138 deletions(-) diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c index e68a02b4264c..b49ff1c9fd42 100644 --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c @@ -707,18 +707,8 @@ set_default_part_metadata(const char *name, const char *scheme, if (strcmp(type, "freebsd-swap") == 0) mountpoint = "none"; if (strcmp(type, bootpart_type(scheme, &default_bootmount)) == 0) { - if (default_bootmount == NULL) { - - int fd = openat(tmpdfd, "bsdinstall-esps", - O_CREAT | O_WRONLY | O_APPEND, 0600); - if (fd > 0) { - write(fd, md->name, strlen(md->name)); - write(fd, "\n", 1); - close(fd); - } - + if (default_bootmount == NULL) md->bootcode = 1; - } else if (mountpoint == NULL || strlen(mountpoint) == 0) mountpoint = default_bootmount; } diff --git a/usr.sbin/bsdinstall/partedit/partedit_efi.c b/usr.sbin/bsdinstall/partedit/partedit_efi.c index 85b3b15d1853..074475e07152 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_efi.c +++ b/usr.sbin/bsdinstall/partedit/partedit_efi.c @@ -85,6 +85,7 @@ bootpart_type(const char *scheme, const char **mountpoint) { /* Only EFI is supported as boot partition */ + *mountpoint = "/boot/efi"; return ("efi"); } diff --git a/usr.sbin/bsdinstall/partedit/partedit_x86.c b/usr.sbin/bsdinstall/partedit/partedit_x86.c index e81adcad5f6b..6983188ba34f 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_x86.c +++ b/usr.sbin/bsdinstall/partedit/partedit_x86.c @@ -113,8 +113,10 @@ const char * bootpart_type(const char *scheme, const char **mountpoint) { - if (strcmp(x86_bootmethod(), "UEFI") == 0) + if (strcmp(x86_bootmethod(), "UEFI") == 0) { + *mountpoint = "/boot/efi"; return ("efi"); + } return ("freebsd-boot"); } diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index f07fb3065c23..088d88ca9b2f 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -46,84 +46,8 @@ if [ `uname -m` == powerpc ]; then fi fi -# Update the ESP (EFI System Partition) with the new bootloader -if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "i386" ]; then - X86_BOOTMETHOD=$(sysctl -n machdep.bootmethod) -fi - -if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "riscv" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then - UFSBOOT_ESPS=$(cat $TMPDIR/bsdinstall-esps 2>/dev/null) - ZFSBOOT_DISKS=$(cat $TMPDIR/bsdinstall-zfsboot 2>/dev/null) - num_esps=0 - - if [ -n "$ZFSBOOT_DISKS" ]; then - # We're in a ZFS install environment - for disk in $ZFSBOOT_DISKS; do - index=$(gpart show "$disk" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) - # Check that $index is an integer - [ -n "$index" ] && [ "$index" -eq "$index" ] && [ "$index" -ge 0 ] 2> /dev/null - if [ $? -ne 0 ]; then - continue - fi - - if [ -e "/dev/${disk}p${index}" ]; then - ESPS="$ESPS ${disk}p${index}" - elif [ -e "/dev/${disk}s${index}" ]; then - ESPS="$ESPS ${disk}s${index}" - else - continue - fi - - num_esps=$((num_esps + 1)) - done - fi - - if [ -n "$UFSBOOT_ESPS" ]; then - # We're in a UFS install environment - for partition in $UFSBOOT_ESPS; do - ESPS="$ESPS $partition" - num_esps=$((num_esps + 1)) - done - fi - - if [ -z "$ESPS" ]; then - # The installer hasn't given us any ESPs to use. - # Try and figure out which to use by looking for an - # unformatted efi partition - - for geom in $(gpart status -sg | awk '{print $1}'); do - hasfreebsd=$(gpart show "${geom}" | cut -w -f 4,5 | grep "freebsd") - if [ -n "$hasfreebsd" ]; then - index=$(gpart show "${geom}" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) - # Check that $index is a valid integer - [ -n "$index" ] && [ "$index" -eq "$index" ] && [ "$index" -ge 0 ] 2> /dev/null - if [ $? -ne 0 ]; then - continue - fi - - mntpt=$(mktemp -d $TMPDIR/stand-test.XXXXXX) - if [ -e "/dev/${geom}p${index}" ]; then - dev=${geom}p${index} - elif [ -e "/dev/${geom}s${index}" ]; then - dev=/${geom}s${index} - else - continue - fi - - # Try and mount it. If it fails, assume it's - # unformatted and should be used. - mount -t msdosfs -o ro "/dev/${dev}" "${mntpt}" - if [ $? -ne 0 ]; then - ESPS="$ESPS ${dev}" - num_esps=$((num_esps + 1)) - else - umount "${mntpt}" - fi - rmdir "${mntpt}" - fi - done - fi - +# Update the ESP (EFI System Partition) with the new bootloader if we have an ESP +if [ -d "$BSDINSTALL_CHROOT/boot/efi" ]; then case $(uname -m) in arm64) ARCHBOOTNAME=aa64 ;; amd64) ARCHBOOTNAME=x64 ;; @@ -136,55 +60,33 @@ if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "riscv" ] || [ "$X86_BOOTMET BOOTNAME="${BOOTDIR}/boot${ARCHBOOTNAME}.efi" FREEBSD_BOOTDIR="/efi/freebsd" FREEBSD_BOOTNAME="${FREEBSD_BOOTDIR}/loader.efi" + mntpt="$BSDINSTALL_CHROOT/boot/efi" + + f_dprintf "Installing loader.efi onto ESP" + mkdir -p "${mntpt}/${FREEBSD_BOOTDIR}" "${mntpt}/${BOOTDIR}" + cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${FREEBSD_BOOTNAME}" + + # + # The following shouldn't be necessary. UEFI defines a way to + # specifically select what to boot (which we do via + # efibootmgr). However, virtual environments often times lack + # support for the NV variables efibootmgr sets. In addition, + # some UEFI implementations have features that interfere with + # the setting of these variables. To combat that, we install the + # default removable media boot file as a fallback if it doesn't + # exist. We don't install it all the time since that can + # interfere with other installations on the drive (like rEFInd). + # + if [ ! -f "${mntpt}/${BOOTNAME}" ]; then + cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${BOOTNAME}" + fi - for esp in $ESPS; do - f_dprintf "Formatting /dev/${esp} as FAT32" - newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - die "Failed to format ESP $esp as FAT32" - fi - - mntpt=$(mktemp -d $TMPDIR/stand-test.XXXXXX) - f_dprintf "Mounting ESP /dev/${esp}" - mount -t msdosfs "/dev/${esp}" "${mntpt}" - if [ $? -ne 0 ]; then - die "Failed to mount ESP ${dev} on ${mntpt}" - fi - - f_dprintf "Installing loader.efi onto ESP" - mkdir -p "${mntpt}/${FREEBSD_BOOTDIR}" "${mntpt}/${BOOTDIR}" - cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${FREEBSD_BOOTNAME}" - - # - # The following shouldn't be necessary. UEFI defines a way to - # specifically select what to boot (which we do via - # efibootmgr). However, virtual environments often times lack - # support for the NV variables efibootmgr sets. In addition, - # some UEFI implementations have features that interfere with - # the setting of these variables. To combat that, we install the - # default removable media boot file as a fallback if it doesn't - # exist. We don't install it all the time since that can - # interfere with other installations on the drive (like rEFInd). - # - if [ ! -f "${mntpt}/${BOOTNAME}" ]; then - cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${BOOTNAME}" - fi - - if [ "$num_esps" -gt 1 ]; then - bootlabel="FreeBSD (${esp})" - else - bootlabel="FreeBSD" - fi - - f_dprintf "Creating UEFI boot entry" - efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null + bootlabel="FreeBSD" - f_dprintf "Unmounting ESP" - umount "${mntpt}" - rmdir "${mntpt}" + f_dprintf "Creating UEFI boot entry" + efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null - f_dprintf "Finished configuring /dev/${esp} as ESP" - done + f_dprintf "Finished configuring ESP" fi # Add boot0cfg for MBR BIOS booting? diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 33cec0ef9ae9..3b673addb10a 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -213,6 +213,7 @@ KLDLOAD='kldload %s' LN_SF='ln -sf "%s" "%s"' MKDIR_P='mkdir -p "%s"' MOUNT_TYPE='mount -t %s "%s" "%s"' +NEWFS_ESP='newfs_msdos "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' @@ -845,12 +846,25 @@ zfs_create_diskpart() if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o \ "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ] then - f_eval_catch $funcname gpart \ + f_eval_catch -k justaddedpart $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ - "$align_small" efiboot$index efi 200M \ + "$align_small" efiboot$index efi 260M \ $disk || return $FAILURE # We'll configure the ESP in bootconfig + if [ -z "$efibootpart" ]; then + efibootpart="/dev/$(echo $justaddedpart | cut -f 1 -d ' ')" + f_dprintf "$funcname: configuring ESP at [%s]" \ + "${efibootpart}" + + f_eval_catch $funcname newfs_msdos "$NEWFS_ESP"\ + "$efibootpart" \ + || return $FAILURE + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + $efibootpart /boot/efi msdosfs \ + rw 2 2 "$BSDINSTALL_TMPETC/fstab" \ + || return $FAILURE + fi fi if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o \ @@ -1066,6 +1080,7 @@ zfs_create_boot() local isswapmirror local bootpart targetpart swappart # Set by zfs_create_diskpart() below local create_options + local efibootpart # # Pedantic checks; should never be seen From owner-dev-commits-src-all@freebsd.org Tue Feb 23 21:24: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 35CC355384D; Tue, 23 Feb 2021 21:24: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 4DlXBf15n7z4fYJ; Tue, 23 Feb 2021 21:24: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 18AD620B8E; Tue, 23 Feb 2021 21:24: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 11NLOvIW012552; Tue, 23 Feb 2021 21:24:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NLOvtr012551; Tue, 23 Feb 2021 21:24:57 GMT (envelope-from git) Date: Tue, 23 Feb 2021 21:24:57 GMT Message-Id: <202102232124.11NLOvtr012551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: d2589dc3d56c - main - ipmi_smbios: remove unused smbios_cksum function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2589dc3d56ce063b28b54df11c950c3758d9578 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 21:24:58 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=d2589dc3d56ce063b28b54df11c950c3758d9578 commit d2589dc3d56ce063b28b54df11c950c3758d9578 Author: Allan Jude AuthorDate: 2021-02-23 21:24:12 +0000 Commit: Allan Jude CommitDate: 2021-02-23 21:24:47 +0000 ipmi_smbios: remove unused smbios_cksum function Sponsored By: Ampere Computing LLC Submitted By: Klara Inc. Differential Revision: https://reviews.freebsd.org/D28751 --- sys/dev/ipmi/ipmi_smbios.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index 735f404eec5f..f7bc50d5173e 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -87,7 +87,6 @@ static struct mtx ipmi_info_mtx; MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF); static void ipmi_smbios_probe(struct ipmi_get_info *); -static int smbios_cksum(struct smbios_eps *); static void smbios_walk_table(uint8_t *, vm_size_t, smbios_callback_t, void *); static void smbios_ipmi_info(struct smbios_structure_header *, void *); @@ -237,19 +236,3 @@ ipmi_smbios_identify(struct ipmi_get_info *info) return (info->iface_type != 0); } - -static int -smbios_cksum(struct smbios_eps *e) -{ - u_int8_t *ptr; - u_int8_t cksum; - int i; - - ptr = (u_int8_t *)e; - cksum = 0; - for (i = 0; i < e->length; i++) { - cksum += ptr[i]; - } - - return (cksum); -} From owner-dev-commits-src-all@freebsd.org Tue Feb 23 21:26: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 2F79A553957; Tue, 23 Feb 2021 21:26: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 4DlXDg0sVLz4fyf; Tue, 23 Feb 2021 21:26: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 0FFCA20833; Tue, 23 Feb 2021 21:26: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 11NLQg4C012933; Tue, 23 Feb 2021 21:26:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NLQgnO012932; Tue, 23 Feb 2021 21:26:42 GMT (envelope-from git) Date: Tue, 23 Feb 2021 21:26:42 GMT Message-Id: <202102232126.11NLQgnO012932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: 408edcca0746 - main - rc.conf(5): Add note about parallel startup variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 408edcca0746d15303e0b47bbf31a6d4aa721363 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 21:26:43 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=408edcca0746d15303e0b47bbf31a6d4aa721363 commit 408edcca0746d15303e0b47bbf31a6d4aa721363 Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-23 21:25:44 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-23 21:26:31 +0000 rc.conf(5): Add note about parallel startup variable The commit below added parallel service startup, and it needs to be documented, so people know about it. PR: 249192 MFC with: 77e1ccbee3ed Reviewed by: yuripv Differential Revision: https://reviews.freebsd.org/D28898 --- share/man/man5/rc.conf.5 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 473406660b8b..fef0f167d1a5 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 10, 2021 +.Dd February 23, 2021 .Dt RC.CONF 5 .Os .Sh NAME @@ -140,6 +140,14 @@ If set to show .Dq Starting foo: when faststart is used (e.g., at boot time). +.It Va rc_parallel_start +.Pq Vt bool +If set to +.Dq Li YES , +enable parallel startup of services. +Care should be taken to ensure that no loops occur, by using +.Nm rcorder +.Fl p . .It Va early_late_divider .Pq Vt str The name of the script that should be used as the @@ -4670,6 +4678,7 @@ it will be made permanently active. .Xr quotaon 8 , .Xr rc 8 , .Xr rc.sendmail 8 , +.Xr rcorder 8 , .Xr rfcomm_pppd 8 , .Xr route 8 , .Xr routed 8 , From owner-dev-commits-src-all@freebsd.org Tue Feb 23 21:59: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 3F3B9554C1C for ; Tue, 23 Feb 2021 21:59:58 +0000 (UTC) (envelope-from 01000177d0e7f048-815d1dbe-542c-4c9d-bc2c-0bd239f5defb-000000@amazonses.com) Received: from a8-60.smtp-out.amazonses.com (a8-60.smtp-out.amazonses.com [54.240.8.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlXz21Dmqz4jGr for ; Tue, 23 Feb 2021 21:59:58 +0000 (UTC) (envelope-from 01000177d0e7f048-815d1dbe-542c-4c9d-bc2c-0bd239f5defb-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1614117597; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=HFSeP4OTjDLH8jFuswbLsbPbmTgEpGEFIqwwA3T6iDo=; b=VZHLL5HyG61oKjJJ3BeWaMHd/tFNkj4Y86ETYMhQBuZPNfrFvyQt9U77qQm8P4A4 9+KYrvuCJ5rjxzn6zWPqdCOsMx0zJ67dGEznUgtdwt1ZBpIiwp/GmZZu49vUoE4DL9d 6BYJYFFRi97Ev1gv1cIIVQ9TGuyowB+RR53MMU8I= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1614117597; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=HFSeP4OTjDLH8jFuswbLsbPbmTgEpGEFIqwwA3T6iDo=; b=Xe8tHaq0mF48WFjYV0aWqJXtKb7Y67elhjlPmQS7cEj4zNpF/ftM+fMd4tfIhJYG uox7ErEbk+oMVOVihjFo2Rgc37YWBgJl8KyTfu06MdPuY8h2Q9mp0c5fiREayJ8pAV4 FmThGq/piiI/wUsuYzmIn6LX1bMi1nC+wQ03K3ck= Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Nathan Whitehorn , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> From: Colin Percival Message-ID: <01000177d0e7f048-815d1dbe-542c-4c9d-bc2c-0bd239f5defb-000000@email.amazonses.com> Date: Tue, 23 Feb 2021 21:59:57 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <202102232124.11NLOT27012354@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2021.02.23-54.240.8.60 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 4DlXz21Dmqz4jGr 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, 23 Feb 2021 21:59:58 -0000 On 2/23/21 1:24 PM, Nathan Whitehorn wrote: > Mount the EFI system partition (ESP) on newly-installed systems. Should we do this in VM/cloudware images too? -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:02: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 3925A5549DC; Tue, 23 Feb 2021 22:02:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlY1r1DJyz4jLq; Tue, 23 Feb 2021 22:02:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:e908:86d2:b976:1c3e]) (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 E6B781FDE; Tue, 23 Feb 2021 22:02:23 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Colin Percival , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> From: Nathan Whitehorn Message-ID: Date: Tue, 23 Feb 2021 17:02:22 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> 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, 23 Feb 2021 22:02:24 -0000 On 2/23/21 4:59 PM, Colin Percival wrote: > On 2/23/21 1:24 PM, Nathan Whitehorn wrote: >> Mount the EFI system partition (ESP) on newly-installed systems. > Should we do this in VM/cloudware images too? > That's a good point. I think so, though I don't have the time or test setup to make that change. -Nathan From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:03: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 E0258554E6A; Tue, 23 Feb 2021 22:03:43 +0000 (UTC) (envelope-from crees@bayofrum.net) Received: from mail263c50.megamailservers.eu (mail1421c50.megamailservers.eu [91.136.14.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlY3M2xWfz4jpJ; Tue, 23 Feb 2021 22:03:43 +0000 (UTC) (envelope-from crees@bayofrum.net) X-Authenticated-User: crees@uwclub.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1614117820; bh=jK8ISz6uZowfcCq8ooktI6ZPH0YAS6pZXxHp9CfnfkA=; h=Date:In-Reply-To:References:Subject:To:From:From; b=aICUXcczsz4+YIMfhmjTnE1mJVTtjHW1+/KiYr4KyNPNL4KFScdpHPVImQ59zhmf0 XNUBXm0YObC64hS0Tmuwpd+85cml/1x/Twk4zN4InfG7cY7a/7PR1xpYyNiS//8F0m KRG4rSPWOHu1nzuW3AoK8NHKxJSQgxzsSPfQwQ3I= Feedback-ID: crees@bayofrum. Received: from pegasus.bayofrum.net (81-178-238-223.dsl.pipex.com [81.178.238.223]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 11NM3cG7008769; Tue, 23 Feb 2021 22:03:40 +0000 X-Spam-Status: No X-bayofrum-MailScanner-From: crees@bayofrum.net X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-ID: 64748915C.A4293 X-bayofrum-MailScanner-Information: Please contact the ISP for more information Received: from [192.168.1.120] (unknown [192.168.1.120]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id 64748915C; Tue, 23 Feb 2021 22:03:35 +0000 (GMT) Date: Tue, 23 Feb 2021 22:03:35 +0000 User-Agent: K-9 Mail for Android In-Reply-To: <202102231027.11NARYYE041280@gitrepo.freebsd.org> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot To: dev-commits-src-all@freebsd.org, Baptiste Daroussin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chris Rees Message-ID: <6D4FCE07-B996-430C-8EA8-6CB37A6DEEE8@bayofrum.net> X-CTCH-RefID: str=0001.0A742F23.60357BBC.0062, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=fdHTNHYF c=1 sm=1 tr=0 a=VPjlEbx5XC2baNimRf67MQ==:117 a=VPjlEbx5XC2baNimRf67MQ==:17 a=IkcTkHD0fZMA:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=IfVgSExIhUPS_bJByyIA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 X-Origin-Country: GB X-Rspamd-Queue-Id: 4DlY3M2xWfz4jpJ 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, 23 Feb 2021 22:03:43 -0000 Hi, On 23 February 2021 10:27:34 GMT, Baptiste Daroussin = wrote: >The branch main has been updated by bapt: > >URL: >https://cgit=2EFreeBSD=2Eorg/src/commit/?id=3D77e1ccbee3ed6c837929e4e232f= d07f95bfc8294 > >commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 >Author: Rick Parrish >AuthorDate: 2021-02-07 06:15:21 +0000 >Commit: Baptiste Daroussin >CommitDate: 2021-02-23 10:16:53 +0000 > > rc: implement parallel boot > =20 > take advantage of the rcorder -p argument to implement parallel > booting in rc=2E > =20 > According to the author non scientific tests: > on a Core 2 Duo with spinning disk: > =20 > | Services enabled | before | after | saving | > | 0 | 8s | 8s | 0 | > | 1 | 13s | 13s | 0 | > | 2 | 17s | 13s | 5 | > | 3 | 23s | 13s | 10 | > | 4 | 28s | 13s | 15 | > | 5 | 33s | 13s | 20 | > =20 > PR: 249192 > MFC after: 3 weeks >--- > libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > 1 file changed, 34 insertions(+), 15 deletions(-) > >diff --git a/libexec/rc/rc b/libexec/rc/rc >index 35db4a850516=2E=2E722d7fe35884 100644 >--- a/libexec/rc/rc >+++ b/libexec/rc/rc >@@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > skip_firstboot=3D"-s firstboot" > fi >=20 >+# rc_parallel_start default is "NO" >+rc_parallel_start=3D${rc_parallel_start:-NO} Should this go in defaults/rc=2Econf? Chris From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:24: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 953C95555EE; Tue, 23 Feb 2021 22:24: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 4DlYWl3r0zz4kk5; Tue, 23 Feb 2021 22:24: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 76A76217E1; Tue, 23 Feb 2021 22:24: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 11NMOp6D091224; Tue, 23 Feb 2021 22:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NMOpFu091223; Tue, 23 Feb 2021 22:24:51 GMT (envelope-from git) Date: Tue, 23 Feb 2021 22:24:51 GMT Message-Id: <202102232224.11NMOpFu091223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: bbacb7ce7295 - main - ig4: Add PCI IDs for Intel Gemini Lake I2C controller. 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/main X-Git-Reftype: branch X-Git-Commit: bbacb7ce72956a41c0daeefe875e5209d87c11ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 22:24:51 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=bbacb7ce72956a41c0daeefe875e5209d87c11ba commit bbacb7ce72956a41c0daeefe875e5209d87c11ba Author: Vladimir Kondratyev AuthorDate: 2021-02-23 22:20:36 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-23 22:23:43 +0000 ig4: Add PCI IDs for Intel Gemini Lake I2C controller. Submitted by: Dmitry Luhtionov MFC after: 2 weeks --- sys/dev/ichiic/ig4_iic.c | 6 ++++++ sys/dev/ichiic/ig4_pci.c | 16 ++++++++++++++++ sys/dev/ichiic/ig4_var.h | 3 ++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c index 4781154f03c8..12a103fc20d5 100644 --- a/sys/dev/ichiic/ig4_iic.c +++ b/sys/dev/ichiic/ig4_iic.c @@ -125,6 +125,12 @@ static const struct ig4_hw ig4iic_hw[] = { .scl_fall_time = 208, .sda_hold_time = 42, }, + [IG4_GEMINILAKE] = { + .ic_clock_rate = 133, + .sda_fall_time = 171, + .scl_fall_time = 290, + .sda_hold_time = 313, + }, }; static int ig4iic_set_config(ig4iic_softc_t *sc, bool reset); diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c index 4667709e2fa2..2d80a8b1800a 100644 --- a/sys/dev/ichiic/ig4_pci.c +++ b/sys/dev/ichiic/ig4_pci.c @@ -136,6 +136,14 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_TIGERLAKE_LP_I2C_5 0xa0e98086 #define PCI_CHIP_TIGERLAKE_LP_I2C_6 0xa0ea8086 #define PCI_CHIP_TIGERLAKE_LP_I2C_7 0xa0eb8086 +#define PCI_CHIP_GEMINILAKE_I2C_0 0x31ac8086 +#define PCI_CHIP_GEMINILAKE_I2C_1 0x31ae8086 +#define PCI_CHIP_GEMINILAKE_I2C_2 0x31b08086 +#define PCI_CHIP_GEMINILAKE_I2C_3 0x31b28086 +#define PCI_CHIP_GEMINILAKE_I2C_4 0x31b48086 +#define PCI_CHIP_GEMINILAKE_I2C_5 0x31b68086 +#define PCI_CHIP_GEMINILAKE_I2C_6 0x31b88086 +#define PCI_CHIP_GEMINILAKE_I2C_7 0x31ba8086 struct ig4iic_pci_device { uint32_t devid; @@ -214,6 +222,14 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { { PCI_CHIP_TIGERLAKE_LP_I2C_5, "Intel Tiger Lake-LP I2C Controller-5", IG4_SKYLAKE}, { PCI_CHIP_TIGERLAKE_LP_I2C_6, "Intel Tiger Lake-LP I2C Controller-6", IG4_SKYLAKE}, { PCI_CHIP_TIGERLAKE_LP_I2C_7, "Intel Tiger Lake-LP I2C Controller-7", IG4_SKYLAKE}, + { PCI_CHIP_GEMINILAKE_I2C_0, "Intel Gemini Lake I2C Controller-0", IG4_GEMINILAKE}, + { PCI_CHIP_GEMINILAKE_I2C_1, "Intel Gemini Lake I2C Controller-1", IG4_GEMINILAKE}, + { PCI_CHIP_GEMINILAKE_I2C_2, "Intel Gemini Lake I2C Controller-2", IG4_GEMINILAKE}, + { PCI_CHIP_GEMINILAKE_I2C_3, "Intel Gemini Lake I2C Controller-3", IG4_GEMINILAKE}, + { PCI_CHIP_GEMINILAKE_I2C_4, "Intel Gemini Lake I2C Controller-4", IG4_GEMINILAKE}, + { PCI_CHIP_GEMINILAKE_I2C_5, "Intel Gemini Lake I2C Controller-5", IG4_GEMINILAKE}, + { PCI_CHIP_GEMINILAKE_I2C_6, "Intel Gemini Lake I2C Controller-6", IG4_GEMINILAKE}, + { PCI_CHIP_GEMINILAKE_I2C_7, "Intel Gemini Lake I2C Controller-7", IG4_GEMINILAKE}, }; static int diff --git a/sys/dev/ichiic/ig4_var.h b/sys/dev/ichiic/ig4_var.h index 7a94e4f5cffd..da81980039f1 100644 --- a/sys/dev/ichiic/ig4_var.h +++ b/sys/dev/ichiic/ig4_var.h @@ -49,7 +49,8 @@ enum ig4_vers { IG4_SKYLAKE, IG4_APL, IG4_CANNONLAKE, - IG4_TIGERLAKE + IG4_TIGERLAKE, + IG4_GEMINILAKE }; /* Controller has additional registers */ From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:39: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 EC600555A83 for ; Tue, 23 Feb 2021 22:39:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 4DlYrS69KXz4lXy for ; Tue, 23 Feb 2021 22:39:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id l25so95321qtr.3 for ; Tue, 23 Feb 2021 14:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PS9c5VNnt3RCV+qZp3iku5LVDdgoep5VosthyidhE9o=; b=dB5pgyWNiXQ9QOp1ygKpz8vHjsdqKUugV/SN7QfPigUAuG1xUzAwTpeu6p5Ajk18Ru b9ES+Pmv3wBQtD4wIW0dRKv/d8fvznAbUx26oHoy924dQQMilphZhcAgd+2yp5ItdBhl O9FIZ9Dfd0Hir2NwXUHkMbS1VYK4czppqqKZ0YTxxpQOzAI6ncqv+1DSePzJ2Zv70vxv kKxCwppAoyJHPXF44n8cWjtC+61jDl8Cv7beaTyeCQU6d4TBtDiYQszF0r+u1ZLor5AM RFQYiTGij0+p+zCv+9ou2Xiv/PtOdwK86K7W66Wq0vxLIfMyLTTjjjno/59plKBsp32k 0IPQ== 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=PS9c5VNnt3RCV+qZp3iku5LVDdgoep5VosthyidhE9o=; b=VotE714lN/bX2+8Phrc6coZRiwzZmWb5r4TweuepZAnSB8HPS881LVTsY7KzLFh9fW tkqhFCdHdaCvErqcDy6K4SDg2NF663SCguZEtI5LmszwE+DDrD3gLNq3K6wtoSNiRfi4 1dtYnNP4RPWdDvlcwwzVQ+hYXNVZKSIMMs9FHwGk4jusXvgcZV8BMJ68N2muGQV0L63K b+5T9VamwJfl+yBOs+VpS/J0PdUuJdlpMQXKg7gKS3UD4rY5r2TIHKtJy18dfUM1KOy4 njGf8bL12uCDO39OSW8KP4paDZ0BbxTiKU6G9heFaLAB9mbzBb959YdctODYZqlY8R7k fdcg== X-Gm-Message-State: AOAM532T18EVV0VFYDJLdMYZTxjCi3HCHnJq3o4PoBUSWkqknIOUuNmi W/VjXwl0eXGe/4Nev2AqlXuDXdJaTFefrqrzAUEDfzpMcUExeA== X-Google-Smtp-Source: ABdhPJzWvawL1aeEOav4+EwYcRieBAtoT7SYq82MwpD7ZSGKMNXVCdGoF70Jq/4p87mHF2yeu4qKlA8nXl+eXVXITW4= X-Received: by 2002:ac8:5154:: with SMTP id h20mr3818257qtn.73.1614119959668; Tue, 23 Feb 2021 14:39:19 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> In-Reply-To: From: Warner Losh Date: Tue, 23 Feb 2021 15:39:08 -0700 Message-ID: Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Nathan Whitehorn Cc: Colin Percival , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DlYrS69KXz4lXy 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, 23 Feb 2021 22:39:21 -0000 On Tue, Feb 23, 2021 at 3:02 PM Nathan Whitehorn wrote: > > > On 2/23/21 4:59 PM, Colin Percival wrote: > > On 2/23/21 1:24 PM, Nathan Whitehorn wrote: > >> Mount the EFI system partition (ESP) on newly-installed systems. > > Should we do this in VM/cloudware images too? > > > > That's a good point. I think so, though I don't have the time or test > setup to make that change. > It would be best if we could do it. Warner From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22: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 2E37E555B8D; Tue, 23 Feb 2021 22: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 4DlYt10p0Rz4lZG; Tue, 23 Feb 2021 22: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 0DA81216E3; Tue, 23 Feb 2021 22: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 11NMeenZ013098; Tue, 23 Feb 2021 22:40:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NMee1T013097; Tue, 23 Feb 2021 22:40:40 GMT (envelope-from git) Date: Tue, 23 Feb 2021 22:40:40 GMT Message-Id: <202102232240.11NMee1T013097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 9c4a8d24f0ff - main - Fix nd6 rib_action() handling. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c4a8d24f0ffd5243fa5c6fe27178f669f16d1f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 22:40:41 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=9c4a8d24f0ffd5243fa5c6fe27178f669f16d1f5 commit 9c4a8d24f0ffd5243fa5c6fe27178f669f16d1f5 Author: Alexander V. Chernikov AuthorDate: 2021-02-23 22:31:07 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-23 22:40:01 +0000 Fix nd6 rib_action() handling. rib_action() guarantees valid rc filling IFF it returns without error. Check rib_action() return code instead of checking rc fields. PR: 253800 Reported by: Frederic Denis MFC after: immediately --- sys/netinet6/nd6_rtr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index eca704dc2843..51b831a956bc 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -698,12 +698,11 @@ defrouter_addreq(struct nd_defrouter *new) NET_EPOCH_ASSERT(); error = rib_action(fibnum, RTM_ADD, &info, &rc); - if (rc.rc_rt != NULL) { + if (error == 0) { struct nhop_object *nh = nhop_select(rc.rc_nh_new, 0); rt_routemsg(RTM_ADD, rc.rc_rt, nh, fibnum); - } - if (error == 0) new->installed = 1; + } } /* @@ -719,6 +718,7 @@ defrouter_delreq(struct nd_defrouter *dr) struct rib_cmd_info rc; struct epoch_tracker et; unsigned int fibnum; + int error; bzero(&def, sizeof(def)); bzero(&mask, sizeof(mask)); @@ -737,8 +737,8 @@ defrouter_delreq(struct nd_defrouter *dr) info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; NET_EPOCH_ENTER(et); - rib_action(fibnum, RTM_DELETE, &info, &rc); - if (rc.rc_rt != NULL) { + error = rib_action(fibnum, RTM_DELETE, &info, &rc); + if (error == 0) { struct nhop_object *nh = nhop_select(rc.rc_nh_old, 0); rt_routemsg(RTM_DELETE, rc.rc_rt, nh, fibnum); } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:44: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 7895755673A; Tue, 23 Feb 2021 22:44: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 4DlYxt1X9kz4mjG; Tue, 23 Feb 2021 22:44: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 2363F219BC; Tue, 23 Feb 2021 22:44: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 11NMi2Xv017735; Tue, 23 Feb 2021 22:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NMi2Pa017734; Tue, 23 Feb 2021 22:44:02 GMT (envelope-from git) Date: Tue, 23 Feb 2021 22:44:02 GMT Message-Id: <202102232244.11NMi2Pa017734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: ea10694336b9 - stable/13 - Fix nd6 rib_action() handling. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea10694336b9a07d58d22187052291976f4906b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 22:44:02 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=ea10694336b9a07d58d22187052291976f4906b2 commit ea10694336b9a07d58d22187052291976f4906b2 Author: Alexander V. Chernikov AuthorDate: 2021-02-23 22:31:07 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-23 22:42:28 +0000 Fix nd6 rib_action() handling. rib_action() guarantees valid rc filling IFF it returns without error. Check rib_action() return code instead of checking rc fields. PR: 253800 Reported by: Frederic Denis (cherry picked from commit 9c4a8d24f0ffd5243fa5c6fe27178f669f16d1f5) --- sys/netinet6/nd6_rtr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index eca704dc2843..51b831a956bc 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -698,12 +698,11 @@ defrouter_addreq(struct nd_defrouter *new) NET_EPOCH_ASSERT(); error = rib_action(fibnum, RTM_ADD, &info, &rc); - if (rc.rc_rt != NULL) { + if (error == 0) { struct nhop_object *nh = nhop_select(rc.rc_nh_new, 0); rt_routemsg(RTM_ADD, rc.rc_rt, nh, fibnum); - } - if (error == 0) new->installed = 1; + } } /* @@ -719,6 +718,7 @@ defrouter_delreq(struct nd_defrouter *dr) struct rib_cmd_info rc; struct epoch_tracker et; unsigned int fibnum; + int error; bzero(&def, sizeof(def)); bzero(&mask, sizeof(mask)); @@ -737,8 +737,8 @@ defrouter_delreq(struct nd_defrouter *dr) info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; NET_EPOCH_ENTER(et); - rib_action(fibnum, RTM_DELETE, &info, &rc); - if (rc.rc_rt != NULL) { + error = rib_action(fibnum, RTM_DELETE, &info, &rc); + if (error == 0) { struct nhop_object *nh = nhop_select(rc.rc_nh_old, 0); rt_routemsg(RTM_DELETE, rc.rc_rt, nh, fibnum); } From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:49: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 E0C1C556C66; Tue, 23 Feb 2021 22:49: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 4DlZ4961N7z4mbh; Tue, 23 Feb 2021 22:49: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 BD42021B1B; Tue, 23 Feb 2021 22:49: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 11NMnTKD018711; Tue, 23 Feb 2021 22:49:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NMnTal018710; Tue, 23 Feb 2021 22:49:29 GMT (envelope-from git) Date: Tue, 23 Feb 2021 22:49:29 GMT Message-Id: <202102232249.11NMnTal018710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: 4a5dfded17ef - main - Revert "ipmi_smbios: remove unused smbios_cksum function" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a5dfded17efb48fd04bcc8d69b70597b8cea808 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 22:49:29 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=4a5dfded17efb48fd04bcc8d69b70597b8cea808 commit 4a5dfded17efb48fd04bcc8d69b70597b8cea808 Author: Allan Jude AuthorDate: 2021-02-23 22:48:37 +0000 Commit: Allan Jude CommitDate: 2021-02-23 22:48:59 +0000 Revert "ipmi_smbios: remove unused smbios_cksum function" This reverts commit d2589dc3d56ce063b28b54df11c950c3758d9578. --- sys/dev/ipmi/ipmi_smbios.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index f7bc50d5173e..735f404eec5f 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -87,6 +87,7 @@ static struct mtx ipmi_info_mtx; MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF); static void ipmi_smbios_probe(struct ipmi_get_info *); +static int smbios_cksum(struct smbios_eps *); static void smbios_walk_table(uint8_t *, vm_size_t, smbios_callback_t, void *); static void smbios_ipmi_info(struct smbios_structure_header *, void *); @@ -236,3 +237,19 @@ ipmi_smbios_identify(struct ipmi_get_info *info) return (info->iface_type != 0); } + +static int +smbios_cksum(struct smbios_eps *e) +{ + u_int8_t *ptr; + u_int8_t cksum; + int i; + + ptr = (u_int8_t *)e; + cksum = 0; + for (i = 0; i < e->length; i++) { + cksum += ptr[i]; + } + + return (cksum); +} From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:49: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 E7CF955718F; Tue, 23 Feb 2021 22:49: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 4DlZ4B6GwWz4mvc; Tue, 23 Feb 2021 22:49: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 CA61A21C93; Tue, 23 Feb 2021 22:49: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 11NMnUvm018734; Tue, 23 Feb 2021 22:49:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NMnUSw018733; Tue, 23 Feb 2021 22:49:30 GMT (envelope-from git) Date: Tue, 23 Feb 2021 22:49:30 GMT Message-Id: <202102232249.11NMnUSw018733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: 6d67af5f8e66 - main - Revert "ipmi_smbios: Deduplicate smbios entry point discovery logic" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d67af5f8e66218ab0b3d927837fe00903c2feac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 22:49:31 -0000 The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=6d67af5f8e66218ab0b3d927837fe00903c2feac commit 6d67af5f8e66218ab0b3d927837fe00903c2feac Author: Allan Jude AuthorDate: 2021-02-23 22:48:42 +0000 Commit: Allan Jude CommitDate: 2021-02-23 22:49:13 +0000 Revert "ipmi_smbios: Deduplicate smbios entry point discovery logic" This depends on another commit that has not landed yet, and broke the build This reverts commit ba6e37e47f41484fc61cc034619267b82ddd056c. --- sys/dev/ipmi/ipmi_isa.c | 1 - sys/dev/ipmi/ipmi_pci.c | 1 - sys/dev/ipmi/ipmi_smbios.c | 46 ++++++++++++++++++++++++++++++---------------- sys/dev/ipmi/ipmi_smbus.c | 1 - sys/dev/smbios/smbios.c | 21 --------------------- sys/dev/smbios/smbios.h | 2 -- 6 files changed, 30 insertions(+), 42 deletions(-) diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c index 2831b53e4586..cdff305b07ec 100644 --- a/sys/dev/ipmi/ipmi_isa.c +++ b/sys/dev/ipmi/ipmi_isa.c @@ -286,4 +286,3 @@ static driver_t ipmi_isa_driver = { }; DRIVER_MODULE(ipmi_isa, isa, ipmi_isa_driver, ipmi_devclass, 0, 0); -MODULE_DEPEND(ipmi_isa, smbios, 1, 1, 1); diff --git a/sys/dev/ipmi/ipmi_pci.c b/sys/dev/ipmi/ipmi_pci.c index 1697a4c31c2a..d4598f9db873 100644 --- a/sys/dev/ipmi/ipmi_pci.c +++ b/sys/dev/ipmi/ipmi_pci.c @@ -179,7 +179,6 @@ static driver_t ipmi_pci_driver = { }; DRIVER_MODULE(ipmi_pci, pci, ipmi_pci_driver, ipmi_devclass, 0, 0); -MODULE_DEPEND(ipmi_pci, smbios, 1, 1, 1); /* Native IPMI on PCI driver. */ diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index 735f404eec5f..308a3b076ef7 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -88,7 +88,7 @@ MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF); static void ipmi_smbios_probe(struct ipmi_get_info *); static int smbios_cksum(struct smbios_eps *); -static void smbios_walk_table(uint8_t *, vm_size_t, smbios_callback_t, +static void smbios_walk_table(uint8_t *, int, smbios_callback_t, void *); static void smbios_ipmi_info(struct smbios_structure_header *, void *); @@ -147,12 +147,11 @@ smbios_ipmi_info(struct smbios_structure_header *h, void *arg) } static void -smbios_walk_table(uint8_t *table, vm_size_t size, smbios_callback_t cb, void *arg) +smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) { struct smbios_structure_header *s; - uint8_t *p; - for (p = table; p < table + size;) { + while (entries--) { s = (struct smbios_structure_header *)p; cb(s, arg); @@ -161,11 +160,8 @@ smbios_walk_table(uint8_t *table, vm_size_t size, smbios_callback_t cb, void *ar * formatted area of this structure. */ p += s->length; - while (!(p[0] == 0 && p[1] == 0)) { + while (!(p[0] == 0 && p[1] == 0)) p++; - if (p >= table + size) - return; - } /* * Skip over the double-nul to the start of the next @@ -183,23 +179,41 @@ smbios_walk_table(uint8_t *table, vm_size_t size, smbios_callback_t cb, void *ar static void ipmi_smbios_probe(struct ipmi_get_info *info) { + struct smbios_eps *header; void *table; - vm_paddr_t table_paddr; - vm_size_t table_size; - int err; + u_int32_t addr; bzero(info, sizeof(struct ipmi_get_info)); - err = smbios_get_structure_table(&table_paddr, &table_size); - if (err != 0) + /* Find the SMBIOS table header. */ + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, + SMBIOS_STEP, SMBIOS_OFF); + if (addr == 0) return; - table = pmap_mapbios(table_paddr, table_size); + /* + * Map the header. We first map a fixed size to get the actual + * length and then map it a second time with the actual length so + * we can verify the checksum. + */ + header = pmap_mapbios(addr, sizeof(struct smbios_eps)); + table = pmap_mapbios(addr, header->length); + pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_eps)); + header = table; + if (smbios_cksum(header) != 0) { + pmap_unmapbios((vm_offset_t)header, header->length); + return; + } - smbios_walk_table(table, table_size, smbios_ipmi_info, info); + /* Now map the actual table and walk it looking for an IPMI entry. */ + table = pmap_mapbios(header->structure_table_address, + header->structure_table_length); + smbios_walk_table(table, header->number_structures, smbios_ipmi_info, + info); /* Unmap everything. */ - pmap_unmapbios((vm_offset_t)table, table_size); + pmap_unmapbios((vm_offset_t)table, header->structure_table_length); + pmap_unmapbios((vm_offset_t)header, header->length); } /* diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c index bc7377e5aee8..212248f0217e 100644 --- a/sys/dev/ipmi/ipmi_smbus.c +++ b/sys/dev/ipmi/ipmi_smbus.c @@ -131,4 +131,3 @@ static driver_t ipmi_smbus_driver = { DRIVER_MODULE(ipmi_smbus, smbus, ipmi_smbus_driver, ipmi_devclass, 0, 0); MODULE_DEPEND(ipmi_smbus, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); -MODULE_DEPEND(ipmi_smbus, smbios, 1, 1, 1); diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 00c7e2c98d2a..10589ed8d49d 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$"); #endif #include -static struct smbios_softc *smbios; - /* * System Management BIOS Reference Specification, v2.4 Final * http://www.dmtf.org/standards/published_documents/DSP0134.pdf @@ -181,7 +179,6 @@ smbios_attach (device_t dev) bcd2bin(sc->eps->BCD_revision & 0x0f)); printf("\n"); - smbios = sc; return (0); bad: if (sc->res) @@ -194,7 +191,6 @@ smbios_detach (device_t dev) { struct smbios_softc *sc; - smbios = NULL; sc = device_get_softc(dev); if (sc->res) @@ -203,23 +199,6 @@ smbios_detach (device_t dev) return (0); } -int -smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size) -{ - - if (smbios == NULL) - return (ENXIO); - if (smbios->eps_64bit) { - *table = smbios->eps3->structure_table_address; - *size = smbios->eps3->structure_table_max_size; - } else { - *table = smbios->eps->structure_table_address; - *size = smbios->eps->structure_table_length; - } - return (0); -} - - static int smbios_modevent (mod, what, arg) module_t mod; diff --git a/sys/dev/smbios/smbios.h b/sys/dev/smbios/smbios.h index 554b882f1da4..6503cdb73c4c 100644 --- a/sys/dev/smbios/smbios.h +++ b/sys/dev/smbios/smbios.h @@ -32,8 +32,6 @@ #ifndef _SMBIOS_H_ #define _SMBIOS_H_ -int smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size); - /* * System Management BIOS */ From owner-dev-commits-src-all@freebsd.org Tue Feb 23 22:51: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 407025570CF; Tue, 23 Feb 2021 22:51:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlZ6J5ktSz4nS0; Tue, 23 Feb 2021 22:51:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id EgWTlIZPCHmS3EgWUlo6Iz; Tue, 23 Feb 2021 15:51:19 -0700 X-Authority-Analysis: v=2.4 cv=MaypB7zf c=1 sm=1 tr=0 ts=603586e7 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=iGbCS3zQAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=DvCTxDGqdahi0-rcVXsA:9 a=m1hu7YsS2IuEFSGk:21 a=da-7ecNw1VAO5s_I:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=oRZS8w7TM5j8Y1SnqK-S:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 3ACCCD23; Tue, 23 Feb 2021 14:51:07 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11NMp7Dl013494; Tue, 23 Feb 2021 14:51:07 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102232251.11NMp7Dl013494@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: Allan Jude cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ba6e37e47f41 - main - ipmi_smbios: Deduplicate smbios entry point discovery logic In-reply-to: <202102232119.11NLJw17099523@gitrepo.freebsd.org> References: <202102232119.11NLJw17099523@gitrepo.freebsd.org> Comments: In-reply-to Allan Jude message dated "Tue, 23 Feb 2021 21:19:58 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 23 Feb 2021 14:51:07 -0800 X-CMAE-Envelope: MS4xfNoa64ZQnJ5pAQdhtP0wViBvtDMwQiqCMEYf1wgBdUZIGWjp/th+fNqSC781vgR9qwphEVXOUZYD/tH80t0q/9qVrXmvnU65hvRwC/7O5TkFXJeSod1L cPQRpUmGj7EvV2PTlAEf3RPP2WnbRONughdAFSzonXgfyQlDj/68QGMFSeVDMup62YKzX0GaB5WRSl8fHm247ia5S2uodHGYh7qtKyWMUU9sGl7MMFjy085b FsOFllQ7B/TvKnXzSNDDRmPB+O3wHtkycSqFSaJrhJ/gAt5h5EaHIdv8S7terdiS9ES1APm3cPvFDHbfKGInboMX+wvFHLdjLttppFafQ6I= X-Rspamd-Queue-Id: 4DlZ6J5ktSz4nS0 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, 23 Feb 2021 22:51:21 -0000 In message <202102232119.11NLJw17099523@gitrepo.freebsd.org>, Allan Jude writes : > The branch main has been updated by allanjude: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ba6e37e47f41484fc61cc034619267b8 > 2ddd056c > > commit ba6e37e47f41484fc61cc034619267b82ddd056c > Author: Allan Jude > AuthorDate: 2021-02-23 21:17:37 +0000 > Commit: Allan Jude > CommitDate: 2021-02-23 21:17:37 +0000 > > ipmi_smbios: Deduplicate smbios entry point discovery logic > > Sponsored by: Ampere Computing LLC > Submitted by: Klara Inc. > Reviewed by: imp > Differential Revision: https://reviews.freebsd.org/D28743 > --- > sys/dev/ipmi/ipmi_isa.c | 1 + > sys/dev/ipmi/ipmi_pci.c | 1 + > sys/dev/ipmi/ipmi_smbios.c | 46 ++++++++++++++++---------------------------- > -- > sys/dev/ipmi/ipmi_smbus.c | 1 + > sys/dev/smbios/smbios.c | 21 +++++++++++++++++++++ > sys/dev/smbios/smbios.h | 2 ++ > 6 files changed, 42 insertions(+), 30 deletions(-) > > diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c > index cdff305b07ec..2831b53e4586 100644 > --- a/sys/dev/ipmi/ipmi_isa.c > +++ b/sys/dev/ipmi/ipmi_isa.c > @@ -286,3 +286,4 @@ static driver_t ipmi_isa_driver = { > }; > > DRIVER_MODULE(ipmi_isa, isa, ipmi_isa_driver, ipmi_devclass, 0, 0); > +MODULE_DEPEND(ipmi_isa, smbios, 1, 1, 1); > diff --git a/sys/dev/ipmi/ipmi_pci.c b/sys/dev/ipmi/ipmi_pci.c > index d4598f9db873..1697a4c31c2a 100644 > --- a/sys/dev/ipmi/ipmi_pci.c > +++ b/sys/dev/ipmi/ipmi_pci.c > @@ -179,6 +179,7 @@ static driver_t ipmi_pci_driver = { > }; > > DRIVER_MODULE(ipmi_pci, pci, ipmi_pci_driver, ipmi_devclass, 0, 0); > +MODULE_DEPEND(ipmi_pci, smbios, 1, 1, 1); > > /* Native IPMI on PCI driver. */ > > diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c > index 308a3b076ef7..735f404eec5f 100644 > --- a/sys/dev/ipmi/ipmi_smbios.c > +++ b/sys/dev/ipmi/ipmi_smbios.c > @@ -88,7 +88,7 @@ MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF > ); > > static void ipmi_smbios_probe(struct ipmi_get_info *); > static int smbios_cksum(struct smbios_eps *); > -static void smbios_walk_table(uint8_t *, int, smbios_callback_t, > +static void smbios_walk_table(uint8_t *, vm_size_t, smbios_callback_t, > void *); > static void smbios_ipmi_info(struct smbios_structure_header *, void *); > > @@ -147,11 +147,12 @@ smbios_ipmi_info(struct smbios_structure_header *h, voi > d *arg) > } > > static void > -smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) > +smbios_walk_table(uint8_t *table, vm_size_t size, smbios_callback_t cb, void > *arg) > { > struct smbios_structure_header *s; > + uint8_t *p; > > - while (entries--) { > + for (p = table; p < table + size;) { > s = (struct smbios_structure_header *)p; > cb(s, arg); > > @@ -160,8 +161,11 @@ smbios_walk_table(uint8_t *p, int entries, smbios_callba > ck_t cb, void *arg) > * formatted area of this structure. > */ > p += s->length; > - while (!(p[0] == 0 && p[1] == 0)) > + while (!(p[0] == 0 && p[1] == 0)) { > p++; > + if (p >= table + size) > + return; > + } > > /* > * Skip over the double-nul to the start of the next > @@ -179,41 +183,23 @@ smbios_walk_table(uint8_t *p, int entries, smbios_callb > ack_t cb, void *arg) > static void > ipmi_smbios_probe(struct ipmi_get_info *info) > { > - struct smbios_eps *header; > void *table; > - u_int32_t addr; > + vm_paddr_t table_paddr; > + vm_size_t table_size; > + int err; > > bzero(info, sizeof(struct ipmi_get_info)); > > - /* Find the SMBIOS table header. */ > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, > - SMBIOS_STEP, SMBIOS_OFF); > - if (addr == 0) > + err = smbios_get_structure_table(&table_paddr, &table_size); > + if (err != 0) > return; > > - /* > - * Map the header. We first map a fixed size to get the actual > - * length and then map it a second time with the actual length so > - * we can verify the checksum. > - */ > - header = pmap_mapbios(addr, sizeof(struct smbios_eps)); > - table = pmap_mapbios(addr, header->length); > - pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_eps)); > - header = table; > - if (smbios_cksum(header) != 0) { > - pmap_unmapbios((vm_offset_t)header, header->length); > - return; > - } > + table = pmap_mapbios(table_paddr, table_size); > > - /* Now map the actual table and walk it looking for an IPMI entry. */ > - table = pmap_mapbios(header->structure_table_address, > - header->structure_table_length); > - smbios_walk_table(table, header->number_structures, smbios_ipmi_info, > - info); > + smbios_walk_table(table, table_size, smbios_ipmi_info, info); > > /* Unmap everything. */ > - pmap_unmapbios((vm_offset_t)table, header->structure_table_length); > - pmap_unmapbios((vm_offset_t)header, header->length); > + pmap_unmapbios((vm_offset_t)table, table_size); > } > > /* > diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c > index 212248f0217e..bc7377e5aee8 100644 > --- a/sys/dev/ipmi/ipmi_smbus.c > +++ b/sys/dev/ipmi/ipmi_smbus.c > @@ -131,3 +131,4 @@ static driver_t ipmi_smbus_driver = { > > DRIVER_MODULE(ipmi_smbus, smbus, ipmi_smbus_driver, ipmi_devclass, 0, 0); > MODULE_DEPEND(ipmi_smbus, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); > +MODULE_DEPEND(ipmi_smbus, smbios, 1, 1, 1); > diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c > index 10589ed8d49d..00c7e2c98d2a 100644 > --- a/sys/dev/smbios/smbios.c > +++ b/sys/dev/smbios/smbios.c > @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); > #endif > #include > > +static struct smbios_softc *smbios; > + > /* > * System Management BIOS Reference Specification, v2.4 Final > * http://www.dmtf.org/standards/published_documents/DSP0134.pdf > @@ -179,6 +181,7 @@ smbios_attach (device_t dev) > bcd2bin(sc->eps->BCD_revision & 0x0f)); > printf("\n"); > > + smbios = sc; > return (0); > bad: > if (sc->res) > @@ -191,6 +194,7 @@ smbios_detach (device_t dev) > { > struct smbios_softc *sc; > > + smbios = NULL; > sc = device_get_softc(dev); > > if (sc->res) > @@ -199,6 +203,23 @@ smbios_detach (device_t dev) > return (0); > } > > +int > +smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size) > +{ > + > + if (smbios == NULL) > + return (ENXIO); > + if (smbios->eps_64bit) { > + *table = smbios->eps3->structure_table_address; > + *size = smbios->eps3->structure_table_max_size; This had some undesired results. --- all_subdir_bios/smbios --- /opt/src/git-src/sys/dev/smbios/smbios.c:212:14: error: no member named 'eps_64bit' in 'struct smbios_softc' if (smbios->eps_64bit) { ~~~~~~ ^ /opt/src/git-src/sys/dev/smbios/smbios.c:213:20: error: no member named 'eps3' in 'struct smbios_softc'; did you mean 'eps'? *table = smbios->eps3->structure_table_address; ^~~~ eps /opt/src/git-src/sys/dev/smbios/smbios.c:66:22: note: 'eps' declared here struct smbios_eps * eps; ^ /opt/src/git-src/sys/dev/smbios/smbios.c:214:19: error: no member named 'eps3' in 'struct smbios_softc'; did you mean 'eps'? *size = smbios->eps3->structure_table_max_size; ^~~~ eps /opt/src/git-src/sys/dev/smbios/smbios.c:66:22: note: 'eps' declared here struct smbios_eps * eps; ^ /opt/src/git-src/sys/dev/smbios/smbios.c:214:25: error: no member named 'structure_table_max_size' in 'struct smbios_eps'; did you mean 'structure_table_address'? *size = smbios->eps3->structure_table_max_size; ^~~~~~~~~~~~~~~~~~~~~~~~ structure_table_address /opt/src/git-src/sys/dev/smbios/smbios.h:58:11: note: 'structure_table_address' declared here uint32_t structure_table_address; ^ > + } else { > + *table = smbios->eps->structure_table_address; > + *size = smbios->eps->structure_table_length; > + } > + return (0); > +} > + > + > static int > smbios_modevent (mod, what, arg) > module_t mod; > diff --git a/sys/dev/smbios/smbios.h b/sys/dev/smbios/smbios.h > index 6503cdb73c4c..554b882f1da4 100644 > --- a/sys/dev/smbios/smbios.h > +++ b/sys/dev/smbios/smbios.h > @@ -32,6 +32,8 @@ > #ifndef _SMBIOS_H_ > #define _SMBIOS_H_ > > +int smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size); > + > /* > * System Management BIOS > */ > -- 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 Feb 23 22:56: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 9A678557889; Tue, 23 Feb 2021 22:56:03 +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 4DlZCk4R2jz4nnm; Tue, 23 Feb 2021 22:56:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id Egb0lVloy2SWTEgb2lPcq9; Tue, 23 Feb 2021 15:56:00 -0700 X-Authority-Analysis: v=2.4 cv=fdJod2cF c=1 sm=1 tr=0 ts=60358800 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=iGbCS3zQAAAA:8 a=1SrTYSZmx2jzKtmugbUA:9 a=umdqf8azl6mVhff5:21 a=aaFSTmKjo1xzFNRr:21 a=CjuIK1q_8ugA:10 a=3RcraWcUxpgA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=oRZS8w7TM5j8Y1SnqK-S:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 85A46D2F; Tue, 23 Feb 2021 14:55:58 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11NMtwxL013572; Tue, 23 Feb 2021 14:55:58 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102232255.11NMtwxL013572@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: Allan Jude cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ba6e37e47f41 - main - ipmi_smbios: Deduplicate smbios entry point discovery logic In-reply-to: <202102232251.11NMp7Dl013494@slippy.cwsent.com> References: <202102232119.11NLJw17099523@gitrepo.freebsd.org> <202102232251.11NMp7Dl013494@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Tue, 23 Feb 2021 14:51:07 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 23 Feb 2021 14:55:58 -0800 X-CMAE-Envelope: MS4xfL3NJOhwCziznn2mUpMoNclUYK0PUe2869z96Tzmezp2r3GVYfHoV4Ruclg96V30oh3NKeBmvzpAmaHHfKJZsFX2yWNBg6QWFmkz56cOrc+2TkC7oQaL MnjA0z33u6yfrjF19KZME5/K2HAOEHZi9ZlwjUpi0jZxjQdZ9DZY9YiKVy5OlKgsGPWckvhNtIU2CyZ+OVIdE4XIgI7wVySFA1LuKaOsxXaew7ISm0PhvWxz RBK8sRQYyZ4Ms9EYzqOkICQeh6EuM3t8qMIHEniqIgjrE1IGn0mux+0UuXYtc4dYVZ0Npc8i/V1V373QwzZ4+08fGzP8lxf44bk/o+5vids= X-Rspamd-Queue-Id: 4DlZCk4R2jz4nnm X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.9) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [0.30 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[64.59.134.9:from]; RCVD_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[64.59.134.9:from]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; R_DKIM_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.134.9:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; REPLYTO_EQ_FROM(0.00)[]; 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)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[64.59.134.9:from:127.0.2.255]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 22:56:03 -0000 Nevermind. I see you found it. -- 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. In message <202102232251.11NMp7Dl013494@slippy.cwsent.com>, Cy Schubert writes: > In message <202102232119.11NLJw17099523@gitrepo.freebsd.org>, Allan Jude > writes > : > > The branch main has been updated by allanjude: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ba6e37e47f41484fc61cc034619267 > b8 > > 2ddd056c > > > > commit ba6e37e47f41484fc61cc034619267b82ddd056c > > Author: Allan Jude > > AuthorDate: 2021-02-23 21:17:37 +0000 > > Commit: Allan Jude > > CommitDate: 2021-02-23 21:17:37 +0000 > > > > ipmi_smbios: Deduplicate smbios entry point discovery logic > > > > Sponsored by: Ampere Computing LLC > > Submitted by: Klara Inc. > > Reviewed by: imp > > Differential Revision: https://reviews.freebsd.org/D28743 > > --- > > sys/dev/ipmi/ipmi_isa.c | 1 + > > sys/dev/ipmi/ipmi_pci.c | 1 + > > sys/dev/ipmi/ipmi_smbios.c | 46 ++++++++++++++++-------------------------- > -- > > -- > > sys/dev/ipmi/ipmi_smbus.c | 1 + > > sys/dev/smbios/smbios.c | 21 +++++++++++++++++++++ > > sys/dev/smbios/smbios.h | 2 ++ > > 6 files changed, 42 insertions(+), 30 deletions(-) > > > > diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c > > index cdff305b07ec..2831b53e4586 100644 > > --- a/sys/dev/ipmi/ipmi_isa.c > > +++ b/sys/dev/ipmi/ipmi_isa.c > > @@ -286,3 +286,4 @@ static driver_t ipmi_isa_driver = { > > }; > > > > DRIVER_MODULE(ipmi_isa, isa, ipmi_isa_driver, ipmi_devclass, 0, 0); > > +MODULE_DEPEND(ipmi_isa, smbios, 1, 1, 1); > > diff --git a/sys/dev/ipmi/ipmi_pci.c b/sys/dev/ipmi/ipmi_pci.c > > index d4598f9db873..1697a4c31c2a 100644 > > --- a/sys/dev/ipmi/ipmi_pci.c > > +++ b/sys/dev/ipmi/ipmi_pci.c > > @@ -179,6 +179,7 @@ static driver_t ipmi_pci_driver = { > > }; > > > > DRIVER_MODULE(ipmi_pci, pci, ipmi_pci_driver, ipmi_devclass, 0, 0); > > +MODULE_DEPEND(ipmi_pci, smbios, 1, 1, 1); > > > > /* Native IPMI on PCI driver. */ > > > > diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c > > index 308a3b076ef7..735f404eec5f 100644 > > --- a/sys/dev/ipmi/ipmi_smbios.c > > +++ b/sys/dev/ipmi/ipmi_smbios.c > > @@ -88,7 +88,7 @@ MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_D > EF > > ); > > > > static void ipmi_smbios_probe(struct ipmi_get_info *); > > static int smbios_cksum(struct smbios_eps *); > > -static void smbios_walk_table(uint8_t *, int, smbios_callback_t, > > +static void smbios_walk_table(uint8_t *, vm_size_t, smbios_callback > _t, > > void *); > > static void smbios_ipmi_info(struct smbios_structure_header *, void > *); > > > > @@ -147,11 +147,12 @@ smbios_ipmi_info(struct smbios_structure_header *h, v > oi > > d *arg) > > } > > > > static void > > -smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg > ) > > +smbios_walk_table(uint8_t *table, vm_size_t size, smbios_callback_t cb, vo > id > > *arg) > > { > > struct smbios_structure_header *s; > > + uint8_t *p; > > > > - while (entries--) { > > + for (p = table; p < table + size;) { > > s = (struct smbios_structure_header *)p; > > cb(s, arg); > > > > @@ -160,8 +161,11 @@ smbios_walk_table(uint8_t *p, int entries, smbios_call > ba > > ck_t cb, void *arg) > > * formatted area of this structure. > > */ > > p += s->length; > > - while (!(p[0] == 0 && p[1] == 0)) > > + while (!(p[0] == 0 && p[1] == 0)) { > > p++; > > + if (p >= table + size) > > + return; > > + } > > > > /* > > * Skip over the double-nul to the start of the next > > @@ -179,41 +183,23 @@ smbios_walk_table(uint8_t *p, int entries, smbios_cal > lb > > ack_t cb, void *arg) > > static void > > ipmi_smbios_probe(struct ipmi_get_info *info) > > { > > - struct smbios_eps *header; > > void *table; > > - u_int32_t addr; > > + vm_paddr_t table_paddr; > > + vm_size_t table_size; > > + int err; > > > > bzero(info, sizeof(struct ipmi_get_info)); > > > > - /* Find the SMBIOS table header. */ > > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, > > - SMBIOS_STEP, SMBIOS_OFF); > > - if (addr == 0) > > + err = smbios_get_structure_table(&table_paddr, &table_size); > > + if (err != 0) > > return; > > > > - /* > > - * Map the header. We first map a fixed size to get the actual > > - * length and then map it a second time with the actual length so > > - * we can verify the checksum. > > - */ > > - header = pmap_mapbios(addr, sizeof(struct smbios_eps)); > > - table = pmap_mapbios(addr, header->length); > > - pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_eps)); > > - header = table; > > - if (smbios_cksum(header) != 0) { > > - pmap_unmapbios((vm_offset_t)header, header->length); > > - return; > > - } > > + table = pmap_mapbios(table_paddr, table_size); > > > > - /* Now map the actual table and walk it looking for an IPMI entry. */ > > - table = pmap_mapbios(header->structure_table_address, > > - header->structure_table_length); > > - smbios_walk_table(table, header->number_structures, smbios_ipmi_info, > > - info); > > + smbios_walk_table(table, table_size, smbios_ipmi_info, info); > > > > /* Unmap everything. */ > > - pmap_unmapbios((vm_offset_t)table, header->structure_table_length); > > - pmap_unmapbios((vm_offset_t)header, header->length); > > + pmap_unmapbios((vm_offset_t)table, table_size); > > } > > > > /* > > diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c > > index 212248f0217e..bc7377e5aee8 100644 > > --- a/sys/dev/ipmi/ipmi_smbus.c > > +++ b/sys/dev/ipmi/ipmi_smbus.c > > @@ -131,3 +131,4 @@ static driver_t ipmi_smbus_driver = { > > > > DRIVER_MODULE(ipmi_smbus, smbus, ipmi_smbus_driver, ipmi_devclass, 0, 0); > > MODULE_DEPEND(ipmi_smbus, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER > ); > > +MODULE_DEPEND(ipmi_smbus, smbios, 1, 1, 1); > > diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c > > index 10589ed8d49d..00c7e2c98d2a 100644 > > --- a/sys/dev/smbios/smbios.c > > +++ b/sys/dev/smbios/smbios.c > > @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); > > #endif > > #include > > > > +static struct smbios_softc *smbios; > > + > > /* > > * System Management BIOS Reference Specification, v2.4 Final > > * http://www.dmtf.org/standards/published_documents/DSP0134.pdf > > @@ -179,6 +181,7 @@ smbios_attach (device_t dev) > > bcd2bin(sc->eps->BCD_revision & 0x0f)); > > printf("\n"); > > > > + smbios = sc; > > return (0); > > bad: > > if (sc->res) > > @@ -191,6 +194,7 @@ smbios_detach (device_t dev) > > { > > struct smbios_softc *sc; > > > > + smbios = NULL; > > sc = device_get_softc(dev); > > > > if (sc->res) > > @@ -199,6 +203,23 @@ smbios_detach (device_t dev) > > return (0); > > } > > > > +int > > +smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size) > > +{ > > + > > + if (smbios == NULL) > > + return (ENXIO); > > + if (smbios->eps_64bit) { > > + *table = smbios->eps3->structure_table_address; > > + *size = smbios->eps3->structure_table_max_size; > > This had some undesired results. > > --- all_subdir_bios/smbios --- > /opt/src/git-src/sys/dev/smbios/smbios.c:212:14: error: no member named > 'eps_64bit' in 'struct smbios_softc' > if (smbios->eps_64bit) { > ~~~~~~ ^ > /opt/src/git-src/sys/dev/smbios/smbios.c:213:20: error: no member named > 'eps3' in 'struct smbios_softc'; did you mean 'eps'? > *table = smbios->eps3->structure_table_address; > ^~~~ > eps > /opt/src/git-src/sys/dev/smbios/smbios.c:66:22: note: 'eps' declared here > struct smbios_eps * eps; > ^ > /opt/src/git-src/sys/dev/smbios/smbios.c:214:19: error: no member named > 'eps3' in 'struct smbios_softc'; did you mean 'eps'? > *size = smbios->eps3->structure_table_max_size; > ^~~~ > eps > /opt/src/git-src/sys/dev/smbios/smbios.c:66:22: note: 'eps' declared here > struct smbios_eps * eps; > ^ > /opt/src/git-src/sys/dev/smbios/smbios.c:214:25: error: no member named > 'structure_table_max_size' in 'struct smbios_eps'; did you mean > 'structure_table_address'? > *size = smbios->eps3->structure_table_max_size; > ^~~~~~~~~~~~~~~~~~~~~~~~ > structure_table_address > /opt/src/git-src/sys/dev/smbios/smbios.h:58:11: note: > 'structure_table_address' declared here > uint32_t structure_table_address; > ^ > > > > + } else { > > + *table = smbios->eps->structure_table_address; > > + *size = smbios->eps->structure_table_length; > > + } > > + return (0); > > +} > > + > > + > > static int > > smbios_modevent (mod, what, arg) > > module_t mod; > > diff --git a/sys/dev/smbios/smbios.h b/sys/dev/smbios/smbios.h > > index 6503cdb73c4c..554b882f1da4 100644 > > --- a/sys/dev/smbios/smbios.h > > +++ b/sys/dev/smbios/smbios.h > > @@ -32,6 +32,8 @@ > > #ifndef _SMBIOS_H_ > > #define _SMBIOS_H_ > > > > +int smbios_get_structure_table(vm_paddr_t *table, vm_size_t *size); > > + > > /* > > * System Management BIOS > > */ > > > > > > -- > 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 Feb 23 23:43: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 27C01558607; Tue, 23 Feb 2021 23:43: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 4DlbG70fx3z4r2P; Tue, 23 Feb 2021 23:43: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 0984822902; Tue, 23 Feb 2021 23:43: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 11NNhArr096889; Tue, 23 Feb 2021 23:43:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NNhAvO096888; Tue, 23 Feb 2021 23:43:10 GMT (envelope-from git) Date: Tue, 23 Feb 2021 23:43:10 GMT Message-Id: <202102232343.11NNhAvO096888@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: 9262a9ce06a6 - stable/13 - hidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size 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: 9262a9ce06a697c7459a03d559b980673fd9c934 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 23:43:11 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9262a9ce06a697c7459a03d559b980673fd9c934 commit 9262a9ce06a697c7459a03d559b980673fd9c934 Author: Vladimir Kondratyev AuthorDate: 2021-02-13 18:19:02 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-23 23:41:49 +0000 hidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size defined by hardware rather than cached one to match HIDIOCGRDESC ioctl. This fixes errors reported by hid-tools being run against /dev/hidraw# device node belonging to driver which overloads report descriptor. MFC after: 1 week (cherry picked from commit f988d7fa050e4886cdeb9483a039e75d58c31883) --- sys/dev/hid/hidraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c index 6cc67ff14d23..e71b2e2c7d5d 100644 --- a/sys/dev/hid/hidraw.c +++ b/sys/dev/hid/hidraw.c @@ -703,7 +703,7 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, return (0); case HIDIOCGRDESCSIZE: - *(int *)addr = sc->sc_rdesc->len; + *(int *)addr = sc->sc_hw->rdescsize; return (0); case HIDIOCGRDESC: From owner-dev-commits-src-all@freebsd.org Tue Feb 23 23:43: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 48EAE558438; Tue, 23 Feb 2021 23:43: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 4DlbG81f7xz4r2Q; Tue, 23 Feb 2021 23:43: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 2B42822903; Tue, 23 Feb 2021 23:43: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 11NNhCT3096912; Tue, 23 Feb 2021 23:43:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NNhC8u096911; Tue, 23 Feb 2021 23:43:12 GMT (envelope-from git) Date: Tue, 23 Feb 2021 23:43:12 GMT Message-Id: <202102232343.11NNhC8u096911@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: e7211ca03a85 - stable/13 - ukbd: Fix handling of keyboard ErrorRollOver reports 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: e7211ca03a85e3a980daf389af823fefb24b8869 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 23:43:12 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e7211ca03a85e3a980daf389af823fefb24b8869 commit e7211ca03a85e3a980daf389af823fefb24b8869 Author: Vladimir Kondratyev AuthorDate: 2021-02-13 18:12:56 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-23 23:41:49 +0000 ukbd: Fix handling of keyboard ErrorRollOver reports Ignore fantom keyboard state reports entirelly rather than ignore RollOver states for each key separatelly. Latter results in spurious release/push pairs of events on each fantom keyboard state report. Reported by: Jan Martin Mikkelsen Submitted by: Jan Martin Mikkelsen (initial version) PR: 253249 MFC after: 1 week (cherry picked from commit 032d3153877ef1767c121bbdf8e00f4f93b30a5d) --- sys/dev/usb/input/ukbd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 3314a3b3e70f..f2ff476150ff 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -722,11 +722,16 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t error) hid_get_udata(sc->sc_buffer, len, &tmp_loc); /* advance to next location */ tmp_loc.pos += tmp_loc.size; + if (key == KEY_ERROR) { + DPRINTF("KEY_ERROR\n"); + sc->sc_ndata = sc->sc_odata; + goto tr_setup; /* ignore */ + } if (modifiers & MOD_FN) key = ukbd_apple_fn(key); if (sc->sc_flags & UKBD_FLAG_APPLE_SWAP) key = ukbd_apple_swap(key); - if (key == KEY_NONE || key == KEY_ERROR || key >= UKBD_NKEYCODE) + if (key == KEY_NONE || key >= UKBD_NKEYCODE) continue; /* set key in bitmap */ sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 23:43: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 0673B5585A5; Tue, 23 Feb 2021 23:43: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 4DlbG93rvbz4r2T; Tue, 23 Feb 2021 23:43: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 4923622655; Tue, 23 Feb 2021 23:43: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 11NNhDpw096932; Tue, 23 Feb 2021 23:43:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NNhD5J096931; Tue, 23 Feb 2021 23:43:13 GMT (envelope-from git) Date: Tue, 23 Feb 2021 23:43:13 GMT Message-Id: <202102232343.11NNhD5J096931@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: 98b3658c4e8a - stable/13 - hkbd: Fix handling of keyboard ErrorRollOver reports 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: 98b3658c4e8a3760a2e4f71a8a4a3dec2d55065a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 23:43:14 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=98b3658c4e8a3760a2e4f71a8a4a3dec2d55065a commit 98b3658c4e8a3760a2e4f71a8a4a3dec2d55065a Author: Vladimir Kondratyev AuthorDate: 2021-02-13 18:18:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-23 23:41:49 +0000 hkbd: Fix handling of keyboard ErrorRollOver reports Ignore fantom keyboard state reports entirelly rather than ignore RollOver states for each key separatelly. Latter results in spurious release/push pairs of events on each fantom keyboard state report. Reported by: Jan Martin Mikkelsen Submitted by: Jan Martin Mikkelsen (initial version) PR: 253249 MFC after: 1 week (cherry picked from commit 812c59ed614df94380e0b1f9ff4a3d15b78ce1bf) --- sys/dev/hid/hkbd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 6f4b71dd49b6..89325f9b2499 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -715,11 +715,16 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) uint32_t key = hid_get_data(buf + offset, len - offset, &sc->sc_loc_key[i]); + if (key == KEY_ERROR) { + DPRINTF("KEY_ERROR\n"); + sc->sc_ndata = sc->sc_odata; + return; /* ignore */ + } if (modifiers & MOD_FN) key = hkbd_apple_fn(key); if (sc->sc_flags & HKBD_FLAG_APPLE_SWAP) key = hkbd_apple_swap(key); - if (key == KEY_NONE || key == KEY_ERROR || key >= HKBD_NKEYCODE) + if (key == KEY_NONE || key >= HKBD_NKEYCODE) continue; /* set key in bitmap */ sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); From owner-dev-commits-src-all@freebsd.org Tue Feb 23 23: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 73B6D5588AC; Tue, 23 Feb 2021 23: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 4DlbJL2rggz4rRM; Tue, 23 Feb 2021 23: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 5465C22657; Tue, 23 Feb 2021 23:45: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 11NNj6YS097360; Tue, 23 Feb 2021 23:45:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11NNj6Zm097359; Tue, 23 Feb 2021 23:45:06 GMT (envelope-from git) Date: Tue, 23 Feb 2021 23:45:06 GMT Message-Id: <202102232345.11NNj6Zm097359@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: 9bdb559d9726 - stable/12 - ukbd: Fix handling of keyboard ErrorRollOver reports 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: 9bdb559d97268967e893b9f37dc556ae5dcd44fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 23 Feb 2021 23:45:06 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9bdb559d97268967e893b9f37dc556ae5dcd44fb commit 9bdb559d97268967e893b9f37dc556ae5dcd44fb Author: Vladimir Kondratyev AuthorDate: 2021-02-13 18:12:56 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-23 23:43:28 +0000 ukbd: Fix handling of keyboard ErrorRollOver reports Ignore fantom keyboard state reports entirelly rather than ignore RollOver states for each key separatelly. Latter results in spurious release/push pairs of events on each fantom keyboard state report. Reported by: Jan Martin Mikkelsen Submitted by: Jan Martin Mikkelsen (initial version) PR: 253249 MFC after: 1 week (cherry picked from commit 032d3153877ef1767c121bbdf8e00f4f93b30a5d) --- sys/dev/usb/input/ukbd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index e438a1521f97..52b358c20324 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -721,11 +721,16 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t error) hid_get_data_unsigned(sc->sc_buffer, len, &tmp_loc); /* advance to next location */ tmp_loc.pos += tmp_loc.size; + if (key == KEY_ERROR) { + DPRINTF("KEY_ERROR\n"); + sc->sc_ndata = sc->sc_odata; + goto tr_setup; /* ignore */ + } if (modifiers & MOD_FN) key = ukbd_apple_fn(key); if (sc->sc_flags & UKBD_FLAG_APPLE_SWAP) key = ukbd_apple_swap(key); - if (key == KEY_NONE || key == KEY_ERROR || key >= UKBD_NKEYCODE) + if (key == KEY_NONE || key >= UKBD_NKEYCODE) continue; /* set key in bitmap */ sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 00:00: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 1DA96558B5D; Wed, 24 Feb 2021 00:00: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 4Dlbdk0J8Zz4sLb; Wed, 24 Feb 2021 00:00: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 F154622A3D; Wed, 24 Feb 2021 00:00: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 11O009ce014075; Wed, 24 Feb 2021 00:00:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O009S2014072; Wed, 24 Feb 2021 00:00:09 GMT (envelope-from git) Date: Wed, 24 Feb 2021 00:00:09 GMT Message-Id: <202102240000.11O009S2014072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jason A. Harmening" Subject: git: fc6c898ec5f4 - stable/13 - Fix divide-by-zero panic when ASLR is enabled and superpages disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc6c898ec5f46c730b8f2902c2692549de47d7d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 00:00:10 -0000 The branch stable/13 has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=fc6c898ec5f46c730b8f2902c2692549de47d7d6 commit fc6c898ec5f46c730b8f2902c2692549de47d7d6 Author: Jason A. Harmening AuthorDate: 2021-02-15 02:47:22 +0000 Commit: Jason A. Harmening CommitDate: 2021-02-24 00:01:30 +0000 Fix divide-by-zero panic when ASLR is enabled and superpages disabled When locating the anonymous memory region for a vm_map with ASLR enabled, we try to keep the slid base address aligned on a superpage boundary to minimize pagetable fragmentation and maximize the potential usage of superpage mappings. We can't (portably) do this if superpages have been disabled by loader tunable and pagesizes[1] is 0, and it would be less beneficial in that case anyway. PR: 253511 (cherry picked from commit 41032835dc2d489ec7841d7529f74f6389329cd3) --- sys/kern/imgact_elf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index dae11ab92a6c..245894926ee1 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1287,7 +1287,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) maxv1 = maxv / 2 + addr / 2; MPASS(maxv1 >= addr); /* No overflow */ map->anon_loc = __CONCAT(rnd_, __elfN(base))(map, addr, maxv1, - MAXPAGESIZES > 1 ? pagesizes[1] : pagesizes[0]); + (MAXPAGESIZES > 1 && pagesizes[1] != 0) ? + pagesizes[1] : pagesizes[0]); } else { map->anon_loc = addr; } @@ -1297,7 +1298,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) if (interp != NULL) { VOP_UNLOCK(imgp->vp); if ((map->flags & MAP_ASLR) != 0) { - /* Assume that interpeter fits into 1/4 of AS */ + /* Assume that interpreter fits into 1/4 of AS */ maxv1 = maxv / 2 + addr / 2; MPASS(maxv1 >= addr); /* No overflow */ addr = __CONCAT(rnd_, __elfN(base))(map, addr, From owner-dev-commits-src-all@freebsd.org Wed Feb 24 00:02: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 69AED558F7D; Wed, 24 Feb 2021 00:02: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 4Dlbgv2QJCz4sTY; Wed, 24 Feb 2021 00:02: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 4602322C27; Wed, 24 Feb 2021 00:02: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 11O023o1020909; Wed, 24 Feb 2021 00:02:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O023wP020908; Wed, 24 Feb 2021 00:02:03 GMT (envelope-from git) Date: Wed, 24 Feb 2021 00:02:03 GMT Message-Id: <202102240002.11O023wP020908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jason A. Harmening" Subject: git: 941747f63cfa - stable/12 - Fix divide-by-zero panic when ASLR is enabled and superpages disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 941747f63cfa127248e6c7246f75c5ac5e142fcc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 00:02:03 -0000 The branch stable/12 has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=941747f63cfa127248e6c7246f75c5ac5e142fcc commit 941747f63cfa127248e6c7246f75c5ac5e142fcc Author: Jason A. Harmening AuthorDate: 2021-02-15 02:47:22 +0000 Commit: Jason A. Harmening CommitDate: 2021-02-24 00:04:00 +0000 Fix divide-by-zero panic when ASLR is enabled and superpages disabled When locating the anonymous memory region for a vm_map with ASLR enabled, we try to keep the slid base address aligned on a superpage boundary to minimize pagetable fragmentation and maximize the potential usage of superpage mappings. We can't (portably) do this if superpages have been disabled by loader tunable and pagesizes[1] is 0, and it would be less beneficial in that case anyway. PR: 253511 (cherry picked from commit 41032835dc2d489ec7841d7529f74f6389329cd3) --- sys/kern/imgact_elf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 18b83d6b499a..4c05be66e51f 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1271,7 +1271,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) maxv1 = maxv / 2 + addr / 2; MPASS(maxv1 >= addr); /* No overflow */ map->anon_loc = __CONCAT(rnd_, __elfN(base))(map, addr, maxv1, - MAXPAGESIZES > 1 ? pagesizes[1] : pagesizes[0]); + (MAXPAGESIZES > 1 && pagesizes[1] != 0) ? + pagesizes[1] : pagesizes[0]); } else { map->anon_loc = addr; } @@ -1281,7 +1282,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) if (interp != NULL) { VOP_UNLOCK(imgp->vp, 0); if ((map->flags & MAP_ASLR) != 0) { - /* Assume that interpeter fits into 1/4 of AS */ + /* Assume that interpreter fits into 1/4 of AS */ maxv1 = maxv / 2 + addr / 2; MPASS(maxv1 >= addr); /* No overflow */ addr = __CONCAT(rnd_, __elfN(base))(map, addr, From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:37: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 6C7DD55B445; Wed, 24 Feb 2021 01:37: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 4DldpK2Rsvz3Fcc; Wed, 24 Feb 2021 01:37: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 4298F23D43; Wed, 24 Feb 2021 01:37: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 11O1bjcS042475; Wed, 24 Feb 2021 01:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1bjCc042474; Wed, 24 Feb 2021 01:37:45 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:37:45 GMT Message-Id: <202102240137.11O1bjCc042474@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: 6ab923cbca87 - main - pam_login_access: Fix negative entry matching logic 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: 6ab923cbca8759503a08683a5978b9ebf5efd607 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:37:45 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6ab923cbca8759503a08683a5978b9ebf5efd607 commit 6ab923cbca8759503a08683a5978b9ebf5efd607 Author: Mark Johnston AuthorDate: 2021-02-23 22:01:29 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 00:14:05 +0000 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access --- lib/libpam/modules/pam_login_access/login_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 9496081d362e..719808858dac 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -137,10 +137,10 @@ list_match(char *list, const char *item, if (match != NO) { while ((tok = strtok((char *) 0, listsep)) && strcmp(tok, "EXCEPT")) { /* VOID */ ; - if (tok == NULL || list_match((char *) 0, item, match_fn, - login_access_opts) == NO) { + } + if (tok == NULL || + list_match((char *) 0, item, match_fn, login_access_opts) == NO) { return (match); - } } } return (NO); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01: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 54E6F55B651; Wed, 24 Feb 2021 01: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 4Dldpk21lkz3FgR; Wed, 24 Feb 2021 01:38: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 3859E23D44; Wed, 24 Feb 2021 01:38: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 11O1c6Oj042638; Wed, 24 Feb 2021 01:38:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1c6RS042637; Wed, 24 Feb 2021 01:38:06 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:38:06 GMT Message-Id: <202102240138.11O1c6RS042637@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: 8cf559d6b9b4 - stable/13 - pam_login_access: Fix negative entry matching logic 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: 8cf559d6b9b4782bf67eb868ea480f47fc8c64a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:38:06 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8cf559d6b9b4782bf67eb868ea480f47fc8c64a4 commit 8cf559d6b9b4782bf67eb868ea480f47fc8c64a4 Author: Mark Johnston AuthorDate: 2021-02-23 22:01:29 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:20:53 +0000 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access (cherry picked from commit 6ab923cbca8759503a08683a5978b9ebf5efd607) --- lib/libpam/modules/pam_login_access/login_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 9496081d362e..719808858dac 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -137,10 +137,10 @@ list_match(char *list, const char *item, if (match != NO) { while ((tok = strtok((char *) 0, listsep)) && strcmp(tok, "EXCEPT")) { /* VOID */ ; - if (tok == NULL || list_match((char *) 0, item, match_fn, - login_access_opts) == NO) { + } + if (tok == NULL || + list_match((char *) 0, item, match_fn, login_access_opts) == NO) { return (match); - } } } return (NO); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01: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 A9DCE55B6BD; Wed, 24 Feb 2021 01:38: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 4Dldpx3yrsz3FSZ; Wed, 24 Feb 2021 01:38: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 B9FF423D45; Wed, 24 Feb 2021 01:38: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 11O1cFMh042769; Wed, 24 Feb 2021 01:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1cFAf042768; Wed, 24 Feb 2021 01:38:15 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:38:15 GMT Message-Id: <202102240138.11O1cFAf042768@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: c99e3e2d9693 - stable/12 - pam_login_access: Fix negative entry matching logic 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: c99e3e2d96935ae4d61948bf7660e9b9c2afb4d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:38:17 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c99e3e2d96935ae4d61948bf7660e9b9c2afb4d9 commit c99e3e2d96935ae4d61948bf7660e9b9c2afb4d9 Author: Mark Johnston AuthorDate: 2021-02-23 22:01:29 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:21:06 +0000 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access (cherry picked from commit 6ab923cbca8759503a08683a5978b9ebf5efd607) --- lib/libpam/modules/pam_login_access/login_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 9496081d362e..719808858dac 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -137,10 +137,10 @@ list_match(char *list, const char *item, if (match != NO) { while ((tok = strtok((char *) 0, listsep)) && strcmp(tok, "EXCEPT")) { /* VOID */ ; - if (tok == NULL || list_match((char *) 0, item, match_fn, - login_access_opts) == NO) { + } + if (tok == NULL || + list_match((char *) 0, item, match_fn, login_access_opts) == NO) { return (match); - } } } return (NO); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:38: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 7375655BA70; Wed, 24 Feb 2021 01:38: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 4Dldq141fZz3FnN; Wed, 24 Feb 2021 01:38: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 4084123B62; Wed, 24 Feb 2021 01:38: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 11O1cLU7042896; Wed, 24 Feb 2021 01:38:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1cLaK042895; Wed, 24 Feb 2021 01:38:21 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:38:21 GMT Message-Id: <202102240138.11O1cLaK042895@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: dae05d22d64e - stable/11 - pam_login_access: Fix negative entry matching logic 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/11 X-Git-Reftype: branch X-Git-Commit: dae05d22d64ea218abe5883be539c2b41c20b1fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:38:22 -0000 The branch stable/11 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dae05d22d64ea218abe5883be539c2b41c20b1fb commit dae05d22d64ea218abe5883be539c2b41c20b1fb Author: Mark Johnston AuthorDate: 2021-02-23 22:01:29 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:21:13 +0000 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access (cherry picked from commit 6ab923cbca8759503a08683a5978b9ebf5efd607) --- lib/libpam/modules/pam_login_access/login_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 9496081d362e..719808858dac 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -137,10 +137,10 @@ list_match(char *list, const char *item, if (match != NO) { while ((tok = strtok((char *) 0, listsep)) && strcmp(tok, "EXCEPT")) { /* VOID */ ; - if (tok == NULL || list_match((char *) 0, item, match_fn, - login_access_opts) == NO) { + } + if (tok == NULL || + list_match((char *) 0, item, match_fn, login_access_opts) == NO) { return (match); - } } } return (NO); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01: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 5602255BB84; Wed, 24 Feb 2021 01: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 4DldsK1y4Zz3G7J; Wed, 24 Feb 2021 01: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 35A4E23DBA; Wed, 24 Feb 2021 01: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 11O1eLeW050825; Wed, 24 Feb 2021 01: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 11O1eL6G050824; Wed, 24 Feb 2021 01:40:21 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:40:21 GMT Message-Id: <202102240140.11O1eL6G050824@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: 491cafa96113 - releng/11.4 - MFC jail: Handle a possible race between jail_remove(2) and fork(2) 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: 491cafa9611306ec513c9cbcb766a49ff7167dad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:40:21 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=491cafa9611306ec513c9cbcb766a49ff7167dad commit 491cafa9611306ec513c9cbcb766a49ff7167dad Author: Jamie Gritton AuthorDate: 2021-02-16 19:19:13 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:34:35 +0000 MFC jail: Handle a possible race between jail_remove(2) and fork(2) jail_remove(2) includes a loop that sends SIGKILL to all processes in a jail, but skips processes in PRS_NEW state. Thus it is possible the a process in mid-fork(2) during jail removal can survive the jail being removed. Add a prison flag PR_REMOVE, which is checked before the new process returns. If the jail is being removed, the process will then exit. Also check this flag in jail_attach(2) which has a similar issue. Approved by: so Security: CVE-2020-25581 Security: FreeBSD-SA-21:04.jail_remove Reported by: mjg Approved by: kib (cherry picked from commit cc7b73065302005ebc4a19503188c8d6d5eb923d) (cherry picked from commit c837631bd47af73d03e3d8907f1e58b88403007c) --- sys/kern/kern_fork.c | 6 ++++++ sys/kern/kern_jail.c | 18 ++++++++++++++++++ sys/sys/jail.h | 1 + 3 files changed, 25 insertions(+) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 2aa5f405d3c2..ea35afb42f99 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1144,6 +1144,12 @@ fork_return(struct thread *td, struct trapframe *frame) PROC_UNLOCK(p); } + /* + * If the prison was killed mid-fork, die along with it. + */ + if (td->td_ucred->cr_prison->pr_flags & PR_REMOVE) + exit1(td, 0, SIGKILL); + userret(td, frame); #ifdef KTRACE diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 47cc3ddd3bce..0bb9c76a25c9 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1751,6 +1751,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } } pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags; + pr->pr_flags &= ~PR_REMOVE; mtx_unlock(&pr->pr_mtx); #ifdef RACCT @@ -2287,6 +2288,12 @@ prison_remove_one(struct prison *pr) struct proc *p; int deuref; + /* + * Mark the prison as doomed, so it doesn't accidentally come back + * to life. It may still be explicitly brought back by jail_set(2). + */ + pr->pr_flags |= PR_REMOVE; + /* If the prison was persistent, it is not anymore. */ deuref = 0; if (pr->pr_flags & PR_PERSIST) { @@ -2431,6 +2438,17 @@ do_jail_attach(struct thread *td, struct prison *pr) #endif prison_deref(oldcred->cr_prison, PD_DEREF | PD_DEUREF); crfree(oldcred); + + /* + * If the prison was killed while changing credentials, die along + * with it. + */ + if (pr->pr_flags & PR_REMOVE) { + PROC_LOCK(p); + kern_psignal(p, SIGKILL); + PROC_UNLOCK(p); + } + return (0); e_unlock: diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 7142d0d0d71a..90a3fbce821f 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -209,6 +209,7 @@ struct prison_racct { /* primary jail address. */ /* Internal flag bits */ +#define PR_REMOVE 0x01000000 /* In process of being removed */ #define PR_IP4 0x02000000 /* IPv4 restricted or disabled */ /* by this jail or an ancestor */ #define PR_IP6 0x04000000 /* IPv6 restricted or disabled */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:40: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 7D6E055BB2F; Wed, 24 Feb 2021 01:40: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 4DldsL312bz3G2s; Wed, 24 Feb 2021 01:40: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 58C0823E25; Wed, 24 Feb 2021 01:40: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 11O1eMO0050845; Wed, 24 Feb 2021 01:40:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1eMk1050844; Wed, 24 Feb 2021 01:40:22 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:40:22 GMT Message-Id: <202102240140.11O1eMk1050844@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: bc0d9b9b84ec - releng/11.4 - MFC jail: Change both root and working directories in jail_attach(2) 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: bc0d9b9b84ec5f8c463488c46721dd71fc803ceb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:40:22 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bc0d9b9b84ec5f8c463488c46721dd71fc803ceb commit bc0d9b9b84ec5f8c463488c46721dd71fc803ceb Author: Jamie Gritton AuthorDate: 2021-02-19 22:13:35 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:34:48 +0000 MFC jail: Change both root and working directories in jail_attach(2) jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Approved by: so Security: CVE-2020-25582 Security: FreeBSD-SA-21:05.jail_chdir Reported by: mjg Approved by: markj, kib (cherry picked from commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5) (cherry picked from commit 570121808a76b85b2709502fb15618dd1e5296f1) --- lib/libc/sys/jail.2 | 5 ++++- sys/kern/kern_descrip.c | 40 ++++++++++++++++++++++++++++++++++++---- sys/kern/kern_jail.c | 2 +- sys/sys/filedesc.h | 1 + 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/lib/libc/sys/jail.2 b/lib/libc/sys/jail.2 index 2e13a6c3a381..82c2e97d4a7b 100644 --- a/lib/libc/sys/jail.2 +++ b/lib/libc/sys/jail.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 19, 2021 .Dt JAIL 2 .Os .Sh NAME @@ -228,6 +228,9 @@ The system call attaches the current process to an existing jail, identified by .Fa jid . +It changes the process's root and current directories to the jail's +.Va path +directory. .Pp The .Fn jail_remove diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 26b059c0a4b6..17f773d2b7de 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3052,10 +3052,9 @@ chroot_refuse_vdir_fds(struct filedesc *fdp) } /* - * Common routine for kern_chroot() and jail_attach(). The caller is - * responsible for invoking priv_check() and mac_vnode_check_chroot() to - * authorize this operation. - */ +* The caller is responsible for invoking priv_check() and +* mac_vnode_check_chroot() to authorize this operation. +*/ int pwd_chroot(struct thread *td, struct vnode *vp) { @@ -3101,6 +3100,39 @@ pwd_chdir(struct thread *td, struct vnode *vp) vrele(oldvp); } +/* + * jail_attach(2) changes both root and working directories. + */ +int +pwd_chroot_chdir(struct thread *td, struct vnode *vp) +{ + struct filedesc *fdp; + struct vnode *oldvrp, *oldvcp; + int error; + + fdp = td->td_proc->p_fd; + FILEDESC_XLOCK(fdp); + error = chroot_refuse_vdir_fds(fdp); + if (error != 0) { + FILEDESC_XUNLOCK(fdp); + return (error); + } + oldvrp = fdp->fd_rdir; + vrefact(vp); + fdp->fd_rdir = vp; + oldvcp = fdp->fd_cdir; + vrefact(vp); + fdp->fd_cdir = vp; + if (fdp->fd_jdir == NULL) { + vrefact(vp); + fdp->fd_jdir = vp; + } + FILEDESC_XUNLOCK(fdp); + vrele(oldvrp); + vrele(oldvcp); + return (0); +} + /* * Scan all active processes and prisons to see if any of them have a current * or root directory of `olddp'. If so, replace them with the new mount point. diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 0bb9c76a25c9..836bc4e4f8b7 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2418,7 +2418,7 @@ do_jail_attach(struct thread *td, struct prison *pr) goto e_unlock; #endif VOP_UNLOCK(pr->pr_root, 0); - if ((error = pwd_chroot(td, pr->pr_root))) + if ((error = pwd_chroot_chdir(td, pr->pr_root))) goto e_revert_osd; newcred = crget(); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index b9ad9fe363e9..5bbc5a3e6fa8 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -239,6 +239,7 @@ fd_modified(struct filedesc *fdp, int fd, seq_t seq) /* cdir/rdir/jdir manipulation functions. */ void pwd_chdir(struct thread *td, struct vnode *vp); int pwd_chroot(struct thread *td, struct vnode *vp); +int pwd_chroot_chdir(struct thread *td, struct vnode *vp); void pwd_ensure_dirs(void); #endif /* _KERNEL */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:40: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 F0D9255B979; Wed, 24 Feb 2021 01:40: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 4DldsM4JYbz3G9H; Wed, 24 Feb 2021 01:40: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 8151623B65; Wed, 24 Feb 2021 01:40: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 11O1eNY3050866; Wed, 24 Feb 2021 01:40:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1eNkQ050865; Wed, 24 Feb 2021 01:40:23 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:40:23 GMT Message-Id: <202102240140.11O1eNkQ050865@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: 2ca137b4306d - releng/11.4 - MFC freebsd-update: unconditionally regenerate passwd/login.conf files 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: 2ca137b4306dea2dbe1db31c44102060caedb19a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:40:24 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2ca137b4306dea2dbe1db31c44102060caedb19a commit 2ca137b4306dea2dbe1db31c44102060caedb19a Author: Kyle Evans AuthorDate: 2020-12-17 03:42:54 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:34:51 +0000 MFC freebsd-update: unconditionally regenerate passwd/login.conf files The existing logic is nice in theory, but in practice freebsd-update will not preserve the timestamps on these files. When doing a major upgrade, e.g. from 12.1-RELEASE -> 12.2-RELEASE, pwd.mkdb et al. appear in the INDEX and we clobber the timestamp several times in the process of packaging up the existing system into /var/db/freebsd-update/files and extracting for comparisons. This leads to these files not getting regenerated when they're most likely to be needed. Measures could be taken to preserve timestamps, but it's unclear whether the complexity and overhead of doing so is really outweighed by the marginal benefit. I observed this issue when pkg subsequently failed to install a package that wanted to add a user, claiming that the user was removed in the process. bapt@ pointed to this pre-existing bug with freebsd-update as the cause. PR: 234014, 232921 Approved by: so Security: FreeBSD-EN-21:08.freebsd-update (cherry picked from commit ebebc41e4cfe44b8e8fd881badf2fa2c4be65aa4) (cherry picked from commit cd7da1deb581122c94c3735b78fafdd04ce77b67) --- usr.sbin/freebsd-update/freebsd-update.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 1996996b512b..67c323449745 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2949,17 +2949,9 @@ Kernel updates have been installed. Please reboot and run env DESTDIR=${BASEDIR} certctl rehash fi - # Rebuild generated pwd files. - if [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/spwd.db ] || - [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ] || - [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/passwd ]; then - pwd_mkdb -d ${BASEDIR}/etc -p ${BASEDIR}/etc/master.passwd - fi - - # Rebuild /etc/login.conf.db if necessary. - if [ ${BASEDIR}/etc/login.conf -nt ${BASEDIR}/etc/login.conf.db ]; then - cap_mkdb ${BASEDIR}/etc/login.conf - fi + # Rebuild generated pwd files and /etc/login.conf.db. + pwd_mkdb -d ${BASEDIR}/etc -p ${BASEDIR}/etc/master.passwd + cap_mkdb ${BASEDIR}/etc/login.conf # Rebuild man page databases, if necessary. for D in /usr/share/man /usr/share/openssl/man; do From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:40: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 0423355B8FF; Wed, 24 Feb 2021 01:40: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 4DldsP0JnYz3G5q; Wed, 24 Feb 2021 01:40: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 C67D223DBB; Wed, 24 Feb 2021 01:40: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 11O1eOWV050884; Wed, 24 Feb 2021 01:40:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1eOAH050883; Wed, 24 Feb 2021 01:40:24 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:40:24 GMT Message-Id: <202102240140.11O1eOAH050883@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: ab1cd885a619 - releng/11.4 - xen-blkback: fix leak of grant maps on ring setup failure 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: ab1cd885a619a0304e40fa07795ea9ddcb33134e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:40:27 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ab1cd885a619a0304e40fa07795ea9ddcb33134e commit ab1cd885a619a0304e40fa07795ea9ddcb33134e Author: Roger Pau Monné AuthorDate: 2021-01-20 18:40:51 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:34:52 +0000 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Approved by: so Security: CVE-2021-26932 Security: FreeBSD-SA-21:06.xen Sponsored by: Citrix Systems R&D (cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45) (cherry picked from commit 89238773a37f4fc8f0bf3ccca3aa03874478f194) --- sys/dev/xen/blkback/blkback.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index 4b6eeb0cf62f..5fb5cdbe6ea1 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -2911,10 +2911,31 @@ xbb_connect_ring(struct xbb_softc *xbb) ring_idx < xbb->ring_config.ring_pages; ring_idx++, gnt++) { if (gnt->status != 0) { + struct gnttab_unmap_grant_ref unmap[XBB_MAX_RING_PAGES]; + unsigned int i, j; + xbb->ring_config.va = 0; xenbus_dev_fatal(xbb->dev, EACCES, "Ring shared page mapping failed. " "Status %d.", gnt->status); + + /* Unmap everything to avoid leaking grant table maps */ + for (i = 0, j = 0; i < xbb->ring_config.ring_pages; + i++) { + if (gnts[i].status != GNTST_okay) + continue; + + unmap[j].host_addr = gnts[i].host_addr; + unmap[j].dev_bus_addr = gnts[i].dev_bus_addr; + unmap[j++].handle = gnts[i].handle; + } + if (j != 0) { + error = HYPERVISOR_grant_table_op( + GNTTABOP_unmap_grant_ref, unmap, j); + if (error != 0) + panic("Unable to unmap grants (%d)", + error); + } return (EACCES); } xbb->ring_config.handle[ring_idx] = gnt->handle; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:40: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 EB93055BC0D; Wed, 24 Feb 2021 01:40: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 4DldsR5kQhz3Ftx; Wed, 24 Feb 2021 01:40: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 F202623E26; Wed, 24 Feb 2021 01:40: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 11O1eQNX050924; Wed, 24 Feb 2021 01:40:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1eQ7C050923; Wed, 24 Feb 2021 01:40:26 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:40:26 GMT Message-Id: <202102240140.11O1eQ7C050923@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: 7a03d4b081a0 - releng/11.4 - Add UPDATING entry and bump version 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: 7a03d4b081a02c6b8d8d816f4172f0d01980497e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:40:31 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7a03d4b081a02c6b8d8d816f4172f0d01980497e commit 7a03d4b081a02c6b8d8d816f4172f0d01980497e Author: Mark Johnston AuthorDate: 2021-02-23 22:54:20 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:34:52 +0000 Add UPDATING entry and bump version Approved by: so --- UPDATING | 16 ++++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 9e75e2201d6b..f67b1d59b118 100644 --- a/UPDATING +++ b/UPDATING @@ -16,6 +16,22 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20210223: p8 FreeBSD-SA-21:03.pam_login_access + FreeBSD-SA-21:04.jail_remove + FreeBSD-SA-21:05.jail_chdir + FreeBSD-SA-21:06.xen + FreeBSD-EN-21:08.freebsd-update + + login.access fails to apply rules [SA-21:03.pam_login_access] + + jail_remove(2) fails to kill all jailed processes [SA-21:04.jail_remove] + + jail_attach(2) relies on the caller to change the cwd [SA-21:05.jail_chdir] + + Xen grant mapping error handling issues [SA-21:06.xen] + + freebsd-update passwd regeneration [EN-21:08.freebsd-update] + 20210128: p7 FreeBSD-EN-21:01.tzdata FreeBSD-EN-21:02.extattr FreeBSD-EN-21:05.libatomic diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e9d5ad3f5d41..96d5d515e010 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.4" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:40: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 BEBDF55BC0C; Wed, 24 Feb 2021 01:40: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 4DldsR5l4Cz3Fv2; Wed, 24 Feb 2021 01:40: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 2BAE823D4A; Wed, 24 Feb 2021 01:40: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 11O1ePpt050904; Wed, 24 Feb 2021 01:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1ePIX050903; Wed, 24 Feb 2021 01:40:25 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:40:25 GMT Message-Id: <202102240140.11O1ePIX050903@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: 3ea0e6b45274 - releng/11.4 - pam_login_access: Fix negative entry matching logic 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: 3ea0e6b45274a296b859a3171070834a2e33c5fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:40:30 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3ea0e6b45274a296b859a3171070834a2e33c5fd commit 3ea0e6b45274a296b859a3171070834a2e33c5fd Author: Mark Johnston AuthorDate: 2021-02-23 22:01:29 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:34:52 +0000 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access (cherry picked from commit 6ab923cbca8759503a08683a5978b9ebf5efd607) (cherry picked from commit dae05d22d64ea218abe5883be539c2b41c20b1fb) --- lib/libpam/modules/pam_login_access/login_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 9496081d362e..719808858dac 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -137,10 +137,10 @@ list_match(char *list, const char *item, if (match != NO) { while ((tok = strtok((char *) 0, listsep)) && strcmp(tok, "EXCEPT")) { /* VOID */ ; - if (tok == NULL || list_match((char *) 0, item, match_fn, - login_access_opts) == NO) { + } + if (tok == NULL || + list_match((char *) 0, item, match_fn, login_access_opts) == NO) { return (match); - } } } return (NO); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 D881355BCF8; Wed, 24 Feb 2021 01:42: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 4DldvJ5qLLz3Gt8; Wed, 24 Feb 2021 01:42: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 BAC2624183; Wed, 24 Feb 2021 01:42: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 11O1g47p054459; Wed, 24 Feb 2021 01:42:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1g4fS054458; Wed, 24 Feb 2021 01:42:04 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:04 GMT Message-Id: <202102240142.11O1g4fS054458@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: b306be13a9c7 - releng/12.2 - MFC jail: Handle a possible race between jail_remove(2) and fork(2) 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: b306be13a9c7ea0db8979a8a53dca93f90ec59cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:04 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b306be13a9c7ea0db8979a8a53dca93f90ec59cc commit b306be13a9c7ea0db8979a8a53dca93f90ec59cc Author: Jamie Gritton AuthorDate: 2021-02-16 19:19:13 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:41:49 +0000 MFC jail: Handle a possible race between jail_remove(2) and fork(2) jail_remove(2) includes a loop that sends SIGKILL to all processes in a jail, but skips processes in PRS_NEW state. Thus it is possible the a process in mid-fork(2) during jail removal can survive the jail being removed. Add a prison flag PR_REMOVE, which is checked before the new process returns. If the jail is being removed, the process will then exit. Also check this flag in jail_attach(2) which has a similar issue. Approved by: so Security: CVE-2020-25581 Security: FreeBSD-SA-21:04.jail_remove Reported by: mjg Approved by: kib (cherry picked from commit cc7b73065302005ebc4a19503188c8d6d5eb923d) (cherry picked from commit f7007a7d05255a6859dea0982b1f0a6d695e8881) --- sys/kern/kern_fork.c | 6 ++++++ sys/kern/kern_jail.c | 18 ++++++++++++++++++ sys/sys/jail.h | 1 + 3 files changed, 25 insertions(+) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index e427164cd150..f8e134c30948 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1138,6 +1138,12 @@ fork_return(struct thread *td, struct trapframe *frame) PROC_UNLOCK(p); } + /* + * If the prison was killed mid-fork, die along with it. + */ + if (td->td_ucred->cr_prison->pr_flags & PR_REMOVE) + exit1(td, 0, SIGKILL); + userret(td, frame); #ifdef KTRACE diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 60cbea3c9849..b4a20b4d29e9 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1768,6 +1768,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } } pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags; + pr->pr_flags &= ~PR_REMOVE; mtx_unlock(&pr->pr_mtx); #ifdef RACCT @@ -2306,6 +2307,12 @@ prison_remove_one(struct prison *pr) struct proc *p; int deuref; + /* + * Mark the prison as doomed, so it doesn't accidentally come back + * to life. It may still be explicitly brought back by jail_set(2). + */ + pr->pr_flags |= PR_REMOVE; + /* If the prison was persistent, it is not anymore. */ deuref = 0; if (pr->pr_flags & PR_PERSIST) { @@ -2450,6 +2457,17 @@ do_jail_attach(struct thread *td, struct prison *pr) #endif prison_deref(oldcred->cr_prison, PD_DEREF | PD_DEUREF); crfree(oldcred); + + /* + * If the prison was killed while changing credentials, die along + * with it. + */ + if (pr->pr_flags & PR_REMOVE) { + PROC_LOCK(p); + kern_psignal(p, SIGKILL); + PROC_UNLOCK(p); + } + return (0); e_unlock: diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 878b97a064a3..8baf784d6b6d 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -213,6 +213,7 @@ struct prison_racct { /* primary jail address. */ /* Internal flag bits */ +#define PR_REMOVE 0x01000000 /* In process of being removed */ #define PR_IP4 0x02000000 /* IPv4 restricted or disabled */ /* by this jail or an ancestor */ #define PR_IP6 0x04000000 /* IPv6 restricted or disabled */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 1154F55BE70; Wed, 24 Feb 2021 01:42: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 4DldvK6th7z3GqZ; Wed, 24 Feb 2021 01:42: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 D450023E4F; Wed, 24 Feb 2021 01:42: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 11O1g5dD054482; Wed, 24 Feb 2021 01:42:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1g5L6054481; Wed, 24 Feb 2021 01:42:05 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:05 GMT Message-Id: <202102240142.11O1g5L6054481@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: 4dd124c3171d - releng/12.2 - MFC jail: Change both root and working directories in jail_attach(2) 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: 4dd124c3171db9cd7fbcc49d8081de590a065d0b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:06 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4dd124c3171db9cd7fbcc49d8081de590a065d0b commit 4dd124c3171db9cd7fbcc49d8081de590a065d0b Author: Jamie Gritton AuthorDate: 2021-02-19 22:13:35 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:41:57 +0000 MFC jail: Change both root and working directories in jail_attach(2) jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Approved by: so Security: CVE-2020-25582 Security: FreeBSD-SA-21:05.jail_chdir Reported by: mjg Approved by: markj, kib (cherry picked from commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5) (cherry picked from commit ca9ab8ea17748a1758701fde262cb272fb757989) --- lib/libc/sys/jail.2 | 5 ++++- sys/kern/kern_descrip.c | 40 ++++++++++++++++++++++++++++++++++++---- sys/kern/kern_jail.c | 2 +- sys/sys/filedesc.h | 1 + 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/lib/libc/sys/jail.2 b/lib/libc/sys/jail.2 index 2e13a6c3a381..82c2e97d4a7b 100644 --- a/lib/libc/sys/jail.2 +++ b/lib/libc/sys/jail.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 19, 2021 .Dt JAIL 2 .Os .Sh NAME @@ -228,6 +228,9 @@ The system call attaches the current process to an existing jail, identified by .Fa jid . +It changes the process's root and current directories to the jail's +.Va path +directory. .Pp The .Fn jail_remove diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index cda64931779b..b61b6bc2d66e 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3216,10 +3216,9 @@ chroot_refuse_vdir_fds(struct filedesc *fdp) } /* - * Common routine for kern_chroot() and jail_attach(). The caller is - * responsible for invoking priv_check() and mac_vnode_check_chroot() to - * authorize this operation. - */ +* The caller is responsible for invoking priv_check() and +* mac_vnode_check_chroot() to authorize this operation. +*/ int pwd_chroot(struct thread *td, struct vnode *vp) { @@ -3265,6 +3264,39 @@ pwd_chdir(struct thread *td, struct vnode *vp) vrele(oldvp); } +/* + * jail_attach(2) changes both root and working directories. + */ +int +pwd_chroot_chdir(struct thread *td, struct vnode *vp) +{ + struct filedesc *fdp; + struct vnode *oldvrp, *oldvcp; + int error; + + fdp = td->td_proc->p_fd; + FILEDESC_XLOCK(fdp); + error = chroot_refuse_vdir_fds(fdp); + if (error != 0) { + FILEDESC_XUNLOCK(fdp); + return (error); + } + oldvrp = fdp->fd_rdir; + vrefact(vp); + fdp->fd_rdir = vp; + oldvcp = fdp->fd_cdir; + vrefact(vp); + fdp->fd_cdir = vp; + if (fdp->fd_jdir == NULL) { + vrefact(vp); + fdp->fd_jdir = vp; + } + FILEDESC_XUNLOCK(fdp); + vrele(oldvrp); + vrele(oldvcp); + return (0); +} + /* * Scan all active processes and prisons to see if any of them have a current * or root directory of `olddp'. If so, replace them with the new mount point. diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index b4a20b4d29e9..46b43fa7bbc2 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2437,7 +2437,7 @@ do_jail_attach(struct thread *td, struct prison *pr) goto e_unlock; #endif VOP_UNLOCK(pr->pr_root, 0); - if ((error = pwd_chroot(td, pr->pr_root))) + if ((error = pwd_chroot_chdir(td, pr->pr_root))) goto e_revert_osd; newcred = crget(); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index db5debcfe7c8..ca85f49d7997 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -243,6 +243,7 @@ fd_modified(struct filedesc *fdp, int fd, seq_t seq) /* cdir/rdir/jdir manipulation functions. */ void pwd_chdir(struct thread *td, struct vnode *vp); int pwd_chroot(struct thread *td, struct vnode *vp); +int pwd_chroot_chdir(struct thread *td, struct vnode *vp); void pwd_ensure_dirs(void); #endif /* _KERNEL */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 F27B955BF14; Wed, 24 Feb 2021 01:42: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 4DldvM36QLz3H2x; Wed, 24 Feb 2021 01:42: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 036D424118; Wed, 24 Feb 2021 01:42: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 11O1g6VD054500; Wed, 24 Feb 2021 01:42:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1g6eF054499; Wed, 24 Feb 2021 01:42:06 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:06 GMT Message-Id: <202102240142.11O1g6eF054499@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: 0f1ee1523649 - releng/12.2 - Free microcode memory later. 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: 0f1ee1523649b745535f14988880eea239c2af3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:09 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0f1ee1523649b745535f14988880eea239c2af3f commit 0f1ee1523649b745535f14988880eea239c2af3f Author: Konstantin Belousov AuthorDate: 2019-05-17 17:11:01 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:00 +0000 Free microcode memory later. Approved by: so Security: FreeBSD-EN-21:06.microcode (cherry picked from commit 8f7f38457f940798c149ae40b73e0d20672812de) (cherry picked from commit 79bee465de342b82fa300293d04f155f2d6a6183) --- sys/x86/x86/ucode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/x86/ucode.c b/sys/x86/x86/ucode.c index 93f82e37eb66..d8beeed68215 100644 --- a/sys/x86/x86/ucode.c +++ b/sys/x86/x86/ucode.c @@ -260,7 +260,7 @@ restart: goto restart; } } -SYSINIT(ucode_release, SI_SUB_KMEM + 1, SI_ORDER_ANY, ucode_release, NULL); +SYSINIT(ucode_release, SI_SUB_SMP + 1, SI_ORDER_ANY, ucode_release, NULL); void ucode_load_ap(int cpu) From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 3B66E55BC75; Wed, 24 Feb 2021 01:42: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 4DldvP2Kc1z3HF8; Wed, 24 Feb 2021 01:42: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 4A55D238ED; Wed, 24 Feb 2021 01:42: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 11O1g8gg054518; Wed, 24 Feb 2021 01:42:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1g8dm054517; Wed, 24 Feb 2021 01:42:08 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:08 GMT Message-Id: <202102240142.11O1g8dm054517@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: df378912ebc2 - releng/12.2 - MFC freebsd-update: unconditionally regenerate passwd/login.conf files 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: df378912ebc2fe2603fcbcedf72af9d7b0e94db7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:11 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=df378912ebc2fe2603fcbcedf72af9d7b0e94db7 commit df378912ebc2fe2603fcbcedf72af9d7b0e94db7 Author: Kyle Evans AuthorDate: 2020-12-17 03:42:54 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:01 +0000 MFC freebsd-update: unconditionally regenerate passwd/login.conf files The existing logic is nice in theory, but in practice freebsd-update will not preserve the timestamps on these files. When doing a major upgrade, e.g. from 12.1-RELEASE -> 12.2-RELEASE, pwd.mkdb et al. appear in the INDEX and we clobber the timestamp several times in the process of packaging up the existing system into /var/db/freebsd-update/files and extracting for comparisons. This leads to these files not getting regenerated when they're most likely to be needed. Measures could be taken to preserve timestamps, but it's unclear whether the complexity and overhead of doing so is really outweighed by the marginal benefit. I observed this issue when pkg subsequently failed to install a package that wanted to add a user, claiming that the user was removed in the process. bapt@ pointed to this pre-existing bug with freebsd-update as the cause. PR: 234014, 232921 Approved by: so Security: FreeBSD-EN-21:08.freebsd-update (cherry picked from commit ebebc41e4cfe44b8e8fd881badf2fa2c4be65aa4) (cherry picked from commit 5cf1ba21eebaf89cf4d8639a18345dc49116d1d5) --- usr.sbin/freebsd-update/freebsd-update.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index ea85bb7c6831..004515bb8bf8 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2949,17 +2949,9 @@ Kernel updates have been installed. Please reboot and run env DESTDIR=${BASEDIR} certctl rehash fi - # Rebuild generated pwd files. - if [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/spwd.db ] || - [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ] || - [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/passwd ]; then - pwd_mkdb -d ${BASEDIR}/etc -p ${BASEDIR}/etc/master.passwd - fi - - # Rebuild /etc/login.conf.db if necessary. - if [ ${BASEDIR}/etc/login.conf -nt ${BASEDIR}/etc/login.conf.db ]; then - cap_mkdb ${BASEDIR}/etc/login.conf - fi + # Rebuild generated pwd files and /etc/login.conf.db. + pwd_mkdb -d ${BASEDIR}/etc -p ${BASEDIR}/etc/master.passwd + cap_mkdb ${BASEDIR}/etc/login.conf # Rebuild man page databases, if necessary. for D in /usr/share/man /usr/share/openssl/man; do From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 168AA55BD7D; Wed, 24 Feb 2021 01:42: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 4DldvR1ffDz3HFN; Wed, 24 Feb 2021 01:42: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 467B82411B; Wed, 24 Feb 2021 01:42: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 11O1g9QB054540; Wed, 24 Feb 2021 01:42:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1g9w9054539; Wed, 24 Feb 2021 01:42:09 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:09 GMT Message-Id: <202102240142.11O1g9w9054539@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: efc9549ba0c2 - releng/12.2 - MFC r368555: caroot: update bundle 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: efc9549ba0c2caffd45e1f7f88fdd75a0225e568 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:14 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=efc9549ba0c2caffd45e1f7f88fdd75a0225e568 commit efc9549ba0c2caffd45e1f7f88fdd75a0225e568 Author: Kyle Evans AuthorDate: 2020-12-15 21:50:05 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:01 +0000 MFC r368555: caroot: update bundle Summary: - One (1) added - Ten (10) removed Approved by: so Security: FreeBSD-EN-21:07.caroot (cherry picked from commit e4e8ecaf63ba6f2767680a7b4666461243d88749) --- .../GeoTrust_Global_CA.pem | 0 .../GeoTrust_Primary_Certification_Authority.pem | 0 ...oTrust_Primary_Certification_Authority_-_G3.pem | 0 .../GeoTrust_Universal_CA.pem | 0 .../GeoTrust_Universal_CA_2.pem | 0 ...Public_Primary_Certification_Authority_-_G4.pem | 0 ...Public_Primary_Certification_Authority_-_G5.pem | 0 .../thawte_Primary_Root_CA.pem | 0 .../thawte_Primary_Root_CA_-_G2.pem | 0 .../thawte_Primary_Root_CA_-_G3.pem | 0 .../NAVER_Global_Root_Certification_Authority.pem | 134 +++++++++++++++++++++ 11 files changed, 134 insertions(+) diff --git a/secure/caroot/trusted/GeoTrust_Global_CA.pem b/secure/caroot/blacklisted/GeoTrust_Global_CA.pem similarity index 100% rename from secure/caroot/trusted/GeoTrust_Global_CA.pem rename to secure/caroot/blacklisted/GeoTrust_Global_CA.pem diff --git a/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority.pem b/secure/caroot/blacklisted/GeoTrust_Primary_Certification_Authority.pem similarity index 100% rename from secure/caroot/trusted/GeoTrust_Primary_Certification_Authority.pem rename to secure/caroot/blacklisted/GeoTrust_Primary_Certification_Authority.pem diff --git a/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G3.pem b/secure/caroot/blacklisted/GeoTrust_Primary_Certification_Authority_-_G3.pem similarity index 100% rename from secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G3.pem rename to secure/caroot/blacklisted/GeoTrust_Primary_Certification_Authority_-_G3.pem diff --git a/secure/caroot/trusted/GeoTrust_Universal_CA.pem b/secure/caroot/blacklisted/GeoTrust_Universal_CA.pem similarity index 100% rename from secure/caroot/trusted/GeoTrust_Universal_CA.pem rename to secure/caroot/blacklisted/GeoTrust_Universal_CA.pem diff --git a/secure/caroot/trusted/GeoTrust_Universal_CA_2.pem b/secure/caroot/blacklisted/GeoTrust_Universal_CA_2.pem similarity index 100% rename from secure/caroot/trusted/GeoTrust_Universal_CA_2.pem rename to secure/caroot/blacklisted/GeoTrust_Universal_CA_2.pem diff --git a/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem b/secure/caroot/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem similarity index 100% rename from secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem rename to secure/caroot/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem diff --git a/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem b/secure/caroot/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem similarity index 100% rename from secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem rename to secure/caroot/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem diff --git a/secure/caroot/trusted/thawte_Primary_Root_CA.pem b/secure/caroot/blacklisted/thawte_Primary_Root_CA.pem similarity index 100% rename from secure/caroot/trusted/thawte_Primary_Root_CA.pem rename to secure/caroot/blacklisted/thawte_Primary_Root_CA.pem diff --git a/secure/caroot/trusted/thawte_Primary_Root_CA_-_G2.pem b/secure/caroot/blacklisted/thawte_Primary_Root_CA_-_G2.pem similarity index 100% rename from secure/caroot/trusted/thawte_Primary_Root_CA_-_G2.pem rename to secure/caroot/blacklisted/thawte_Primary_Root_CA_-_G2.pem diff --git a/secure/caroot/trusted/thawte_Primary_Root_CA_-_G3.pem b/secure/caroot/blacklisted/thawte_Primary_Root_CA_-_G3.pem similarity index 100% rename from secure/caroot/trusted/thawte_Primary_Root_CA_-_G3.pem rename to secure/caroot/blacklisted/thawte_Primary_Root_CA_-_G3.pem diff --git a/secure/caroot/trusted/NAVER_Global_Root_Certification_Authority.pem b/secure/caroot/trusted/NAVER_Global_Root_Certification_Authority.pem new file mode 100644 index 000000000000..3b042c1c2716 --- /dev/null +++ b/secure/caroot/trusted/NAVER_Global_Root_Certification_Authority.pem @@ -0,0 +1,134 @@ +## +## NAVER Global Root Certification Authority +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 01:94:30:1e:a2:0b:dd:f5:c5:33:2a:b1:43:44:71:f8:d6:50:4d:0d + Signature Algorithm: sha384WithRSAEncryption + Issuer: C = KR, O = NAVER BUSINESS PLATFORM Corp., CN = NAVER Global Root Certification Authority + Validity + Not Before: Aug 18 08:58:42 2017 GMT + Not After : Aug 18 23:59:59 2037 GMT + Subject: C = KR, O = NAVER BUSINESS PLATFORM Corp., CN = NAVER Global Root Certification Authority + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:b6:d4:f1:93:5c:b5:40:89:0a:ab:0d:90:5b:50: + 63:ae:90:94:74:17:45:72:d6:7b:65:5a:29:4b:a7: + 56:a0:4b:b8:2f:42:75:e9:d9:7b:24:5a:31:65:ab: + 17:17:d1:33:3a:d9:11:dc:40:36:87:df:c7:6a:e9: + 26:5e:59:8a:77:e3:e8:48:9c:31:16:fa:3e:91:b1: + ca:c9:a3:e2:9f:ce:21:53:a3:02:36:30:cb:52:02: + e5:da:32:5d:c3:c5:e6:f9:ee:11:c7:8b:c9:44:1e: + 84:93:18:4a:b4:9f:e5:12:64:69:d0:26:85:62:01: + b6:c9:02:1d:be:83:51:bb:5c:da:f8:ad:15:6a:99: + f7:92:54:f7:34:5b:e9:bf:ea:29:81:12:d4:53:91: + 96:b3:91:5a:dd:fe:90:73:28:fb:30:46:b5:ca:08: + 07:c7:71:72:c9:66:d3:34:97:f6:8c:f4:18:4a:e1: + d0:3d:5a:45:b6:69:a7:29:fb:23:ce:88:d8:12:9c: + 00:48:a8:a6:0f:b3:3b:92:8d:71:0e:74:c5:8b:c8: + 4c:f9:f4:9b:8e:b8:3c:69:ed:6f:3b:50:2f:58:ed: + c4:b0:d0:1c:1b:6a:0c:e2:bc:44:aa:d8:cd:14:5d: + 94:78:61:bf:0e:6e:da:2a:bc:2f:0c:0b:71:a6:b3: + 16:3f:9c:e6:f9:cc:9f:53:35:e2:03:a0:a0:18:bf: + bb:f1:be:f4:d6:8c:87:0d:42:f7:06:b9:f1:6d:ed: + 04:94:a8:fe:b6:d3:06:c6:40:61:df:9d:9d:f3:54: + 76:ce:53:3a:01:a6:92:41:ec:04:a3:8f:0d:a2:d5: + 09:ca:d6:cb:9a:f1:ef:43:5d:c0:ab:a5:41:cf:5c: + 53:70:70:c9:88:a6:2d:d4:6b:61:73:50:26:86:61: + 0e:5f:1b:c2:2b:e2:8c:d5:bb:9d:c1:03:42:ba:94: + da:5f:a9:b0:ca:cc:4d:0a:ef:47:69:03:2f:22:fb: + f1:28:ce:bf:5d:50:65:a8:90:6d:b3:74:b0:08:c7: + ac:a8:d1:eb:3e:9c:fc:5d:1a:83:2e:2b:cb:b5:f3: + 44:9d:3a:a7:17:61:96:a2:71:d3:70:96:15:4d:b7: + 4c:73:ee:19:5c:c5:5b:3e:41:fe:ac:75:60:3b:1b: + 63:ce:00:dd:da:08:90:62:b4:e5:2d:ee:48:a7:6b: + 17:99:54:be:87:4a:e3:a9:5e:04:4c:eb:10:6d:54: + d6:ef:f1:e8:f2:62:16:cb:80:6b:ed:3d:ed:f5:1f: + 30:a5:ae:4b:c9:13:ed:8a:01:01:c9:b8:51:58:c0: + 66:3a:b1:66:4b:c4:d5:31:02:62:e9:74:84:0c:db: + 4d:46:2d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + D2:9F:88:DF:A1:CD:2C:BD:EC:F5:3B:01:01:93:33:27:B2:EB:60:4B + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha384WithRSAEncryption + 32:ca:80:b3:9d:3d:54:06:dd:d2:d2:2e:f0:a4:01:21:0b:67: + 48:ca:6d:8e:e0:c8:aa:0d:aa:8d:21:57:8f:c6:3e:7a:ca:db: + 51:d4:52:b3:d4:96:84:a5:58:60:7f:e5:0b:8e:1f:f5:dc:0a: + 15:81:e5:3b:b6:b7:22:2f:09:9c:13:16:b1:6c:0c:35:08:6d: + ab:63:72:ed:dc:be:ec:c7:57:e6:30:20:71:d6:d7:10:c1:13: + 55:01:8c:2a:43:e4:41:f1:cf:3a:7a:53:92:ce:a2:03:05:0d: + 38:df:02:bb:10:2e:d9:3b:d2:9b:7a:c0:a1:a6:f8:b5:31:e6: + f4:75:c9:b9:53:99:75:47:22:5a:14:15:c7:78:1b:b6:9d:e9: + 0c:f8:1b:76:f1:85:84:de:a1:da:12:ef:a4:e2:10:97:7a:78: + de:0c:51:97:a8:21:40:8b:86:bd:0d:f0:5e:4e:4b:36:bb:3b: + 20:1f:8a:42:56:e1:0b:1a:bf:7b:d0:22:43:2c:44:8c:fb:e5: + 2a:b4:6c:1c:1c:ba:94:e0:13:7e:21:e6:9a:c2:cb:c5:42:64: + b4:1e:94:7b:08:25:c8:71:cc:87:45:57:85:d3:9f:29:62:22: + 83:51:97:00:18:97:77:6a:98:92:c9:7c:60:6c:df:6c:7d:4a: + e4:70:4c:c2:9e:b8:1d:f7:d0:34:c7:0f:cc:fb:a7:ff:03:be: + ad:70:90:da:0b:dd:c8:6d:97:5f:9a:7f:09:32:41:fd:cd:a2: + cc:5a:6d:4c:f2:aa:49:fe:66:f8:e9:d8:35:eb:0e:28:1e:ee: + 48:2f:3a:d0:79:09:38:7c:a6:22:82:93:95:d0:03:be:be:02: + a0:05:dd:20:22:e3:6f:1d:88:34:60:c6:e6:0a:b9:09:75:0b: + f0:07:e8:69:96:35:c7:fb:23:81:8e:38:39:b8:45:2b:43:78: + a2:d1:2c:14:ff:0d:28:72:72:95:9b:5e:09:db:89:44:98:aa: + a1:49:bb:71:52:f2:bf:f6:ff:27:a1:36:af:b8:b6:77:88:dd: + 3a:a4:6d:9b:34:90:dc:14:5d:30:bf:b7:eb:17:e4:87:b7:71: + d0:a1:d7:77:15:d4:42:d7:f2:f3:31:99:5d:9b:dd:16:6d:3f: + ea:06:23:f8:46:a2:22:ed:93:f6:dd:9a:e6:2a:87:b1:98:54: + f1:22:f7:6b:45:e3:e2:8e:76:1d:9a:8d:c4:06:8d:36:b7:14: + f3:9d:54:69:b7:8e:3c:d5:a4:6d:93:81:b7:ad:f6:bd:64:7b: + c2:c9:68:39:a0:92:9c:cd:34:86:91:90:fa:64:51:9d:fe:fe: + eb:a5:f5:75:de:89:f7:72 +SHA1 Fingerprint=8F:6B:F2:A9:27:4A:DA:14:A0:C4:F4:8E:61:27:F9:C0:1E:78:5D:D1 +-----BEGIN CERTIFICATE----- +MIIFojCCA4qgAwIBAgIUAZQwHqIL3fXFMyqxQ0Rx+NZQTQ0wDQYJKoZIhvcNAQEM +BQAwaTELMAkGA1UEBhMCS1IxJjAkBgNVBAoMHU5BVkVSIEJVU0lORVNTIFBMQVRG +T1JNIENvcnAuMTIwMAYDVQQDDClOQVZFUiBHbG9iYWwgUm9vdCBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eTAeFw0xNzA4MTgwODU4NDJaFw0zNzA4MTgyMzU5NTlaMGkx +CzAJBgNVBAYTAktSMSYwJAYDVQQKDB1OQVZFUiBCVVNJTkVTUyBQTEFURk9STSBD +b3JwLjEyMDAGA1UEAwwpTkFWRVIgR2xvYmFsIFJvb3QgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC21PGTXLVA +iQqrDZBbUGOukJR0F0Vy1ntlWilLp1agS7gvQnXp2XskWjFlqxcX0TM62RHcQDaH +38dq6SZeWYp34+hInDEW+j6RscrJo+KfziFTowI2MMtSAuXaMl3Dxeb57hHHi8lE +HoSTGEq0n+USZGnQJoViAbbJAh2+g1G7XNr4rRVqmfeSVPc0W+m/6imBEtRTkZaz +kVrd/pBzKPswRrXKCAfHcXLJZtM0l/aM9BhK4dA9WkW2aacp+yPOiNgSnABIqKYP +szuSjXEOdMWLyEz59JuOuDxp7W87UC9Y7cSw0BwbagzivESq2M0UXZR4Yb8Obtoq +vC8MC3GmsxY/nOb5zJ9TNeIDoKAYv7vxvvTWjIcNQvcGufFt7QSUqP620wbGQGHf +nZ3zVHbOUzoBppJB7ASjjw2i1QnK1sua8e9DXcCrpUHPXFNwcMmIpi3Ua2FzUCaG +YQ5fG8Ir4ozVu53BA0K6lNpfqbDKzE0K70dpAy8i+/Eozr9dUGWokG2zdLAIx6yo +0es+nPxdGoMuK8u180SdOqcXYZaicdNwlhVNt0xz7hlcxVs+Qf6sdWA7G2POAN3a +CJBitOUt7kinaxeZVL6HSuOpXgRM6xBtVNbv8ejyYhbLgGvtPe31HzClrkvJE+2K +AQHJuFFYwGY6sWZLxNUxAmLpdIQM201GLQIDAQABo0IwQDAdBgNVHQ4EFgQU0p+I +36HNLL3s9TsBAZMzJ7LrYEswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMB +Af8wDQYJKoZIhvcNAQEMBQADggIBADLKgLOdPVQG3dLSLvCkASELZ0jKbY7gyKoN +qo0hV4/GPnrK21HUUrPUloSlWGB/5QuOH/XcChWB5Tu2tyIvCZwTFrFsDDUIbatj +cu3cvuzHV+YwIHHW1xDBE1UBjCpD5EHxzzp6U5LOogMFDTjfArsQLtk70pt6wKGm ++LUx5vR1yblTmXVHIloUFcd4G7ad6Qz4G3bxhYTeodoS76TiEJd6eN4MUZeoIUCL +hr0N8F5OSza7OyAfikJW4Qsav3vQIkMsRIz75Sq0bBwcupTgE34h5prCy8VCZLQe +lHsIJchxzIdFV4XTnyliIoNRlwAYl3dqmJLJfGBs32x9SuRwTMKeuB330DTHD8z7 +p/8Dvq1wkNoL3chtl1+afwkyQf3NosxabUzyqkn+Zvjp2DXrDige7kgvOtB5CTh8 +piKCk5XQA76+AqAF3SAi428diDRgxuYKuQl1C/AH6GmWNcf7I4GOODm4RStDeKLR +LBT/DShycpWbXgnbiUSYqqFJu3FS8r/2/yehNq+4tneI3TqkbZs0kNwUXTC/t+sX +5Ie3cdCh13cV1ELX8vMxmV2b3RZtP+oGI/hGoiLtk/bdmuYqh7GYVPEi92tF4+KO +dh2ajcQGjTa3FPOdVGm3jjzVpG2Tgbet9r1ke8LJaDmgkpzNNIaRkPpkUZ3+/uul +9XXeifdy +-----END CERTIFICATE----- From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 98B8355BF92; Wed, 24 Feb 2021 01:42: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 4DldvW6L3sz3HFj; Wed, 24 Feb 2021 01:42: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 863A323FB6; Wed, 24 Feb 2021 01:42: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 11O1gB0F054795; Wed, 24 Feb 2021 01:42:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1gBhj054781; Wed, 24 Feb 2021 01:42:11 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:11 GMT Message-Id: <202102240142.11O1gBhj054781@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: f8e0874a2d97 - releng/12.2 - pam_login_access: Fix negative entry matching logic 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: f8e0874a2d975f98fd87a63460faa4f09f84b33c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:17 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f8e0874a2d975f98fd87a63460faa4f09f84b33c commit f8e0874a2d975f98fd87a63460faa4f09f84b33c Author: Mark Johnston AuthorDate: 2021-02-23 22:01:29 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:01 +0000 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access (cherry picked from commit 6ab923cbca8759503a08683a5978b9ebf5efd607) (cherry picked from commit c99e3e2d96935ae4d61948bf7660e9b9c2afb4d9) --- lib/libpam/modules/pam_login_access/login_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 9496081d362e..719808858dac 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -137,10 +137,10 @@ list_match(char *list, const char *item, if (match != NO) { while ((tok = strtok((char *) 0, listsep)) && strcmp(tok, "EXCEPT")) { /* VOID */ ; - if (tok == NULL || list_match((char *) 0, item, match_fn, - login_access_opts) == NO) { + } + if (tok == NULL || + list_match((char *) 0, item, match_fn, login_access_opts) == NO) { return (match); - } } } return (NO); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 C440C55C014; Wed, 24 Feb 2021 01:42: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 4DldvX6WzCz3HHl; Wed, 24 Feb 2021 01:42: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 B92F02405E; Wed, 24 Feb 2021 01:42: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 11O1gCJL055455; Wed, 24 Feb 2021 01:42:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1gCqX055454; Wed, 24 Feb 2021 01:42:12 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:12 GMT Message-Id: <202102240142.11O1gCqX055454@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: 142f0d36d909 - releng/12.2 - Add UPDATING entry and bump version 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: 142f0d36d90979a983e1bb0b69d1d859338b4d90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:19 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=142f0d36d90979a983e1bb0b69d1d859338b4d90 commit 142f0d36d90979a983e1bb0b69d1d859338b4d90 Author: Mark Johnston AuthorDate: 2021-02-23 23:00:02 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:01 +0000 Add UPDATING entry and bump version Approved by: so --- UPDATING | 22 ++++++++++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 7273d677649d..b33065306a1e 100644 --- a/UPDATING +++ b/UPDATING @@ -16,6 +16,28 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20210223: p4 FreeBSD-SA-21:03.pam_login_access + FreeBSD-SA-21:04.jail_remove + FreeBSD-SA-21:05.jail_chdir + FreeBSD-SA-21:06.xen + FreeBSD-EN-21:06.microcode + FreeBSD-EN-21:07.caroot + FreeBSD-EN-21:08.freebsd-update + + login.access fails to apply rules [SA-21:03.pam_login_access] + + jail_remove(2) fails to kill all jailed processes [SA-21:04.jail_remove] + + jail_attach(2) relies on the caller to change the cwd [SA-21:05.jail_chdir] + + Xen grant mapping error handling issues [SA-21:06.xen] + + Boot-time microcode loading causes a boot hang [EN-21:06.microcode] + + Root certificate bundle update [EN-21:07.caroot] + + freebsd-update passwd regeneration [EN-21:08.freebsd-update] + 20210128: p3 FreeBSD-EN-21:01.tzdata FreeBSD-EN-21:03.vnet FreeBSD-EN-21:04.zfs diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 3e08cc3503ef..dfcb11bb7d5d 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH="RELEASE-p3" +BRANCH="RELEASE-p4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 9191555BC7E; Wed, 24 Feb 2021 01:42: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 4DldvS2k4Vz3HCZ; Wed, 24 Feb 2021 01:42: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 BF66224184; Wed, 24 Feb 2021 01:42: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 11O1gA4N054562; Wed, 24 Feb 2021 01:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1gAfd054561; Wed, 24 Feb 2021 01:42:10 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:10 GMT Message-Id: <202102240142.11O1gAfd054561@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: 602f1da04217 - releng/12.2 - xen-blkback: fix leak of grant maps on ring setup failure 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: 602f1da04217967e7627be3fe19a56098ad29b6f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:42:15 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=602f1da04217967e7627be3fe19a56098ad29b6f commit 602f1da04217967e7627be3fe19a56098ad29b6f Author: Roger Pau Monné AuthorDate: 2021-01-20 18:40:51 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:01 +0000 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Approved by: so Security: CVE-2021-26932 Security: FreeBSD-SA-21:06.xen Security: XSA-361 Sponsored by: Citrix Systems R&D (cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45) (cherry picked from commit dfb372f5d38c302953a6a4e2838179cd0a1a6438) --- sys/dev/xen/blkback/blkback.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index d935ba965b00..b98ccb6e2595 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -2912,10 +2912,31 @@ xbb_connect_ring(struct xbb_softc *xbb) ring_idx < xbb->ring_config.ring_pages; ring_idx++, gnt++) { if (gnt->status != 0) { + struct gnttab_unmap_grant_ref unmap[XBB_MAX_RING_PAGES]; + unsigned int i, j; + xbb->ring_config.va = 0; xenbus_dev_fatal(xbb->dev, EACCES, "Ring shared page mapping failed. " "Status %d.", gnt->status); + + /* Unmap everything to avoid leaking grant table maps */ + for (i = 0, j = 0; i < xbb->ring_config.ring_pages; + i++) { + if (gnts[i].status != GNTST_okay) + continue; + + unmap[j].host_addr = gnts[i].host_addr; + unmap[j].dev_bus_addr = gnts[i].dev_bus_addr; + unmap[j++].handle = gnts[i].handle; + } + if (j != 0) { + error = HYPERVISOR_grant_table_op( + GNTTABOP_unmap_grant_ref, unmap, j); + if (error != 0) + panic("Unable to unmap grants (%d)", + error); + } return (EACCES); } xbb->ring_config.handle[ring_idx] = gnt->handle; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01: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 D452D55C1BA; Wed, 24 Feb 2021 01:42: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 4DldwK75csz3Hl4; Wed, 24 Feb 2021 01:42: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 3C6BD2406F; Wed, 24 Feb 2021 01:42: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 11O1goRt055714; Wed, 24 Feb 2021 01:42:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1goX9055713; Wed, 24 Feb 2021 01:42:50 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:50 GMT Message-Id: <202102240142.11O1goX9055713@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: ce9af53d0897 - releng/13.0 - xen-blkback: fix leak of grant maps on ring setup failure 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: ce9af53d0897a1cb926bd244f499fc09b1626b27 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:43:00 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ce9af53d0897a1cb926bd244f499fc09b1626b27 commit ce9af53d0897a1cb926bd244f499fc09b1626b27 Author: Roger Pau Monné AuthorDate: 2021-01-20 18:40:51 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:35 +0000 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Approved by: re (implicit, so) Approved by: so Security: CVE-2021-26932 Security: FreeBSD-SA-21:06.xen Security: XSA-361 Sponsored by: Citrix Systems R&D (cherry picked from commit 808d4aad1022a2a33d222663b0c9badde30b9d45) (cherry picked from commit ab3e1bd3c22a222520c23c2793cc39e3a23c9b46) --- sys/dev/xen/blkback/blkback.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index 762f25302c00..678472cc2ab8 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -2893,10 +2893,31 @@ xbb_connect_ring(struct xbb_softc *xbb) ring_idx < xbb->ring_config.ring_pages; ring_idx++, gnt++) { if (gnt->status != 0) { + struct gnttab_unmap_grant_ref unmap[XBB_MAX_RING_PAGES]; + unsigned int i, j; + xbb->ring_config.va = 0; xenbus_dev_fatal(xbb->dev, EACCES, "Ring shared page mapping failed. " "Status %d.", gnt->status); + + /* Unmap everything to avoid leaking grant table maps */ + for (i = 0, j = 0; i < xbb->ring_config.ring_pages; + i++) { + if (gnts[i].status != GNTST_okay) + continue; + + unmap[j].host_addr = gnts[i].host_addr; + unmap[j].dev_bus_addr = gnts[i].dev_bus_addr; + unmap[j++].handle = gnts[i].handle; + } + if (j != 0) { + error = HYPERVISOR_grant_table_op( + GNTTABOP_unmap_grant_ref, unmap, j); + if (error != 0) + panic("Unable to unmap grants (%d)", + error); + } return (EACCES); } xbb->ring_config.handle[ring_idx] = gnt->handle; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 BCF0755C304; Wed, 24 Feb 2021 01:42: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 4DldwK75Wwz3Hl3; Wed, 24 Feb 2021 01:42: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 579DF23E5D; Wed, 24 Feb 2021 01:42: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 11O1gpYK055737; Wed, 24 Feb 2021 01:42:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1gpCT055736; Wed, 24 Feb 2021 01:42:51 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:51 GMT Message-Id: <202102240142.11O1gpCT055736@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: f82cffcf2f44 - releng/13.0 - pam_login_access: Fix negative entry matching logic 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f82cffcf2f44c909bec00d18549826f5d1d62205 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:43:00 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f82cffcf2f44c909bec00d18549826f5d1d62205 commit f82cffcf2f44c909bec00d18549826f5d1d62205 Author: Mark Johnston AuthorDate: 2021-02-23 22:01:29 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:42 +0000 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: re (implicit, so) Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access (cherry picked from commit 6ab923cbca8759503a08683a5978b9ebf5efd607) (cherry picked from commit 8cf559d6b9b4782bf67eb868ea480f47fc8c64a4) --- lib/libpam/modules/pam_login_access/login_access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 9496081d362e..719808858dac 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -137,10 +137,10 @@ list_match(char *list, const char *item, if (match != NO) { while ((tok = strtok((char *) 0, listsep)) && strcmp(tok, "EXCEPT")) { /* VOID */ ; - if (tok == NULL || list_match((char *) 0, item, match_fn, - login_access_opts) == NO) { + } + if (tok == NULL || + list_match((char *) 0, item, match_fn, login_access_opts) == NO) { return (match); - } } } return (NO); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 01:42: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 B34D955C28B; Wed, 24 Feb 2021 01:42: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 4DldwK6sLnz3Hf2; Wed, 24 Feb 2021 01:42: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 62D1C2412C; Wed, 24 Feb 2021 01:42: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 11O1gqaW055758; Wed, 24 Feb 2021 01:42:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O1gqcE055756; Wed, 24 Feb 2021 01:42:52 GMT (envelope-from git) Date: Wed, 24 Feb 2021 01:42:52 GMT Message-Id: <202102240142.11O1gqcE055756@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: 035021b98a25 - releng/13.0 - Add UPDATING entries and bump version 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 035021b98a251247ba62ffbb6b6411766b3dd321 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 01:43:00 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=035021b98a251247ba62ffbb6b6411766b3dd321 commit 035021b98a251247ba62ffbb6b6411766b3dd321 Author: Mark Johnston AuthorDate: 2021-02-24 00:21:19 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 01:42:47 +0000 Add UPDATING entries and bump version Approved by: re (implicit, so) Approved by: so --- UPDATING | 7 +++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index c42fe6639b12..880be2ef12e0 100644 --- a/UPDATING +++ b/UPDATING @@ -11,6 +11,13 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20210223: p1 FreeBSD-SA-21:03.pam_login_access + FreeBSD-SA-21:06.xen + + login.access fails to apply rules [SA-21:03.pam_login_access] + + Xen grant mapping error handling issues [SA-21:06.xen] + 20210202: Various LinuxKPI functionality was added which conflicts with DRM. Please update your drm-kmod port to after the __FreeBSD_verison 1300139 diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b0887168026a..fa48289cc39a 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="BETA3" +BRANCH="BETA3-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-all@freebsd.org Wed Feb 24 02:18: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 BD18E55D22F; Wed, 24 Feb 2021 02:18: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 4Dlfhx4y18z3LtB; Wed, 24 Feb 2021 02:18: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 9CED6240E7; Wed, 24 Feb 2021 02:18: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 11O2I9N1096586; Wed, 24 Feb 2021 02:18:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O2I9tY096585; Wed, 24 Feb 2021 02:18:09 GMT (envelope-from git) Date: Wed, 24 Feb 2021 02:18:09 GMT Message-Id: <202102240218.11O2I9tY096585@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: 1d44514fcd68 - main - rmlock: Add a required compiler membar to the rlock slow path 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: 1d44514fcd68809cfd493a7352ace29ddad443d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 02:18:09 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d44514fcd68809cfd493a7352ace29ddad443d6 commit 1d44514fcd68809cfd493a7352ace29ddad443d6 Author: Mark Johnston AuthorDate: 2021-02-24 02:15:50 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 02:17:12 +0000 rmlock: Add a required compiler membar to the rlock slow path The tracker flags need to be loaded only after the tracker is removed from its per-CPU queue. Otherwise, readers may fail to synchronize with pending writers attempting to propagate priority to active readers, and readers and writers deadlock on each other. This was observed in a stable/12-based armv7 kernel where the compiler had reordered the load of rmp_flags to before the stores updating the queue. Reviewed by: rlibby, scottl Discussed with: kib Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28821 --- sys/kern/kern_rmlock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 401445d3d03f..9135709d88cf 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -362,7 +362,11 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) /* Remove our tracker from the per-cpu list. */ rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all. */ + /* + * Check to see if the IPI granted us the lock after all. The load of + * rmp_flags must happen after the tracker is removed from the list. + */ + __compiler_membar(); if (tracker->rmp_flags) { /* Just add back tracker - we hold the lock. */ rm_tracker_add(pc, tracker); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 02:21: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 7A21D55D24F; Wed, 24 Feb 2021 02:21:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dlfmn0bP6z3LvG; Wed, 24 Feb 2021 02:21:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id EjnqljthxnRGtEjnrlQ0Zs; Tue, 23 Feb 2021 19:21:28 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=6035b828 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=HENm2Bnh0uIwcDd5ynwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 224A1204; Tue, 23 Feb 2021 18:21:26 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11O15bKn096987; Tue, 23 Feb 2021 17:05:37 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102240105.11O15bKn096987@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: Baptiste Daroussin cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-reply-to: <202102231027.11NARYYE041280@gitrepo.freebsd.org> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> Comments: In-reply-to Baptiste Daroussin message dated "Tue, 23 Feb 2021 10:27:34 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 23 Feb 2021 17:05:37 -0800 X-CMAE-Envelope: MS4xfG8e3bLSBzqRqYI5RUfaKLh+EmSV2dwOZsalKP/EVXCIoxS2QsGJbZTjsjJQCO8llvHZGlZxdngOHb2ZqtJVqjSwOkjPeaml6zaWG/Af0qcQKwx091ok +PliKenzEZY9giQhRqsWJFpgjk6W+9BLdlZ0WeqhEaWv9XKuod/xUBwycYnWT0/20jNd+w1Ax6PpknQFc9lA2lgaijFsRIe2ni0mOX38PJaVcpCFRVDLmrsV PGAo1eQnh3tzblYV+wcj36FvOfjB8yLNPfsgyS3OkEWNbJOWpUwWfo2em8+3spVQz0pl0vo1bCfWbaxQXGizdUiNct8NOzdnTLZ6tCipQW4= X-Rspamd-Queue-Id: 4Dlfmn0bP6z3LvG 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, 24 Feb 2021 02:21:29 -0000 In message <202102231027.11NARYYE041280@gitrepo.freebsd.org>, Baptiste Daroussi n writes: > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=77e1ccbee3ed6c837929e4e232fd07f9 > 5bfc8294 > > commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 > Author: Rick Parrish > AuthorDate: 2021-02-07 06:15:21 +0000 > Commit: Baptiste Daroussin > CommitDate: 2021-02-23 10:16:53 +0000 > > rc: implement parallel boot > > take advantage of the rcorder -p argument to implement parallel > booting in rc. > > According to the author non scientific tests: > on a Core 2 Duo with spinning disk: > > | Services enabled | before | after | saving | > | 0 | 8s | 8s | 0 | > | 1 | 13s | 13s | 0 | > | 2 | 17s | 13s | 5 | > | 3 | 23s | 13s | 10 | > | 4 | 28s | 13s | 15 | > | 5 | 33s | 13s | 20 | > > PR: 249192 > MFC after: 3 weeks > --- > libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > 1 file changed, 34 insertions(+), 15 deletions(-) > > diff --git a/libexec/rc/rc b/libexec/rc/rc > index 35db4a850516..722d7fe35884 100644 > --- a/libexec/rc/rc > +++ b/libexec/rc/rc > @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > skip_firstboot="-s firstboot" > fi > > +# rc_parallel_start default is "NO" > +rc_parallel_start=${rc_parallel_start:-NO} > +_rc_parallel='' > +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" > +checkyesno rc_parallel_start && _rc_parallel='-p' > + > # Do a first pass to get everything up to $early_late_divider so that > # we can do a second pass that includes $local_startup directories > # > -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` > +files=`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/* 2>/dev/ > null` > > _rc_elem_done=' ' > -for _rc_elem in ${files}; do > - run_rc_script ${_rc_elem} ${_boot} > - _rc_elem_done="${_rc_elem_done}${_rc_elem} " > - > - case "$_rc_elem" in > - */${early_late_divider}) break ;; > - esac > +IFS=$'\n' > +for _rc_group in ${files}; do > + IFS=$' ' > + for _rc_elem in ${_rc_group}; do > + run_rc_script ${_rc_elem} ${_boot} & > + _rc_elem_done="${_rc_elem_done}${_rc_elem} " > + > + case "$_rc_elem" in > + */${early_late_divider}) break ;; > + esac > + done > + wait > + IFS=$'\n' > done > > unset files local_rc > @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then > skip_firstboot="" > fi > > -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null > ` > -for _rc_elem in ${files}; do > - case "$_rc_elem_done" in > - *" $_rc_elem "*) continue ;; > - esac > - > - run_rc_script ${_rc_elem} ${_boot} > +files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_rc_paral > lel} 2>/dev/null` > +IFS=$'\n' > +for _rc_group in ${files}; do > + IFS=$' ' > + for _rc_elem in ${_rc_group}; do > + case "$_rc_elem_done" in > + *" $_rc_elem "*) continue ;; > + esac > + > + run_rc_script ${_rc_elem} ${_boot} & > + done > + wait > + IFS=$'\n' > done > +unset IFS > > # Remove the firstboot sentinel, and reboot if it was requested. > # Be a bit paranoid about removing it to handle the common failure > Since this commit my postfix, dovecot and nut fail to start at boot, and must be started by hand. -- 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 Feb 24 03:15: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 AC59A55EBC9; Wed, 24 Feb 2021 03:15:56 +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 4Dlgzc21ycz3Qtv; Wed, 24 Feb 2021 03:15:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:e908:86d2:b976:1c3e]) (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 F05B05074; Wed, 24 Feb 2021 03:15:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Warner Losh Cc: Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> From: Nathan Whitehorn Message-ID: Date: Tue, 23 Feb 2021 22:15:54 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 03:15:56 -0000 On 2/23/21 5:39 PM, Warner Losh wrote: > > > On Tue, Feb 23, 2021 at 3:02 PM Nathan Whitehorn > > wrote: > > > > On 2/23/21 4:59 PM, Colin Percival wrote: > > On 2/23/21 1:24 PM, Nathan Whitehorn wrote: > >>      Mount the EFI system partition (ESP) on newly-installed > systems. > > Should we do this in VM/cloudware images too? > > > > That's a good point. I think so, though I don't have the time or test > setup to make that change. > > > It would be best if we could do it. > > Warner I'm giving it a shot and will try to get a patch in tomorrow. -Nathan From owner-dev-commits-src-all@freebsd.org Wed Feb 24 03:20: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 0D7DE55EDF1; Wed, 24 Feb 2021 03:20: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 4Dlh4q6yfHz3RGB; Wed, 24 Feb 2021 03:20: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 DF23B24CF9; Wed, 24 Feb 2021 03:20: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 11O3KR1Q083807; Wed, 24 Feb 2021 03:20:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O3KRBL083806; Wed, 24 Feb 2021 03:20:27 GMT (envelope-from git) Date: Wed, 24 Feb 2021 03:20:27 GMT Message-Id: <202102240320.11O3KRBL083806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: 1af48800c20f - main - Delete memstick images for PowerPC. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1af48800c20fadb07acca2ab930bb3bccd363edb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 03:20:28 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=1af48800c20fadb07acca2ab930bb3bccd363edb commit 1af48800c20fadb07acca2ab930bb3bccd363edb Author: Nathan Whitehorn AuthorDate: 2021-02-24 03:17:20 +0000 Commit: Nathan Whitehorn CommitDate: 2021-02-24 03:17:20 +0000 Delete memstick images for PowerPC. These images only ever worked on Apple Powermacs, which are now a very old platform, and did so only for a very loose definition of "worked" (they booted on a small subset of supported machines). Moreover, all the machines they *did* boot on also would boot from a memstick made by dd'ing an CD image to a flash drive. Since a flash drive prepared in this way would also boot all the newer systems we support, the memstick images were strictly less functional than the CD images, even for booting from memory sticks. Reviewed by: jhibbits MFC after: 1 week --- release/powerpc/make-memstick.sh | 50 ---------------------------------------- 1 file changed, 50 deletions(-) diff --git a/release/powerpc/make-memstick.sh b/release/powerpc/make-memstick.sh deleted file mode 100755 index 75a86a73e206..000000000000 --- a/release/powerpc/make-memstick.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# This script generates a "memstick image" (image that can be copied to a -# USB memory stick) from a directory tree. Note that the script does not -# clean up after itself very well for error conditions on purpose so the -# problem can be diagnosed (full filesystem most likely but ...). -# -# Usage: make-memstick.sh -# -# $FreeBSD$ -# - -set -e - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -export PATH - -BLOCKSIZE=10240 - -if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 -fi - -tempfile="${2}.$$" - -if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 -fi - -if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 -fi - -echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab -echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local -rm -f ${tempfile} -makefs -B big -o version=2 ${tempfile} ${1} -rm ${1}/etc/fstab -rm ${1}/etc/rc.conf.local - -mkimg -s apm \ - -p freebsd-boot:=${1}/boot/boot1.hfs \ - -p freebsd-ufs/FreeBSD_Install:=${tempfile} \ - -o ${2} - -rm -f ${tempfile} - From owner-dev-commits-src-all@freebsd.org Wed Feb 24 04:49: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 D530354807E; Wed, 24 Feb 2021 04:49: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 4Dlk3k5k8vz3lnf; Wed, 24 Feb 2021 04:49: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 B2F5226614; Wed, 24 Feb 2021 04:49: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 11O4ncfg095979; Wed, 24 Feb 2021 04:49:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O4ncm1095978; Wed, 24 Feb 2021 04:49:38 GMT (envelope-from git) Date: Wed, 24 Feb 2021 04:49:38 GMT Message-Id: <202102240449.11O4ncm1095978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 7f73db6d04d0 - stable/13 - 504ebd612ec: kern: sonewconn: set so_options before pru_attach() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7f73db6d04d0fcfe52dde537ba1495886f34762d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 04:49:38 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7f73db6d04d0fcfe52dde537ba1495886f34762d commit 7f73db6d04d0fcfe52dde537ba1495886f34762d Author: Kyle Evans AuthorDate: 2021-01-20 17:53:05 +0000 Commit: Kyle Evans CommitDate: 2021-02-24 04:48:42 +0000 504ebd612ec: kern: sonewconn: set so_options before pru_attach() Protocol attachment has historically been able to observe and modify so->so_options as needed, and it still can for newly created sockets. 779f106aa169 moved this to after pru_attach() when we re-acquire the lock on the listening socket. Restore the historical behavior so that pru_attach implementations can consistently use it. Note that some pru_attach() do currently rely on this, though that may change in the future. D28265 contains a change to remove the use in TCP and IB/SDP bits, as resetting the requested linger time on incoming connections seems questionable at best. This does move the assignment out from under the head's listen lock, but glebius notes that head won't be going away and applications cannot assume any specific ordering with a race between a connection coming in and the application changing socket options anyways. 4c0bef07be0: kern: net: remove TCP_LINGERTIME TCP_LINGERTIME can be traced back to BSD 4.4 Lite and perhaps beyond, in exactly the same form that it appears here modulo slightly different context. It used to be the case that there was a single pr_usrreq method with requests dispatched to it; these exact two lines appeared in tcp_usrreq's PRU_ATTACH handling. The only purpose of this that I can find is to cause surprising behavior on accepted connections. Newly-created sockets will never hit these paths as one cannot set SO_LINGER prior to socket(2). If SO_LINGER is set on a listening socket and inherited, one would expect the timeout to be inherited rather than changed arbitrarily like this -- noting that SO_LINGER is nonsense on a listening socket beyond inheritance, since they cannot be 'connected' by definition. Neither Illumos nor Linux reset the timer like this based on testing and inspection of Illumos, and testing of Linux. (cherry picked from commit 504ebd612ec61165bb949cfce3a348b0d6f37008) (cherry picked from commit 4c0bef07be071a1633ebc86a653f9bd59d40796e) --- sys/kern/uipc_socket.c | 2 +- sys/netinet/tcp_timer.h | 2 -- sys/netinet/tcp_usrreq.c | 2 -- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7b16401b7071..7f06b51cf096 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -718,6 +718,7 @@ sonewconn(struct socket *head, int connstatus) } so->so_listen = head; so->so_type = head->so_type; + so->so_options = head->so_options & ~SO_ACCEPTCONN; so->so_linger = head->so_linger; so->so_state = head->so_state | SS_NOFDREF; so->so_fibnum = head->so_fibnum; @@ -754,7 +755,6 @@ sonewconn(struct socket *head, int connstatus) if (head->sol_accept_filter != NULL) connstatus = 0; so->so_state |= connstatus; - so->so_options = head->so_options & ~SO_ACCEPTCONN; soref(head); /* A socket on (in)complete queue refs head. */ if (connstatus) { TAILQ_INSERT_TAIL(&head->sol_comp, so, so_list); diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 6f0c3a46605a..9a711d173386 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -115,8 +115,6 @@ #define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */ -#define TCP_LINGERTIME 120 /* linger at most 2 minutes */ - #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ #define TCPTV_DELACK ( hz/25 ) /* 40ms timeout */ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index bfa96ce093b5..31b580bfafcc 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -204,8 +204,6 @@ tcp_usr_attach(struct socket *so, int proto, struct thread *td) tp->t_state = TCPS_CLOSED; INP_WUNLOCK(inp); TCPSTATES_INC(TCPS_CLOSED); - if ((so->so_options & SO_LINGER) && so->so_linger == 0) - so->so_linger = TCP_LINGERTIME; out: TCPDEBUG2(PRU_ATTACH); TCP_PROBE2(debug__user, tp, PRU_ATTACH); diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index 46a43e1b8e3b..e7ae4e03365e 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -482,8 +482,6 @@ sdp_attach(struct socket *so, int proto, struct thread *td) LIST_INSERT_HEAD(&sdp_list, ssk, list); sdp_count++; SDP_LIST_WUNLOCK(); - if ((so->so_options & SO_LINGER) && so->so_linger == 0) - so->so_linger = TCP_LINGERTIME; return (0); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 04:52: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 CA5515485CF; Wed, 24 Feb 2021 04:52: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 4Dlk7C5PsWz3mF4; Wed, 24 Feb 2021 04:52: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 A9BC926543; Wed, 24 Feb 2021 04:52: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 11O4qd8m008161; Wed, 24 Feb 2021 04:52:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O4qdbq008160; Wed, 24 Feb 2021 04:52:39 GMT (envelope-from git) Date: Wed, 24 Feb 2021 04:52:39 GMT Message-Id: <202102240452.11O4qdbq008160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 5e57a3806ef3 - stable/12 - 504ebd612ec: kern: sonewconn: set so_options before pru_attach() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5e57a3806ef3dc9d04981b1bc06f69507cc67684 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 04:52:39 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5e57a3806ef3dc9d04981b1bc06f69507cc67684 commit 5e57a3806ef3dc9d04981b1bc06f69507cc67684 Author: Kyle Evans AuthorDate: 2021-01-20 17:53:05 +0000 Commit: Kyle Evans CommitDate: 2021-02-24 04:52:18 +0000 504ebd612ec: kern: sonewconn: set so_options before pru_attach() Protocol attachment has historically been able to observe and modify so->so_options as needed, and it still can for newly created sockets. 779f106aa169 moved this to after pru_attach() when we re-acquire the lock on the listening socket. Restore the historical behavior so that pru_attach implementations can consistently use it. Note that some pru_attach() do currently rely on this, though that may change in the future. D28265 contains a change to remove the use in TCP and IB/SDP bits, as resetting the requested linger time on incoming connections seems questionable at best. This does move the assignment out from under the head's listen lock, but glebius notes that head won't be going away and applications cannot assume any specific ordering with a race between a connection coming in and the application changing socket options anyways. 4c0bef07be0: kern: net: remove TCP_LINGERTIME TCP_LINGERTIME can be traced back to BSD 4.4 Lite and perhaps beyond, in exactly the same form that it appears here modulo slightly different context. It used to be the case that there was a single pr_usrreq method with requests dispatched to it; these exact two lines appeared in tcp_usrreq's PRU_ATTACH handling. The only purpose of this that I can find is to cause surprising behavior on accepted connections. Newly-created sockets will never hit these paths as one cannot set SO_LINGER prior to socket(2). If SO_LINGER is set on a listening socket and inherited, one would expect the timeout to be inherited rather than changed arbitrarily like this -- noting that SO_LINGER is nonsense on a listening socket beyond inheritance, since they cannot be 'connected' by definition. Neither Illumos nor Linux reset the timer like this based on testing and inspection of Illumos, and testing of Linux. (cherry picked from commit 504ebd612ec61165bb949cfce3a348b0d6f37008) (cherry picked from commit 4c0bef07be071a1633ebc86a653f9bd59d40796e) --- sys/kern/uipc_socket.c | 2 +- sys/netinet/tcp_timer.h | 2 -- sys/netinet/tcp_usrreq.c | 3 --- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 2 -- 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ba03de4c32fe..ab05da880e46 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -616,6 +616,7 @@ sonewconn(struct socket *head, int connstatus) } so->so_listen = head; so->so_type = head->so_type; + so->so_options = head->so_options & ~SO_ACCEPTCONN; so->so_linger = head->so_linger; so->so_state = head->so_state | SS_NOFDREF; so->so_fibnum = head->so_fibnum; @@ -652,7 +653,6 @@ sonewconn(struct socket *head, int connstatus) if (head->sol_accept_filter != NULL) connstatus = 0; so->so_state |= connstatus; - so->so_options = head->so_options & ~SO_ACCEPTCONN; soref(head); /* A socket on (in)complete queue refs head. */ if (connstatus) { TAILQ_INSERT_TAIL(&head->sol_comp, so, so_list); diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 1f73a806eb7a..b95fcf52861b 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -115,8 +115,6 @@ #define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */ -#define TCP_LINGERTIME 120 /* linger at most 2 minutes */ - #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ #define TCPTV_DELACK ( hz/25 ) /* 40ms timeout */ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 71c35c1bed66..968b1f4c5e30 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -163,9 +163,6 @@ tcp_usr_attach(struct socket *so, int proto, struct thread *td) if (error) goto out; - if ((so->so_options & SO_LINGER) && so->so_linger == 0) - so->so_linger = TCP_LINGERTIME; - inp = sotoinpcb(so); tp = intotcpcb(inp); out: diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index 5fefa2929b12..ba6d822c38e8 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -481,8 +481,6 @@ sdp_attach(struct socket *so, int proto, struct thread *td) LIST_INSERT_HEAD(&sdp_list, ssk, list); sdp_count++; SDP_LIST_WUNLOCK(); - if ((so->so_options & SO_LINGER) && so->so_linger == 0) - so->so_linger = TCP_LINGERTIME; return (0); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 05:04: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 9CEB5548A9E; Wed, 24 Feb 2021 05:04: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 4DlkP03sDCz3mDX; Wed, 24 Feb 2021 05:04: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 7327F265CC; Wed, 24 Feb 2021 05:04: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 11O54aDS022206; Wed, 24 Feb 2021 05:04:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O54aSk022204; Wed, 24 Feb 2021 05:04:36 GMT (envelope-from git) Date: Wed, 24 Feb 2021 05:04:36 GMT Message-Id: <202102240504.11O54aSk022204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rajesh Kumar M A Subject: git: ec786886661a - main - Update manpage for AMD 10GbE driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rajeshasp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec786886661ac8d6c41420c4460eba8461308e0b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 05:04:36 -0000 The branch main has been updated by rajeshasp: URL: https://cgit.FreeBSD.org/src/commit/?id=ec786886661ac8d6c41420c4460eba8461308e0b commit ec786886661ac8d6c41420c4460eba8461308e0b Author: Rajesh Kumar M A AuthorDate: 2021-02-24 05:01:10 +0000 Commit: Rajesh Kumar M A CommitDate: 2021-02-24 05:01:10 +0000 Update manpage for AMD 10GbE driver Approved by: vmaffione, gallatin Differential Revision: https://reviews.freebsd.org/D28724 MFC after: 1 week --- share/man/man4/axp.4 | 69 +++++++++++++++------------------------------------- 1 file changed, 20 insertions(+), 49 deletions(-) diff --git a/share/man/man4/axp.4 b/share/man/man4/axp.4 index 598e6a968e7a..41c2737bc7f1 100644 --- a/share/man/man4/axp.4 +++ b/share/man/man4/axp.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd January 24, 2021 +.Dd February 19, 2021 .Dt AXP 4 .Os .Sh NAME @@ -133,41 +133,23 @@ of the register by reading the second variable. Configure the log-level for the driver. Default is 0. Supports 0-3. -.It Va dev.ax.X.single_fl -This variable must be set before loading the driver, either via -.Xr loader.conf 5 -or through the use of -.Xr kenv 1 . -This cannot be modified when driver is loaded. -.Pp -Setting this variable in +.It Va dev.ax.X.link_workaround +This variable enables the workaround for an intermittent link issue. +When link does not come up for long time, this variable can be set to 1 to +reset the phy and bring up the link. +.El +.Sh LOADER TUNABLES +The following variable is available as .Xr loader.conf 5 -needs the system to be restarted to take effect. -When using -.Xr kenv 1 , -use the wrapper variable -.Va dev.ax.single_fl\&, -which will configure all AMD interfaces with single freelist per receive queue. -Default is 2 freelist per receive queue. -.Pp -This variable is to configure the interface when single freelist is needed. -(For Eg. netmap). -Basically, this will control the software behavior of how the receive -descriptors are used. -.Pp -Setting this variable to 1, will use 1 Freelist per receive queue. -.Pp -Setting this variable to 0, will use 2 Freelist per receive queue. -.Pp -Based on the setting, the receive buffers are programmed accordingly on the -received descriptors. +tunable. +.Bl -tag -width indent +.It Va dev.ax.X.sph_enable +This variable controls split header feature for the interface. +Default is 1, meaning the split header support is enabled. .Pp -By default, this variable will be set to 0, meaning the interfaces will be -configured for regular data traffic (not netmap traffic). -.It Va dev.ax.X.sph_enabled This variable must be set before loading the driver, either via .Xr loader.conf 5 -or through the use of +or through .Xr kenv 1 . This cannot be modified when driver is loaded. .Pp @@ -177,24 +159,13 @@ needs the system to be restarted to take effect. When using .Xr kenv 1 , use the wrapper variable -.Va dev.ax.sph_enable\&, -which will configure(enable/disable) split header support in all -AMD interfaces. -.Pp -This variable is to control enable/disable of the split header feature in -the interface. -.Pp -Setting this variable to 1, will enable split header feature. -.Pp -Setting this variable to 0, will disable split header feature. -.Pp -By default, this variable will be set to 1, meaning the Split header support be -enabled. +.Va dev.ax.sph_enable , +which will configure(enable/disable) split header support for all +.Nm +interfaces. .Pp -NOTE: It is recommended to use this variable only when -.Va single_fl\& -is configured. -Otherwise let it be default value. +To use netmap with this device, split header support must be disabled +(set this variable to 0). .El .Sh SEE ALSO .Xr arp 4 , From owner-dev-commits-src-all@freebsd.org Wed Feb 24 05:22:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 753A15487FE; Wed, 24 Feb 2021 05:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dlknl2wMTz3nNp; Wed, 24 Feb 2021 05:22:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56EF026F18; Wed, 24 Feb 2021 05:22: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 11O5MZZq048269; Wed, 24 Feb 2021 05:22:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O5MZ7B048268; Wed, 24 Feb 2021 05:22:35 GMT (envelope-from git) Date: Wed, 24 Feb 2021 05:22:35 GMT Message-Id: <202102240522.11O5MZ7B048268@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 6e822e99570f - main - rc: fix parse of $local_startup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e822e99570fdf4c564be04840a054bccc070222 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 05:22:35 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6e822e99570fdf4c564be04840a054bccc070222 commit 6e822e99570fdf4c564be04840a054bccc070222 Author: Cy Schubert AuthorDate: 2021-02-24 05:12:49 +0000 Commit: Cy Schubert CommitDate: 2021-02-24 05:12:49 +0000 rc: fix parse of $local_startup 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 introduced parallel execution of rc. It separated groups with line feeds (\n) and elements within groups using spaces. This is a natural separation due to rcorder using spaces and lines to separate elements within groups with groups of services separated by line feeds. 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 parses the output from rcorder by setting $IFS. However it failed to reset $IFS to default ' \t\n' prior to calling find_local_scripts_new(), causing find_local_scripts_new() to fail parsing $local_startup for site-specific local rc scripts, i.e. ${LOCALBASE}/etc/rc.d. This caused daemons from ports and packages such as postfix, dovecot, nut, and others in ${LOCALBASE} not to be started. PR: 249192 MFC after: 3 week X-MFC with: 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 --- libexec/rc/rc | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc b/libexec/rc/rc index 722d7fe35884..b5bc188fc7c0 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -119,6 +119,7 @@ for _rc_group in ${files}; do done unset files local_rc +unset IFS # Now that disks are mounted, for each dir in $local_startup # search for init scripts that use the new rc.d semantics. From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:56: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 5AAF35533F1; Wed, 24 Feb 2021 07:56: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 4DlpCt27qLz4Yhd; Wed, 24 Feb 2021 07:56: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 3C35E28C1B; Wed, 24 Feb 2021 07:56: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 11O7uwBA045736; Wed, 24 Feb 2021 07:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7uw64045735; Wed, 24 Feb 2021 07:56:58 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:56:58 GMT Message-Id: <202102240756.11O7uw64045735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cc9958bf22f1 - main - ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ() 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/main X-Git-Reftype: branch X-Git-Commit: cc9958bf22f1426faf4be8bf492ce69587a9008f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:56:58 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cc9958bf22f1426faf4be8bf492ce69587a9008f commit cc9958bf22f1426faf4be8bf492ce69587a9008f Author: Konstantin Belousov AuthorDate: 2021-02-19 12:37:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:54:30 +0000 ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ() instead of DOINGSOFTDEP(). The softdep_prealloc() function does nothing in SU case. Note that the call should be safe with regard to the vnode relock, because it is called with MNT_NOWAIT, which does not descend into fsync. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 3b652ea14303..c7a1e2dec15e 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -543,7 +543,7 @@ ffs_reallocblks(ap) * here. Instead we simply fail to reallocate blocks if this * rare condition arises. */ - if (DOINGSOFTDEP(ap->a_vp)) + if (DOINGSUJ(ap->a_vp)) if (softdep_prealloc(ap->a_vp, MNT_NOWAIT) != 0) return (ENOSPC); if (ump->um_fstype == UFS1) From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:57: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 E32FE553663; Wed, 24 Feb 2021 07:57: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 4DlpCw5p3rz4YLP; Wed, 24 Feb 2021 07:57: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 9D2E02857F; Wed, 24 Feb 2021 07:57: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 11O7v0sD045777; Wed, 24 Feb 2021 07:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7v0Y4045776; Wed, 24 Feb 2021 07:57:00 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:57:00 GMT Message-Id: <202102240757.11O7v0Y4045776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c6d68ca842a3 - main - ffs_vnops.c: style 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/main X-Git-Reftype: branch X-Git-Commit: c6d68ca842a3f5b6814cdd5c87e406bad579b792 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:57:01 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c6d68ca842a3f5b6814cdd5c87e406bad579b792 commit c6d68ca842a3f5b6814cdd5c87e406bad579b792 Author: Konstantin Belousov AuthorDate: 2021-02-20 17:01:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:54:53 +0000 ffs_vnops.c: style Use local var to shorten ap->a_vp expression. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index db14d2099be9..4e574f85c9e4 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1423,8 +1423,8 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td struct inode *ip; struct uio luio; struct iovec liovec; - int error; struct ufs2_dinode *dp; + int error; ip = VTOI(vp); @@ -1527,14 +1527,15 @@ struct vop_closeextattr_args { }; */ { + struct vnode *vp; - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + vp = ap->a_vp; + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - - if (ap->a_commit && (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)) + if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); - return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred, ap->a_td)); + return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } /* @@ -1552,6 +1553,7 @@ vop_deleteextattr { }; */ { + struct vnode *vp; struct inode *ip; struct extattr *eap; uint32_t ul; @@ -1559,18 +1561,17 @@ vop_deleteextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); - - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1582,7 +1583,7 @@ vop_deleteextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1596,7 +1597,7 @@ vop_deleteextattr { if (olen == -1) { /* delete but nonexistent */ free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); return (ENOATTR); } ul = eap->ea_length; @@ -1608,7 +1609,7 @@ vop_deleteextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); } @@ -1741,6 +1742,7 @@ vop_setextattr { }; */ { + struct vnode *vp; struct inode *ip; struct fs *fs; struct extattr *eap; @@ -1750,12 +1752,12 @@ vop_setextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); fs = ITOFS(ip); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); @@ -1763,14 +1765,14 @@ vop_setextattr { if (ap->a_uio == NULL) return (EOPNOTSUPP); - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); ealen = ap->a_uio->uio_resid; if (ealen < 0 || ealen > lblktosize(fs, UFS_NXADDR)) return (EINVAL); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1782,7 +1784,7 @@ vop_setextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1819,7 +1821,7 @@ vop_setextattr { } if (easize > lblktosize(fs, UFS_NXADDR)) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = ENOSPC; return (ENOSPC); @@ -1833,7 +1835,7 @@ vop_setextattr { error = uiomove(EXTATTR_CONTENT(eap), ealen, ap->a_uio); if (error) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = error; return (error); @@ -1844,7 +1846,7 @@ vop_setextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:56: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 824875533F9; Wed, 24 Feb 2021 07:56: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 4DlpCv3B9Vz4Ybt; Wed, 24 Feb 2021 07:56: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 5E8C228E0F; Wed, 24 Feb 2021 07:56: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 11O7uxQ1045754; Wed, 24 Feb 2021 07:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7uxKk045753; Wed, 24 Feb 2021 07:56:59 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:56:59 GMT Message-Id: <202102240756.11O7uxKk045753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 498314627946 - main - ffs: do not call softdep_prealloc() from UFS_BALLOC() 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/main X-Git-Reftype: branch X-Git-Commit: 49831462794690155ce8dbe02679e6d9390f3d7d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:56:59 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49831462794690155ce8dbe02679e6d9390f3d7d commit 49831462794690155ce8dbe02679e6d9390f3d7d Author: Konstantin Belousov AuthorDate: 2021-02-18 14:51:50 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:54:50 +0000 ffs: do not call softdep_prealloc() from UFS_BALLOC() Do it in ffs_write(), where we can gracefuly handle relock and its consequences. In particular, recheck the v_data to see if the vnode reclamation ended, and return EBADF when we cannot proceed with the write. Reviewed by: mckusick Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_balloc.c | 5 ----- sys/ufs/ffs/ffs_vnops.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index daa897dfe032..1b53a90a48c4 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -128,8 +128,6 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size, return (EFBIG); gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; - if (DOINGSOFTDEP(vp)) - softdep_prealloc(vp, MNT_WAIT); /* * If the next write will extend the file into a new block, * and the file is currently composed of a fragment @@ -621,9 +619,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size, return (EFBIG); gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; - if (DOINGSOFTDEP(vp)) - softdep_prealloc(vp, MNT_WAIT); - /* * Check for allocating external data. */ diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 686bfddcb0ea..db14d2099be9 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -834,6 +834,11 @@ ffs_write(ap) int blkoffset, error, flags, ioflag, size, xfersize; vp = ap->a_vp; + if (DOINGSUJ(vp)) + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + uio = ap->a_uio; ioflag = ap->a_ioflag; if (ap->a_ioflag & IO_EXT) From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:57: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 46B7A553664; Wed, 24 Feb 2021 07:57: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 4DlpCy1KKDz4Yc3; Wed, 24 Feb 2021 07:57: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 C2E5928E10; Wed, 24 Feb 2021 07:57: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 11O7v1qb045798; Wed, 24 Feb 2021 07:57:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7v1u1045797; Wed, 24 Feb 2021 07:57:01 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:57:01 GMT Message-Id: <202102240757.11O7v1u1045797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5e198e7646a2 - main - ffs_close_ea: do not relock vnode under lock_ea 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/main X-Git-Reftype: branch X-Git-Commit: 5e198e7646a27412c0541719f7bf1bbc0bd89223 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:57:09 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5e198e7646a27412c0541719f7bf1bbc0bd89223 commit 5e198e7646a27412c0541719f7bf1bbc0bd89223 Author: Konstantin Belousov AuthorDate: 2021-02-21 10:10:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:55:04 +0000 ffs_close_ea: do not relock vnode under lock_ea ffs_lock_ea is after the vnode lock, so vnode must not be relocked under lock_ea. Move ffs_truncate() call in ffs_close_ea() after the lock_ea is dropped, and only truncate to length zero, since this is the only mode supported by ffs_truncate() for EAs. Previously code did truncation and then write. Zero the part of the ext area that is unused, if truncation is due but not done because ea area is not zero-length. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 4e574f85c9e4..9be46951c04e 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1422,9 +1422,10 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td { struct inode *ip; struct uio luio; - struct iovec liovec; + struct iovec *liovec; struct ufs2_dinode *dp; - int error; + size_t ea_len, tlen; + int error, i, lcnt; ip = VTOI(vp); @@ -1439,18 +1440,31 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td ASSERT_VOP_ELOCKED(vp, "ffs_close_ea commit"); if (cred == NOCRED) cred = vp->v_mount->mnt_cred; - liovec.iov_base = ip->i_ea_area; - liovec.iov_len = ip->i_ea_len; - luio.uio_iov = &liovec; - luio.uio_iovcnt = 1; + + ea_len = MAX(ip->i_ea_len, dp->di_extsize); + for (lcnt = 1, tlen = ea_len - ip->i_ea_len; tlen > 0;) { + tlen -= MIN(ZERO_REGION_SIZE, tlen); + lcnt++; + } + + liovec = __builtin_alloca(lcnt * sizeof(struct iovec)); + luio.uio_iovcnt = lcnt; + + liovec[0].iov_base = ip->i_ea_area; + liovec[0].iov_len = ip->i_ea_len; + for (i = 1, tlen = ea_len; i < lcnt; i++) { + liovec[i].iov_base = __DECONST(void *, zero_region); + liovec[i].iov_len = MIN(ZERO_REGION_SIZE, tlen); + tlen -= liovec[i].iov_len; + } + MPASS(tlen == ip->i_ea_len); + + luio.uio_iov = liovec; luio.uio_offset = 0; - luio.uio_resid = ip->i_ea_len; + luio.uio_resid = ea_len; luio.uio_segflg = UIO_SYSSPACE; luio.uio_rw = UIO_WRITE; luio.uio_td = td; - /* XXX: I'm not happy about truncating to zero size */ - if (ip->i_ea_len < dp->di_extsize) - error = ffs_truncate(vp, 0, IO_EXT, cred); error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred); } if (--ip->i_ea_refs == 0) { @@ -1460,6 +1474,9 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td ip->i_ea_error = 0; } ffs_unlock_ea(vp); + + if (commit && error == 0 && ip->i_ea_len == 0) + ffs_truncate(vp, 0, IO_EXT, cred); return (error); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:57: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 E33DF5533FA; Wed, 24 Feb 2021 07:57: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 4DlpCz72F5z4Ykh; Wed, 24 Feb 2021 07:57: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 E064928B53; Wed, 24 Feb 2021 07:57: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 11O7v2M5045817; Wed, 24 Feb 2021 07:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7v20J045816; Wed, 24 Feb 2021 07:57:02 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:57:02 GMT Message-Id: <202102240757.11O7v20J045816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6f30ac9995ff - main - Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing 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/main X-Git-Reftype: branch X-Git-Commit: 6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:57:06 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba commit 6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba Author: Konstantin Belousov AuthorDate: 2021-02-21 10:11:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:55:21 +0000 Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing softdep_prealloc() must be called to ensure enough journal space is available, before ffs_extwrite(). Also it must be done before taking ffs_lock_ea(), because it calls ffs_syncvnode(), potentially dropping the vnode lock. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 9be46951c04e..050a6f66be17 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1552,6 +1552,12 @@ struct vop_closeextattr_args { if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); + if (ap->a_commit && DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_closeextattr commit"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } @@ -1600,6 +1606,13 @@ vop_deleteextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1801,6 +1814,13 @@ vop_setextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 38A5A55395F; Wed, 24 Feb 2021 07:58: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 4DlpFm19YYz4ZCh; Wed, 24 Feb 2021 07:58: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 1AFFE28BB2; Wed, 24 Feb 2021 07:58: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 11O7waXi046297; Wed, 24 Feb 2021 07:58:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7waUZ046296; Wed, 24 Feb 2021 07:58:36 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:36 GMT Message-Id: <202102240758.11O7waUZ046296@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: 750252612dad - stable/13 - buf SU hooks: track buf_start() calls with B_IOSTARTED flag 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: 750252612dad72149832fac62645919c73cbf5d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:36 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=750252612dad72149832fac62645919c73cbf5d2 commit 750252612dad72149832fac62645919c73cbf5d2 Author: Konstantin Belousov AuthorDate: 2021-01-30 02:10:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:40:04 +0000 buf SU hooks: track buf_start() calls with B_IOSTARTED flag (cherry picked from commit bf0db19339e770a82236b74f523be4b572bde15d) --- sys/kern/vfs_bio.c | 14 ++++++++++++++ sys/sys/buf.h | 16 +++++++++++----- sys/ufs/ffs/ffs_vfsops.c | 4 ++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 2f18221e9270..9264388e9a3e 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2639,6 +2639,13 @@ brelse(struct buf *bp) return; } + if (LIST_EMPTY(&bp->b_dep)) { + bp->b_flags &= ~B_IOSTARTED; + } else { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("brelse: SU io not finished bp %p", bp)); + } + if ((bp->b_vflags & (BV_BKGRDINPROG | BV_BKGRDERR)) == BV_BKGRDERR) { BO_LOCK(bp->b_bufobj); bp->b_vflags &= ~BV_BKGRDERR; @@ -2826,6 +2833,13 @@ bqrelse(struct buf *bp) bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF); bp->b_xflags &= ~(BX_CVTENXIO); + if (LIST_EMPTY(&bp->b_dep)) { + bp->b_flags &= ~B_IOSTARTED; + } else { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("bqrelse: SU io not finished bp %p", bp)); + } + if (bp->b_flags & B_MANAGED) { if (bp->b_flags & B_REMFREE) bremfreef(bp); diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 50fa0f35491e..2997560b9ab3 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -232,7 +232,7 @@ struct buf { #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ #define B_INVALONERR 0x00040000 /* Invalidate on write error. */ -#define B_00080000 0x00080000 /* Available flag. */ +#define B_IOSTARTED 0x00080000 /* buf_start() called */ #define B_00100000 0x00100000 /* Available flag. */ #define B_MAXPHYS 0x00200000 /* nitems(b_pages[]) = atop(MAXPHYS). */ #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ @@ -248,8 +248,8 @@ struct buf { #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26maxphys\25b20" \ - "\24b19\23invalonerr\22clusterok\21malloc\20nocache\17b14\16inval" \ - "\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ + "\24iostarted\23invalonerr\22clusterok\21malloc\20nocache\17b14" \ + "\16inval\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" /* @@ -434,6 +434,9 @@ bstrategy(struct buf *bp) static __inline void buf_start(struct buf *bp) { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("recursed buf_start %p", bp)); + bp->b_flags |= B_IOSTARTED; if (bioops.io_start) (*bioops.io_start)(bp); } @@ -441,8 +444,11 @@ buf_start(struct buf *bp) static __inline void buf_complete(struct buf *bp) { - if (bioops.io_complete) - (*bioops.io_complete)(bp); + if ((bp->b_flags & B_IOSTARTED) != 0) { + bp->b_flags &= ~B_IOSTARTED; + if (bioops.io_complete) + (*bioops.io_complete)(bp); + } } static __inline void diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 60d4dad57d03..04afbfd4d6e4 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2393,10 +2393,10 @@ ffs_backgroundwritedone(struct buf *bp) #endif /* * This buffer is marked B_NOCACHE so when it is released - * by biodone it will be tossed. + * by biodone it will be tossed. Clear B_IOSTARTED in case of error. */ bp->b_flags |= B_NOCACHE; - bp->b_flags &= ~B_CACHE; + bp->b_flags &= ~(B_CACHE | B_IOSTARTED); pbrelvp(bp); /* From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AE3B553AE3; Wed, 24 Feb 2021 07:58:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlpFn282Zz4ZJs; Wed, 24 Feb 2021 07:58:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C43E28E11; Wed, 24 Feb 2021 07:58: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 11O7wbKB046318; Wed, 24 Feb 2021 07:58:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wbiO046317; Wed, 24 Feb 2021 07:58:37 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:37 GMT Message-Id: <202102240758.11O7wbiO046317@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: 0672f9d80860 - stable/13 - ffs: call ufsdirhash_dirtrunc() right after setting directory size 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: 0672f9d80860c0280aa6b2a24cb3e85df6eaeb1c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:37 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0672f9d80860c0280aa6b2a24cb3e85df6eaeb1c commit 0672f9d80860c0280aa6b2a24cb3e85df6eaeb1c Author: Konstantin Belousov AuthorDate: 2021-01-28 18:33:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:40:29 +0000 ffs: call ufsdirhash_dirtrunc() right after setting directory size (cherry picked from commit e94f2f1be32294cb6d519b6631f7522466fbbb3b) --- sys/ufs/ffs/ffs_inode.c | 13 +++++++++++++ sys/ufs/ufs/ufs_lookup.c | 4 ---- sys/ufs/ufs/ufs_vnops.c | 2 -- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 0b4172b34300..3df7bf8e8596 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ufs.h" #include "opt_quota.h" #include @@ -59,6 +60,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef UFS_DIRHASH +#include +#endif #include #include @@ -456,6 +461,10 @@ ffs_truncate(vp, length, flags, cred) ip->i_size = length; DIP_SET(ip, i_size, length); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); +#ifdef UFS_DIRHASH + if (vp->v_type == VDIR && ip->i_dirhash != NULL) + ufsdirhash_dirtrunc(ip, length); +#endif } else { lbn = lblkno(fs, length); flags |= BA_CLRBUF; @@ -482,6 +491,10 @@ ffs_truncate(vp, length, flags, cred) return (error); ip->i_size = length; DIP_SET(ip, i_size, length); +#ifdef UFS_DIRHASH + if (vp->v_type == VDIR && ip->i_dirhash != NULL) + ufsdirhash_dirtrunc(ip, length); +#endif size = blksize(fs, ip, lbn); if (vp->v_type != VDIR && offset != 0) bzero((char *)bp->b_data + offset, diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 7dbd58f795cc..2f5fbf3d8001 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1131,10 +1131,6 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) vn_printf(dvp, "ufs_direnter: failed to truncate, error %d\n", error); -#ifdef UFS_DIRHASH - if (error == 0 && dp->i_dirhash != NULL) - ufsdirhash_dirtrunc(dp, I_ENDOFF(dp)); -#endif error = 0; if (tvp != NULL) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 0e7ec7ae5453..70b5a44ca21d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1694,8 +1694,6 @@ unlockout: #ifdef UFS_DIRHASH if (error != 0) ufsdirhash_free(tdp); - else if (tdp->i_dirhash != NULL) - ufsdirhash_dirtrunc(tdp, endoff); #endif /* * Even if the directory compaction failed, rename was From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 6AE2D553AE6; Wed, 24 Feb 2021 07:58: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 4DlpFp2dfBz4ZFl; Wed, 24 Feb 2021 07:58: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 4C7B228B54; Wed, 24 Feb 2021 07:58: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 11O7wcNM046340; Wed, 24 Feb 2021 07:58:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wc9n046339; Wed, 24 Feb 2021 07:58:38 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:38 GMT Message-Id: <202102240758.11O7wc9n046339@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: 9255b36faf8a - stable/13 - ffs: Add FFSV_REPLACE_DOOMED flag to ffs_vgetf() 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: 9255b36faf8a6ba790517c665fb47f174fa185db Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:38 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9255b36faf8a6ba790517c665fb47f174fa185db commit 9255b36faf8a6ba790517c665fb47f174fa185db Author: Konstantin Belousov AuthorDate: 2021-01-26 11:35:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:40:52 +0000 ffs: Add FFSV_REPLACE_DOOMED flag to ffs_vgetf() (cherry picked from commit f16c26b1c009fd0d87d07d3b1cf0d5078ad7f511) --- sys/ufs/ffs/ffs_extern.h | 5 +++-- sys/ufs/ffs/ffs_vfsops.c | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index d54df1deced9..bdb3f533e1ad 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -122,8 +122,9 @@ int ffs_breadz(struct ufsmount *, struct vnode *, daddr_t, daddr_t, int, /* * Flags to ffs_vgetf */ -#define FFSV_FORCEINSMQ 0x0001 -#define FFSV_REPLACE 0x0002 +#define FFSV_FORCEINSMQ 0x0001 +#define FFSV_REPLACE 0x0002 +#define FFSV_REPLACE_DOOMED 0x0004 /* * Flags to ffs_reload diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 04afbfd4d6e4..91b8c30f0919 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1954,13 +1954,16 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) daddr_t dbn; int error; - MPASS((ffs_flags & FFSV_REPLACE) == 0 || (flags & LK_EXCLUSIVE) != 0); + MPASS((ffs_flags & (FFSV_REPLACE | FFSV_REPLACE_DOOMED)) == 0 || + (flags & LK_EXCLUSIVE) != 0); error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL); if (error != 0) return (error); if (*vpp != NULL) { - if ((ffs_flags & FFSV_REPLACE) == 0) + if ((ffs_flags & FFSV_REPLACE) == 0 || + ((ffs_flags & FFSV_REPLACE_DOOMED) == 0 || + !VN_IS_DOOMED(*vpp))) return (0); vgone(*vpp); vput(*vpp); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 F3473553B3C; Wed, 24 Feb 2021 07:58: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 4DlpFw6GKjz4Z9X; Wed, 24 Feb 2021 07:58: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 B42E728BB4; Wed, 24 Feb 2021 07:58: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 11O7wgp0046420; Wed, 24 Feb 2021 07:58:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wg5C046419; Wed, 24 Feb 2021 07:58:42 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:42 GMT Message-Id: <202102240758.11O7wg5C046419@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: ed3b4bbe359b - stable/13 - ufs_direnter/SU: unconditionally UFS_UPDATE inode when extending directory 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: ed3b4bbe359bc01407e455eb3f535bc0d632e9b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:46 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ed3b4bbe359bc01407e455eb3f535bc0d632e9b4 commit ed3b4bbe359bc01407e455eb3f535bc0d632e9b4 Author: Konstantin Belousov AuthorDate: 2021-01-23 21:52:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:42:20 +0000 ufs_direnter/SU: unconditionally UFS_UPDATE inode when extending directory (cherry picked from commit 08c2dc2841214187a162d5e4475aa1b94d03fd77) --- sys/ufs/ufs/ufs_lookup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 2f5fbf3d8001..e614f189a623 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -964,9 +964,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) if (newdirbp) bdwrite(newdirbp); bdwrite(bp); - if ((dp->i_flag & IN_NEEDSYNC) == 0) - return (UFS_UPDATE(dvp, 0)); - return (0); + return (UFS_UPDATE(dvp, 0)); } if (DOINGASYNC(dvp)) { bdwrite(bp); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 B4A73553C9F; Wed, 24 Feb 2021 07:58: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 4DlpFw5vs6z4ZKT; Wed, 24 Feb 2021 07:58: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 CF10628E12; Wed, 24 Feb 2021 07:58: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 11O7wfMg046402; Wed, 24 Feb 2021 07:58:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wfZK046401; Wed, 24 Feb 2021 07:58:41 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:41 GMT Message-Id: <202102240758.11O7wfZK046401@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: 861d47845f24 - stable/13 - ffs_syncvnode: only clear IN_NEEDSYNC after successfull sync 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: 861d47845f248be085e784dc5ab4221e078f8100 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:46 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=861d47845f248be085e784dc5ab4221e078f8100 commit 861d47845f248be085e784dc5ab4221e078f8100 Author: Konstantin Belousov AuthorDate: 2021-01-23 21:50:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:41:58 +0000 ffs_syncvnode: only clear IN_NEEDSYNC after successfull sync (cherry picked from commit 1de1e2bfbf3c089418bbe67c096d60315c8ca5dd) --- sys/ufs/ffs/ffs_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 68985d8715f3..be2653e32adc 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -257,7 +257,6 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) bool still_dirty, unlocked, wait; ip = VTOI(vp); - ip->i_flag &= ~IN_NEEDSYNC; bo = &vp->v_bufobj; ump = VFSTOUFS(vp->v_mount); @@ -445,6 +444,8 @@ next: } if (error == 0 && unlocked) error = ERELOOKUP; + if (error == 0) + ip->i_flag &= ~IN_NEEDSYNC; return (error); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 68FED553BDC; Wed, 24 Feb 2021 07:58: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 4DlpFr6NJyz4ZRF; Wed, 24 Feb 2021 07:58: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 8CEB728B55; Wed, 24 Feb 2021 07:58: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 11O7wet8046380; Wed, 24 Feb 2021 07:58:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7weXx046379; Wed, 24 Feb 2021 07:58:40 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:40 GMT Message-Id: <202102240758.11O7weXx046379@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: ed0639829323 - stable/13 - Merge ufs_fhtovp() into ffs_inotovp(). 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: ed0639829323e813d5ca2c5edb4d8fe17eb04fd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:42 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ed0639829323e813d5ca2c5edb4d8fe17eb04fd2 commit ed0639829323e813d5ca2c5edb4d8fe17eb04fd2 Author: Konstantin Belousov AuthorDate: 2021-01-28 12:20:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:41:37 +0000 Merge ufs_fhtovp() into ffs_inotovp(). (cherry picked from commit 89fd61d955ada4fdb20030253206201bc279cdf0) --- sys/ufs/ffs/ffs_vfsops.c | 21 +++++++++++++++++---- sys/ufs/ufs/ufs_extern.h | 1 - sys/ufs/ufs/ufs_vfsops.c | 25 ------------------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 596e2f4b4b5f..540dd02c9631 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2170,6 +2170,7 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) { struct ufsmount *ump; struct vnode *nvp; + struct inode *ip; struct fs *fs; struct cg *cgp; struct buf *bp; @@ -2178,6 +2179,8 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) ump = VFSTOUFS(mp); fs = ump->um_fs; + *vpp = NULL; + if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) return (ESTALE); @@ -2198,10 +2201,20 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) } error = ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags); - if (error == 0) - error = ufs_fhtovp(mp, nvp, gen); - *vpp = error == 0 ? nvp : NULLVP; - return (error); + if (error != 0) + return (error); + + ip = VTOI(nvp); + if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { + if (ip->i_mode == 0) + vgone(nvp); + vput(nvp); + return (ESTALE); + } + + vnode_create_vobject(nvp, DIP(ip, i_size), curthread); + *vpp = nvp; + return (0); } /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index ab26750455e8..1697f2c0ba61 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -59,7 +59,6 @@ int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); int ufs_bmap_seekdata(struct vnode *, off_t *); -int ufs_fhtovp(struct mount *, struct vnode *, u_int64_t); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); int ufs_dirbadentry(struct vnode *, struct direct *, int); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 1a63e92b3e2c..0f45baed634f 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -214,28 +214,3 @@ ufs_uninit(vfsp) #endif return (0); } - -/* - * This is the generic part of fhtovp called after the underlying - * filesystem has validated the file handle. - * - * Call the VFS_CHECKEXP beforehand to verify access. - */ -int -ufs_fhtovp(mp, nvp, gen) - struct mount *mp; - struct vnode *nvp; - u_int64_t gen; -{ - struct inode *ip; - - ip = VTOI(nvp); - if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { - if (ip->i_mode == 0) - vgone(nvp); - vput(nvp); - return (ESTALE); - } - vnode_create_vobject(nvp, DIP(ip, i_size), curthread); - return (0); -} From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 83DDE553BDB; Wed, 24 Feb 2021 07:58: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 4DlpFr0G1Qz4ZR9; Wed, 24 Feb 2021 07:58: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 88DA628BB3; Wed, 24 Feb 2021 07:58: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 11O7wdSO046358; Wed, 24 Feb 2021 07:58:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wdLB046357; Wed, 24 Feb 2021 07:58:39 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:39 GMT Message-Id: <202102240758.11O7wdLB046357@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: e3e958f3a4f2 - stable/13 - ffs_inotovp(): interface to convert (ino, gen) into alive 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: e3e958f3a4f2d3c8cb630e9659bc2a65d0846c52 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:42 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e3e958f3a4f2d3c8cb630e9659bc2a65d0846c52 commit e3e958f3a4f2d3c8cb630e9659bc2a65d0846c52 Author: Konstantin Belousov AuthorDate: 2021-01-26 11:52:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:41:12 +0000 ffs_inotovp(): interface to convert (ino, gen) into alive vnode (cherry picked from commit 5952c86c78b177b5e904bf139e6b56519897c7e0) --- sys/ufs/ffs/ffs_extern.h | 2 ++ sys/ufs/ffs/ffs_vfsops.c | 44 ++++++++++++++++++++++++++++++++------------ sys/ufs/ufs/ufs_extern.h | 2 +- sys/ufs/ufs/ufs_vfsops.c | 21 +++++---------------- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index bdb3f533e1ad..9694489266b6 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -80,6 +80,8 @@ int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t, void ffs_fserr(struct fs *, ino_t, char *); int ffs_getcg(struct fs *, struct vnode *, u_int, int, struct buf **, struct cg **); +int ffs_inotovp(struct mount *, ino_t, u_int64_t, int, struct vnode **, + int); int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 91b8c30f0919..596e2f4b4b5f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2153,35 +2153,55 @@ ffs_fhtovp(mp, fhp, flags, vpp) struct vnode **vpp; { struct ufid *ufhp; + + ufhp = (struct ufid *)fhp; + return (ffs_inotovp(mp, ufhp->ufid_ino, ufhp->ufid_gen, flags, + vpp, 0)); +} + +int +ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) + struct mount *mp; + ino_t ino; + u_int64_t gen; + int lflags; + struct vnode **vpp; + int ffs_flags; +{ struct ufsmount *ump; + struct vnode *nvp; struct fs *fs; struct cg *cgp; struct buf *bp; - ino_t ino; u_int cg; int error; - ufhp = (struct ufid *)fhp; - ino = ufhp->ufid_ino; ump = VFSTOUFS(mp); fs = ump->um_fs; if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) return (ESTALE); + /* * Need to check if inode is initialized because UFS2 does lazy * initialization and nfs_fhtovp can offer arbitrary inode numbers. */ - if (fs->fs_magic != FS_UFS2_MAGIC) - return (ufs_fhtovp(mp, ufhp, flags, vpp)); - cg = ino_to_cg(fs, ino); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) - return (error); - if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { + if (fs->fs_magic == FS_UFS2_MAGIC) { + cg = ino_to_cg(fs, ino); + error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp); + if (error != 0) + return (error); + if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { + brelse(bp); + return (ESTALE); + } brelse(bp); - return (ESTALE); } - brelse(bp); - return (ufs_fhtovp(mp, ufhp, flags, vpp)); + + error = ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags); + if (error == 0) + error = ufs_fhtovp(mp, nvp, gen); + *vpp = error == 0 ? nvp : NULLVP; + return (error); } /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index a28fcffabd2e..ab26750455e8 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -59,7 +59,7 @@ int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); int ufs_bmap_seekdata(struct vnode *, off_t *); -int ufs_fhtovp(struct mount *, struct ufid *, int, struct vnode **); +int ufs_fhtovp(struct mount *, struct vnode *, u_int64_t); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); int ufs_dirbadentry(struct vnode *, struct direct *, int); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 4813ac7db763..1a63e92b3e2c 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -222,31 +222,20 @@ ufs_uninit(vfsp) * Call the VFS_CHECKEXP beforehand to verify access. */ int -ufs_fhtovp(mp, ufhp, flags, vpp) +ufs_fhtovp(mp, nvp, gen) struct mount *mp; - struct ufid *ufhp; - int flags; - struct vnode **vpp; + struct vnode *nvp; + u_int64_t gen; { struct inode *ip; - struct vnode *nvp; - int error; - error = VFS_VGET(mp, ufhp->ufid_ino, flags, &nvp); - if (error) { - *vpp = NULLVP; - return (error); - } ip = VTOI(nvp); - if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen || - ip->i_effnlink <= 0) { + if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { if (ip->i_mode == 0) vgone(nvp); vput(nvp); - *vpp = NULLVP; return (ESTALE); } - *vpp = nvp; - vnode_create_vobject(*vpp, DIP(ip, i_size), curthread); + vnode_create_vobject(nvp, DIP(ip, i_size), curthread); return (0); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 5B0F4553CA1; Wed, 24 Feb 2021 07:58: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 4DlpFy1ww0z4ZDQ; Wed, 24 Feb 2021 07:58: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 1993828BB5; Wed, 24 Feb 2021 07:58: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 11O7wiwZ046464; Wed, 24 Feb 2021 07:58:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wiaK046463; Wed, 24 Feb 2021 07:58:44 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:44 GMT Message-Id: <202102240758.11O7wiaK046463@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: 1f96e4cd1e3c - stable/13 - Add VOP_VPUT_PAIR() with trivial default implementation. 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: 1f96e4cd1e3c500d3837a77811ce47b96353296b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:48 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1f96e4cd1e3c500d3837a77811ce47b96353296b commit 1f96e4cd1e3c500d3837a77811ce47b96353296b Author: Konstantin Belousov AuthorDate: 2021-01-28 22:30:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:43:03 +0000 Add VOP_VPUT_PAIR() with trivial default implementation. (cherry picked from commit 49c117c193768b10f5fb1c5e4d6b88300cfbcdd6) --- sys/kern/vfs_default.c | 15 +++++++++++++++ sys/kern/vnode_if.src | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 4b96d9522ce3..382fbb2d9ace 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -92,6 +92,7 @@ static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); static int vop_stdread_pgcache(struct vop_read_pgcache_args *ap); static int vop_stdstat(struct vop_stat_args *ap); +static int vop_stdvput_pair(struct vop_vput_pair_args *ap); /* * This vnode table stores what we want to do if the filesystem doesn't @@ -151,6 +152,7 @@ struct vop_vector default_vnodeops = { .vop_unset_text = vop_stdunset_text, .vop_add_writecount = vop_stdadd_writecount, .vop_copy_file_range = vop_stdcopy_file_range, + .vop_vput_pair = vop_stdvput_pair, }; VFS_VOP_VECTOR_REGISTER(default_vnodeops); @@ -1592,3 +1594,16 @@ vop_stdread_pgcache(struct vop_read_pgcache_args *ap __unused) { return (EJUSTRETURN); } + +static int +vop_stdvput_pair(struct vop_vput_pair_args *ap) +{ + struct vnode *dvp, *vp, **vpp; + + dvp = ap->a_dvp; + vpp = ap->a_vpp; + vput(dvp); + if (vpp != NULL && ap->a_unlock_vp && (vp = *vpp) != NULL) + vput(vp); + return (0); +} diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 5d15d4a0c863..b506237f385d 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -792,6 +792,15 @@ vop_copy_file_range { }; +%% vput_pair dvp E - - + +vop_vput_pair { + IN struct vnode *dvp; + INOUT struct vnode **vpp; + IN bool unlock_vp; +}; + + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 ADDB655397D; Wed, 24 Feb 2021 07:58: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 4DlpFz3kG3z4ZGP; Wed, 24 Feb 2021 07:58: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 3521D28B56; Wed, 24 Feb 2021 07:58: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 11O7wkW6046482; Wed, 24 Feb 2021 07:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wkXn046481; Wed, 24 Feb 2021 07:58:46 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:46 GMT Message-Id: <202102240758.11O7wkXn046481@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: e45f7c841983 - stable/13 - nullfs: provide special bypass for VOP_VPUT_PAIR 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: e45f7c841983f6ccd65d6061a5542989a8201826 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:48 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e45f7c841983f6ccd65d6061a5542989a8201826 commit e45f7c841983f6ccd65d6061a5542989a8201826 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:22:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:43:22 +0000 nullfs: provide special bypass for VOP_VPUT_PAIR (cherry picked from commit e4aaf35ab54958f74409790fa2b7df8c2d230cee) --- sys/fs/nullfs/null_vnops.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 1de0cdfca9ac..45065e0be7b5 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -967,6 +967,54 @@ null_read_pgcache(struct vop_read_pgcache_args *ap) return (error); } +/* + * Avoid standard bypass, since lower dvp and vp could be no longer + * valid after vput(). + */ +static int +null_vput_pair(struct vop_vput_pair_args *ap) +{ + struct mount *mp; + struct vnode *dvp, *ldvp, *lvp, *vp, *vp1, **vpp; + int error, res; + + dvp = ap->a_dvp; + ldvp = NULLVPTOLOWERVP(dvp); + vref(ldvp); + + vpp = ap->a_vpp; + vp = NULL; + lvp = NULL; + if (vpp != NULL) { + vp = *vpp; + if (vp != NULL) { + vhold(vp); + mp = vp->v_mount; + lvp = NULLVPTOLOWERVP(vp); + if (ap->a_unlock_vp) + vref(lvp); + } + } + + res = VOP_VPUT_PAIR(ldvp, &lvp, ap->a_unlock_vp); + + /* lvp might have been unlocked and vp reclaimed */ + if (vp != NULL) { + if (!ap->a_unlock_vp && vp->v_vnlock != lvp->v_vnlock) { + error = null_nodeget(mp, lvp, &vp1); + if (error == 0) { + vput(vp); + *vpp = vp1; + } + } + if (ap->a_unlock_vp) + vrele(vp); + vdrop(vp); + } + vrele(dvp); + return (res); +} + /* * Global vfs data structures */ @@ -997,5 +1045,6 @@ struct vop_vector null_vnodeops = { .vop_vptocnp = null_vptocnp, .vop_vptofh = null_vptofh, .vop_add_writecount = null_add_writecount, + .vop_vput_pair = null_vput_pair, }; VFS_VOP_VECTOR_REGISTER(null_vnodeops); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 807D6553CA5; Wed, 24 Feb 2021 07:58: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 4DlpFy1wt5z4ZTL; Wed, 24 Feb 2021 07:58: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 E383328E80; Wed, 24 Feb 2021 07:58: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 11O7whoH046442; Wed, 24 Feb 2021 07:58:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7whnO046441; Wed, 24 Feb 2021 07:58:43 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:43 GMT Message-Id: <202102240758.11O7whnO046441@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: 75f0d88bd3f0 - stable/13 - vn_open(): If the vnode is reclaimed during open(2), do not return error. 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: 75f0d88bd3f0d85cce17f7d1039c7e14c7d2aa4d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:48 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=75f0d88bd3f0d85cce17f7d1039c7e14c7d2aa4d commit 75f0d88bd3f0d85cce17f7d1039c7e14c7d2aa4d Author: Konstantin Belousov AuthorDate: 2021-02-03 11:02:18 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:42:42 +0000 vn_open(): If the vnode is reclaimed during open(2), do not return error. (cherry picked from commit ee965dfa64929227ced8adb68900c35f877480e7) --- sys/fs/deadfs/dead_vnops.c | 11 +++++++++-- sys/kern/vfs_vnops.c | 2 -- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index 09c3c996ee0e..324bbafd7caf 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -45,6 +45,7 @@ */ static vop_lookup_t dead_lookup; static vop_open_t dead_open; +static vop_close_t dead_close; static vop_getwritemount_t dead_getwritemount; static vop_rename_t dead_rename; static vop_unset_text_t dead_unset_text; @@ -55,6 +56,7 @@ struct vop_vector dead_vnodeops = { .vop_access = VOP_EBADF, .vop_advlock = VOP_EBADF, .vop_bmap = VOP_EBADF, + .vop_close = dead_close, .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, .vop_getwritemount = dead_getwritemount, @@ -104,13 +106,18 @@ dead_lookup(struct vop_lookup_args *ap) } /* - * Open always fails as if device did not exist. + * Silently succeed open and close. */ static int dead_open(struct vop_open_args *ap) { + return (0); +} - return (ENXIO); +static int +dead_close(struct vop_close_args *ap) +{ + return (0); } int diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 1e52a797a1f7..3ec2662dfcd8 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -356,8 +356,6 @@ vn_open_vnode_advlock(struct vnode *vp, int fmode, struct file *fp) fp->f_flag |= FHASLOCK; vn_lock(vp, lock_flags | LK_RETRY); - if (error == 0 && VN_IS_DOOMED(vp)) - error = ENOENT; return (error); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 87F09553E0A; Wed, 24 Feb 2021 07:59: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 4DlpGC3c0qz4Zmn; Wed, 24 Feb 2021 07:58: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 2A61228E81; Wed, 24 Feb 2021 07:58: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 11O7wtgO046650; Wed, 24 Feb 2021 07:58:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wtHc046649; Wed, 24 Feb 2021 07:58:55 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:55 GMT Message-Id: <202102240758.11O7wtHc046649@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: 220cd6b04580 - stable/13 - ufs_direnter: directory truncation does not need special case for rename 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: 220cd6b0458006554944598e170436eb0db683da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:03 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=220cd6b0458006554944598e170436eb0db683da commit 220cd6b0458006554944598e170436eb0db683da Author: Konstantin Belousov AuthorDate: 2021-01-29 12:31:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:45:57 +0000 ufs_direnter: directory truncation does not need special case for rename (cherry picked from commit 06f2918ab8a2621c6e6bc5729ed9ab982741aaf2) --- sys/ufs/ffs/ffs_vnops.c | 25 ++++++++++++------------- sys/ufs/ufs/ufs_extern.h | 2 +- sys/ufs/ufs/ufs_lookup.c | 12 +++++------- sys/ufs/ufs/ufs_vnops.c | 10 +++++----- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index dd0f1ba6b81d..38511647c502 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1968,22 +1968,21 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) * now that other locks are no longer held. */ if ((dp->i_flag & IN_ENDOFF) != 0) { + VNASSERT(I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size, dvp, + ("IN_ENDOFF set but I_ENDOFF() is not")); dp->i_flag &= ~IN_ENDOFF; - if (I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { - old_size = dp->i_size; - error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), - IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), - curthread->td_ucred); - if (error != 0 && error != ERELOOKUP) { - if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { - vn_printf(dvp, - "IN_ENDOFF: failed to truncate, " - "error %d\n", error); - } + old_size = dp->i_size; + error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), IO_NORMAL | + (DOINGASYNC(dvp) ? 0 : IO_SYNC), curthread->td_ucred); + if (error != 0 && error != ERELOOKUP) { + if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { + vn_printf(dvp, + "IN_ENDOFF: failed to truncate, " + "error %d\n", error); + } #ifdef UFS_DIRHASH - ufsdirhash_free(dp); + ufsdirhash_free(dp); #endif - } } SET_I_ENDOFF(dp, 0); } diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index 1697f2c0ba61..3ac631e6ab0b 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -68,7 +68,7 @@ int ufs_extwrite(struct vop_write_args *); void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); int ufs_direnter(struct vnode *, struct vnode *, struct direct *, - struct componentname *, struct buf *, int); + struct componentname *, struct buf *); int ufs_dirremove(struct vnode *, struct inode *, int, int); int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 3036bce81caf..0509185c4663 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -876,13 +876,12 @@ ufs_makedirentry(ip, cnp, newdirp) * soft dependency code). */ int -ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) +ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) struct vnode *dvp; struct vnode *tvp; struct direct *dirp; struct componentname *cnp; struct buf *newdirbp; - int isrename; { struct ucred *cr; struct thread *td; @@ -1111,14 +1110,13 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) error = bwrite(bp); } } - UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE); /* - * If all went well, and the directory can be shortened, mark directory inode - * with the truncation request right before unlock. + * If all went well, and the directory can be shortened, + * mark directory inode with the truncation request. */ - if (isrename == 0 && error == 0) - UFS_INODE_SET_FLAG(dp, IN_ENDOFF); + UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE | (error == 0 && + I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size ? IN_ENDOFF : 0)); return (error); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index c101e699bad6..22199a390dd4 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1111,7 +1111,7 @@ ufs_link(ap) error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp) && !DOINGASYNC(vp)); if (!error) { ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL, 0); + error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL); } if (error) { @@ -1171,7 +1171,7 @@ ufs_whiteout(ap) newdir.d_namlen = cnp->cn_namelen; bcopy(cnp->cn_nameptr, newdir.d_name, (unsigned)cnp->cn_namelen + 1); newdir.d_type = DT_WHT; - error = ufs_direnter(dvp, NULL, &newdir, cnp, NULL, 0); + error = ufs_direnter(dvp, NULL, &newdir, cnp, NULL); break; case DELETE: @@ -1511,7 +1511,7 @@ relock: } } ufs_makedirentry(fip, tcnp, &newdir); - error = ufs_direnter(tdvp, NULL, &newdir, tcnp, NULL, 1); + error = ufs_direnter(tdvp, NULL, &newdir, tcnp, NULL); if (error) goto bad; /* Setup tdvp for directory compaction if needed. */ @@ -2132,7 +2132,7 @@ ufs_mkdir(ap) else if (!DOINGSOFTDEP(dvp) && ((error = bwrite(bp)))) goto bad; ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(dvp, tvp, &newdir, cnp, bp, 0); + error = ufs_direnter(dvp, tvp, &newdir, cnp, bp); bad: if (error == 0) { @@ -2865,7 +2865,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) } #endif /* !UFS_ACL */ ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(dvp, tvp, &newdir, cnp, NULL, 0); + error = ufs_direnter(dvp, tvp, &newdir, cnp, NULL); if (error) goto bad; vn_seqc_write_end(tvp); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 68BA0553D92; Wed, 24 Feb 2021 07:59: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 4DlpGF025Rz4ZkF; Wed, 24 Feb 2021 07: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 75E6428B58; Wed, 24 Feb 2021 07:58: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 11O7wvQQ046690; Wed, 24 Feb 2021 07:58:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wv86046689; Wed, 24 Feb 2021 07:58:57 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:57 GMT Message-Id: <202102240758.11O7wv86046689@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: d72a156fb67d - stable/13 - ufs vnops: brace softdep_prelink() with DOINGSUJ instead of DOINGSOFTDEP 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: d72a156fb67da00890137b8f1ec5f5117fbe7015 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d72a156fb67da00890137b8f1ec5f5117fbe7015 commit d72a156fb67da00890137b8f1ec5f5117fbe7015 Author: Konstantin Belousov AuthorDate: 2021-01-23 23:12:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:46:41 +0000 ufs vnops: brace softdep_prelink() with DOINGSUJ instead of DOINGSOFTDEP (cherry picked from commit 6aed2435c8bf1fa55891c7d30186c9ad91064da8) --- sys/ufs/ufs/ufs_vnops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index b035a8b1c34d..e6a78c3655cc 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1006,7 +1006,7 @@ ufs_remove(ap) if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (VTOI(dvp)->i_flags & APPEND)) return (EPERM); - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -1071,7 +1071,7 @@ ufs_link(ap) panic("ufs_link: no name"); #endif - if (DOINGSOFTDEP(tdvp)) { + if (DOINGSUJ(tdvp)) { error = softdep_prelink(tdvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -1142,7 +1142,7 @@ ufs_whiteout(ap) struct direct newdir; int error = 0; - if (DOINGSOFTDEP(dvp) && (ap->a_flags == CREATE || + if (DOINGSUJ(dvp) && (ap->a_flags == CREATE || ap->a_flags == DELETE)) { error = softdep_prelink(dvp, NULL); if (error != 0) { @@ -1945,7 +1945,7 @@ ufs_mkdir(ap) goto out; } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); @@ -2209,7 +2209,7 @@ ufs_rmdir(ap) error = EINVAL; goto out; } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -2736,7 +2736,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) print_bad_link_count(callfunc, dvp); return (EINVAL); } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 80A0C553D38; Wed, 24 Feb 2021 07:59: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 4DlpGG6JRzz4ZXq; Wed, 24 Feb 2021 07:59: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 8235B28D8E; Wed, 24 Feb 2021 07:58: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 11O7wwLV046712; Wed, 24 Feb 2021 07:58:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wwgW046711; Wed, 24 Feb 2021 07:58:58 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:58 GMT Message-Id: <202102240758.11O7wwgW046711@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: bbf612a1af56 - stable/13 - Stop ignoring ERELOOKUP from VOP_INACTIVE() 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: bbf612a1af56cc4307650c5f38ec63deeefdbe32 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bbf612a1af56cc4307650c5f38ec63deeefdbe32 commit bbf612a1af56cc4307650c5f38ec63deeefdbe32 Author: Konstantin Belousov AuthorDate: 2021-01-30 19:17:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:46:59 +0000 Stop ignoring ERELOOKUP from VOP_INACTIVE() (cherry picked from commit b59a8e63d6bf9092419b7a421c655d0ae2099662) --- sys/kern/vfs_subr.c | 47 ++++++++++++++++++++++++++++++++-------------- sys/sys/vnode.h | 3 ++- sys/ufs/ffs/ffs_snapshot.c | 8 +++++++- 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 047e4c54f0c5..04cd0e0175f9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3159,9 +3159,21 @@ vput_final(struct vnode *vp, enum vput_op func) break; } if (error == 0) { - vinactive(vp); - if (want_unlock) - VOP_UNLOCK(vp); + if (func == VUNREF) { + VNASSERT((vp->v_vflag & VV_UNREF) == 0, vp, + ("recursive vunref")); + vp->v_vflag |= VV_UNREF; + } + for (;;) { + error = vinactive(vp); + if (want_unlock) + VOP_UNLOCK(vp); + if (error != ERELOOKUP || !want_unlock) + break; + VOP_LOCK(vp, LK_EXCLUSIVE); + } + if (func == VUNREF) + vp->v_vflag &= ~VV_UNREF; vdropl(vp); } else { vdefer_inactive(vp); @@ -3546,10 +3558,11 @@ vdropl(struct vnode *vp) * Call VOP_INACTIVE on the vnode and manage the DOINGINACT and OWEINACT * flags. DOINGINACT prevents us from recursing in calls to vinactive. */ -static void +static int vinactivef(struct vnode *vp) { struct vm_object *obj; + int error; ASSERT_VOP_ELOCKED(vp, "vinactive"); ASSERT_VI_LOCKED(vp, "vinactive"); @@ -3575,14 +3588,15 @@ vinactivef(struct vnode *vp) vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); } - VOP_INACTIVE(vp); + error = VOP_INACTIVE(vp); VI_LOCK(vp); VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, ("vinactive: lost VI_DOINGINACT")); vp->v_iflag &= ~VI_DOINGINACT; + return (error); } -void +int vinactive(struct vnode *vp) { @@ -3591,14 +3605,14 @@ vinactive(struct vnode *vp) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if ((vp->v_iflag & VI_OWEINACT) == 0) - return; + return (0); if (vp->v_iflag & VI_DOINGINACT) - return; + return (0); if (vp->v_usecount > 0) { vp->v_iflag &= ~VI_OWEINACT; - return; + return (0); } - vinactivef(vp); + return (vinactivef(vp)); } /* @@ -3911,10 +3925,15 @@ vgonel(struct vnode *vp) */ if (active) VOP_CLOSE(vp, FNONBLOCK, NOCRED, td); - if ((oweinact || active) && !doinginact) { - VI_LOCK(vp); - vinactivef(vp); - VI_UNLOCK(vp); + if (!doinginact) { + do { + if (oweinact || active) { + VI_LOCK(vp); + vinactivef(vp); + oweinact = (vp->v_iflag & VI_OWEINACT) != 0; + VI_UNLOCK(vp); + } + } while (oweinact); } if (vp->v_type == VSOCK) vfs_unp_reclaim(vp); diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 78fbec1bd0ba..639a16881e09 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -269,6 +269,7 @@ struct xvnode { #define VV_MD 0x0800 /* vnode backs the md device */ #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ #define VV_READLINK 0x2000 /* fdescfs linux vnode */ +#define VV_UNREF 0x4000 /* vunref, do not drop lock in inactive() */ #define VMP_LAZYLIST 0x0001 /* Vnode is on mnt's lazy list */ @@ -710,7 +711,7 @@ void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdnz(struct vnode *); bool vhold_smr(struct vnode *); -void vinactive(struct vnode *vp); +int vinactive(struct vnode *vp); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, off_t length, int blksize); void v_inval_buf_range(struct vnode *vp, daddr_t startlbn, daddr_t endlbn, diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index b5daec14decf..72c8061917d8 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -2595,6 +2595,7 @@ process_deferred_inactive(struct mount *mp) continue; } vholdl(vp); +retry_vnode: error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK); if (error != 0) { vdrop(vp); @@ -2609,7 +2610,12 @@ process_deferred_inactive(struct mount *mp) UFS_INODE_SET_FLAG(ip, IN_MODIFIED); } VI_LOCK(vp); - vinactive(vp); + error = vinactive(vp); + if (error == ERELOOKUP && vp->v_usecount == 0) { + VI_UNLOCK(vp); + VOP_UNLOCK(vp); + goto retry_vnode; + } VI_UNLOCK(vp); VOP_UNLOCK(vp); vdrop(vp); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 937AD553BEF; Wed, 24 Feb 2021 07:58: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 4DlpG24dR2z4Z9v; Wed, 24 Feb 2021 07:58: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 701EA28C1D; Wed, 24 Feb 2021 07:58: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 11O7wmsk046526; Wed, 24 Feb 2021 07:58:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wmUw046525; Wed, 24 Feb 2021 07:58:48 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:48 GMT Message-Id: <202102240758.11O7wmUw046525@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: 6c465e4719ab - stable/13 - ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. 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: 6c465e4719abe04a2c97f49385c2da3046cf39c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:53 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6c465e4719abe04a2c97f49385c2da3046cf39c9 commit 6c465e4719abe04a2c97f49385c2da3046cf39c9 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:56:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:44:07 +0000 ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. (cherry picked from commit be44e986377780f533f961fe7c009b93379b4710) --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 32dc47653d18..b5daec14decf 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -296,16 +296,21 @@ restart: goto restart; } error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vat); - VOP_UNLOCK(nd.ni_dvp); if (error) { + VOP_VPUT_PAIR(nd.ni_dvp, NULL, true); NDFREE(&nd, NDF_ONLY_PNBUF); vn_finished_write(wrtmp); - vrele(nd.ni_dvp); if (error == ERELOOKUP) goto restart; return (error); } vp = nd.ni_vp; + vref(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, false); + if (VN_IS_DOOMED(vp)) { + error = EBADF; + goto out; + } vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 6157D553CB5; Wed, 24 Feb 2021 07:58: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 4DlpG73L20z4ZS8; Wed, 24 Feb 2021 07:58: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 CD47228B57; Wed, 24 Feb 2021 07:58: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 11O7wpfM046588; Wed, 24 Feb 2021 07:58:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wpLY046587; Wed, 24 Feb 2021 07:58:51 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:51 GMT Message-Id: <202102240758.11O7wpLY046587@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: b7d28c4e9073 - stable/13 - ffs_vput_pair(): try harder to recover from the vnode reclaim 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: b7d28c4e9073299c2a18c5c7d8013f5f55eb73ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:57 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b7d28c4e9073299c2a18c5c7d8013f5f55eb73ce commit b7d28c4e9073299c2a18c5c7d8013f5f55eb73ce Author: Konstantin Belousov AuthorDate: 2021-01-27 18:10:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:45:01 +0000 ffs_vput_pair(): try harder to recover from the vnode reclaim (cherry picked from commit 30bfb2fa0fad8e5bbcce369df46dcaa2e08324f3) --- sys/ufs/ffs/ffs_vnops.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 623b13790ce0..2ac67adad5f2 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1924,8 +1924,11 @@ ffs_getpages_async(struct vop_getpages_async_args *ap) static int ffs_vput_pair(struct vop_vput_pair_args *ap) { - struct vnode *dvp, *vp, **vpp; - struct inode *dp; + struct mount *mp; + struct vnode *dvp, *vp, *vp1, **vpp; + struct inode *dp, *ip; + ino_t ip_ino; + u_int64_t ip_gen; int error, vp_locked; dvp = ap->a_dvp; @@ -1940,12 +1943,17 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) return (0); } + mp = NULL; if (vp != NULL) { if (ap->a_unlock_vp) { vput(vp); } else { MPASS(vp->v_type != VNON); vp_locked = VOP_ISLOCKED(vp); + ip = VTOI(vp); + ip_ino = ip->i_number; + ip_gen = ip->i_gen; + mp = vp->v_mount; VOP_UNLOCK(vp); } } @@ -1957,6 +1965,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) if (vp == NULL || ap->a_unlock_vp) return (0); + MPASS(mp != NULL); /* * It is possible that vp is reclaimed at this point. Only @@ -1970,5 +1979,29 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) * and respond to dead vnodes by returning ESTALE. */ VOP_LOCK(vp, vp_locked | LK_RETRY); - return (0); + if (!VN_IS_DOOMED(vp)) + return (0); + + /* + * Try harder to recover from reclaimed vp if reclaim was not + * because underlying inode was cleared. We saved inode + * number and inode generation, so we can try to reinstantiate + * exactly same version of inode. If this fails, return + * original doomed vnode and let caller to handle + * consequences. + * + * Note that callers must keep write started around + * VOP_VPUT_PAIR() calls, so it is safe to use mp without + * busying it. + */ + VOP_UNLOCK(vp); + error = ffs_inotovp(mp, ip_ino, ip_gen, LK_EXCLUSIVE, &vp1, + FFSV_REPLACE_DOOMED); + if (error != 0) { + VOP_LOCK(vp, vp_locked | LK_RETRY); + } else { + vrele(vp); + *vpp = vp1; + } + return (error); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 BC6F3553D2D; Wed, 24 Feb 2021 07:58: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 4DlpG94PBYz4ZV2; Wed, 24 Feb 2021 07:58: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 F379428E14; Wed, 24 Feb 2021 07:58: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 11O7wrQ4046628; Wed, 24 Feb 2021 07:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wraZ046627; Wed, 24 Feb 2021 07:58:53 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:53 GMT Message-Id: <202102240758.11O7wraZ046627@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: e1e108f35102 - stable/13 - ufs_rename: use VOP_VPUT_PAIR and rely on directory sync/truncation there 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: e1e108f351026e9f06fdc18f0db2d657402b9fcf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:00 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e1e108f351026e9f06fdc18f0db2d657402b9fcf commit e1e108f351026e9f06fdc18f0db2d657402b9fcf Author: Konstantin Belousov AuthorDate: 2021-01-28 13:34:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:45:39 +0000 ufs_rename: use VOP_VPUT_PAIR and rely on directory sync/truncation there (cherry picked from commit 038fe6e089f03ca864c1dd5ac0c76404a13bbe79) --- sys/ufs/ufs/ufs_vnops.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 70b5a44ca21d..c101e699bad6 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1676,38 +1676,16 @@ unlockout: vput(fdvp); vput(fvp); - if (tvp) - vput(tvp); + /* - * If compaction or fsync was requested do it now that other locks - * are no longer needed. + * If compaction or fsync was requested do it in + * ffs_vput_pair() now that other locks are no longer needed. */ if (error == 0 && endoff != 0) { - do { - error = UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | - (DOINGASYNC(tdvp) ? 0 : IO_SYNC), tcnp->cn_cred); - } while (error == ERELOOKUP); - if (error != 0 && !ffs_fsfail_cleanup(VFSTOUFS(mp), error)) - vn_printf(tdvp, - "ufs_rename: failed to truncate, error %d\n", - error); -#ifdef UFS_DIRHASH - if (error != 0) - ufsdirhash_free(tdp); -#endif - /* - * Even if the directory compaction failed, rename was - * succesful. Do not propagate a UFS_TRUNCATE() error - * to the caller. - */ - error = 0; - } - if (error == 0 && tdp->i_flag & IN_NEEDSYNC) { - do { - error = VOP_FSYNC(tdvp, MNT_WAIT, td); - } while (error == ERELOOKUP); + UFS_INODE_SET_FLAG(tdp, IN_ENDOFF); + SET_I_ENDOFF(tdp, endoff); } - vput(tdvp); + VOP_VPUT_PAIR(tdvp, &tvp, true); return (error); bad: From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 0B1CE553D12; Wed, 24 Feb 2021 07:58: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 4DlpG048znz4ZWk; Wed, 24 Feb 2021 07:58: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 578C228E13; Wed, 24 Feb 2021 07:58: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 11O7wliV046504; Wed, 24 Feb 2021 07:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wlJT046503; Wed, 24 Feb 2021 07:58:47 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:47 GMT Message-Id: <202102240758.11O7wlJT046503@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: b7a3af0b9f01 - stable/13 - Use VOP_VPUT_PAIR() for eligible VFS syscalls. 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: b7a3af0b9f010afa9cc0e29d87827f349ab2db9a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:49 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b7a3af0b9f010afa9cc0e29d87827f349ab2db9a commit b7a3af0b9f010afa9cc0e29d87827f349ab2db9a Author: Konstantin Belousov AuthorDate: 2021-01-28 22:31:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:43:40 +0000 Use VOP_VPUT_PAIR() for eligible VFS syscalls. (cherry picked from commit 3b2aa36024abcb2d8fdbf3a6ecc7438b073b04e4) --- sys/kern/uipc_usrreq.c | 5 +++-- sys/kern/vfs_syscalls.c | 29 ++++++++++++----------------- sys/kern/vfs_vnops.c | 5 +++-- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0809f5180cc1..ca23ccbdb05e 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -669,8 +669,8 @@ restart: if (error == 0) error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); if (error) { + VOP_VPUT_PAIR(nd.ni_dvp, NULL, true); vn_finished_write(mp); if (error == ERELOOKUP) goto restart; @@ -686,7 +686,8 @@ restart: unp->unp_addr = soun; unp->unp_flags &= ~UNP_BINDING; UNP_PCB_UNLOCK(unp); - VOP_UNLOCK(vp); + vref(vp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, true); vn_finished_write(mp); free(buf, M_TEMP); return (0); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 35a56510e9ef..aba3d62936bb 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1370,13 +1370,12 @@ restart: else { error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); - if (error == 0) - vput(nd.ni_vp); } } - NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 && !whiteout ? &nd.ni_vp : NULL, + true); vn_finished_write(mp); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) goto restart; return (error); @@ -1457,12 +1456,10 @@ restart: goto out; #endif error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); - if (error == 0) - vput(nd.ni_vp); #ifdef MAC out: #endif - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) @@ -1629,10 +1626,10 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, return (EAGAIN); } error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); - VOP_UNLOCK(vp); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, true); vn_finished_write(mp); NDFREE(&nd, NDF_ONLY_PNBUF); + vp = NULL; } else { vput(nd.ni_dvp); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1640,7 +1637,8 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, return (EAGAIN); } } - vrele(vp); + if (vp != NULL) + vrele(vp); return (error); } @@ -1710,6 +1708,7 @@ restart: else vput(nd.ni_dvp); vrele(nd.ni_vp); + nd.ni_vp = NULL; error = EEXIST; goto out; } @@ -1730,14 +1729,12 @@ restart: goto out2; #endif error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, syspath); - if (error == 0) - vput(nd.ni_vp); #ifdef MAC out2: #endif - NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) goto restart; out: @@ -3794,9 +3791,7 @@ restart: out: #endif NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); - if (error == 0) - vput(nd.ni_vp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); if (error == ERELOOKUP) goto restart; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 3ec2662dfcd8..71dd379558cb 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -274,8 +274,9 @@ restart: if (error == 0) #endif error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, - &ndp->ni_cnd, vap); - vput(ndp->ni_dvp); + &ndp->ni_cnd, vap); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); vn_finished_write(mp); if (error) { NDFREE(ndp, NDF_ONLY_PNBUF); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 AD72D553C36; Wed, 24 Feb 2021 07:59: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 4DlpGB49jDz4ZZw; Wed, 24 Feb 2021 07:58: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 495E428E15; Wed, 24 Feb 2021 07:58: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 11O7wugH046672; Wed, 24 Feb 2021 07:58:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wuWx046671; Wed, 24 Feb 2021 07:58:56 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:56 GMT Message-Id: <202102240758.11O7wuWx046671@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: df1314860ab0 - stable/13 - ffs softdep: remove will_direnter argument of softdep_prelink() 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: df1314860ab0eb5dc983bc80b1e6d6dc94610916 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:03 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=df1314860ab0eb5dc983bc80b1e6d6dc94610916 commit df1314860ab0eb5dc983bc80b1e6d6dc94610916 Author: Konstantin Belousov AuthorDate: 2021-01-23 22:40:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:46:18 +0000 ffs softdep: remove will_direnter argument of softdep_prelink() (cherry picked from commit ede40b0675155b5cc862652f2fee11c738a46bcd) --- sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_softdep.c | 46 ++++++++-------------------------------------- sys/ufs/ufs/ufs_vnops.c | 12 ++++++------ 3 files changed, 15 insertions(+), 45 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 9694489266b6..544012089046 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -178,7 +178,7 @@ int softdep_request_cleanup(struct fs *, struct vnode *, struct ucred *, int); int softdep_prerename(struct vnode *, struct vnode *, struct vnode *, struct vnode *); -int softdep_prelink(struct vnode *, struct vnode *, int); +int softdep_prelink(struct vnode *, struct vnode *); void softdep_setup_freeblocks(struct inode *, off_t, int); void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int); void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t, diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index e90593b20e40..3cc76f9142c3 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -621,10 +621,9 @@ softdep_prerename(fdvp, fvp, tdvp, tvp) } int -softdep_prelink(dvp, vp, will_direnter) +softdep_prelink(dvp, vp) struct vnode *dvp; struct vnode *vp; - int will_direnter; { panic("softdep_prelink called"); @@ -3358,13 +3357,11 @@ softdep_prerename(fdvp, fvp, tdvp, tvp) * syscall must be restarted at top level from the lookup. */ int -softdep_prelink(dvp, vp, will_direnter) +softdep_prelink(dvp, vp) struct vnode *dvp; struct vnode *vp; - int will_direnter; { struct ufsmount *ump; - int error, error1; ASSERT_VOP_ELOCKED(dvp, "prelink dvp"); if (vp != NULL) @@ -3372,40 +3369,13 @@ softdep_prelink(dvp, vp, will_direnter) ump = VFSTOUFS(dvp->v_mount); /* - * Nothing to do if we have sufficient journal space. - * If we currently hold the snapshot lock, we must avoid - * handling other resources that could cause deadlock. - * - * will_direnter == 1: In case allocated a directory block in - * an indirect block, we must prevent holes in the directory - * created if directory entries are written out of order. To - * accomplish this we fsync when we extend a directory into - * indirects. During rename it's not safe to drop the tvp - * lock so sync must be delayed until it is. - * - * This synchronous step could be removed if fsck and the - * kernel were taught to fill in sparse directories rather - * than panic. + * Nothing to do if we have sufficient journal space. We skip + * flushing when vp is a snapshot to avoid deadlock where + * another thread is trying to update the inodeblock for dvp + * and is waiting on snaplk that vp holds. */ - if (journal_space(ump, 0) || (vp != NULL && IS_SNAPSHOT(VTOI(vp)))) { - error = 0; - if (will_direnter && (vp == NULL || !IS_SNAPSHOT(VTOI(vp)))) { - if (vp != NULL) - VOP_UNLOCK(vp); - error = ffs_syncvnode(dvp, MNT_WAIT, 0); - if (vp != NULL) { - error1 = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); - if (error1 != 0) { - vn_lock_pair(dvp, true, vp, false); - if (error == 0) - error = ERELOOKUP; - } else if (vp->v_data == NULL) { - error = ERELOOKUP; - } - } - } - return (error); - } + if (journal_space(ump, 0) || (vp != NULL && IS_SNAPSHOT(VTOI(vp)))) + return (0); stat_journal_low++; if (vp != NULL) { diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 22199a390dd4..b035a8b1c34d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1007,7 +1007,7 @@ ufs_remove(ap) (VTOI(dvp)->i_flags & APPEND)) return (EPERM); if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, vp, true); + error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1072,7 +1072,7 @@ ufs_link(ap) #endif if (DOINGSOFTDEP(tdvp)) { - error = softdep_prelink(tdvp, vp, true); + error = softdep_prelink(tdvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1144,7 +1144,7 @@ ufs_whiteout(ap) if (DOINGSOFTDEP(dvp) && (ap->a_flags == CREATE || ap->a_flags == DELETE)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1946,7 +1946,7 @@ ufs_mkdir(ap) } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -2210,7 +2210,7 @@ ufs_rmdir(ap) goto out; } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, vp, false); + error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -2737,7 +2737,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) return (EINVAL); } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 8CA31553E8F; Wed, 24 Feb 2021 07:59: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 4DlpGK33Q0z4ZXv; Wed, 24 Feb 2021 07:59: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 EE28928B5A; Wed, 24 Feb 2021 07:59: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 11O7x15e046774; Wed, 24 Feb 2021 07:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7x1EE046773; Wed, 24 Feb 2021 07:59:01 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:59:01 GMT Message-Id: <202102240759.11O7x1EE046773@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: ea8aa5f3edbb - stable/13 - ffs softdep: Force processing of VI_OWEINACT vnodes when there is inode shortage 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: ea8aa5f3edbba1048740c42d7d0734f3fd4cc7b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ea8aa5f3edbba1048740c42d7d0734f3fd4cc7b2 commit ea8aa5f3edbba1048740c42d7d0734f3fd4cc7b2 Author: Konstantin Belousov AuthorDate: 2021-01-31 18:39:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:48:00 +0000 ffs softdep: Force processing of VI_OWEINACT vnodes when there is inode shortage (cherry picked from commit 28703d27130c9cb7e7830ff53155c379a502c248) --- sys/ufs/ffs/ffs_softdep.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++ sys/ufs/ffs/softdep.h | 2 ++ 2 files changed, 63 insertions(+) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8c52139687f9..786fb43c7d81 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1311,6 +1311,7 @@ static int softdep_flushcache = 0; /* Should we do BIO_FLUSH? */ */ static int stat_flush_threads; /* number of softdep flushing threads */ static int stat_worklist_push; /* number of worklist cleanups */ +static int stat_delayed_inact; /* number of delayed inactivation cleanups */ static int stat_blk_limit_push; /* number of times block limit neared */ static int stat_ino_limit_push; /* number of times inode limit neared */ static int stat_blk_limit_hit; /* number of times block slowdown imposed */ @@ -1344,6 +1345,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, flush_threads, CTLFLAG_RD, &stat_flush_threads, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, CTLFLAG_RW | CTLFLAG_STATS, &stat_worklist_push, 0,""); +SYSCTL_INT(_debug_softdep, OID_AUTO, delayed_inactivations, CTLFLAG_RD, + &stat_delayed_inact, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, CTLFLAG_RW | CTLFLAG_STATS, &stat_blk_limit_push, 0,""); SYSCTL_INT(_debug_softdep, OID_AUTO, ino_limit_push, @@ -13707,6 +13710,37 @@ softdep_slowdown(vp) return (1); } +static int +softdep_request_cleanup_filter(struct vnode *vp, void *arg __unused) +{ + return ((vp->v_iflag & VI_OWEINACT) != 0 && vp->v_usecount == 0 && + ((vp->v_vflag & VV_NOSYNC) != 0 || VTOI(vp)->i_effnlink == 0)); +} + +static void +softdep_request_cleanup_inactivate(struct mount *mp) +{ + struct vnode *vp, *mvp; + int error; + + MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, softdep_request_cleanup_filter, + NULL) { + vholdl(vp); + vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY); + VI_LOCK(vp); + if (vp->v_data != NULL && vp->v_usecount == 0) { + while ((vp->v_iflag & VI_OWEINACT) != 0) { + error = vinactive(vp); + if (error != 0 && error != ERELOOKUP) + break; + } + atomic_add_int(&stat_delayed_inact, 1); + } + VOP_UNLOCK(vp); + vdropl(vp); + } +} + /* * Called by the allocation routines when they are about to fail * in the hope that we can free up the requested resource (inodes @@ -13819,6 +13853,33 @@ retry: stat_worklist_push += 1; FREE_LOCK(ump); } + + /* + * Check that there are vnodes pending inactivation. As they + * have been unlinked, inactivating them will free up their + * inodes. + */ + ACQUIRE_LOCK(ump); + if (resource == FLUSH_INODES_WAIT && + fs->fs_cstotal.cs_nifree <= needed && + fs->fs_pendinginodes <= needed) { + if ((ump->um_softdep->sd_flags & FLUSH_DI_ACTIVE) == 0) { + ump->um_softdep->sd_flags |= FLUSH_DI_ACTIVE; + FREE_LOCK(ump); + softdep_request_cleanup_inactivate(mp); + ACQUIRE_LOCK(ump); + ump->um_softdep->sd_flags &= ~FLUSH_DI_ACTIVE; + wakeup(&ump->um_softdep->sd_flags); + } else { + while ((ump->um_softdep->sd_flags & + FLUSH_DI_ACTIVE) != 0) { + msleep(&ump->um_softdep->sd_flags, + LOCK_PTR(ump), PVM, "ffsvina", hz); + } + } + } + FREE_LOCK(ump); + /* * If we still need resources and there are no more worklist * entries to process to obtain them, we have to start flushing diff --git a/sys/ufs/ffs/softdep.h b/sys/ufs/ffs/softdep.h index 868ada00f2dc..3493aadafc98 100644 --- a/sys/ufs/ffs/softdep.h +++ b/sys/ufs/ffs/softdep.h @@ -1086,6 +1086,8 @@ struct mount_softdeps { #define FLUSH_CLEANUP 0x0002 /* need to clear out softdep structures */ #define FLUSH_STARTING 0x0004 /* flush thread not yet started */ #define FLUSH_RC_ACTIVE 0x0008 /* a thread is flushing the mount point */ +#define FLUSH_DI_ACTIVE 0x0010 /* a thread is processing delayed + inactivations */ /* * Keep the old names from when these were in the ufsmount structure. From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 054B4553F04; Wed, 24 Feb 2021 07:59: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 4DlpGN4xjrz4Zkb; Wed, 24 Feb 2021 07:59: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 451FD28B5C; Wed, 24 Feb 2021 07:59: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 11O7x4WQ046816; Wed, 24 Feb 2021 07:59:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7x46M046815; Wed, 24 Feb 2021 07:59:04 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:59:04 GMT Message-Id: <202102240759.11O7x46M046815@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: c6e46d0c6b9a - stable/13 - fifo: minor comment and assert improvements. 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: c6e46d0c6b9a6a79333689c4bf735cb5456200a2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:12 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c6e46d0c6b9a6a79333689c4bf735cb5456200a2 commit c6e46d0c6b9a6a79333689c4bf735cb5456200a2 Author: Konstantin Belousov AuthorDate: 2021-02-01 10:43:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:48:37 +0000 fifo: minor comment and assert improvements. (cherry picked from commit adf28ab45670329459aed8afeec2dbe91c9b3713) --- sys/kern/vfs_syscalls.c | 3 ++- sys/ufs/ufs/ufs_vnops.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index aba3d62936bb..a51d693446e3 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1183,7 +1183,8 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, * vnode operations here. */ if (fp->f_ops == &badfileops) { - KASSERT(vp->v_type != VFIFO, ("Unexpected fifo.")); + KASSERT(vp->v_type != VFIFO, + ("Unexpected fifo fp %p vp %p", fp, vp)); finit_vnode(fp, flags, NULL, &vnops); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index e6a78c3655cc..301c583291d1 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -252,9 +252,10 @@ ufs_mknod(ap) DIP_SET(ip, i_rdev, vap->va_rdev); } /* - * Remove inode, then reload it through VFS_VGET so it is - * checked to see if it is an alias of an existing entry in - * the inode cache. XXX I don't believe this is necessary now. + * Remove inode, then reload it through VFS_VGET(). This is + * needed to do further inode initialization, for instance + * fifo, which was too early for VFS_VGET() done as part of + * UFS_VALLOC(). */ (*vpp)->v_type = VNON; ino = ip->i_number; /* Save this before vgone() invalidates ip. */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 43903553CCA; Wed, 24 Feb 2021 07:59: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 4DlpGG2QjBz4ZdB; Wed, 24 Feb 2021 07:59: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 A6A6E28C1F; Wed, 24 Feb 2021 07:58: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 11O7wxXd046734; Wed, 24 Feb 2021 07:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wxlF046733; Wed, 24 Feb 2021 07:58:59 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:59 GMT Message-Id: <202102240758.11O7wxlF046733@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: 6dde909bb597 - stable/13 - ufs_inactive(): stop hiding ERELOOKUP from ffs_truncate(), return it. 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: 6dde909bb5976988483dacf6c56465c62f795e8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6dde909bb5976988483dacf6c56465c62f795e8a commit 6dde909bb5976988483dacf6c56465c62f795e8a Author: Konstantin Belousov AuthorDate: 2021-01-30 19:18:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:47:18 +0000 ufs_inactive(): stop hiding ERELOOKUP from ffs_truncate(), return it. (cherry picked from commit 013168db8cea926c3dde1247d400d6bedf9a889d) --- sys/ufs/ffs/ffs_softdep.c | 9 +++++---- sys/ufs/ufs/ufs_inode.c | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 3cc76f9142c3..8c3ae9dd95fc 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1493,13 +1493,14 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_t inum, struct buf *bp, } /* - * Do not drop vnode lock while inactivating. This - * would result in leaks of the VI flags and - * reclaiming of non-truncated vnode. Instead, + * Do not drop vnode lock while inactivating during + * vunref. This would result in leaks of the VI flags + * and reclaiming of non-truncated vnode. Instead, * re-schedule inactivation hoping that we would be * able to sync inode later. */ - if ((vp->v_iflag & VI_DOINGINACT) != 0) { + if ((vp->v_iflag & VI_DOINGINACT) != 0 && + (vp->v_vflag & VV_UNREF) != 0) { VI_LOCK(vp); vp->v_iflag |= VI_OWEINACT; VI_UNLOCK(vp); diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index 15bd8be448a9..46e4f8e54e41 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -212,8 +212,6 @@ out: vrecycle(vp); if (mp != NULL) vn_finished_secondary_write(mp); - if (error == ERELOOKUP) - error = 0; return (error); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 8DB86553D43; Wed, 24 Feb 2021 07:59: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 4DlpGL41Hqz4ZdQ; Wed, 24 Feb 2021 07:59: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 10BFB28B5B; Wed, 24 Feb 2021 07:59: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 11O7x2Fe046796; Wed, 24 Feb 2021 07:59:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7x2G5046795; Wed, 24 Feb 2021 07:59:02 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:59:02 GMT Message-Id: <202102240759.11O7x2G5046795@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: 3f0157cb6578 - stable/13 - ffs_unlock: assert that IN_ENDOFF is not leaked past locked scope 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: 3f0157cb65788ea71e0be15ed0815faaade61054 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0157cb65788ea71e0be15ed0815faaade61054 commit 3f0157cb65788ea71e0be15ed0815faaade61054 Author: Konstantin Belousov AuthorDate: 2021-01-31 19:01:17 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:48:20 +0000 ffs_unlock: assert that IN_ENDOFF is not leaked past locked scope (cherry picked from commit 26af9f72f7cb162abeced8b7e444800b601e5017) --- sys/ufs/ffs/ffs_vnops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 38511647c502..1dfdf5182a42 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -591,6 +591,9 @@ ffs_unlock_debug(struct vop_unlock_args *ap) VI_UNLOCK(vp); } } + KASSERT(vp->v_type != VDIR || vp->v_vnlock->lk_recurse != 0 || + (ip->i_flag & IN_ENDOFF) == 0, + ("ufs dir vp %p ip %p flags %#x", vp, ip, ip->i_flag)); #ifdef DIAGNOSTIC if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE && ip != NULL && vp->v_vnlock->lk_recurse == 0) From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 56ECC553D4C; Wed, 24 Feb 2021 07:59: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 4DlpGN4ytYz4ZYG; Wed, 24 Feb 2021 07:59: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 5C94328D8F; Wed, 24 Feb 2021 07:59: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 11O7x5Go046836; Wed, 24 Feb 2021 07:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7x5e5046835; Wed, 24 Feb 2021 07:59:05 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:59:05 GMT Message-Id: <202102240759.11O7x5e5046835@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: 2947fc2ccf91 - stable/13 - lockf: ensure atomicity of lockf for open(O_CREAT|O_EXCL|O_EXLOCK) 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: 2947fc2ccf918661b0896526a0c0513c59d8d652 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:12 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2947fc2ccf918661b0896526a0c0513c59d8d652 commit 2947fc2ccf918661b0896526a0c0513c59d8d652 Author: Konstantin Belousov AuthorDate: 2021-01-29 23:48:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:50:27 +0000 lockf: ensure atomicity of lockf for open(O_CREAT|O_EXCL|O_EXLOCK) (cherry picked from commit fa3bd463cee5c3abeac29a83dc86eb3abfa97b06) (cherry picked from commit 662283b1088d6488671b90ab18a66a997c526448) --- sys/kern/vfs_default.c | 15 +++++++++++++++ sys/kern/vfs_subr.c | 4 +++- sys/kern/vfs_vnops.c | 23 ++++++++++++++++++++--- sys/sys/fcntl.h | 1 + sys/sys/vnode.h | 2 ++ 5 files changed, 41 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 382fbb2d9ace..3c428d7b7511 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -423,10 +423,25 @@ int vop_stdadvlock(struct vop_advlock_args *ap) { struct vnode *vp; + struct mount *mp; struct vattr vattr; int error; vp = ap->a_vp; + + /* + * Provide atomicity of open(O_CREAT | O_EXCL | O_EXLOCK) for + * local filesystems. See vn_open_cred() for reciprocal part. + */ + mp = vp->v_mount; + if (mp != NULL && (mp->mnt_flag & MNT_LOCAL) != 0 && + ap->a_op == F_SETLK && (ap->a_flags & F_FIRSTOPEN) == 0) { + VI_LOCK(vp); + while ((vp->v_iflag & VI_FOPENING) != 0) + msleep(vp, VI_MTX(vp), PLOCK, "lockfo", 0); + VI_UNLOCK(vp); + } + if (ap->a_fl->l_whence == SEEK_END) { /* * The NFSv4 server must avoid doing a vn_lock() here, since it diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 04cd0e0175f9..3e39d19666e5 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4116,8 +4116,10 @@ vn_printf(struct vnode *vp, const char *fmt, ...) strlcat(buf, "|VI_OWEINACT", sizeof(buf)); if (vp->v_iflag & VI_DEFINACT) strlcat(buf, "|VI_DEFINACT", sizeof(buf)); + if (vp->v_iflag & VI_FOPENING) + strlcat(buf, "|VI_FOPENING", sizeof(buf)); flags = vp->v_iflag & ~(VI_TEXT_REF | VI_MOUNT | VI_DOINGINACT | - VI_OWEINACT | VI_DEFINACT); + VI_OWEINACT | VI_DEFINACT | VI_FOPENING); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 71dd379558cb..781968f2db53 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -228,8 +228,10 @@ vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, struct vattr vat; struct vattr *vap = &vat; int fmode, error; + bool first_open; restart: + first_open = false; fmode = *flagp; if ((fmode & (O_CREAT | O_EXCL | O_DIRECTORY)) == (O_CREAT | O_EXCL | O_DIRECTORY)) @@ -275,8 +277,16 @@ restart: #endif error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, vap); - VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : - NULL, false); + vp = ndp->ni_vp; + if (error == 0 && (fmode & O_EXCL) != 0 && + (fmode & (O_EXLOCK | O_SHLOCK)) != 0) { + VI_LOCK(vp); + vp->v_iflag |= VI_FOPENING; + VI_UNLOCK(vp); + first_open = true; + } + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &vp : NULL, + false); vn_finished_write(mp); if (error) { NDFREE(ndp, NDF_ONLY_PNBUF); @@ -287,7 +297,6 @@ restart: return (error); } fmode &= ~O_TRUNC; - vp = ndp->ni_vp; } else { if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); @@ -317,6 +326,12 @@ restart: vp = ndp->ni_vp; } error = vn_open_vnode(vp, fmode, cred, td, fp); + if (first_open) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_FOPENING; + wakeup(vp); + VI_UNLOCK(vp); + } if (error) goto bad; *flagp = fmode; @@ -352,6 +367,8 @@ vn_open_vnode_advlock(struct vnode *vp, int fmode, struct file *fp) type = F_FLOCK; if ((fmode & FNONBLOCK) == 0) type |= F_WAIT; + if ((fmode & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) + type |= F_FIRSTOPEN; error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type); if (error == 0) fp->f_flag |= FHASLOCK; diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 3c29c04e46db..70e68246be13 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -287,6 +287,7 @@ typedef __pid_t pid_t; #define F_POSIX 0x040 /* Use POSIX semantics for lock */ #define F_REMOTE 0x080 /* Lock owner is remote NFS client */ #define F_NOINTR 0x100 /* Ignore signals when waiting */ +#define F_FIRSTOPEN 0x200 /* First right to advlock file */ #endif /* diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 639a16881e09..9d68f9e236f6 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -254,6 +254,8 @@ struct xvnode { #define VI_DOINGINACT 0x0004 /* VOP_INACTIVE is in progress */ #define VI_OWEINACT 0x0008 /* Need to call inactive */ #define VI_DEFINACT 0x0010 /* deferred inactive */ +#define VI_FOPENING 0x0020 /* In open, with opening process having the + first right to advlock file */ #define VV_ROOT 0x0001 /* root of its filesystem */ #define VV_ISTTY 0x0002 /* vnode represents a tty */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 8828F553B43; Wed, 24 Feb 2021 07:58: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 4DlpG40zZ3z4Zcq; Wed, 24 Feb 2021 07:58: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 9F4D928BB6; Wed, 24 Feb 2021 07:58: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 11O7wnQB046544; Wed, 24 Feb 2021 07:58:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wnjB046543; Wed, 24 Feb 2021 07:58:49 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:49 GMT Message-Id: <202102240758.11O7wnjB046543@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: d96c8375a637 - stable/13 - nfsserver: use VOP_VPUT_PAIR(). 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: d96c8375a6373a57a3c2a92b60a9f0dd1215d6c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:53 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d96c8375a6373a57a3c2a92b60a9f0dd1215d6c1 commit d96c8375a6373a57a3c2a92b60a9f0dd1215d6c1 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:02:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:44:24 +0000 nfsserver: use VOP_VPUT_PAIR(). (cherry picked from commit 4a21bcb24174438e0944d6e4d6633290a067b7a8) --- sys/fs/nfsserver/nfs_nfsdport.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index b781503a6815..4d19c73dfa06 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1105,7 +1105,8 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred, p); } - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); nfsvno_relpathbuf(ndp); if (!error) { if (*exclusive_flagp) { @@ -1140,7 +1141,8 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, nvap->na_rdev = rdev; error = VOP_MKNOD(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); nfsvno_relpathbuf(ndp); vrele(ndp->ni_startdir); if (error) @@ -1221,7 +1223,8 @@ nfsvno_mknod(struct nameidata *ndp, struct nfsvattr *nvap, struct ucred *cred, vrele(ndp->ni_startdir); error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, + false); nfsvno_relpathbuf(ndp); } else { if (nvap->na_type != VFIFO && @@ -1233,7 +1236,8 @@ nfsvno_mknod(struct nameidata *ndp, struct nfsvattr *nvap, struct ucred *cred, } error = VOP_MKNOD(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, + false); nfsvno_relpathbuf(ndp); vrele(ndp->ni_startdir); /* @@ -1268,7 +1272,7 @@ nfsvno_mkdir(struct nameidata *ndp, struct nfsvattr *nvap, uid_t saved_uid, } error = VOP_MKDIR(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, false); nfsvno_relpathbuf(ndp); out: @@ -1300,17 +1304,15 @@ nfsvno_symlink(struct nameidata *ndp, struct nfsvattr *nvap, char *pathcp, error = VOP_SYMLINK(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr, pathcp); - vput(ndp->ni_dvp); - vrele(ndp->ni_startdir); - nfsvno_relpathbuf(ndp); /* * Although FreeBSD still had the lookup code in * it for 7/current, there doesn't seem to be any * point, since VOP_SYMLINK() returns the ni_vp. * Just vput it for v2. */ - if (!not_v2 && !error) - vput(ndp->ni_vp); + VOP_VPUT_PAIR(ndp->ni_dvp, &ndp->ni_vp, !not_v2 && error == 0); + vrele(ndp->ni_startdir); + nfsvno_relpathbuf(ndp); out: NFSEXITCODE(error); @@ -1595,11 +1597,13 @@ nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); else error = EPERM; - if (ndp->ni_dvp == vp) + if (ndp->ni_dvp == vp) { vrele(ndp->ni_dvp); - else - vput(ndp->ni_dvp); - NFSVOPUNLOCK(vp); + NFSVOPUNLOCK(vp); + } else { + vref(vp); + VOP_VPUT_PAIR(ndp->ni_dvp, &vp, true); + } } else { if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); @@ -1793,7 +1797,8 @@ nfsvno_open(struct nfsrv_descript *nd, struct nameidata *ndp, nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, cred, p); } - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, nd->nd_repstat == 0 ? + &ndp->ni_vp : NULL, false); nfsvno_relpathbuf(ndp); if (!nd->nd_repstat) { if (*exclusive_flagp) { @@ -4106,7 +4111,8 @@ nfsrv_dscreate(struct vnode *dvp, struct vattr *vap, struct vattr *nvap, error = NFSVOPLOCK(dvp, LK_EXCLUSIVE); if (error == 0) { error = VOP_CREATE(dvp, &nvp, &named.ni_cnd, vap); - NFSVOPUNLOCK(dvp); + vref(dvp); + VOP_VPUT_PAIR(dvp, error == 0 ? &nvp : NULL, false); if (error == 0) { /* Set the ownership of the file. */ error = VOP_SETATTR(nvp, nvap, tcred); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 7ADEF553A7C; Wed, 24 Feb 2021 07:58: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 4DlpG62LZDz4ZS2; Wed, 24 Feb 2021 07:58: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 EFA3A28C1E; Wed, 24 Feb 2021 07:58: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 11O7wqcD046608; Wed, 24 Feb 2021 07:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wqLq046607; Wed, 24 Feb 2021 07:58:52 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:52 GMT Message-Id: <202102240758.11O7wqLq046607@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: c918922cb9a7 - stable/13 - ufs_direnter: move directory truncation to ffs_vput_pair(). 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: c918922cb9a74f4f5f39420527642f207ba1ce50 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:57 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c918922cb9a74f4f5f39420527642f207ba1ce50 commit c918922cb9a74f4f5f39420527642f207ba1ce50 Author: Konstantin Belousov AuthorDate: 2021-01-27 20:34:14 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:45:21 +0000 ufs_direnter: move directory truncation to ffs_vput_pair(). (cherry picked from commit 74a3652f832f4ed0f1ad9f7eb60d70013b478e1a) --- sys/ufs/ffs/ffs_vnops.c | 44 ++++++++++++++++++++++++++++++++++++++------ sys/ufs/ufs/inode.h | 2 ++ sys/ufs/ufs/ufs_lookup.c | 25 ++++++------------------- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 2ac67adad5f2..dd0f1ba6b81d 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "opt_directio.h" #include "opt_ffs.h" +#include "opt_ufs.h" #include #include @@ -99,6 +100,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef UFS_DIRHASH +#include +#endif #include #include @@ -1929,6 +1934,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) struct inode *dp, *ip; ino_t ip_ino; u_int64_t ip_gen; + off_t old_size; int error, vp_locked; dvp = ap->a_dvp; @@ -1936,14 +1942,14 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) vpp = ap->a_vpp; vp = vpp != NULL ? *vpp : NULL; - if ((dp->i_flag & IN_NEEDSYNC) == 0) { + if ((dp->i_flag & (IN_NEEDSYNC | IN_ENDOFF)) == 0) { vput(dvp); if (vp != NULL && ap->a_unlock_vp) vput(vp); return (0); } - mp = NULL; + mp = dvp->v_mount; if (vp != NULL) { if (ap->a_unlock_vp) { vput(vp); @@ -1953,14 +1959,40 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) ip = VTOI(vp); ip_ino = ip->i_number; ip_gen = ip->i_gen; - mp = vp->v_mount; VOP_UNLOCK(vp); } } - do { - error = ffs_syncvnode(dvp, MNT_WAIT, 0); - } while (error == ERELOOKUP); + /* + * If compaction or fsync was requested do it in ffs_vput_pair() + * now that other locks are no longer held. + */ + if ((dp->i_flag & IN_ENDOFF) != 0) { + dp->i_flag &= ~IN_ENDOFF; + if (I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { + old_size = dp->i_size; + error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), + IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), + curthread->td_ucred); + if (error != 0 && error != ERELOOKUP) { + if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { + vn_printf(dvp, + "IN_ENDOFF: failed to truncate, " + "error %d\n", error); + } +#ifdef UFS_DIRHASH + ufsdirhash_free(dp); +#endif + } + } + SET_I_ENDOFF(dp, 0); + } + if ((dp->i_flag & IN_NEEDSYNC) != 0) { + do { + error = ffs_syncvnode(dvp, MNT_WAIT, 0); + } while (error == ERELOOKUP); + } + vput(dvp); if (vp == NULL || ap->a_unlock_vp) diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 16db8d6d5cea..4515dcbed401 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -152,6 +152,8 @@ struct inode { #define IN_IBLKDATA 0x0800 /* datasync requires inode block update */ #define IN_SIZEMOD 0x1000 /* Inode size has been modified */ +#define IN_ENDOFF 0x2000 /* Free space at the end of directory, + try to truncate when possible */ #define PRINT_INODE_FLAGS "\20\20b16\17b15\16b14\15sizemod" \ "\14iblkdata\13is_ufs2\12truncated\11ea_lockwait\10ea_locked" \ diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index e614f189a623..3036bce81caf 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1112,27 +1112,14 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) } } UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE); + /* - * If all went well, and the directory can be shortened, proceed - * with the truncation. Note that we have to unlock the inode for - * the entry that we just entered, as the truncation may need to - * lock other inodes which can lead to deadlock if we also hold a - * lock on the newly entered node. + * If all went well, and the directory can be shortened, mark directory inode + * with the truncation request right before unlock. */ - if (isrename == 0 && error == 0 && - I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { - if (tvp != NULL) - VOP_UNLOCK(tvp); - error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), - IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); - if (error != 0) - vn_printf(dvp, - "ufs_direnter: failed to truncate, error %d\n", - error); - error = 0; - if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); - } + if (isrename == 0 && error == 0) + UFS_INODE_SET_FLAG(dp, IN_ENDOFF); + return (error); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:58: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 67006553C31; Wed, 24 Feb 2021 07:58: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 4DlpG60qvlz4ZgM; Wed, 24 Feb 2021 07:58: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 9BCF1288C2; Wed, 24 Feb 2021 07:58: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 11O7wolc046566; Wed, 24 Feb 2021 07:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11O7wolM046565; Wed, 24 Feb 2021 07:58:50 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:58:50 GMT Message-Id: <202102240758.11O7wolM046565@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: 1de6eb52fdbf - stable/13 - FFS: implement special VOP_VPUT_PAIR(). 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: 1de6eb52fdbfca2df545cf4860b8f18c1f140f70 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:58:58 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1de6eb52fdbfca2df545cf4860b8f18c1f140f70 commit 1de6eb52fdbfca2df545cf4860b8f18c1f140f70 Author: Konstantin Belousov AuthorDate: 2021-01-27 18:09:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:44:41 +0000 FFS: implement special VOP_VPUT_PAIR(). (cherry picked from commit f2c9d038bdee547be07c8b0404547617b71f2232) --- sys/ufs/ffs/ffs_vnops.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index be2653e32adc..623b13790ce0 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -130,6 +130,7 @@ static vop_listextattr_t ffs_listextattr; static vop_openextattr_t ffs_openextattr; static vop_setextattr_t ffs_setextattr; static vop_vptofh_t ffs_vptofh; +static vop_vput_pair_t ffs_vput_pair; /* Global vfs data structures for ufs. */ struct vop_vector ffs_vnodeops1 = { @@ -146,6 +147,7 @@ struct vop_vector ffs_vnodeops1 = { .vop_reallocblks = ffs_reallocblks, .vop_write = ffs_write, .vop_vptofh = ffs_vptofh, + .vop_vput_pair = ffs_vput_pair, }; VFS_VOP_VECTOR_REGISTER(ffs_vnodeops1); @@ -182,6 +184,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_openextattr = ffs_openextattr, .vop_setextattr = ffs_setextattr, .vop_vptofh = ffs_vptofh, + .vop_vput_pair = ffs_vput_pair, }; VFS_VOP_VECTOR_REGISTER(ffs_vnodeops2); @@ -1917,3 +1920,55 @@ ffs_getpages_async(struct vop_getpages_async_args *ap) return (error); } + +static int +ffs_vput_pair(struct vop_vput_pair_args *ap) +{ + struct vnode *dvp, *vp, **vpp; + struct inode *dp; + int error, vp_locked; + + dvp = ap->a_dvp; + dp = VTOI(dvp); + vpp = ap->a_vpp; + vp = vpp != NULL ? *vpp : NULL; + + if ((dp->i_flag & IN_NEEDSYNC) == 0) { + vput(dvp); + if (vp != NULL && ap->a_unlock_vp) + vput(vp); + return (0); + } + + if (vp != NULL) { + if (ap->a_unlock_vp) { + vput(vp); + } else { + MPASS(vp->v_type != VNON); + vp_locked = VOP_ISLOCKED(vp); + VOP_UNLOCK(vp); + } + } + + do { + error = ffs_syncvnode(dvp, MNT_WAIT, 0); + } while (error == ERELOOKUP); + vput(dvp); + + if (vp == NULL || ap->a_unlock_vp) + return (0); + + /* + * It is possible that vp is reclaimed at this point. Only + * routines that call us with a_unlock_vp == false can find + * that their vp has been reclaimed. There are three areas + * that are affected: + * 1) vn_open_cred() - later VOPs could fail, but + * dead_open() returns 0 to simulate successful open. + * 2) ffs_snapshot() - creation of snapshot fails with EBADF. + * 3) NFS server (several places) - code is prepared to detect + * and respond to dead vnodes by returning ESTALE. + */ + VOP_LOCK(vp, vp_locked | LK_RETRY); + return (0); +} From owner-dev-commits-src-all@freebsd.org Wed Feb 24 07:59: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 91D2D553C5D; Wed, 24 Feb 2021 07:59: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 4DlpGJ6zVzz4ZnD; Wed, 24 Feb 2021 07:59: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 CCDC028B59; Wed, 24 Feb 2021 07: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 11O7x0RT046754; Wed, 24 Feb 2021 07: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 11O7x0b5046753; Wed, 24 Feb 2021 07:59:00 GMT (envelope-from git) Date: Wed, 24 Feb 2021 07:59:00 GMT Message-Id: <202102240759.11O7x0b5046753@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: b1ed1a515137 - stable/13 - softdep_request_cleanup: wait for softdep_request_clean_flush() to pass 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: b1ed1a515137fb9cff3037a64c8e4edf7ff9b03f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 07:59:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b1ed1a515137fb9cff3037a64c8e4edf7ff9b03f commit b1ed1a515137fb9cff3037a64c8e4edf7ff9b03f Author: Konstantin Belousov AuthorDate: 2021-02-03 23:58:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 07:47:41 +0000 softdep_request_cleanup: wait for softdep_request_clean_flush() to pass (cherry picked from commit 2011b44fa3f2b2bd5a24be01094420cce9144b2d) --- sys/ufs/ffs/ffs_softdep.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8c3ae9dd95fc..8c52139687f9 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -13847,6 +13847,7 @@ retry: failed_vnode = softdep_request_cleanup_flush(mp, ump); ACQUIRE_LOCK(ump); ump->um_softdep->sd_flags &= ~FLUSH_RC_ACTIVE; + wakeup(&ump->um_softdep->sd_flags); FREE_LOCK(ump); if (ump->softdep_on_worklist > 0) { stat_cleanup_retries += 1; @@ -13854,6 +13855,11 @@ retry: goto retry; } } else { + while ((ump->um_softdep->sd_flags & + FLUSH_RC_ACTIVE) != 0) { + msleep(&ump->um_softdep->sd_flags, + LOCK_PTR(ump), PVM, "ffsrca", hz); + } FREE_LOCK(ump); error = 0; } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 09:20: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 E5958556821; Wed, 24 Feb 2021 09:20:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dlr4d5Wjkz4jLr; Wed, 24 Feb 2021 09:20:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (unknown [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 6A21A85EB; Wed, 24 Feb 2021 09:20:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id CC3C53314C; Wed, 24 Feb 2021 10:20:47 +0100 (CET) Date: Wed, 24 Feb 2021 10:20:47 +0100 From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot Message-ID: <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <202102240105.11O15bKn096987@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7stizekjxx47ph24" Content-Disposition: inline In-Reply-To: <202102240105.11O15bKn096987@slippy.cwsent.com> X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 09:20:50 -0000 --7stizekjxx47ph24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 23, 2021 at 05:05:37PM -0800, Cy Schubert wrote: > In message <202102231027.11NARYYE041280@gitrepo.freebsd.org>, Baptiste=20 > Daroussi > n writes: > > The branch main has been updated by bapt: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D77e1ccbee3ed6c837929e4e2= 32fd07f9 > > 5bfc8294 > > > > commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 > > Author: Rick Parrish > > AuthorDate: 2021-02-07 06:15:21 +0000 > > Commit: Baptiste Daroussin > > CommitDate: 2021-02-23 10:16:53 +0000 > > > > rc: implement parallel boot > > =20 > > take advantage of the rcorder -p argument to implement parallel > > booting in rc. > > =20 > > According to the author non scientific tests: > > on a Core 2 Duo with spinning disk: > > =20 > > | Services enabled | before | after | saving | > > | 0 | 8s | 8s | 0 | > > | 1 | 13s | 13s | 0 | > > | 2 | 17s | 13s | 5 | > > | 3 | 23s | 13s | 10 | > > | 4 | 28s | 13s | 15 | > > | 5 | 33s | 13s | 20 | > > =20 > > PR: 249192 > > MFC after: 3 weeks > > --- > > libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > > 1 file changed, 34 insertions(+), 15 deletions(-) > > > > diff --git a/libexec/rc/rc b/libexec/rc/rc > > index 35db4a850516..722d7fe35884 100644 > > --- a/libexec/rc/rc > > +++ b/libexec/rc/rc > > @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > > skip_firstboot=3D"-s firstboot" > > fi > > =20 > > +# rc_parallel_start default is "NO" > > +rc_parallel_start=3D${rc_parallel_start:-NO} > > +_rc_parallel=3D'' > > +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" > > +checkyesno rc_parallel_start && _rc_parallel=3D'-p' > > + > > # Do a first pass to get everything up to $early_late_divider so that > > # we can do a second pass that includes $local_startup directories > > # > > -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` > > +files=3D`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/*= 2>/dev/ > > null` > > =20 > > _rc_elem_done=3D' ' > > -for _rc_elem in ${files}; do > > - run_rc_script ${_rc_elem} ${_boot} > > - _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > > - > > - case "$_rc_elem" in > > - */${early_late_divider}) break ;; > > - esac > > +IFS=3D$'\n' > > +for _rc_group in ${files}; do > > + IFS=3D$' ' > > + for _rc_elem in ${_rc_group}; do > > + run_rc_script ${_rc_elem} ${_boot} & > > + _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > > + > > + case "$_rc_elem" in > > + */${early_late_divider}) break ;; > > + esac > > + done > > + wait > > + IFS=3D$'\n' > > done > > =20 > > unset files local_rc > > @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then > > skip_firstboot=3D"" > > fi > > =20 > > -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/= dev/null > > ` > > -for _rc_elem in ${files}; do > > - case "$_rc_elem_done" in > > - *" $_rc_elem "*) continue ;; > > - esac > > - > > - run_rc_script ${_rc_elem} ${_boot} > > +files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_= rc_paral > > lel} 2>/dev/null` > > +IFS=3D$'\n' > > +for _rc_group in ${files}; do > > + IFS=3D$' ' > > + for _rc_elem in ${_rc_group}; do > > + case "$_rc_elem_done" in > > + *" $_rc_elem "*) continue ;; > > + esac > > + > > + run_rc_script ${_rc_elem} ${_boot} & > > + done > > + wait > > + IFS=3D$'\n' > > done > > +unset IFS > > =20 > > # Remove the firstboot sentinel, and reboot if it was requested. > > # Be a bit paranoid about removing it to handle the common failure > > >=20 > Since this commit my postfix, dovecot and nut fail to start at boot, and= =20 > must be started by hand. >=20 >=20 I cannot reproduce, what failure do you have?=20 Best regards, Bapt --7stizekjxx47ph24 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAmA2Gm0ACgkQY4mL3PG3 PlrMXA//QhyZ/eSQO/bykVc21yMPOaArRUOC10a7zApG/cVNu8PXzAMG7eFGgP11 Vv915uEtquHuALMBfzqmE6Ujf/XIi/xr7odJvFFYo9zmzKP74wBir4uGg6JfDlYV OQzwoxJGV/qUuA1d3pqDUUlCsFWN2M//9Six78sy09Dn098GsTb8DadE0L9HA+HW wh321Wa8aqLgHVZcwQgNsPtRqUaJY3TIOTAigI609tbN+VehzFoxRg9g7yIFIKoD 1ANRkHEGWsGMF2mtVQwutIsuF0Vm+ScQY3An7xuF7rw42YsxZo3jljhrx1znttg5 VziKWO5viDJo460qv9ex6loVqcW/JBfO8rUpQQHu1mY7/dK0uASczMTHKORnkUz3 03ZCA8beO3Bh1VY/Lv5DQaQia5OTM2I00636EayncHmnvocdXzHW7FZw/00xM02K WguZ+xyN9KJ2GLLKirkyuSmIuemh1+HU3EjWZF3GZV7MJwf/zIaUrR2+jFnjTLiI EXOxzVf7KE/k6eVIrLBtXFg1J95l3i7Brk7f6Rh3arQRLTran8LAlIlkqljP/nLp JWs2Bcp7cY9OoQH2EDN5kPkXylZr9ZkHrzBuxt3661NAFpl5zCtzo+PsV5zaMYKj XA1moNFLy5F0hogmyDtVSQJXpxg2LzjN7iesTAP3ibgMnntYVlo= =Zxua -----END PGP SIGNATURE----- --7stizekjxx47ph24-- From owner-dev-commits-src-all@freebsd.org Wed Feb 24 13:01: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 8C82E55C44D; Wed, 24 Feb 2021 13:01: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 4DlwzF3ZRDz3Dw0; Wed, 24 Feb 2021 13:01: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 6DC502C96C; Wed, 24 Feb 2021 13:01: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 11OD1TLX054478; Wed, 24 Feb 2021 13:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OD1TeX054477; Wed, 24 Feb 2021 13:01:29 GMT (envelope-from git) Date: Wed, 24 Feb 2021 13:01:29 GMT Message-Id: <202102241301.11OD1TeX054477@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: ef160e5cb919 - stable/13 - pf: Remove unused return value from (de)hook_pf() 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: ef160e5cb919659951b3d4f70a966e58d5dce56f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 13:01:29 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ef160e5cb919659951b3d4f70a966e58d5dce56f commit ef160e5cb919659951b3d4f70a966e58d5dce56f Author: Kristof Provost AuthorDate: 2021-02-16 11:40:51 +0000 Commit: Kristof Provost CommitDate: 2021-02-24 08:03:43 +0000 pf: Remove unused return value from (de)hook_pf() These functions always return 0, which is good, because the code calling them doesn't handle this error gracefully. As the functions always succeed remove their return value, and the code handling their errors (because it was never executed anyway). MFC after: 1 week Sponsored by: Rubicon Communications, LLC (“Netgate”’) (cherry picked from commit 8a439f324e9010a122fa4c00426bde70dc373c2f) --- sys/netpfil/pf/pf_ioctl.c | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index bd8896cfb772..97be46509acc 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -213,8 +213,8 @@ static pfil_return_t pf_check6_out(struct mbuf **m, struct ifnet *ifp, int flags, void *ruleset __unused, struct inpcb *inp); #endif -static int hook_pf(void); -static int dehook_pf(void); +static void hook_pf(void); +static void dehook_pf(void); static int shutdown_pf(void); static int pf_load(void); static void pf_unload(void); @@ -1814,12 +1814,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td else { int cpu; - error = hook_pf(); - if (error) { - DPFPRINTF(PF_DEBUG_MISC, - ("pf: pfil registration failed\n")); - break; - } + hook_pf(); V_pf_status.running = 1; V_pf_status.since = time_second; @@ -1836,12 +1831,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td error = ENOENT; else { V_pf_status.running = 0; - error = dehook_pf(); - if (error) { - V_pf_status.running = 1; - DPFPRINTF(PF_DEBUG_MISC, - ("pf: pfil unregistration failed\n")); - } + dehook_pf(); V_pf_status.since = time_second; DPFPRINTF(PF_DEBUG_MISC, ("pf: stopped\n")); } @@ -4565,14 +4555,14 @@ VNET_DEFINE_STATIC(pfil_hook_t, pf_ip6_out_hook); #define V_pf_ip6_out_hook VNET(pf_ip6_out_hook) #endif -static int +static void hook_pf(void) { struct pfil_hook_args pha; struct pfil_link_args pla; if (V_pf_pfil_hooked) - return (0); + return; pha.pa_version = PFIL_VERSION; pha.pa_modname = "pf"; @@ -4620,15 +4610,14 @@ hook_pf(void) #endif V_pf_pfil_hooked = 1; - return (0); } -static int +static void dehook_pf(void) { if (V_pf_pfil_hooked == 0) - return (0); + return; #ifdef INET pfil_remove_hook(V_pf_ip4_in_hook); @@ -4640,7 +4629,6 @@ dehook_pf(void) #endif V_pf_pfil_hooked = 0; - return (0); } static void @@ -4688,20 +4676,10 @@ pf_load(void) static void pf_unload_vnet(void) { - int error; V_pf_vnet_active = 0; V_pf_status.running = 0; - error = dehook_pf(); - if (error) { - /* - * Should not happen! - * XXX Due to error code ESRCH, kldunload will show - * a message like 'No such process'. - */ - printf("%s : pfil unregisteration fail\n", __FUNCTION__); - return; - } + dehook_pf(); PF_RULES_WLOCK(); shutdown_pf(); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 13:01: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 D643B55C44F; Wed, 24 Feb 2021 13:01: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 4DlwzH5cB3z3DQX; Wed, 24 Feb 2021 13:01: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 ABFA42CB5A; Wed, 24 Feb 2021 13:01: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 11OD1VxV054519; Wed, 24 Feb 2021 13:01:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OD1Vci054518; Wed, 24 Feb 2021 13:01:31 GMT (envelope-from git) Date: Wed, 24 Feb 2021 13:01:31 GMT Message-Id: <202102241301.11OD1Vci054518@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: 98e40918a6fa - stable/13 - pf tests: Explicitly ask for python3 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: 98e40918a6fa5113404b0fae15707a9804f447bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 13:01:31 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=98e40918a6fa5113404b0fae15707a9804f447bd commit 98e40918a6fa5113404b0fae15707a9804f447bd Author: Kristof Provost AuthorDate: 2021-02-17 10:45:54 +0000 Commit: Kristof Provost CommitDate: 2021-02-24 08:04:19 +0000 pf tests: Explicitly ask for python3 If we install the scapy package (which we do list as a dependency) we don't automatically install python (but we do have python3). MFC after: 1 week Sponsored by: Rubicon Communications, LLC (“Netgate”’) (cherry picked from commit 4a7d84058d88244c405fc0b73d6985681eb661f5) --- tests/sys/netpfil/common/pft_ping.py | 2 +- tests/sys/netpfil/pf/CVE-2019-5597.py | 2 +- tests/sys/netpfil/pf/CVE-2019-5598.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 957123e4f6f8..916a019d2f4a 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-2-Clause # diff --git a/tests/sys/netpfil/pf/CVE-2019-5597.py b/tests/sys/netpfil/pf/CVE-2019-5597.py index bb95e95c13b7..1050af506f8d 100644 --- a/tests/sys/netpfil/pf/CVE-2019-5597.py +++ b/tests/sys/netpfil/pf/CVE-2019-5597.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # diff --git a/tests/sys/netpfil/pf/CVE-2019-5598.py b/tests/sys/netpfil/pf/CVE-2019-5598.py index 53616e681609..ac1e4f3438f5 100644 --- a/tests/sys/netpfil/pf/CVE-2019-5598.py +++ b/tests/sys/netpfil/pf/CVE-2019-5598.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # From owner-dev-commits-src-all@freebsd.org Wed Feb 24 13:01: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 AC1F955C3DE; Wed, 24 Feb 2021 13:01: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 4DlwzG4YqJz3DbS; Wed, 24 Feb 2021 13:01: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 8F7612CB99; Wed, 24 Feb 2021 13:01: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 11OD1UYS054498; Wed, 24 Feb 2021 13:01:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OD1UH9054497; Wed, 24 Feb 2021 13:01:30 GMT (envelope-from git) Date: Wed, 24 Feb 2021 13:01:30 GMT Message-Id: <202102241301.11OD1UH9054497@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: 720206821fe7 - stable/13 - pf: Assert that pfil_link() calls succeed 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: 720206821fe75cf6e80f78307ef10ec125bbd589 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 13:01:30 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=720206821fe75cf6e80f78307ef10ec125bbd589 commit 720206821fe75cf6e80f78307ef10ec125bbd589 Author: Kristof Provost AuthorDate: 2021-02-17 10:44:37 +0000 Commit: Kristof Provost CommitDate: 2021-02-24 08:03:56 +0000 pf: Assert that pfil_link() calls succeed These should only fail if we use them incorrectly, so assert that they succeed. MFC after: 1 week Sponsored by: Rubicon Communications, LLC (“Netgate”’) (cherry picked from commit c4e0f7aa1ae7729df8c3e525e511b84f8052375c) --- sys/netpfil/pf/pf_ioctl.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 97be46509acc..c32a961f5a0b 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -4560,6 +4560,7 @@ hook_pf(void) { struct pfil_hook_args pha; struct pfil_link_args pla; + int ret; if (V_pf_pfil_hooked) return; @@ -4579,7 +4580,8 @@ hook_pf(void) pla.pa_flags = PFIL_IN | PFIL_HEADPTR | PFIL_HOOKPTR; pla.pa_head = V_inet_pfil_head; pla.pa_hook = V_pf_ip4_in_hook; - (void)pfil_link(&pla); + ret = pfil_link(&pla); + MPASS(ret == 0); pha.pa_func = pf_check_out; pha.pa_flags = PFIL_OUT; pha.pa_rulname = "default-out"; @@ -4587,7 +4589,8 @@ hook_pf(void) pla.pa_flags = PFIL_OUT | PFIL_HEADPTR | PFIL_HOOKPTR; pla.pa_head = V_inet_pfil_head; pla.pa_hook = V_pf_ip4_out_hook; - (void)pfil_link(&pla); + ret = pfil_link(&pla); + MPASS(ret == 0); #endif #ifdef INET6 pha.pa_type = PFIL_TYPE_IP6; @@ -4598,7 +4601,8 @@ hook_pf(void) pla.pa_flags = PFIL_IN | PFIL_HEADPTR | PFIL_HOOKPTR; pla.pa_head = V_inet6_pfil_head; pla.pa_hook = V_pf_ip6_in_hook; - (void)pfil_link(&pla); + ret = pfil_link(&pla); + MPASS(ret == 0); pha.pa_func = pf_check6_out; pha.pa_rulname = "default-out6"; pha.pa_flags = PFIL_OUT; @@ -4606,7 +4610,8 @@ hook_pf(void) pla.pa_flags = PFIL_OUT | PFIL_HEADPTR | PFIL_HOOKPTR; pla.pa_head = V_inet6_pfil_head; pla.pa_hook = V_pf_ip6_out_hook; - (void)pfil_link(&pla); + ret = pfil_link(&pla); + MPASS(ret == 0); #endif V_pf_pfil_hooked = 1; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 13: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 0A15055C7F2; Wed, 24 Feb 2021 13: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 4DlxNJ6wmyz3FVT; Wed, 24 Feb 2021 13:19: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 DC56B2CDA3; Wed, 24 Feb 2021 13:19: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 11ODJiXK069627; Wed, 24 Feb 2021 13: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 11ODJiwv069626; Wed, 24 Feb 2021 13:19:44 GMT (envelope-from git) Date: Wed, 24 Feb 2021 13:19:44 GMT Message-Id: <202102241319.11ODJiwv069626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: e70eb4027151 - main - Mount the ESP on /boot/efi in VM images. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e70eb40271512dfbca7cecf823e4b445e3989c2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 13:19:45 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=e70eb40271512dfbca7cecf823e4b445e3989c2e commit e70eb40271512dfbca7cecf823e4b445e3989c2e Author: Nathan Whitehorn AuthorDate: 2021-02-24 13:18:07 +0000 Commit: Nathan Whitehorn CommitDate: 2021-02-24 13:18:07 +0000 Mount the ESP on /boot/efi in VM images. This follows an earlier change (0b7472b3d8d2) for mounting the ESP from systems set up through the installer and should be MFC'ed with it. --- release/tools/vmimage.subr | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 7bad725c9870..7bd971013656 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -52,7 +52,16 @@ write_partition_layout() { # Create an ESP espfilename=$(mktemp /tmp/efiboot.XXXXXX) make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi - BOOTPARTS="${BOOTPARTS} -p efi:=${espfilename}" + BOOTPARTS="${BOOTPARTS} -p efi/efiesp:=${espfilename}" + + # Add this to fstab, requires temporarily remounting the fs + mddev=$(mdconfig -f ${VMBASE}) + mount /dev/${mddev} ${DESTDIR} + mkdir -p ${DESTDIR}/boot/efi + echo "/dev/${ROOTLABEL}/efiesp /boot/efi msdosfs rw 2 2" \ + >> ${DESTDIR}/etc/fstab + umount ${DESTDIR} + mdconfig -d -u ${mddev} fi mkimg -s ${SCHEME} -f ${VMFORMAT} \ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 13:20: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 846C655CC53; Wed, 24 Feb 2021 13:20:32 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DlxPD3PW0z3Fxl; Wed, 24 Feb 2021 13:20:32 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:f44f:4e72:b9db:4490]) (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 30701A466; Wed, 24 Feb 2021 13:20:32 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. From: Nathan Whitehorn To: Warner Losh Cc: Colin Percival , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> Message-ID: <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> Date: Wed, 24 Feb 2021 08:20:31 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 13:20:32 -0000 On 2/23/21 10:15 PM, Nathan Whitehorn wrote: > > > On 2/23/21 5:39 PM, Warner Losh wrote: >> >> >> On Tue, Feb 23, 2021 at 3:02 PM Nathan Whitehorn >> > wrote: >> >> >> >>     On 2/23/21 4:59 PM, Colin Percival wrote: >>     > On 2/23/21 1:24 PM, Nathan Whitehorn wrote: >>     >>      Mount the EFI system partition (ESP) on newly-installed >>     systems. >>     > Should we do this in VM/cloudware images too? >>     > >> >>     That's a good point. I think so, though I don't have the time or >> test >>     setup to make that change. >> >> >> It would be best if we could do it. >> >> Warner > > I'm giving it a shot and will try to get a patch in tomorrow. > -Nathan > Now in the tree (e70eb402715). Thanks for pointing this out! -Nathan From owner-dev-commits-src-all@freebsd.org Wed Feb 24 13:48: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 86EDA55DA98; Wed, 24 Feb 2021 13:48:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dly1Q0ChNz3HLX; Wed, 24 Feb 2021 13:48:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id EuWclmwQwnRGtEuWdlR4Wl; Wed, 24 Feb 2021 06:48:24 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=60365928 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=w16vAm4-AAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=T19QZEnd91e3Mc5AHPkA:9 a=CjuIK1q_8ugA:10 a=eWus_ag6ds_90y4h1ov8:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 616803D8; Wed, 24 Feb 2021 05:48:11 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11ODmB3X003509; Wed, 24 Feb 2021 05:48:11 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102241348.11ODmB3X003509@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: Baptiste Daroussin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-reply-to: <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <202102240105.11O15bKn096987@slippy.cwsent.com> <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> Comments: In-reply-to Baptiste Daroussin message dated "Wed, 24 Feb 2021 10:20:47 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Feb 2021 05:48:11 -0800 X-CMAE-Envelope: MS4xfGcGrbqNAPeqjp+mttAmsaRpD0cgk4rKEQVZARTfkgucdL3gaXrpTzH4jKkcWXBy3HPqA/T9YwBOcHWrU3uP6RJoJsC2Maw9+XZB7vJK4stuTKYq9xdZ aD24NyaFu6kVPxH8tVVs3ou/U0AIsWFjMTA7ubw7o+WYI4dSR8+uQMtRAhKB9ovwR6xaTjw4iTy4kyBkKEveQCmz9mYQB3f21LA4lLDa/6X3BROMP4ongjm4 EDV9EYAMCD/EVBPbI6f1ZVaAXvFcJFnhk4HDgkwKM2yBuRKj4kdZYotYV9allMVr7wiwwiaaWoSydrUqvyGwQitQOoz1mxsOY32lSaT++No= X-Rspamd-Queue-Id: 4Dly1Q0ChNz3HLX 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, 24 Feb 2021 13:48:26 -0000 In message <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu>, Baptiste Daroussin writes: > > > --7stizekjxx47ph24 > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Tue, Feb 23, 2021 at 05:05:37PM -0800, Cy Schubert wrote: > > In message <202102231027.11NARYYE041280@gitrepo.freebsd.org>, Baptiste=20 > > Daroussi > > n writes: > > > The branch main has been updated by bapt: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D77e1ccbee3ed6c837929e4e2= > 32fd07f9 > > > 5bfc8294 > > > > > > commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 > > > Author: Rick Parrish > > > AuthorDate: 2021-02-07 06:15:21 +0000 > > > Commit: Baptiste Daroussin > > > CommitDate: 2021-02-23 10:16:53 +0000 > > > > > > rc: implement parallel boot > > > =20 > > > take advantage of the rcorder -p argument to implement parallel > > > booting in rc. > > > =20 > > > According to the author non scientific tests: > > > on a Core 2 Duo with spinning disk: > > > =20 > > > | Services enabled | before | after | saving | > > > | 0 | 8s | 8s | 0 | > > > | 1 | 13s | 13s | 0 | > > > | 2 | 17s | 13s | 5 | > > > | 3 | 23s | 13s | 10 | > > > | 4 | 28s | 13s | 15 | > > > | 5 | 33s | 13s | 20 | > > > =20 > > > PR: 249192 > > > MFC after: 3 weeks > > > --- > > > libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > > > 1 file changed, 34 insertions(+), 15 deletions(-) > > > > > > diff --git a/libexec/rc/rc b/libexec/rc/rc > > > index 35db4a850516..722d7fe35884 100644 > > > --- a/libexec/rc/rc > > > +++ b/libexec/rc/rc > > > @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > > > skip_firstboot=3D"-s firstboot" > > > fi > > > =20 > > > +# rc_parallel_start default is "NO" > > > +rc_parallel_start=3D${rc_parallel_start:-NO} > > > +_rc_parallel=3D'' > > > +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" > > > +checkyesno rc_parallel_start && _rc_parallel=3D'-p' > > > + > > > # Do a first pass to get everything up to $early_late_divider so that > > > # we can do a second pass that includes $local_startup directories > > > # > > > -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` > > > +files=3D`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/*= > 2>/dev/ > > > null` > > > =20 > > > _rc_elem_done=3D' ' > > > -for _rc_elem in ${files}; do > > > - run_rc_script ${_rc_elem} ${_boot} > > > - _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > > > - > > > - case "$_rc_elem" in > > > - */${early_late_divider}) break ;; > > > - esac > > > +IFS=3D$'\n' > > > +for _rc_group in ${files}; do > > > + IFS=3D$' ' > > > + for _rc_elem in ${_rc_group}; do > > > + run_rc_script ${_rc_elem} ${_boot} & > > > + _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > > > + > > > + case "$_rc_elem" in > > > + */${early_late_divider}) break ;; > > > + esac > > > + done > > > + wait > > > + IFS=3D$'\n' > > > done > > > =20 > > > unset files local_rc > > > @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then > > > skip_firstboot=3D"" > > > fi > > > =20 > > > -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/= > dev/null > > > ` > > > -for _rc_elem in ${files}; do > > > - case "$_rc_elem_done" in > > > - *" $_rc_elem "*) continue ;; > > > - esac > > > - > > > - run_rc_script ${_rc_elem} ${_boot} > > > +files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_= > rc_paral > > > lel} 2>/dev/null` > > > +IFS=3D$'\n' > > > +for _rc_group in ${files}; do > > > + IFS=3D$' ' > > > + for _rc_elem in ${_rc_group}; do > > > + case "$_rc_elem_done" in > > > + *" $_rc_elem "*) continue ;; > > > + esac > > > + > > > + run_rc_script ${_rc_elem} ${_boot} & > > > + done > > > + wait > > > + IFS=3D$'\n' > > > done > > > +unset IFS > > > =20 > > > # Remove the firstboot sentinel, and reboot if it was requested. > > > # Be a bit paranoid about removing it to handle the common failure > > > > >=20 > > Since this commit my postfix, dovecot and nut fail to start at boot, and= > =20 > > must be started by hand. > >=20 > >=20 > I cannot reproduce, what failure do you have?=20 It was a missing unset IFS and it's been fixed. -- 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 Feb 24 13:51: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 9895355DC41; Wed, 24 Feb 2021 13:51:00 +0000 (UTC) (envelope-from bapt@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 4Dly4N3sB9z3HY2; Wed, 24 Feb 2021 13:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 3F6F0A847; Wed, 24 Feb 2021 13:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from [127.0.0.1] (10.246.39.62.rev.sfr.net [62.39.246.10]) (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 aniel.nours.eu (Postfix) with ESMTPSA id 78BD13383A; Wed, 24 Feb 2021 14:50:57 +0100 (CET) Date: Wed, 24 Feb 2021 13:50:53 +0000 (UTC) From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: In-Reply-To: <202102241348.11ODmB3X003509@slippy.cwsent.com> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <202102240105.11O15bKn096987@slippy.cwsent.com> <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> <202102241348.11ODmB3X003509@slippy.cwsent.com> Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 13:51:00 -0000 24 f=C3=A9vr. 2021 14:48:29 Cy Schubert : > In message <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu>, Baptiste > Daroussin > writes: >> >> >> --7stizekjxx47ph24 >> Content-Type: text/plain; charset=3Dus-ascii >> Content-Disposition: inline >> Content-Transfer-Encoding: quoted-printable >> >> On Tue, Feb 23, 2021 at 05:05:37PM -0800, Cy Schubert wrote: >>> In message <202102231027.11NARYYE041280@gitrepo.freebsd.org>, Baptiste= =3D20 >>> Daroussi >>> n writes: >>>> The branch main has been updated by bapt: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D3D77e1ccbee3ed6c837929e= 4e2=3D >> 32fd07f9 >>>> 5bfc8294 >>>> >>>> commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 >>>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Rick Parrish >>>> AuthorDate: 2021-02-07 06:15:21 +0000 >>>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin >>>> CommitDate: 2021-02-23 10:16:53 +0000 >>>> >>>> =C2=A0=C2=A0=C2=A0 rc: implement parallel boot >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 take advantage of the rcorder -p argument to implem= ent parallel >>>> =C2=A0=C2=A0=C2=A0 booting in rc. >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 According to the author non scientific tests: >>>> =C2=A0=C2=A0=C2=A0 on a Core 2 Duo with spinning disk: >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 | Services enabled | before | after | saving | >>>> =C2=A0=C2=A0=C2=A0 | 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 8s=C2=A0=C2=A0=C2=A0=C2=A0 | 8= s=C2=A0=C2=A0=C2=A0 | 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 1=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 13s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 17s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 5=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 3=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 23s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 10=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 4=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 28s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 15=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 5=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 33s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 20=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 PR:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 249192 >>>> =C2=A0=C2=A0=C2=A0 MFC after:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3 weeks >>>> --- >>>> libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- >>>> 1 file changed, 34 insertions(+), 15 deletions(-) >>>> >>>> diff --git a/libexec/rc/rc b/libexec/rc/rc >>>> index 35db4a850516..722d7fe35884 100644 >>>> --- a/libexec/rc/rc >>>> +++ b/libexec/rc/rc >>>> @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then >>>> =C2=A0 skip_firstboot=3D3D"-s firstboot" >>>> fi >>>> =3D20 >>>> +# rc_parallel_start default is "NO" >>>> +rc_parallel_start=3D3D${rc_parallel_start:-NO} >>>> +_rc_parallel=3D3D'' >>>> +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" >>>> +checkyesno rc_parallel_start && _rc_parallel=3D3D'-p' >>>> + >>>> # Do a first pass to get everything up to $early_late_divider so that >>>> # we can do a second pass that includes $local_startup directories >>>> # >>>> -files=3D3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` >>>> +files=3D3D`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.= d/*=3D >> 2>/dev/ >>>> null` >>>> =3D20 >>>> _rc_elem_done=3D3D' ' >>>> -for _rc_elem in ${files}; do >>>> - run_rc_script ${_rc_elem} ${_boot} >>>> - _rc_elem_done=3D3D"${_rc_elem_done}${_rc_elem} " >>>> - >>>> - case "$_rc_elem" in >>>> - */${early_late_divider})=C2=A0 break ;; >>>> - esac >>>> +IFS=3D3D$'\n' >>>> +for _rc_group in ${files}; do >>>> + IFS=3D3D$' ' >>>> + for _rc_elem in ${_rc_group}; do >>>> +=C2=A0=C2=A0 run_rc_script ${_rc_elem} ${_boot} & >>>> +=C2=A0=C2=A0 _rc_elem_done=3D3D"${_rc_elem_done}${_rc_elem} " >>>> + >>>> +=C2=A0=C2=A0 case "$_rc_elem" in >>>> +=C2=A0=C2=A0 */${early_late_divider}) break ;; >>>> +=C2=A0=C2=A0 esac >>>> + done >>>> + wait >>>> + IFS=3D3D$'\n' >>>> done >>>> =3D20 >>>> unset files local_rc >>>> @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then >>>> =C2=A0 skip_firstboot=3D3D"" >>>> fi >>>> =3D20 >>>> -files=3D3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} = 2>/=3D >> dev/null >>>> ` >>>> -for _rc_elem in ${files}; do >>>> - case "$_rc_elem_done" in >>>> - *" $_rc_elem "*)=C2=A0 continue ;; >>>> - esac >>>> - >>>> - run_rc_script ${_rc_elem} ${_boot} >>>> +files=3D3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} = ${_=3D >> rc_paral >>>> lel} 2>/dev/null` >>>> +IFS=3D3D$'\n' >>>> +for _rc_group in ${files}; do >>>> + IFS=3D3D$' ' >>>> + for _rc_elem in ${_rc_group}; do >>>> +=C2=A0=C2=A0 case "$_rc_elem_done" in >>>> +=C2=A0=C2=A0 *" $_rc_elem "*) continue ;; >>>> +=C2=A0=C2=A0 esac >>>> + >>>> +=C2=A0=C2=A0 run_rc_script ${_rc_elem} ${_boot} & >>>> + done >>>> + wait >>>> + IFS=3D3D$'\n' >>>> done >>>> +unset IFS >>>> =3D20 >>>> # Remove the firstboot sentinel, and reboot if it was requested. >>>> # Be a bit paranoid about removing it to handle the common failure >>>> >>> =3D20 >>> Since this commit my postfix, dovecot and nut fail to start at boot, an= d=3D >> =3D20 >>> must be started by hand. >>> =3D20 >>> =3D20 >> I cannot reproduce, what failure do you have?=3D20 > > It was a missing unset IFS and it's been fixed. > > Thank you for the fix and sorry about that! Bapt From owner-dev-commits-src-all@freebsd.org Wed Feb 24 14:15: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 7BE2E55E811; Wed, 24 Feb 2021 14:15:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dlycc0bSfz3K9m; Wed, 24 Feb 2021 14:15:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id Euwmln4lpnRGtEuwolR8c6; Wed, 24 Feb 2021 07:15:26 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=60365f7e a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=w16vAm4-AAAA:8 a=pGLkceISAAAA:8 a=EkcXrb_YAAAA:8 a=f200sBVU4sSyzcJi4CQA:9 a=wPNLvfGTeEIA:10 a=UJ0tAi3fqDAA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=eWus_ag6ds_90y4h1ov8:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 8A12145C; Wed, 24 Feb 2021 06:15:23 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11OEFNB2047672; Wed, 24 Feb 2021 06:15:23 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102241415.11OEFNB2047672@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: Baptiste Daroussin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-reply-to: References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <202102240105.11O15bKn096987@slippy.cwsent.com> <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> <202102241348.11ODmB3X003509@slippy.cwsent.com> Comments: In-reply-to Baptiste Daroussin message dated "Wed, 24 Feb 2021 13:50:53 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 24 Feb 2021 06:15:23 -0800 X-CMAE-Envelope: MS4xfPJ9S8Rg9OBjyPs4AsreMzOwPofDWlpZOE6eI9DcKZHQNzGD2soJ/CWurvVFKN8hERu/P5Dpztv4suVDvg7WbMg8ra5io49PdC7zd5NLSAEbf8kEqPm1 c2Q+tFsrCnZJT6yVM0F77QYpZHJdV0CeO6xhgZiC2MdgOR8EdIzmkKNlwviuqZdGUQBHUXo/2zR8AdQvZjPN5b6FhfEK1+xLxmj/A2M8iENcA2UtmqoQM88p fa+9D5cWNLE+oW3nBYxN+k5K+csX+1CDuQy0LTxwhWWRHfw2M/XZAcC7RPv+skZpSliCT/cvAlQtI7CuCS6h9owTottF3jneQ6GNJbmlyhk= X-Rspamd-Queue-Id: 4Dlycc0bSfz3K9m 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, 24 Feb 2021 14:15:28 -0000 In message , Baptiste Darouss in writes: > > 24 févr. 2021 14:48:29 Cy Schubert : > > > In message <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu>, Baptiste > > Daroussin > > writes: > >> > >> > >> --7stizekjxx47ph24 > >> Content-Type: text/plain; charset=us-ascii > >> Content-Disposition: inline > >> Content-Transfer-Encoding: quoted-printable > >> > >> On Tue, Feb 23, 2021 at 05:05:37PM -0800, Cy Schubert wrote: > >>> In message <202102231027.11NARYYE041280@gitrepo.freebsd.org>, Baptiste=20 > >>> Daroussi > >>> n writes: > >>>> The branch main has been updated by bapt: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D77e1ccbee3ed6c837929e4e2= > >> 32fd07f9 > >>>> 5bfc8294 > >>>> > >>>> commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 > >>>> Author:     Rick Parrish > >>>> AuthorDate: 2021-02-07 06:15:21 +0000 > >>>> Commit:     Baptiste Daroussin > >>>> CommitDate: 2021-02-23 10:16:53 +0000 > >>>> > >>>>     rc: implement parallel boot > >>>>    =20 > >>>>     take advantage of the rcorder -p argument to implement parallel > >>>>     booting in rc. > >>>>    =20 > >>>>     According to the author non scientific tests: > >>>>     on a Core 2 Duo with spinning disk: > >>>>    =20 > >>>>     | Services enabled | before | after | saving | > >>>>     | 0                | 8s     | 8s    | 0   >     | > >>>>     | 1                | 13s    | 13s   | 0    >    | > >>>>     | 2                | 17s    | 13s   | 5    >    | > >>>>     | 3                | 23s    | 13s   | 10   >   | > >>>>     | 4                | 28s    | 13s   | 15   >   | > >>>>     | 5                | 33s    | 13s   | 20   >   | > >>>>    =20 > >>>>     PR:             249192 > >>>>     MFC after:      3 weeks > >>>> --- > >>>> libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > >>>> 1 file changed, 34 insertions(+), 15 deletions(-) > >>>> > >>>> diff --git a/libexec/rc/rc b/libexec/rc/rc > >>>> index 35db4a850516..722d7fe35884 100644 > >>>> --- a/libexec/rc/rc > >>>> +++ b/libexec/rc/rc > >>>> @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > >>>>   skip_firstboot=3D"-s firstboot" > >>>> fi > >>>> =20 > >>>> +# rc_parallel_start default is "NO" > >>>> +rc_parallel_start=3D${rc_parallel_start:-NO} > >>>> +_rc_parallel=3D'' > >>>> +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" > >>>> +checkyesno rc_parallel_start && _rc_parallel=3D'-p' > >>>> + > >>>> # Do a first pass to get everything up to $early_late_divider so that > >>>> # we can do a second pass that includes $local_startup directories > >>>> # > >>>> -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` > >>>> +files=3D`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/*= > >> 2>/dev/ > >>>> null` > >>>> =20 > >>>> _rc_elem_done=3D' ' > >>>> -for _rc_elem in ${files}; do > >>>> - run_rc_script ${_rc_elem} ${_boot} > >>>> - _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > >>>> - > >>>> - case "$_rc_elem" in > >>>> - */${early_late_divider})  break ;; > >>>> - esac > >>>> +IFS=3D$'\n' > >>>> +for _rc_group in ${files}; do > >>>> + IFS=3D$' ' > >>>> + for _rc_elem in ${_rc_group}; do > >>>> +   run_rc_script ${_rc_elem} ${_boot} & > >>>> +   _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > >>>> + > >>>> +   case "$_rc_elem" in > >>>> +   */${early_late_divider}) break ;; > >>>> +   esac > >>>> + done > >>>> + wait > >>>> + IFS=3D$'\n' > >>>> done > >>>> =20 > >>>> unset files local_rc > >>>> @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then > >>>>   skip_firstboot=3D"" > >>>> fi > >>>> =20 > >>>> -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/= > >> dev/null > >>>> ` > >>>> -for _rc_elem in ${files}; do > >>>> - case "$_rc_elem_done" in > >>>> - *" $_rc_elem "*)  continue ;; > >>>> - esac > >>>> - > >>>> - run_rc_script ${_rc_elem} ${_boot} > >>>> +files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_= > >> rc_paral > >>>> lel} 2>/dev/null` > >>>> +IFS=3D$'\n' > >>>> +for _rc_group in ${files}; do > >>>> + IFS=3D$' ' > >>>> + for _rc_elem in ${_rc_group}; do > >>>> +   case "$_rc_elem_done" in > >>>> +   *" $_rc_elem "*) continue ;; > >>>> +   esac > >>>> + > >>>> +   run_rc_script ${_rc_elem} ${_boot} & > >>>> + done > >>>> + wait > >>>> + IFS=3D$'\n' > >>>> done > >>>> +unset IFS > >>>> =20 > >>>> # Remove the firstboot sentinel, and reboot if it was requested. > >>>> # Be a bit paranoid about removing it to handle the common failure > >>>> > >>> =20 > >>> Since this commit my postfix, dovecot and nut fail to start at boot, and= > >> =20 > >>> must be started by hand. > >>> =20 > >>> =20 > >> I cannot reproduce, what failure do you have?=20 > > > > It was a missing unset IFS and it's been fixed. > > > > > > > > Thank you for the fix and sorry about that! No problem. IFS is easy to miss. -- 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 Feb 24 15:02: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 A256455F17B; Wed, 24 Feb 2021 15:02: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 4Dlzg64Fpvz3N9m; Wed, 24 Feb 2021 15:02: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 849FA2E04F; Wed, 24 Feb 2021 15:02: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 11OF2gCC013441; Wed, 24 Feb 2021 15:02:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OF2gOw013440; Wed, 24 Feb 2021 15:02:42 GMT (envelope-from git) Date: Wed, 24 Feb 2021 15:02:42 GMT Message-Id: <202102241502.11OF2gOw013440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 8837e9c54072 - stable/13 - arm64: validate breakpoint registers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8837e9c54072679b69ae0c0345e7ef7d241255aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 15:02:42 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8837e9c54072679b69ae0c0345e7ef7d241255aa commit 8837e9c54072679b69ae0c0345e7ef7d241255aa Author: Mitchell Horne AuthorDate: 2021-02-09 18:29:38 +0000 Commit: Mitchell Horne CommitDate: 2021-02-24 14:57:04 +0000 arm64: validate breakpoint registers In particular, we want to disallow setting breakpoints on kernel addresses from userspace. The control register fields are validated or ignored as appropriate. Reviewed by: markj Sponsored by: The FreeBSD Foundation (cherry picked from commit de2b9422807586d376ec7ffa7b660cd492464bdf) --- sys/arm64/arm64/machdep.c | 37 +++++++++++++++++++++++++++++++++---- sys/arm64/include/armreg.h | 17 +++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 90fc19d57415..bf44dba19482 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -357,6 +357,8 @@ int set_dbregs(struct thread *td, struct dbreg *regs) { struct debug_monitor_state *monitor; + uint64_t addr; + uint32_t ctrl; int count; int i; @@ -364,11 +366,38 @@ set_dbregs(struct thread *td, struct dbreg *regs) count = 0; monitor->dbg_enable_count = 0; for (i = 0; i < DBG_BRP_MAX; i++) { - /* TODO: Check these values */ - monitor->dbg_bvr[i] = regs->db_regs[i].dbr_addr; - monitor->dbg_bcr[i] = regs->db_regs[i].dbr_ctrl; - if ((monitor->dbg_bcr[i] & 1) != 0) + addr = regs->db_regs[i].dbr_addr; + ctrl = regs->db_regs[i].dbr_ctrl; + + /* Don't let the user set a breakpoint on a kernel address. */ + if (addr >= VM_MAXUSER_ADDRESS) + return (EINVAL); + + /* + * The lowest 2 bits are ignored, so record the effective + * address. + */ + addr = rounddown2(addr, 4); + + /* + * Some control fields are ignored, and other bits reserved. + * Only unlinked, address-matching breakpoints are supported. + * + * XXX: fields that appear unvalidated, such as BAS, have + * constrained undefined behaviour. If the user mis-programs + * these, there is no risk to the system. + */ + ctrl &= DBG_BCR_EN | DBG_BCR_PMC | DBG_BCR_BAS; + if ((ctrl & DBG_BCR_EN) != 0) { + /* Only target EL0. */ + if ((ctrl & DBG_BCR_PMC) != DBG_BCR_PMC_EL0) + return (EINVAL); + monitor->dbg_enable_count++; + } + + monitor->dbg_bvr[i] = addr; + monitor->dbg_bcr[i] = ctrl; } if (monitor->dbg_enable_count > 0) monitor->dbg_flags |= DBGMON_ENABLED; diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 201d7559320b..73d1010057b9 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -943,6 +943,23 @@ #define DBG_MDSCR_KDE (0x1 << 13) #define DBG_MDSCR_MDE (0x1 << 15) +/* Debug Breakpoint Control Registers */ +#define DBG_BCR_EN 0x1 +#define DBG_BCR_PMC_SHIFT 1 +#define DBG_BCR_PMC (0x3 << DBG_BCR_PMC_SHIFT) +#define DBG_BCR_PMC_EL1 (0x1 << DBG_BCR_PMC_SHIFT) +#define DBG_BCR_PMC_EL0 (0x2 << DBG_BCR_PMC_SHIFT) +#define DBG_BCR_BAS_SHIFT 5 +#define DBG_BCR_BAS (0xf << DBG_BCR_BAS_SHIFT) +#define DBG_BCR_HMC_SHIFT 13 +#define DBG_BCR_HMC (0x1 << DBG_BCR_HMC_SHIFT) +#define DBG_BCR_SSC_SHIFT 14 +#define DBG_BCR_SSC (0x3 << DBG_BCR_SSC_SHIFT) +#define DBG_BCR_LBN_SHIFT 16 +#define DBG_BCR_LBN (0xf << DBG_BCR_LBN_SHIFT) +#define DBG_BCR_BT_SHIFT 20 +#define DBG_BCR_BT (0xf << DBG_BCR_BT_SHIFT) + /* Perfomance Monitoring Counters */ #define PMCR_E (1 << 0) /* Enable all counters */ #define PMCR_P (1 << 1) /* Reset all counters */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 15:02: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 BAAEB55F17C; Wed, 24 Feb 2021 15:02: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 4Dlzg74ysZz3N9n; Wed, 24 Feb 2021 15:02: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 9D46B2E4A8; Wed, 24 Feb 2021 15:02: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 11OF2hsF013464; Wed, 24 Feb 2021 15:02:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OF2hYR013463; Wed, 24 Feb 2021 15:02:43 GMT (envelope-from git) Date: Wed, 24 Feb 2021 15:02:43 GMT Message-Id: <202102241502.11OF2hYR013463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9372df63ad5b - stable/13 - arm64: handle watchpoint exceptions from EL0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9372df63ad5b814440732d171c8f04f0e1c26b87 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 15:02:43 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9372df63ad5b814440732d171c8f04f0e1c26b87 commit 9372df63ad5b814440732d171c8f04f0e1c26b87 Author: Mitchell Horne AuthorDate: 2021-02-05 21:46:48 +0000 Commit: Mitchell Horne CommitDate: 2021-02-24 14:58:09 +0000 arm64: handle watchpoint exceptions from EL0 This is a prerequisite to allowing the use of hardware watchpoints for userspace debuggers. This is also a slight departure from the x86 behaviour, since `si_addr` returns the data address that triggered the watchpoint, not the address of the instruction that was executed. Otherwise, there is no straightforward way for the application to determine which watchpoint was triggered. Make a note of this in the siginfo(3) man page. Reviewed by: jhb, markj (earlier version) Tested by: Michał Górny (mgorny@gentoo.org) Sponsored by: The FreeBSD Foundation (cherry picked from commit bd012c71592323d957b409bb5e0cf7940729650e) --- share/man/man3/siginfo.3 | 7 ++++++- sys/arm64/arm64/trap.c | 6 ++++++ sys/arm64/include/armreg.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/share/man/man3/siginfo.3 b/share/man/man3/siginfo.3 index fc4ea2ba1df7..acc8785b2f0d 100644 --- a/share/man/man3/siginfo.3 +++ b/share/man/man3/siginfo.3 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2020 +.Dd February 17, 2021 .Dt SIGINFO 3 .Os .Sh NAME @@ -218,6 +218,11 @@ and may report the address of the faulting memory access (if available) in .Va si_addr instead. +Additionally +.Dv SIGTRAP +raised by a hardware watchpoint exception may report the data address that +triggered the watchpoint in +.Va si_addr . .Pp Sychronous signals set .Va si_trapno diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 0b2d4760cea3..cb3a05ad0163 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -474,6 +474,7 @@ do_el0_sync(struct thread *td, struct trapframe *frame) case EXCP_UNKNOWN: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: + case EXCP_WATCHPT_EL0: far = READ_SPECIALREG(far_el1); break; } @@ -534,6 +535,11 @@ do_el0_sync(struct thread *td, struct trapframe *frame) exception); userret(td, frame); break; + case EXCP_WATCHPT_EL0: + call_trapsignal(td, SIGTRAP, TRAP_TRACE, (void *)far, + exception); + userret(td, frame); + break; case EXCP_MSR: /* * The CPU can raise EXCP_MSR when userspace executes an mrs diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 73d1010057b9..66cd8591c7ab 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -230,6 +230,7 @@ #define EXCP_BRKPT_EL0 0x30 /* Hardware breakpoint, from same EL */ #define EXCP_SOFTSTP_EL0 0x32 /* Software Step, from lower EL */ #define EXCP_SOFTSTP_EL1 0x33 /* Software Step, from same EL */ +#define EXCP_WATCHPT_EL0 0x34 /* Watchpoint, from lower EL */ #define EXCP_WATCHPT_EL1 0x35 /* Watchpoint, from same EL */ #define EXCP_BRK 0x3c /* Breakpoint */ From owner-dev-commits-src-all@freebsd.org Wed Feb 24 15:02: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 E1F7C55F6B9; Wed, 24 Feb 2021 15:02: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 4Dlzg85k3qz3N7p; Wed, 24 Feb 2021 15:02: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 B613A2E255; Wed, 24 Feb 2021 15:02: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 11OF2i2Y013482; Wed, 24 Feb 2021 15:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OF2iwc013481; Wed, 24 Feb 2021 15:02:44 GMT (envelope-from git) Date: Wed, 24 Feb 2021 15:02:44 GMT Message-Id: <202102241502.11OF2iwc013481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 4786c8582c56 - stable/13 - arm64: extend struct db_reg to include watchpoint registers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4786c8582c569a7245dadbdbb4638d1667c10d62 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 15:02:45 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=4786c8582c569a7245dadbdbb4638d1667c10d62 commit 4786c8582c569a7245dadbdbb4638d1667c10d62 Author: Mitchell Horne AuthorDate: 2021-01-28 17:49:47 +0000 Commit: Mitchell Horne CommitDate: 2021-02-24 14:58:43 +0000 arm64: extend struct db_reg to include watchpoint registers The motivation is to provide access to these registers from userspace via ptrace(2) requests PT_GETDBREGS and PT_SETDBREGS. This change breaks the ABI of these particular requests, but is justified by the fact that the intended consumers (debuggers) have not been taught to use them yet. Making this change now enables active upstream work on lldb to begin using this interface, and take advantage of the hardware debugging registers available on the platform. PR: 252860 Reported by: Michał Górny (mgorny@gentoo.org) Reviewed by: andrew, markj (earlier version) Tested by: Michał Górny (mgorny@gentoo.org) Sponsored by: The FreeBSD Foundation (cherry picked from commit f2583be110ca3a5b32f0993f1464a5c69151c62f) --- sys/arm64/arm64/identcpu.c | 2 +- sys/arm64/arm64/machdep.c | 71 ++++++++++++++++++++++++++++++++++++++-------- sys/arm64/include/armreg.h | 22 ++++++++++++++ sys/arm64/include/reg.h | 13 +++++++-- 4 files changed, 92 insertions(+), 16 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index bfbaad7a6483..c3544e9de9aa 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -350,7 +350,7 @@ static struct mrs_field id_aa64dfr0_fields[] = { MRS_FIELD(ID_AA64DFR0, PMSVer, false, MRS_EXACT, id_aa64dfr0_pmsver), MRS_FIELD(ID_AA64DFR0, CTX_CMPs, false, MRS_EXACT, id_aa64dfr0_ctx_cmps), - MRS_FIELD(ID_AA64DFR0, WRPs, false, MRS_EXACT, id_aa64dfr0_wrps), + MRS_FIELD(ID_AA64DFR0, WRPs, false, MRS_LOWER, id_aa64dfr0_wrps), MRS_FIELD(ID_AA64DFR0, BRPs, false, MRS_LOWER, id_aa64dfr0_brps), MRS_FIELD(ID_AA64DFR0, PMUVer, false, MRS_EXACT, id_aa64dfr0_pmuver), MRS_FIELD(ID_AA64DFR0, TraceVer, false, MRS_EXACT, diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index bf44dba19482..73b06beeba7e 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -321,8 +321,8 @@ int fill_dbregs(struct thread *td, struct dbreg *regs) { struct debug_monitor_state *monitor; - int count, i; - uint8_t debug_ver, nbkpts; + int i; + uint8_t debug_ver, nbkpts, nwtpts; memset(regs, 0, sizeof(*regs)); @@ -330,23 +330,30 @@ fill_dbregs(struct thread *td, struct dbreg *regs) &debug_ver); extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_BRPs_SHIFT, &nbkpts); + extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_WRPs_SHIFT, + &nwtpts); /* * The BRPs field contains the number of breakpoints - 1. Armv8-A * allows the hardware to provide 2-16 breakpoints so this won't - * overflow an 8 bit value. + * overflow an 8 bit value. The same applies to the WRPs field. */ - count = nbkpts + 1; + nbkpts++; + nwtpts++; - regs->db_info = debug_ver; - regs->db_info <<= 8; - regs->db_info |= count; + regs->db_debug_ver = debug_ver; + regs->db_nbkpts = nbkpts; + regs->db_nwtpts = nwtpts; monitor = &td->td_pcb->pcb_dbg_regs; if ((monitor->dbg_flags & DBGMON_ENABLED) != 0) { - for (i = 0; i < count; i++) { - regs->db_regs[i].dbr_addr = monitor->dbg_bvr[i]; - regs->db_regs[i].dbr_ctrl = monitor->dbg_bcr[i]; + for (i = 0; i < nbkpts; i++) { + regs->db_breakregs[i].dbr_addr = monitor->dbg_bvr[i]; + regs->db_breakregs[i].dbr_ctrl = monitor->dbg_bcr[i]; + } + for (i = 0; i < nwtpts; i++) { + regs->db_watchregs[i].dbw_addr = monitor->dbg_wvr[i]; + regs->db_watchregs[i].dbw_ctrl = monitor->dbg_wcr[i]; } } @@ -365,9 +372,10 @@ set_dbregs(struct thread *td, struct dbreg *regs) monitor = &td->td_pcb->pcb_dbg_regs; count = 0; monitor->dbg_enable_count = 0; + for (i = 0; i < DBG_BRP_MAX; i++) { - addr = regs->db_regs[i].dbr_addr; - ctrl = regs->db_regs[i].dbr_ctrl; + addr = regs->db_breakregs[i].dbr_addr; + ctrl = regs->db_breakregs[i].dbr_ctrl; /* Don't let the user set a breakpoint on a kernel address. */ if (addr >= VM_MAXUSER_ADDRESS) @@ -399,6 +407,45 @@ set_dbregs(struct thread *td, struct dbreg *regs) monitor->dbg_bvr[i] = addr; monitor->dbg_bcr[i] = ctrl; } + + for (i = 0; i < DBG_WRP_MAX; i++) { + addr = regs->db_watchregs[i].dbw_addr; + ctrl = regs->db_watchregs[i].dbw_ctrl; + + /* Don't let the user set a watchpoint on a kernel address. */ + if (addr >= VM_MAXUSER_ADDRESS) + return (EINVAL); + + /* + * Some control fields are ignored, and other bits reserved. + * Only unlinked watchpoints are supported. + */ + ctrl &= DBG_WCR_EN | DBG_WCR_PAC | DBG_WCR_LSC | DBG_WCR_BAS | + DBG_WCR_MASK; + + if ((ctrl & DBG_WCR_EN) != 0) { + /* Only target EL0. */ + if ((ctrl & DBG_WCR_PAC) != DBG_WCR_PAC_EL0) + return (EINVAL); + + /* Must set at least one of the load/store bits. */ + if ((ctrl & DBG_WCR_LSC) == 0) + return (EINVAL); + + /* + * When specifying the address range with BAS, the MASK + * field must be zero. + */ + if ((ctrl & DBG_WCR_BAS) != DBG_WCR_BAS_MASK && + (ctrl & DBG_WCR_MASK) != 0) + return (EINVAL); + + monitor->dbg_enable_count++; + } + monitor->dbg_wvr[i] = addr; + monitor->dbg_wcr[i] = ctrl; + } + if (monitor->dbg_enable_count > 0) monitor->dbg_flags |= DBGMON_ENABLED; diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 66cd8591c7ab..81cea5431017 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -961,6 +961,28 @@ #define DBG_BCR_BT_SHIFT 20 #define DBG_BCR_BT (0xf << DBG_BCR_BT_SHIFT) +/* Debug Watchpoint Control Registers */ +#define DBG_WCR_EN 0x1 +#define DBG_WCR_PAC_SHIFT 1 +#define DBG_WCR_PAC (0x3 << DBG_WCR_PAC_SHIFT) +#define DBG_WCR_PAC_EL1 (0x1 << DBG_WCR_PAC_SHIFT) +#define DBG_WCR_PAC_EL0 (0x2 << DBG_WCR_PAC_SHIFT) +#define DBG_WCR_LSC_SHIFT 3 +#define DBG_WCR_LSC (0x3 << DBG_WCR_LSC_SHIFT) +#define DBG_WCR_BAS_SHIFT 5 +#define DBG_WCR_BAS (0xff << DBG_WCR_BAS_SHIFT) +#define DBG_WCR_BAS_MASK DBG_WCR_BAS +#define DBG_WCR_HMC_SHIFT 13 +#define DBG_WCR_HMC (0x1 << DBG_WCR_HMC_SHIFT) +#define DBG_WCR_SSC_SHIFT 14 +#define DBG_WCR_SSC (0x3 << DBG_WCR_SSC_SHIFT) +#define DBG_WCR_LBN_SHIFT 16 +#define DBG_WCR_LBN (0xf << DBG_WCR_LBN_SHIFT) +#define DBG_WCR_WT_SHIFT 20 +#define DBG_WCR_WT (0x1 << DBG_WCR_WT_SHIFT) +#define DBG_WCR_MASK_SHIFT 24 +#define DBG_WCR_MASK (0x1f << DBG_WCR_MASK_SHIFT) + /* Perfomance Monitoring Counters */ #define PMCR_E (1 << 0) /* Enable all counters */ #define PMCR_P (1 << 1) /* Reset all counters */ diff --git a/sys/arm64/include/reg.h b/sys/arm64/include/reg.h index aafe02b70925..9cfc5ea1d437 100644 --- a/sys/arm64/include/reg.h +++ b/sys/arm64/include/reg.h @@ -60,14 +60,21 @@ struct fpreg32 { }; struct dbreg { - uint32_t db_info; - uint32_t db_pad; + uint8_t db_debug_ver; + uint8_t db_nbkpts; + uint8_t db_nwtpts; + uint8_t db_pad[5]; struct { uint64_t dbr_addr; uint32_t dbr_ctrl; uint32_t dbr_pad; - } db_regs[16]; + } db_breakregs[16]; + struct { + uint64_t dbw_addr; + uint32_t dbw_ctrl; + uint32_t dbw_pad; + } db_watchregs[16]; }; struct dbreg32 { From owner-dev-commits-src-all@freebsd.org Wed Feb 24 15:13: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 AD31155FE46; Wed, 24 Feb 2021 15:13: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 4DlzvP4b9Zz3PRr; Wed, 24 Feb 2021 15:13: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 904BE2E732; Wed, 24 Feb 2021 15:13: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 11OFDLVb026487; Wed, 24 Feb 2021 15:13:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OFDLK1026486; Wed, 24 Feb 2021 15:13:21 GMT (envelope-from git) Date: Wed, 24 Feb 2021 15:13:21 GMT Message-Id: <202102241513.11OFDLK1026486@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: b6999635b195 - main - iflib: Avoid double counting in rxeof 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: b6999635b195e8c0dd5c08ac9ff268c92107cc66 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 15:13:21 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b6999635b195e8c0dd5c08ac9ff268c92107cc66 commit b6999635b195e8c0dd5c08ac9ff268c92107cc66 Author: Mark Johnston AuthorDate: 2021-02-24 15:08:53 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 15:08:53 +0000 iflib: Avoid double counting in rxeof iflib_rxeof() was counting everything twice. This was introduced when pfil hooks were added to the iflib receive path. We want to count rx packets/bytes before the pfil hooks are executed, so remove the counter adjustments that are executed after. PR: 253583 Reviewed by: gallatin, erj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28900 --- sys/net/iflib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 6312499feac8..5366b652373d 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2973,8 +2973,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if (!IP_ALIGNED(m) && (m = iflib_fixup_rx(m)) == NULL) continue; #endif - rx_bytes += m->m_pkthdr.len; - rx_pkts++; #if defined(INET6) || defined(INET) if (lro_enabled) { if (!lro_possible) { From owner-dev-commits-src-all@freebsd.org Wed Feb 24 15: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 91A2855FFF8; Wed, 24 Feb 2021 15: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 4Dm04K3khKz3Py7; Wed, 24 Feb 2021 15: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 733EC2E6DC; Wed, 24 Feb 2021 15: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 11OFL5Nm035990; Wed, 24 Feb 2021 15: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 11OFL5JM035989; Wed, 24 Feb 2021 15:21:05 GMT (envelope-from git) Date: Wed, 24 Feb 2021 15:21:05 GMT Message-Id: <202102241521.11OFL5JM035989@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: 4664afc05402 - stable/13 - iflib: Fix detach of pseudo interfaces 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: 4664afc05402abb8e572975ec65210bdcd8b2ea1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 15:21:05 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4664afc05402abb8e572975ec65210bdcd8b2ea1 commit 4664afc05402abb8e572975ec65210bdcd8b2ea1 Author: Mark Johnston AuthorDate: 2021-02-19 22:08:34 +0000 Commit: Mark Johnston CommitDate: 2021-02-24 15:20:55 +0000 iflib: Fix detach of pseudo interfaces In commit 38bfc6dee33b we added an IFDI_DETACH() call to iflib_pseudo_deregister() since it looked like it was missing. One is present in the error-handling path of iflib_pseudo_register(). However, the detach actually comes from the DEVICE_DETACH() method for the above-mentioned device_t, so now we're calling IFDI_DETACH() twice when destroying a pseudo interface. Fix the problem by not calling IFDI_DETACH() from the device detach routine. This way we can ensure that iflib de-initialization always happens in a consistent order. It also ensures that you can't do silly things like "devctl detach ", which would previously detach the driver without tearing down the corresponding ifnet. PR: 253541 Reviewed by: erj Fixes: 38bfc6dee33b Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28774 (cherry picked from commit 0f9544d03e89d180f94a7a84b110ec7d2b6c625a) --- sys/net/iflib_clone.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/net/iflib_clone.c b/sys/net/iflib_clone.c index dc4ccbee659f..975873c4a19c 100644 --- a/sys/net/iflib_clone.c +++ b/sys/net/iflib_clone.c @@ -81,13 +81,11 @@ int iflib_pseudo_detach(device_t dev) { if_ctx_t ctx; - uint32_t ifc_flags; ctx = device_get_softc(dev); - ifc_flags = iflib_get_flags(ctx); - if ((ifc_flags & IFC_INIT_DONE) == 0) - return (0); - return (IFDI_DETACH(ctx)); + if ((iflib_get_flags(ctx) & IFC_IN_DETACH) == 0) + return (EBUSY); + return (0); } static device_t iflib_pseudodev; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 15:33: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 8E57A5606E3; Wed, 24 Feb 2021 15:33: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 4Dm0Lg3hWJz3Qv7; Wed, 24 Feb 2021 15:33: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 7181B2E760; Wed, 24 Feb 2021 15:33: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 11OFXVEj053098; Wed, 24 Feb 2021 15:33:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OFXVc8053097; Wed, 24 Feb 2021 15:33:31 GMT (envelope-from git) Date: Wed, 24 Feb 2021 15:33:31 GMT Message-Id: <202102241533.11OFXVc8053097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: f7aebfbe5c0a - main - Add GPT PREP-boot type to mkimg(1) from geom_gpt. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7aebfbe5c0ab63dbb3d134d143ccff2c2b278bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 15:33:31 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=f7aebfbe5c0ab63dbb3d134d143ccff2c2b278bb commit f7aebfbe5c0ab63dbb3d134d143ccff2c2b278bb Author: Nathan Whitehorn AuthorDate: 2021-02-24 15:31:44 +0000 Commit: Nathan Whitehorn CommitDate: 2021-02-24 15:31:44 +0000 Add GPT PREP-boot type to mkimg(1) from geom_gpt. This partition type can be used to boot some PowerKVM VMs. We don't support it well because of some limitations in SLOF, but it's worth at least have feature parity in geom and mkimg. --- usr.bin/mkimg/gpt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/mkimg/gpt.c b/usr.bin/mkimg/gpt.c index b386ef6bc208..a071fbfac272 100644 --- a/usr.bin/mkimg/gpt.c +++ b/usr.bin/mkimg/gpt.c @@ -51,6 +51,7 @@ static mkimg_uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; static mkimg_uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; static mkimg_uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static mkimg_uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static mkimg_uuid_t gpt_uuid_prep_boot = GPT_ENT_TYPE_PREP_BOOT; static struct mkimg_alias gpt_aliases[] = { { ALIAS_EFI, ALIAS_PTR2TYPE(&gpt_uuid_efi) }, @@ -63,6 +64,7 @@ static struct mkimg_alias gpt_aliases[] = { { ALIAS_FREEBSD_ZFS, ALIAS_PTR2TYPE(&gpt_uuid_freebsd_zfs) }, { ALIAS_MBR, ALIAS_PTR2TYPE(&gpt_uuid_mbr) }, { ALIAS_NTFS, ALIAS_PTR2TYPE(&gpt_uuid_ms_basic_data) }, + { ALIAS_PPCBOOT, ALIAS_PTR2TYPE(&gpt_uuid_prep_boot) }, { ALIAS_NONE, 0 } /* Keep last! */ }; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 16:57: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 F3004562577; Wed, 24 Feb 2021 16:57: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 4Dm2C06VLzz3mh1; Wed, 24 Feb 2021 16:57: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 CD7932FD8B; Wed, 24 Feb 2021 16:57: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 11OGv0DS058521; Wed, 24 Feb 2021 16:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OGv0WC058520; Wed, 24 Feb 2021 16:57:00 GMT (envelope-from git) Date: Wed, 24 Feb 2021 16:57:00 GMT Message-Id: <202102241657.11OGv0WC058520@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: 43d4dfac96f7 - main - pwm_backlight: Add MODULE_DEPEND on backlight 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: 43d4dfac96f7f8285a27989f315c075d28aadb12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 16:57:01 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=43d4dfac96f7f8285a27989f315c075d28aadb12 commit 43d4dfac96f7f8285a27989f315c075d28aadb12 Author: Brett Mastbergen AuthorDate: 2021-02-22 10:28:28 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-24 16:56:26 +0000 pwm_backlight: Add MODULE_DEPEND on backlight Make the pwm_backlight module depend on backlight, so it has access to the backlight interface symbols. Otherwise you'll get an error like: link_elf: symbol backlight_get_info_desc undefined Signed-off-by: Brett Mastbergen MFC after: 3 days PR: 253765 --- sys/dev/pwm/pwm_backlight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/pwm/pwm_backlight.c b/sys/dev/pwm/pwm_backlight.c index 352a5a02fed5..3a6ec7f61fec 100644 --- a/sys/dev/pwm/pwm_backlight.c +++ b/sys/dev/pwm/pwm_backlight.c @@ -308,4 +308,5 @@ devclass_t pwm_backlight_devclass; DRIVER_MODULE(pwm_backlight, simplebus, pwm_backlight_driver, pwm_backlight_devclass, 0, 0); +MODULE_DEPEND(pwm_backlight, backlight, 1, 1, 1); OFWBUS_PNP_INFO(compat_data); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:10: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 98919564AA0; Wed, 24 Feb 2021 18:10: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 4Dm3qG3yxgz3tN9; Wed, 24 Feb 2021 18:10: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 777C3D8A; Wed, 24 Feb 2021 18:10: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 11OIA24A052888; Wed, 24 Feb 2021 18:10:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIA2jj052884; Wed, 24 Feb 2021 18:10:02 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:10:02 GMT Message-Id: <202102241810.11OIA2jj052884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: dd9b24be14d4 - stable/13 - boot: remove gptboot.efifat, it never should have been 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dd9b24be14d4311ca6056f41a2d81801d2c0fa03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:10:02 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dd9b24be14d4311ca6056f41a2d81801d2c0fa03 commit dd9b24be14d4311ca6056f41a2d81801d2c0fa03 Author: Warner Losh AuthorDate: 2021-02-19 22:34:25 +0000 Commit: Warner Losh CommitDate: 2021-02-24 17:56:06 +0000 boot: remove gptboot.efifat, it never should have been conical hat reduction: Make sure we also remove gotboot.efifat. It was created, briefly, and shouldn't have existed in the first place. Kill it at the same place we kill boot1.efifat. Pointy Hat to: imp@ (cherry picked from commit 8cd1b2b1a7ab55e96aaf40a401d8792f2697b274) --- ObsoleteFiles.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 7ebff0441581..5f4495c50ee6 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -2601,8 +2601,9 @@ OLD_FILES+=usr/bin/mklocale OLD_FILES+=usr/share/man/man1/mklocale.1.gz OLD_FILES+=usr/bin/colldef OLD_FILES+=usr/share/man/man1/colldef.1.gz -# 20190904: Remove boot1.efifat +# 20190904: Remove boot1.efifat and gptboot.efifat (which never should have been) OLD_FILES+=boot/boot1.efifat +OLD_FILES+=boot/gptboot.efifat # 20190903: pc-sysinstall(8) removed OLD_FILES+=usr/share/examples/pc-sysinstall/README OLD_FILES+=usr/share/examples/pc-sysinstall/pc-autoinstall.conf From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:10: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 B3D165647F3; Wed, 24 Feb 2021 18:10: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 4Dm3qJ4mDbz3tQy; Wed, 24 Feb 2021 18:10: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 966739DE; Wed, 24 Feb 2021 18:10: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 11OIA4TP053308; Wed, 24 Feb 2021 18:10:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIA4Q4053305; Wed, 24 Feb 2021 18:10:04 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:10:04 GMT Message-Id: <202102241810.11OIA4Q4053305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 78050d4966c5 - stable/13 - Remove incorrect statement about EFI environment variables being unsupported. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 78050d4966c5a9c8e953cab2a286450238d51e4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:10:04 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=78050d4966c5a9c8e953cab2a286450238d51e4f commit 78050d4966c5a9c8e953cab2a286450238d51e4f Author: Warner Losh AuthorDate: 2021-02-22 20:19:21 +0000 Commit: Warner Losh CommitDate: 2021-02-24 17:59:37 +0000 Remove incorrect statement about EFI environment variables being unsupported. Our uefi support has included environment variable support for several years now. Remove the bogus blanket statement saying we don't support them. MFC After: 3 days (cherry picked from commit ab77cc9e7bf6d0c2d862dfd514539b81ae248dfd) --- share/man/man8/uefi.8 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 4224af835738..05c74caa6c20 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2020 +.Dd February 22, 2021 .Dt UEFI 8 .Os .Sh NAME @@ -143,7 +143,3 @@ boot support for amd64 first appeared in .Fx 10.1 and for arm64 in .Fx 11.0 . -.Sh CAVEATS -EFI environment variables are not supported by -.Xr loader 8 -or the kernel. From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:10: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 968D5564AA2; Wed, 24 Feb 2021 18:10: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 4Dm3qH3tWZz3tNB; Wed, 24 Feb 2021 18:10: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 78D10ACF; Wed, 24 Feb 2021 18:10: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 11OIA3ZR053099; Wed, 24 Feb 2021 18:10:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIA3Pd053096; Wed, 24 Feb 2021 18:10:03 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:10:03 GMT Message-Id: <202102241810.11OIA3Pd053096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ef1f20560842 - stable/13 - uart: only use MSI on devices that advertise 1 MSI vector 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ef1f2056084202c554d5482af9586a8995e604d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:10:03 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ef1f2056084202c554d5482af9586a8995e604d5 commit ef1f2056084202c554d5482af9586a8995e604d5 Author: Warner Losh AuthorDate: 2021-02-17 22:08:19 +0000 Commit: Warner Losh CommitDate: 2021-02-24 17:57:07 +0000 uart: only use MSI on devices that advertise 1 MSI vector This updates r311987/fb1d9b7f4113d which allowed any number of vectors to be used. Since we're just attaching one instance, the meaning of more than one vector is not clear and seems to cause problems. Fall back to old methods for these cards. PR: 235016 Submitted by: David Cross (cherry picked from commit 955b6109bb36036e9357006be42dfa89cd7cb0f2) --- sys/dev/uart/uart_bus_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 0ed3d7f4f974..fbd1d68b88ca 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -227,10 +227,10 @@ uart_pci_attach(device_t dev) sc = device_get_softc(dev); /* - * Use MSI in preference to legacy IRQ if available. - * Whilst some PCIe UARTs support >1 MSI vector, use only the first. + * Use MSI in preference to legacy IRQ if available. However, experience + * suggests this is only reliable when one MSI vector is advertised. */ - if (pci_msi_count(dev) > 0) { + if (pci_msi_count(dev) == 1) { count = 1; if (pci_alloc_msi(dev, &count) == 0) { sc->sc_irid = 1; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:10: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 BACC6564B10; Wed, 24 Feb 2021 18:10: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 4Dm3qM1ZX4z3tgs; Wed, 24 Feb 2021 18:10: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 EFBC0C26; Wed, 24 Feb 2021 18:10: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 11OIA6Nr053732; Wed, 24 Feb 2021 18:10:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIA6TO053730; Wed, 24 Feb 2021 18:10:06 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:10:06 GMT Message-Id: <202102241810.11OIA6TO053730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1df1b4190b41 - stable/13 - Restore missing word 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1df1b4190b41ee3237486e9daa0a751cbc56312d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:10:11 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1df1b4190b41ee3237486e9daa0a751cbc56312d commit 1df1b4190b41ee3237486e9daa0a751cbc56312d Author: Warner Losh AuthorDate: 2021-02-22 21:39:04 +0000 Commit: Warner Losh CommitDate: 2021-02-24 18:00:03 +0000 Restore missing word "in" got dropped when I shuffled things around. Noticed by: rpokala@ MFC After: 3 days (cherry picked from commit f11e9f325aee3459fee94f3a660a8e6c1a25c2ac) --- share/man/man8/uefi.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index dfc144718f7b..3ecfe05ac1c4 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -141,7 +141,7 @@ EFI boot support for the ia64 architecture first appeared in .Nm boot support for amd64 first appeared in .Fx 10.1 ; -for arm64 +for arm64 in .Fx 11.0 ; and for armv6 and armv7 in .Fx 12.0 . From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:10: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 BC525564B89; Wed, 24 Feb 2021 18:10: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 4Dm3qQ028Sz3tZ2; Wed, 24 Feb 2021 18:10: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 F39A0BEC; Wed, 24 Feb 2021 18:10: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 11OIA7bu053941; Wed, 24 Feb 2021 18:10:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIA7XS053938; Wed, 24 Feb 2021 18:10:07 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:10:07 GMT Message-Id: <202102241810.11OIA7XS053938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 44f483e0fa52 - stable/13 - uefi: Add riscv to historical details 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 44f483e0fa52c42c8f97cf1600c1f7272a283707 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:10:13 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=44f483e0fa52c42c8f97cf1600c1f7272a283707 commit 44f483e0fa52c42c8f97cf1600c1f7272a283707 Author: Jessica Clarke AuthorDate: 2021-02-22 22:27:00 +0000 Commit: Warner Losh CommitDate: 2021-02-24 18:00:13 +0000 uefi: Add riscv to historical details (cherry picked from commit 963cf6cb0fd7e8708c455ecf567fbc34fe2a7156) --- share/man/man8/uefi.8 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 3ecfe05ac1c4..64bc30139f97 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -143,5 +143,7 @@ boot support for amd64 first appeared in .Fx 10.1 ; for arm64 in .Fx 11.0 ; -and for armv6 and armv7 in -.Fx 12.0 . +for armv6 and armv7 in +.Fx 12.0 ; +and for riscv in +.Fx 13.0 . From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:10: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 0299056497D; Wed, 24 Feb 2021 18:10: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 4Dm3qR1tmmz3tdw; Wed, 24 Feb 2021 18:10: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 DACC1849; Wed, 24 Feb 2021 18:10: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 11OIA8Kc054153; Wed, 24 Feb 2021 18:10:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIA8fp054150; Wed, 24 Feb 2021 18:10:08 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:10:08 GMT Message-Id: <202102241810.11OIA8fp054150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: b8b867a10f56 - stable/13 - efibootmgr: Check for efi supported after parsing args 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b8b867a10f56b4a78b680fb5d2a97c83e745a0ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:10:14 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b8b867a10f56b4a78b680fb5d2a97c83e745a0ce commit b8b867a10f56b4a78b680fb5d2a97c83e745a0ce Author: Warner Losh AuthorDate: 2021-02-11 23:06:30 +0000 Commit: Warner Losh CommitDate: 2021-02-24 18:01:41 +0000 efibootmgr: Check for efi supported after parsing args Move the check for efi variables being supported to after parsing the args. This allows '-h' to produce both as a normal user as well as on all systems. (cherry picked from commit 7fe2f504f8a0e4237872f8528e911c5f7b7ed59d) --- usr.sbin/efibootmgr/efibootmgr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 8c7ba82cb5a5..53bc417c4e07 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1072,11 +1072,12 @@ int main(int argc, char *argv[]) { + memset(&opts, 0, sizeof (bmgr_opts_t)); + parse_args(argc, argv); + if (!efi_variables_supported()) errx(1, "efi variables not supported on this system. root? kldload efirt?"); - memset(&opts, 0, sizeof (bmgr_opts_t)); - parse_args(argc, argv); read_vars(); if (opts.create) From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:10: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 7887C5647F4; Wed, 24 Feb 2021 18:10: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 4Dm3qL2dvGz3tYj; Wed, 24 Feb 2021 18:10: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 B0C8DA3D; Wed, 24 Feb 2021 18:10: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 11OIA5wP053519; Wed, 24 Feb 2021 18:10:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIA549053516; Wed, 24 Feb 2021 18:10:05 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:10:05 GMT Message-Id: <202102241810.11OIA549053516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f88db54fd874 - stable/13 - uefi: add historical details 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f88db54fd87471802b44520715d8e373ddf86f60 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:10:09 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f88db54fd87471802b44520715d8e373ddf86f60 commit f88db54fd87471802b44520715d8e373ddf86f60 Author: Warner Losh AuthorDate: 2021-02-22 21:20:00 +0000 Commit: Warner Losh CommitDate: 2021-02-24 17:59:44 +0000 uefi: add historical details Add details about when armv6 and armv7 support was added. (cherry picked from commit 8c09ecb2e25155b4f1490a177826608d52b1bd1b) --- share/man/man8/uefi.8 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 05c74caa6c20..dfc144718f7b 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -140,6 +140,8 @@ EFI boot support for the ia64 architecture first appeared in .Fx 5.0 . .Nm boot support for amd64 first appeared in -.Fx 10.1 -and for arm64 in -.Fx 11.0 . +.Fx 10.1 ; +for arm64 +.Fx 11.0 ; +and for armv6 and armv7 in +.Fx 12.0 . From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:13: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 0C0575652D0; Wed, 24 Feb 2021 18:13: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 4Dm3tg6qsxz3vtw; Wed, 24 Feb 2021 18:12: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 DA80CAFB; Wed, 24 Feb 2021 18:12: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 11OICxUI063706; Wed, 24 Feb 2021 18:12:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OICxi7063705; Wed, 24 Feb 2021 18:12:59 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:12:59 GMT Message-Id: <202102241812.11OICxi7063705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4f4f44f70fb8 - stable/13 - nvme: use NVME_GONE rather than hard-coded 0xffffffff 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f4f44f70fb87d2456e0a9955b66ae7f3cbc1997 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:13:00 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f4f44f70fb87d2456e0a9955b66ae7f3cbc1997 commit 4f4f44f70fb87d2456e0a9955b66ae7f3cbc1997 Author: Warner Losh AuthorDate: 2021-02-08 20:08:48 +0000 Commit: Warner Losh CommitDate: 2021-02-24 18:10:45 +0000 nvme: use NVME_GONE rather than hard-coded 0xffffffff Make it clearer that the value 0xfffffff is being used to detect the device is gone. We use it other places in the driver for other meanings. (cherry picked from commit 9600aa31aa633bbb9e8a56d91a781d5a7ce2bff6) --- sys/dev/nvme/nvme_ctrlr.c | 6 +++--- sys/dev/nvme/nvme_private.h | 2 ++ sys/dev/nvme/nvme_qpair.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 2bd7074ee378..c0e6c408ab56 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -261,7 +261,7 @@ nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) ms_waited = 0; while (1) { csts = nvme_mmio_read_4(ctrlr, csts); - if (csts == 0xffffffff) /* Hot unplug. */ + if (csts == NVME_GONE) /* Hot unplug. */ return (ENXIO); if (((csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK) == desired_val) @@ -1471,7 +1471,7 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) * Check whether it is a hot unplug or a clean driver detach. * If device is not there any more, skip any shutdown commands. */ - gone = (nvme_mmio_read_4(ctrlr, csts) == 0xffffffff); + gone = (nvme_mmio_read_4(ctrlr, csts) == NVME_GONE); if (gone) nvme_ctrlr_fail(ctrlr); else @@ -1549,7 +1549,7 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) ((uint64_t)ctrlr->cdata.rtd3e * hz + 999999) / 1000000; while (1) { csts = nvme_mmio_read_4(ctrlr, csts); - if (csts == 0xffffffff) /* Hot unplug. */ + if (csts == NVME_GONE) /* Hot unplug. */ break; if (NVME_CSTS_GET_SHST(csts) == NVME_SHST_COMPLETE) break; diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index d44f1989dd71..6c1d293f047d 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -104,6 +104,8 @@ MALLOC_DECLARE(M_NVME); #define CACHE_LINE_SIZE (64) #endif +#define NVME_GONE 0xfffffffful + extern int32_t nvme_retry_count; extern bool nvme_verbose_cmd_dump; diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 45b1568a4c5a..0726ca248442 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -945,7 +945,7 @@ nvme_timeout(void *arg) nvme_abort_complete, tr); } else { nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n", - (csts == 0xffffffff) ? " and possible hot unplug" : + (csts == NVME_GONE) ? " and possible hot unplug" : (cfs ? " and fatal error status" : "")); nvme_ctrlr_reset(ctrlr); } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:13: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 4B80256534B; Wed, 24 Feb 2021 18:13: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 4Dm3tj1LvXz3w0t; Wed, 24 Feb 2021 18:13: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 0FA5CDA4; Wed, 24 Feb 2021 18:13: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 11OID0tO063729; Wed, 24 Feb 2021 18:13:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OID05q063728; Wed, 24 Feb 2021 18:13:00 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:13:00 GMT Message-Id: <202102241813.11OID05q063728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 0b90164992a8 - stable/13 - nvme: Make nvme_ctrlr_hw_reset static 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0b90164992a871052da5f1b72105c6d42ded2172 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:13:01 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0b90164992a871052da5f1b72105c6d42ded2172 commit 0b90164992a871052da5f1b72105c6d42ded2172 Author: Warner Losh AuthorDate: 2021-02-08 20:28:18 +0000 Commit: Warner Losh CommitDate: 2021-02-24 18:10:51 +0000 nvme: Make nvme_ctrlr_hw_reset static nvme_ctrlr_hw_reset is no longer used outside of nvme_ctrlr.c, so make it static. If we need to change this in the future we can. (cherry picked from commit dd2516fc078f15633ad5aedaad6de140cb491f80) --- sys/dev/nvme/nvme_ctrlr.c | 2 +- sys/dev/nvme/nvme_private.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index c0e6c408ab56..351c6839a6f6 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -403,7 +403,7 @@ nvme_ctrlr_disable_qpairs(struct nvme_controller *ctrlr) } } -int +static int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) { int err; diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 6c1d293f047d..ee0a909e24ec 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -398,7 +398,6 @@ void nvme_completion_poll_cb(void *arg, const struct nvme_completion *cpl); int nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev); void nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev); void nvme_ctrlr_shutdown(struct nvme_controller *ctrlr); -int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr); void nvme_ctrlr_reset(struct nvme_controller *ctrlr); /* ctrlr defined as void * to allow use with config_intrhook. */ void nvme_ctrlr_start_config_hook(void *ctrlr_arg); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:38: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 31E70565CA6; Wed, 24 Feb 2021 18:38: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 4Dm4Sf0VwNz4SN6; Wed, 24 Feb 2021 18:38: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 042E8DDA; Wed, 24 Feb 2021 18:38: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 11OIcvA9091136; Wed, 24 Feb 2021 18:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIcvIJ091135; Wed, 24 Feb 2021 18:38:57 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:38:57 GMT Message-Id: <202102241838.11OIcvIJ091135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: b3e822993503 - releng/13.0 - loader_lua: consider userboot console as serial MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b3e822993503a9f18575c71020cb98056e022164 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:38:58 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=b3e822993503a9f18575c71020cb98056e022164 commit b3e822993503a9f18575c71020cb98056e022164 Author: Toomas Soome AuthorDate: 2021-02-14 08:28:29 +0000 Commit: Toomas Soome CommitDate: 2021-02-23 07:39:18 +0000 loader_lua: consider userboot console as serial We use ascii box chars with serial console because we do not know if terminal can draw unixode box chars. Same problem is about userboot console. (cherry picked from commit 5d8c062fe3ee7b2d6aed0b46d22f62c7771c0af8) Approved by: re (gjb) --- stand/lua/core.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index a119c3c258f8..55c26e0d6d39 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -403,7 +403,10 @@ end function core.isSerialConsole() local c = loader.getenv("console") if c ~= nil then - if c:find("comconsole") ~= nil then + -- serial console is comconsole, but also userboot. + -- userboot is there, because we have no way to know + -- if the user terminal can draw unicode box chars or not. + if c:find("comconsole") ~= nil or c:find("userboot") ~= nil then return true end end From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:38: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 50537565D9C; Wed, 24 Feb 2021 18:38: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 4Dm4Sg1n7kz4S1g; Wed, 24 Feb 2021 18:38: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 2FE1BDDB; Wed, 24 Feb 2021 18:38: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 11OIcxKu091157; Wed, 24 Feb 2021 18:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OIcxHX091156; Wed, 24 Feb 2021 18:38:59 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:38:59 GMT Message-Id: <202102241838.11OIcxHX091156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: ce132d4aab67 - releng/13.0 - loader: start kernel in text mode when there is no vbefb vt driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: ce132d4aab6762d7287eca1e0f0ade5cf4d7576e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:38:59 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=ce132d4aab6762d7287eca1e0f0ade5cf4d7576e commit ce132d4aab6762d7287eca1e0f0ade5cf4d7576e Author: Toomas Soome AuthorDate: 2021-01-26 22:47:56 +0000 Commit: Toomas Soome CommitDate: 2021-02-23 07:41:09 +0000 loader: start kernel in text mode when there is no vbefb vt driver If kernel is built without VT vbefb driver, make sure we start kernel in text mode. (cherry picked from commit 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd) Approved by: re (gjb) --- stand/common/gfx_fb.h | 1 + stand/common/load_elf.c | 63 ++++++++++++++++++++++++++++++++++++------- stand/i386/libi386/bootinfo.c | 10 +++++++ stand/loader.mk | 9 +++++++ 4 files changed, 74 insertions(+), 9 deletions(-) diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index c62c6441f8ad..04076a2c6d38 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -216,6 +216,7 @@ typedef struct teken_gfx { struct gen_fb tg_fb; teken_funcs_t *tg_functions; void *tg_private; + bool tg_kernel_supported; /* Loaded kernel is supported */ } teken_gfx_t; extern font_list_t fonts; diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index cb542718fe2f..62fdb560ecff 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #define FREEBSD_ELF #include +#include #include "bootstrap.h" @@ -84,12 +85,14 @@ typedef struct elf_file { static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, uint64_t loadaddr); -static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, - const char* name, Elf_Sym* sym); +static int __elfN(lookup_symbol)(elf_file_t ef, const char* name, + Elf_Sym *sym, unsigned char type); static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p, void *val, size_t len); static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p_start, Elf_Addr p_end); +static bool __elfN(parse_vt_drv_set)(struct preloaded_file *mp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end); static symaddr_fn __elfN(symaddr); static char *fake_modname(const char *name); @@ -872,12 +875,24 @@ nosyms: ef->buckets = ef->hashtab + 2; ef->chains = ef->buckets + ef->nbuckets; - if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", - &sym) != 0) + gfx_state.tg_kernel_supported = false; + if (__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, + STT_NOTYPE) == 0) { + p_start = sym.st_value + ef->off; + if (__elfN(lookup_symbol)(ef, "__stop_set_vt_drv_set", &sym, + STT_NOTYPE) == 0) { + p_end = sym.st_value + ef->off; + gfx_state.tg_kernel_supported = + __elfN(parse_vt_drv_set)(fp, ef, p_start, p_end); + } + } + + if (__elfN(lookup_symbol)(ef, "__start_set_modmetadata_set", &sym, + STT_NOTYPE) != 0) return 0; p_start = sym.st_value + ef->off; - if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", - &sym) != 0) + if (__elfN(lookup_symbol)(ef, "__stop_set_modmetadata_set", &sym, + STT_NOTYPE) != 0) return ENOENT; p_end = sym.st_value + ef->off; @@ -1072,6 +1087,36 @@ out: return (err); } +/* + * Walk through vt_drv_set, each vt driver structure starts with + * static 16 chars for driver name. If we have "vbefb", return true. + */ +static bool +__elfN(parse_vt_drv_set)(struct preloaded_file *fp, elf_file_t ef, + Elf_Addr p_start, Elf_Addr p_end) +{ + Elf_Addr v, p; + char vd_name[16]; + int error; + + p = p_start; + while (p < p_end) { + COPYOUT(p, &v, sizeof(v)); + + error = __elfN(reloc_ptr)(fp, ef, p, &v, sizeof(v)); + if (error == EOPNOTSUPP) + v += ef->off; + else if (error != 0) + return (false); + COPYOUT(v, &vd_name, sizeof(vd_name)); + if (strncmp(vd_name, "vbefb", sizeof(vd_name)) == 0) + return (true); + p += sizeof(Elf_Addr); + } + + return (false); +} + int __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef, Elf_Addr p_start, Elf_Addr p_end) @@ -1185,8 +1230,8 @@ elf_hash(const char *name) static const char __elfN(bad_symtable)[] = "elf" __XSTRING(__ELF_WORD_SIZE) "_lookup_symbol: corrupt symbol table\n"; int -__elfN(lookup_symbol)(struct preloaded_file *fp, elf_file_t ef, - const char* name, Elf_Sym *symp) +__elfN(lookup_symbol)(elf_file_t ef, const char* name, Elf_Sym *symp, + unsigned char type) { Elf_Hashelt symnum; Elf_Sym sym; @@ -1213,7 +1258,7 @@ __elfN(lookup_symbol)(struct preloaded_file *fp, elf_file_t ef, free(strp); if (sym.st_shndx != SHN_UNDEF || (sym.st_value != 0 && - ELF_ST_TYPE(sym.st_info) == STT_FUNC)) { + ELF_ST_TYPE(sym.st_info) == type)) { *symp = sym; return 0; } diff --git a/stand/i386/libi386/bootinfo.c b/stand/i386/libi386/bootinfo.c index 71e07cfb9702..57f926b76589 100644 --- a/stand/i386/libi386/bootinfo.c +++ b/stand/i386/libi386/bootinfo.c @@ -41,6 +41,16 @@ __FBSDID("$FreeBSD$"); void bi_load_vbe_data(struct preloaded_file *kfp) { + if (!gfx_state.tg_kernel_supported) { + /* + * Loaded kernel does not have vt/vbe backend, + * switch console to text mode. + */ + if (vbe_available()) + bios_set_text_mode(VGA_TEXT_MODE); + return; + } + if (vbe_available()) { file_addmetadata(kfp, MODINFOMD_VBE_FB, sizeof(gfx_state.tg_fb), &gfx_state.tg_fb); diff --git a/stand/loader.mk b/stand/loader.mk index cde7a31dca7e..3a38a9bc9e63 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -17,23 +17,32 @@ CFLAGS.pnglite.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "aarch64" SRCS+= load_elf64.c reloc_elf64.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "arm" SRCS+= load_elf32.c reloc_elf32.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c SRCS+= metadata.c +CFLAGS.load_elf32.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .elif ${MACHINE_CPUARCH} == "riscv" SRCS+= load_elf64.c reloc_elf64.c SRCS+= metadata.c +CFLAGS.load_elf64.c += -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:39: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 85723565CC3; Wed, 24 Feb 2021 18:39: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 4Dm4Sk09Csz4SCZ; Wed, 24 Feb 2021 18:39: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 715BE148E; Wed, 24 Feb 2021 18:39: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 11OId1c9091197; Wed, 24 Feb 2021 18:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OId1w6091196; Wed, 24 Feb 2021 18:39:01 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:39:01 GMT Message-Id: <202102241839.11OId1w6091196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 8305d6906fe9 - releng/13.0 - loader: unload command should reset tg_kernel_supported in gfx_state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 8305d6906fe983ae470184127b5e42cc6f91493a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:39:06 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=8305d6906fe983ae470184127b5e42cc6f91493a commit 8305d6906fe983ae470184127b5e42cc6f91493a Author: Toomas Soome AuthorDate: 2021-01-28 07:45:47 +0000 Commit: Toomas Soome CommitDate: 2021-02-23 07:42:26 +0000 loader: unload command should reset tg_kernel_supported in gfx_state While loading kernel, we check if vt/vbe backend support is included in kernel and set the tg_kernel_supported flag in gfx_state. unload command needs to reset this flag to allow next load to perform this check with new kernel. (cherry picked from commit 9b388ac30375ad4e0259b264a006753edcb2bd3c) Reported by: jhb Approved by: re (gjb) --- stand/common/module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/common/module.c b/stand/common/module.c index 247fc54b6021..34ffc10cded3 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -271,6 +271,8 @@ unload(void) } loadaddr = 0; unsetenv("kernelname"); + /* Reset tg_kernel_supported to allow next load to check it again. */ + gfx_state.tg_kernel_supported = false; } COMMAND_SET(unload, "unload", "unload all modules", command_unload); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 18:39: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 91718565F2B; Wed, 24 Feb 2021 18:39: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 4Dm4Sh2l7Xz4S90; Wed, 24 Feb 2021 18:39: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 5067813A7; Wed, 24 Feb 2021 18:39: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 11OId0sr091179; Wed, 24 Feb 2021 18:39:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OId0Ze091178; Wed, 24 Feb 2021 18:39:00 GMT (envelope-from git) Date: Wed, 24 Feb 2021 18:39:00 GMT Message-Id: <202102241839.11OId0Ze091178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: 6daafec20838 - releng/13.0 - Fix loader detection of vbefb support on !amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 6daafec2083848e2da210bd2183e6fb598944bd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 18:39:00 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=6daafec2083848e2da210bd2183e6fb598944bd2 commit 6daafec2083848e2da210bd2183e6fb598944bd2 Author: Dimitry Andric AuthorDate: 2021-01-27 21:28:43 +0000 Commit: Toomas Soome CommitDate: 2021-02-23 07:41:55 +0000 Fix loader detection of vbefb support on !amd64 On i386, after 6c7a932d0b8baaaee16eca0ba061bfa6e0e57bfd, the vbefb vt driver was no longer detected by the loader, if any kernel module was loaded after the kernel itself. This was caused by the parse_vt_drv_set() function being called multiple times, resetting the detection flag. (It was called multiple times, becuase i386 .ko files are shared objects like the kernel proper, while this is not the case on amd64.) Fix this by skipping the set_vt_drv_set lookup if vbefb was already detected. (cherry picked from commit 6e26189be406a9a3799074b16925e6cd63cc703b) Reviewed by: tsoome Approved by: re (gjb) --- stand/common/load_elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index 62fdb560ecff..8bb780ef34df 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -875,8 +875,8 @@ nosyms: ef->buckets = ef->hashtab + 2; ef->chains = ef->buckets + ef->nbuckets; - gfx_state.tg_kernel_supported = false; - if (__elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, + if (!gfx_state.tg_kernel_supported && + __elfN(lookup_symbol)(ef, "__start_set_vt_drv_set", &sym, STT_NOTYPE) == 0) { p_start = sym.st_value + ef->off; if (__elfN(lookup_symbol)(ef, "__stop_set_vt_drv_set", &sym, From owner-dev-commits-src-all@freebsd.org Wed Feb 24 19:41: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 15FDD567541; Wed, 24 Feb 2021 19:41: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 4Dm5rd09TJz4XXq; Wed, 24 Feb 2021 19:41: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 ECD732194; Wed, 24 Feb 2021 19:41: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 11OJfKRg079331; Wed, 24 Feb 2021 19:41:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OJfKQa079330; Wed, 24 Feb 2021 19:41:20 GMT (envelope-from git) Date: Wed, 24 Feb 2021 19:41:20 GMT Message-Id: <202102241941.11OJfKQa079330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1c1460747efd - stable/13 - Fix possibly unitialized variables in __cxa_demangle_gnu3() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1c1460747efd44eb74762b960883656b56134e30 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 19:41:21 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1c1460747efd44eb74762b960883656b56134e30 commit 1c1460747efd44eb74762b960883656b56134e30 Author: Dimitry Andric AuthorDate: 2021-02-22 20:01:09 +0000 Commit: Dimitry Andric CommitDate: 2021-02-24 19:39:15 +0000 Fix possibly unitialized variables in __cxa_demangle_gnu3() After 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 where I imported a more recent libcxxrt snapshot, the variables 'rtn' and 'has_ret' could in some cases be used while still uninitialized. Most obviously this would lead to a jemalloc complaint about a bad free(), aborting the program. Fix this by initializing a bunch variables in their declarations. This change has also been sent upstream, with some additional changes to be used in their testing framework. PR: 253226 (cherry picked from commit d149877758f162f0c777e7760164bf2c1f7a1bc1) --- contrib/libcxxrt/libelftc_dem_gnu3.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/contrib/libcxxrt/libelftc_dem_gnu3.c b/contrib/libcxxrt/libelftc_dem_gnu3.c index 6e88f7b4bb4c..93e1c41fa034 100644 --- a/contrib/libcxxrt/libelftc_dem_gnu3.c +++ b/contrib/libcxxrt/libelftc_dem_gnu3.c @@ -538,8 +538,8 @@ __cxa_demangle_gnu3(const char *org) struct type_delimit td; ssize_t org_len; unsigned int limit; - char *rtn; - bool has_ret, more_type; + char *rtn = NULL; + bool has_ret = false, more_type = false; if (org == NULL) return (NULL); @@ -562,13 +562,9 @@ __cxa_demangle_gnu3(const char *org) return (rtn); } - if (!cpp_demangle_data_init(&ddata, org + 2)) return (NULL); - rtn = NULL; - has_ret = more_type = false; - if (!cpp_demangle_read_encoding(&ddata)) goto clean; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 19:41: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 55244567803; Wed, 24 Feb 2021 19:41: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 4Dm5s120nfz4XWv; Wed, 24 Feb 2021 19:41: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 37D1A1F57; Wed, 24 Feb 2021 19:41: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 11OJffbP082695; Wed, 24 Feb 2021 19:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OJffnr082694; Wed, 24 Feb 2021 19:41:41 GMT (envelope-from git) Date: Wed, 24 Feb 2021 19:41:41 GMT Message-Id: <202102241941.11OJffnr082694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 64809c763b0c - stable/12 - Fix possibly unitialized variables in __cxa_demangle_gnu3() 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 64809c763b0c73fe488b61601670067056b07780 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 19:41:41 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=64809c763b0c73fe488b61601670067056b07780 commit 64809c763b0c73fe488b61601670067056b07780 Author: Dimitry Andric AuthorDate: 2021-02-22 20:01:09 +0000 Commit: Dimitry Andric CommitDate: 2021-02-24 19:39:57 +0000 Fix possibly unitialized variables in __cxa_demangle_gnu3() After 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 where I imported a more recent libcxxrt snapshot, the variables 'rtn' and 'has_ret' could in some cases be used while still uninitialized. Most obviously this would lead to a jemalloc complaint about a bad free(), aborting the program. Fix this by initializing a bunch variables in their declarations. This change has also been sent upstream, with some additional changes to be used in their testing framework. PR: 253226 (cherry picked from commit d149877758f162f0c777e7760164bf2c1f7a1bc1) --- contrib/libcxxrt/libelftc_dem_gnu3.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/contrib/libcxxrt/libelftc_dem_gnu3.c b/contrib/libcxxrt/libelftc_dem_gnu3.c index 6e88f7b4bb4c..93e1c41fa034 100644 --- a/contrib/libcxxrt/libelftc_dem_gnu3.c +++ b/contrib/libcxxrt/libelftc_dem_gnu3.c @@ -538,8 +538,8 @@ __cxa_demangle_gnu3(const char *org) struct type_delimit td; ssize_t org_len; unsigned int limit; - char *rtn; - bool has_ret, more_type; + char *rtn = NULL; + bool has_ret = false, more_type = false; if (org == NULL) return (NULL); @@ -562,13 +562,9 @@ __cxa_demangle_gnu3(const char *org) return (rtn); } - if (!cpp_demangle_data_init(&ddata, org + 2)) return (NULL); - rtn = NULL; - has_ret = more_type = false; - if (!cpp_demangle_read_encoding(&ddata)) goto clean; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 19:42: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 E0EED567742; Wed, 24 Feb 2021 19:42: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 4Dm5sf60gYz4XwQ; Wed, 24 Feb 2021 19:42: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 C02101DEC; Wed, 24 Feb 2021 19:42: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 11OJgEbC082888; Wed, 24 Feb 2021 19:42:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OJgELR082887; Wed, 24 Feb 2021 19:42:14 GMT (envelope-from git) Date: Wed, 24 Feb 2021 19:42:14 GMT Message-Id: <202102241942.11OJgELR082887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 696961f67c5e - stable/11 - Fix possibly unitialized variables in __cxa_demangle_gnu3() 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/stable/11 X-Git-Reftype: branch X-Git-Commit: 696961f67c5eaabe03713dbf1b4fc2b7a0ce1cb1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 19:42:14 -0000 The branch stable/11 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=696961f67c5eaabe03713dbf1b4fc2b7a0ce1cb1 commit 696961f67c5eaabe03713dbf1b4fc2b7a0ce1cb1 Author: Dimitry Andric AuthorDate: 2021-02-22 20:01:09 +0000 Commit: Dimitry Andric CommitDate: 2021-02-24 19:40:13 +0000 Fix possibly unitialized variables in __cxa_demangle_gnu3() After 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 where I imported a more recent libcxxrt snapshot, the variables 'rtn' and 'has_ret' could in some cases be used while still uninitialized. Most obviously this would lead to a jemalloc complaint about a bad free(), aborting the program. Fix this by initializing a bunch variables in their declarations. This change has also been sent upstream, with some additional changes to be used in their testing framework. PR: 253226 (cherry picked from commit d149877758f162f0c777e7760164bf2c1f7a1bc1) --- contrib/libcxxrt/libelftc_dem_gnu3.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/contrib/libcxxrt/libelftc_dem_gnu3.c b/contrib/libcxxrt/libelftc_dem_gnu3.c index 6e88f7b4bb4c..93e1c41fa034 100644 --- a/contrib/libcxxrt/libelftc_dem_gnu3.c +++ b/contrib/libcxxrt/libelftc_dem_gnu3.c @@ -538,8 +538,8 @@ __cxa_demangle_gnu3(const char *org) struct type_delimit td; ssize_t org_len; unsigned int limit; - char *rtn; - bool has_ret, more_type; + char *rtn = NULL; + bool has_ret = false, more_type = false; if (org == NULL) return (NULL); @@ -562,13 +562,9 @@ __cxa_demangle_gnu3(const char *org) return (rtn); } - if (!cpp_demangle_data_init(&ddata, org + 2)) return (NULL); - rtn = NULL; - has_ret = more_type = false; - if (!cpp_demangle_read_encoding(&ddata)) goto clean; From owner-dev-commits-src-all@freebsd.org Wed Feb 24 20:56: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 84BE2549405; Wed, 24 Feb 2021 20:56: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 4Dm7WJ3LWgz4d45; Wed, 24 Feb 2021 20:56: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 616E12F2F; Wed, 24 Feb 2021 20:56: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 11OKuSmo075429; Wed, 24 Feb 2021 20:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OKuSrC075428; Wed, 24 Feb 2021 20:56:28 GMT (envelope-from git) Date: Wed, 24 Feb 2021 20:56:28 GMT Message-Id: <202102242056.11OKuSrC075428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e2494f7561c8 - main - atomic: add atomic_interrupt_fence() 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/main X-Git-Reftype: branch X-Git-Commit: e2494f7561c852951d8ac567314f5e12f19ee7af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 20:56:28 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e2494f7561c852951d8ac567314f5e12f19ee7af commit e2494f7561c852951d8ac567314f5e12f19ee7af Author: Konstantin Belousov AuthorDate: 2021-02-23 22:12:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-24 20:45:24 +0000 atomic: add atomic_interrupt_fence() with the semantic following C11 signal_fence, that is, it establishes ordering between its place and any interrupt handler executing on the same CPU. Reviewed by: markj, mjg, rlibby Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28909 --- share/man/man9/atomic.9 | 13 ++++++++++++- sys/sys/atomic_common.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index 39a4fa9c6f96..397a8fcd6b18 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2019 +.Dd February 24, 2021 .Dt ATOMIC 9 .Os .Sh NAME @@ -31,6 +31,7 @@ .Nm atomic_cmpset , .Nm atomic_fcmpset , .Nm atomic_fetchadd , +.Nm atomic_interrupt_fence , .Nm atomic_load , .Nm atomic_readandclear , .Nm atomic_set , @@ -59,6 +60,8 @@ .Fc .Ft .Fn atomic_fetchadd_ "volatile *p" " v" +.Ft void +.Fn atomic_interrupt_fence "void" .Ft .Fn atomic_load_[acq_] "volatile *p" .Ft @@ -292,6 +295,14 @@ release stores, by separating access from ordering, they can sometimes facilitate more efficient implementations of synchronization primitives. For example, they can be used to avoid executing a memory barrier until a memory access shows that some condition is satisfied. +.Ss Interrupt Fence Operations +The +.Fn atomic_interrupt_fence() +function establishes ordering between its call location and any interrupt +handler executing on the same CPU. +It is modeled after the similar C11 function +.Fn atomic_signal_fence() , +and adapted for the kernel environment. .Ss Multiple Processors In multiprocessor systems, the atomicity of the atomic operations on memory depends on support for cache coherence in the underlying architecture. diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index 48f0a8b8939c..403b3de8a092 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -78,4 +78,6 @@ #define atomic_load_consume_ptr(p) \ ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) +#define atomic_interrupt_fence() __compiler_membar() + #endif From owner-dev-commits-src-all@freebsd.org Wed Feb 24 22:46: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 62C2F54B9E5; Wed, 24 Feb 2021 22:46: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 4Dm9yf0yWYz4kYk; Wed, 24 Feb 2021 22:46: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 13E264177; Wed, 24 Feb 2021 22:46: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 11OMknQT020371; Wed, 24 Feb 2021 22:46:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11OMknLT020370; Wed, 24 Feb 2021 22:46:49 GMT (envelope-from git) Date: Wed, 24 Feb 2021 22:46:49 GMT Message-Id: <202102242246.11OMknLT020370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: cc3fa1e29fda - main - Fix crash with rtadv-originated multipath IPv6 routes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc3fa1e29fda2cc761e793a61cef3bd2522b3468 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 22:46:50 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=cc3fa1e29fda2cc761e793a61cef3bd2522b3468 commit cc3fa1e29fda2cc761e793a61cef3bd2522b3468 Author: Alexander V. Chernikov AuthorDate: 2021-02-24 16:42:48 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-24 16:44:10 +0000 Fix crash with rtadv-originated multipath IPv6 routes. PR: 253800 Reported by: Frederic Denis MFC after: immediately --- sys/netinet6/nd6_rtr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 51b831a956bc..2f721b4edcc3 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -699,7 +698,7 @@ defrouter_addreq(struct nd_defrouter *new) NET_EPOCH_ASSERT(); error = rib_action(fibnum, RTM_ADD, &info, &rc); if (error == 0) { - struct nhop_object *nh = nhop_select(rc.rc_nh_new, 0); + struct nhop_object *nh = nhop_select_func(rc.rc_nh_new, 0); rt_routemsg(RTM_ADD, rc.rc_rt, nh, fibnum); new->installed = 1; } @@ -739,7 +738,7 @@ defrouter_delreq(struct nd_defrouter *dr) NET_EPOCH_ENTER(et); error = rib_action(fibnum, RTM_DELETE, &info, &rc); if (error == 0) { - struct nhop_object *nh = nhop_select(rc.rc_nh_old, 0); + struct nhop_object *nh = nhop_select_func(rc.rc_nh_old, 0); rt_routemsg(RTM_DELETE, rc.rc_rt, nh, fibnum); } NET_EPOCH_EXIT(et); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:26: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 8B5BA54C835; Wed, 24 Feb 2021 23:26: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 4DmBrd2qL0z4mT4; Wed, 24 Feb 2021 23:26: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 4FBF8519E; Wed, 24 Feb 2021 23:26: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 11ONQf6V073135; Wed, 24 Feb 2021 23:26:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONQfWA073134; Wed, 24 Feb 2021 23:26:41 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:26:41 GMT Message-Id: <202102242326.11ONQfWA073134@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: 6dd69f0064f1 - main - iflib: introduce isc_dma_width 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: 6dd69f0064f1e54671cdb46ce5975a332fb761e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:26:41 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=6dd69f0064f1e54671cdb46ce5975a332fb761e8 commit 6dd69f0064f1e54671cdb46ce5975a332fb761e8 Author: Marcin Wojtas AuthorDate: 2021-02-24 22:56:45 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-24 23:25:39 +0000 iflib: introduce isc_dma_width Some DMA controllers are unable to address the full host memory space and are instead limited to a subset of address range (e.g. 48-bit). Allow the driver to specify the maximum allowed DMA addressing width (in bits) for the NIC hardware, by introducing a new field in if_softc_ctx. If said field is omitted (set to 0), the lowaddr of DMA window bounds defaults to BUS_SPACE_MAXADDR. Submitted by: Artur Rojek Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D28706 --- sys/net/iflib.c | 23 +++++++++++++++++++---- sys/net/iflib.h | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 5366b652373d..6fd0ee3751f0 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1389,15 +1389,22 @@ _iflib_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) *(bus_addr_t *) arg = segs[0].ds_addr; } +#define DMA_WIDTH_TO_BUS_LOWADDR(width) \ + (((width) == 0) || (width) == flsl(BUS_SPACE_MAXADDR) ? \ + BUS_SPACE_MAXADDR : (1ULL << (width)) - 1ULL) + int iflib_dma_alloc_align(if_ctx_t ctx, int size, int align, iflib_dma_info_t dma, int mapflags) { int err; device_t dev = ctx->ifc_dev; + bus_addr_t lowaddr; + + lowaddr = DMA_WIDTH_TO_BUS_LOWADDR(ctx->ifc_softc_ctx.isc_dma_width); err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ align, 0, /* alignment, bounds */ - BUS_SPACE_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ size, /* maxsize */ @@ -1648,6 +1655,7 @@ iflib_txsd_alloc(iflib_txq_t txq) if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; device_t dev = ctx->ifc_dev; bus_size_t tsomaxsize; + bus_addr_t lowaddr; int err, nsegments, ntsosegments; bool tso; @@ -1664,12 +1672,14 @@ iflib_txsd_alloc(iflib_txq_t txq) MPASS(sctx->isc_tso_maxsize >= tsomaxsize); } + lowaddr = DMA_WIDTH_TO_BUS_LOWADDR(scctx->isc_dma_width); + /* * Set up DMA tags for TX buffers. */ if ((err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, /* alignment, bounds */ - BUS_SPACE_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sctx->isc_tx_maxsize, /* maxsize */ @@ -1687,7 +1697,7 @@ iflib_txsd_alloc(iflib_txq_t txq) tso = (if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) != 0; if (tso && (err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, /* alignment, bounds */ - BUS_SPACE_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ tsomaxsize, /* maxsize */ @@ -1889,18 +1899,21 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; device_t dev = ctx->ifc_dev; iflib_fl_t fl; + bus_addr_t lowaddr; int err; MPASS(scctx->isc_nrxd[0] > 0); MPASS(scctx->isc_nrxd[rxq->ifr_fl_offset] > 0); + lowaddr = DMA_WIDTH_TO_BUS_LOWADDR(scctx->isc_dma_width); + fl = rxq->ifr_fl; for (int i = 0; i < rxq->ifr_nfl; i++, fl++) { fl->ifl_size = scctx->isc_nrxd[rxq->ifr_fl_offset]; /* this isn't necessarily the same */ /* Set up DMA tag for RX buffers. */ err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, 0, /* alignment, bounds */ - BUS_SPACE_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sctx->isc_rx_maxsize, /* maxsize */ @@ -4748,6 +4761,8 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct _iflib_pre_assert(scctx); ctx->ifc_txrx = *scctx->isc_txrx; + MPASS(scctx->isc_dma_width <= flsl(BUS_SPACE_MAXADDR)); + if (sctx->isc_flags & IFLIB_DRIVER_MEDIA) ctx->ifc_mediap = scctx->isc_media; diff --git a/sys/net/iflib.h b/sys/net/iflib.h index a30740e67b6e..95305850f7d3 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -236,6 +236,8 @@ typedef struct if_softc_ctx { int isc_disable_msix; if_txrx_t isc_txrx; struct ifmedia *isc_media; + bus_size_t isc_dma_width; /* device dma width in bits, 0 means + use BUS_SPACE_MAXADDR instead */ } *if_softc_ctx_t; /* From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:26: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 9FDD054C83C; Wed, 24 Feb 2021 23:26: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 4DmBrf3kJ0z4mR0; Wed, 24 Feb 2021 23:26: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 72E374F5B; Wed, 24 Feb 2021 23:26: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 11ONQgMC073153; Wed, 24 Feb 2021 23:26:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONQg18073152; Wed, 24 Feb 2021 23:26:42 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:26:42 GMT Message-Id: <202102242326.11ONQg18073152@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: cd992885bcdf - main - Disable PIE for MIPS ubldr 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: cd992885bcdfb3c2c6b761f5c3bf1c86949acdc3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:26:42 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=cd992885bcdfb3c2c6b761f5c3bf1c86949acdc3 commit cd992885bcdfb3c2c6b761f5c3bf1c86949acdc3 Author: Marcin Wojtas AuthorDate: 2021-02-12 15:41:49 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-24 23:26:11 +0000 Disable PIE for MIPS ubldr When performing buildworld for MIPS with PIE enabled, the build fails with "position-independent code requires '-mabicalls'" message. -mno-abicalls and -fno-pic flags are explicitly set in MIPS ubldr makefile, so to work around this problem, set MK_PIE=no for MIPS ubldr. Submitted by: Dawid Gorecki Reviewed by: emaste Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28370 --- stand/mips/uboot/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stand/mips/uboot/Makefile b/stand/mips/uboot/Makefile index 1162b7fed3b0..984582027de5 100644 --- a/stand/mips/uboot/Makefile +++ b/stand/mips/uboot/Makefile @@ -44,6 +44,10 @@ LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} +# ubldr on MIPS is built with '-mno-abicalls' flag, +# which is incompatible with PIE +MK_PIE= no + ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:26: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 AC75454C465; Wed, 24 Feb 2021 23:26: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 4DmBrg4SPRz4m8b; Wed, 24 Feb 2021 23:26: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 8B939512E; Wed, 24 Feb 2021 23:26: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 11ONQhhX073176; Wed, 24 Feb 2021 23:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONQhk4073175; Wed, 24 Feb 2021 23:26:43 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:26:43 GMT Message-Id: <202102242326.11ONQhk4073175@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: 3aa023643e9d - main - Disable PIE for powerpc bootloaders. 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: 3aa023643e9db78f4da314ff9bfb1643533c004f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:26:43 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=3aa023643e9db78f4da314ff9bfb1643533c004f commit 3aa023643e9db78f4da314ff9bfb1643533c004f Author: Marcin Wojtas AuthorDate: 2021-02-23 12:42:26 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-24 23:26:11 +0000 Disable PIE for powerpc bootloaders. Bootloaders for powerpc are not built as position independent code. Since bsd.prog.mk is used for building, when PIE is enabled, the PIE flags are added and that causes the build to fail. Adding MK_PIE=no stops bsd.prog.mk from adding PIE specific flags. Submitted by: Dawid Gorecki Reviewed by: emaste Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28893 --- stand/powerpc/boot1.chrp/Makefile | 2 ++ stand/powerpc/kboot/Makefile | 2 ++ stand/powerpc/ofw/Makefile | 2 ++ stand/powerpc/uboot/Makefile | 2 ++ 4 files changed, 8 insertions(+) diff --git a/stand/powerpc/boot1.chrp/Makefile b/stand/powerpc/boot1.chrp/Makefile index e2f1739a4f4e..928f30e7eabb 100644 --- a/stand/powerpc/boot1.chrp/Makefile +++ b/stand/powerpc/boot1.chrp/Makefile @@ -43,5 +43,7 @@ boot1.hfs: boot1.elf bootinfo.txt CLEANFILES+= boot1.hfs +MK_PIE= no + .include diff --git a/stand/powerpc/kboot/Makefile b/stand/powerpc/kboot/Makefile index 8b632ae3d076..a5e43ab6fdaa 100644 --- a/stand/powerpc/kboot/Makefile +++ b/stand/powerpc/kboot/Makefile @@ -42,4 +42,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} +MK_PIE= no + .include diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile index a35a7c7c56bf..7c2e97ebb382 100644 --- a/stand/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -53,4 +53,6 @@ CFLAGS+= -I${BOOTSRC}/libofw DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} +MK_PIE= no + .include diff --git a/stand/powerpc/uboot/Makefile b/stand/powerpc/uboot/Makefile index 9124507397ad..b0635104e454 100644 --- a/stand/powerpc/uboot/Makefile +++ b/stand/powerpc/uboot/Makefile @@ -31,4 +31,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +MK_PIE= no + .include From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:26: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 77F1154C9DB; Wed, 24 Feb 2021 23:26: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 4DmBrh6R4cz4mHn; Wed, 24 Feb 2021 23:26: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 B04F34F5C; Wed, 24 Feb 2021 23:26: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 11ONQic5073198; Wed, 24 Feb 2021 23:26:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONQikl073197; Wed, 24 Feb 2021 23:26:44 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:26:44 GMT Message-Id: <202102242326.11ONQikl073197@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: 9a227a2fd642 - main - Enable PIE by default on 64-bit architectures 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: 9a227a2fd642ec057a0ec70d67d5699d65553294 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:26:45 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=9a227a2fd642ec057a0ec70d67d5699d65553294 commit 9a227a2fd642ec057a0ec70d67d5699d65553294 Author: Marcin Wojtas AuthorDate: 2021-01-22 12:13:03 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-24 23:26:11 +0000 Enable PIE by default on 64-bit architectures This patch adds Position Independent Executables (PIE) flags for building OS. It allows to enable the ASLR feature based only on the sysctl knobs, without need to rebuild the image. Tests showed that no problems with stability / performance degradation were seen when using PIEs with ASLR disabled. The change is limited only for 64-bit architectures. Use bsd.opts.mk instead of the src.opts.mk in order to satisfy all build dependencies related to MK_PIE. Reviewed by: emaste, imp Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28328 --- share/mk/bsd.opts.mk | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 88c73cc6bfe4..9f9889d0a0f0 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -75,7 +75,6 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_PATTERN \ INIT_ALL_ZERO \ INSTALL_AS_USER \ - PIE \ RETPOLINE \ STALE_STAGED @@ -85,6 +84,21 @@ __DEFAULT_DEPENDENT_OPTIONS = \ STAGING_PROG/STAGING \ STALE_STAGED/STAGING \ +# +# Default to disabling PIE on 32-bit architectures. The small address space +# means that ASLR is of limited effectiveness, and it may cause issues with +# some memory-hungry workloads. +# +.if ${MACHINE_ARCH} == "armv6" || ${MACHINE_ARCH} == "armv7" \ + || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "mips" \ + || ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipselhf" \ + || ${MACHINE_ARCH} == "mipshf" || ${MACHINE_ARCH} == "mipsn32" \ + || ${MACHINE_ARCH} == "mipsn32el" || ${MACHINE_ARCH} == "powerpc" \ + || ${MACHINE_ARCH} == "powerpcspe" +__DEFAULT_NO_OPTIONS+= PIE +.else +__DEFAULT_YES_OPTIONS+=PIE +.endif .include From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:59: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 5ECB454D91E; Wed, 24 Feb 2021 23:59: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 4DmCZ62FNVz4pVK; Wed, 24 Feb 2021 23:59: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 3556957BC; Wed, 24 Feb 2021 23:59: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 11ONxApr012917; Wed, 24 Feb 2021 23:59:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONxAvU012916; Wed, 24 Feb 2021 23:59:10 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:59:10 GMT Message-Id: <202102242359.11ONxAvU012916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 14b5a3c7d5c0 - main - vm pqbatch: move unmanaged page assert under pagequeue lock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14b5a3c7d5c034c2a5a487b5e2d0de79c2801a65 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:59:10 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=14b5a3c7d5c034c2a5a487b5e2d0de79c2801a65 commit 14b5a3c7d5c034c2a5a487b5e2d0de79c2801a65 Author: Max Laier AuthorDate: 2021-02-24 23:56:16 +0000 Commit: Ryan Libby CommitDate: 2021-02-24 23:56:16 +0000 vm pqbatch: move unmanaged page assert under pagequeue lock This KASSERT is overzealous because of the following race condition: 1) A managed page which is currently in PQ_LAUNDRY is freed. vm_page_free_prep calls vm_page_dequeue_deferred() The page state is: PQ_LAUNDRY, PGA_DEQUEUE|PGA_ENQUEUED 2) The laundry worker comes around and pick up the page and calls vm_pageout_defer(m, PQ_LAUNDRY, true) to check if page is still in the queue. We do a vm_page_astate_load and get PQ_LAUNDRY, PGA_DEQUEUE|PGA_ENQUEUED as per above. 3) The laundry worker is pre-empted and another thread allocates our page from the free pool. For example vm_page_alloc_domain_after calls vm_page_dequeue() and sets VPO_UNMANAGED because we are allocating for an OBJT_UNMANAGED object. The page state is: PQ_NONE, 0 - VPO_UNMANAGED 4) The laundry worker resumes, and processes vm_pageout_defer based on the stale astate which leads to a call to vm_page_pqbatch_submit, which will trip on the KASSERT. Submitted by: mlaier Reviewed by: markj, rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28563 --- sys/vm/vm_page.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index c36b8cdc5762..20fbbc304490 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -3545,9 +3545,8 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m, uint8_t queue) counter_u64_add(queue_nops, 1); break; } - KASSERT(old.queue != PQ_NONE || - (old.flags & PGA_QUEUE_STATE_MASK) == 0, - ("%s: page %p has unexpected queue state", __func__, m)); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("%s: page %p is unmanaged", __func__, m)); new = old; if ((old.flags & PGA_DEQUEUE) != 0) { @@ -3594,8 +3593,6 @@ vm_page_pqbatch_submit(vm_page_t m, uint8_t queue) struct vm_pagequeue *pq; int domain; - KASSERT((m->oflags & VPO_UNMANAGED) == 0, - ("page %p is unmanaged", m)); KASSERT(queue < PQ_COUNT, ("invalid queue %d", queue)); domain = vm_page_domain(m); From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:59: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 681F054DA1B; Wed, 24 Feb 2021 23:59: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 4DmCZ72Y8tz4pSg; Wed, 24 Feb 2021 23:59: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 4B04C59E5; Wed, 24 Feb 2021 23:59: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 11ONxBMj012940; Wed, 24 Feb 2021 23:59:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONxBYv012939; Wed, 24 Feb 2021 23:59:11 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:59:11 GMT Message-Id: <202102242359.11ONxBYv012939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: d85c9cef1380 - main - ddb: reliably fail with ambiguous commands MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d85c9cef1380f4f135aee95ad8c1f4d3eca74c5b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:59:11 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=d85c9cef1380f4f135aee95ad8c1f4d3eca74c5b commit d85c9cef1380f4f135aee95ad8c1f4d3eca74c5b Author: Ryan Libby AuthorDate: 2021-02-24 23:56:16 +0000 Commit: Ryan Libby CommitDate: 2021-02-24 23:56:16 +0000 ddb: reliably fail with ambiguous commands db_cmd_match had an even/odd bug, where if a third command was partially matched (or any odd number greater than one) the search result would be set back from CMD_AMBIGUOUS to CMD_FOUND, causing the last command in the list to be executed instead of failing the match. Reported by: mlaier Reviewed by: markj, mlaier, vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28659 --- sys/ddb/db_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index fedec1dd33a4..e1f822ef44d8 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -293,7 +293,7 @@ db_cmd_match(char *name, struct command *cmd, struct command **cmdp, *resultp = CMD_AMBIGUOUS; /* but keep looking for a full match - this lets us match single letters */ - } else { + } else if (*resultp == CMD_NONE) { *cmdp = cmd; *resultp = CMD_FOUND; } From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:59: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 BC8BC54D93E; Wed, 24 Feb 2021 23:59: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 4DmCZ94Rs5z4pY5; Wed, 24 Feb 2021 23:59: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 8912957BD; Wed, 24 Feb 2021 23:59: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 11ONxDMI012980; Wed, 24 Feb 2021 23:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONxD8B012979; Wed, 24 Feb 2021 23:59:13 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:59:13 GMT Message-Id: <202102242359.11ONxD8B012979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: bf667f282a7b - main - ofed: quiet gcc -Wint-in-bool-context MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf667f282a7b98e7456d11e1cb46d9707ab8e774 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:59:14 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=bf667f282a7b98e7456d11e1cb46d9707ab8e774 commit bf667f282a7b98e7456d11e1cb46d9707ab8e774 Author: Ryan Libby AuthorDate: 2021-02-24 23:56:16 +0000 Commit: Ryan Libby CommitDate: 2021-02-24 23:56:16 +0000 ofed: quiet gcc -Wint-in-bool-context The int in the argument to the ternary triggered -Wint-in-bool-context from gcc. Upstream linux has a larger and more entangled patch, 12f727721eee61b3d19dedb95cb893b2baa9fe41, which doesn't apply cleanly. When we eventually sync that, we can just drop this change. Reviewed by: hselasky, imp, kib MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28762 --- sys/ofed/drivers/infiniband/core/uverbs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/ofed/drivers/infiniband/core/uverbs.h b/sys/ofed/drivers/infiniband/core/uverbs.h index 6c8d9632b0dc..0db0d47cc691 100644 --- a/sys/ofed/drivers/infiniband/core/uverbs.h +++ b/sys/ofed/drivers/infiniband/core/uverbs.h @@ -64,8 +64,10 @@ #define INIT_UDATA_BUF_OR_NULL(udata, ibuf, obuf, ilen, olen) \ do { \ - (udata)->inbuf = (ilen) ? (const void __user *) (ibuf) : NULL; \ - (udata)->outbuf = (olen) ? (void __user *) (obuf) : NULL; \ + (udata)->inbuf = ((ilen) != 0) ? \ + (const void __user *) (ibuf) : NULL; \ + (udata)->outbuf = ((olen) != 0) ? \ + (void __user *) (obuf) : NULL; \ (udata)->inlen = (ilen); \ (udata)->outlen = (olen); \ } while (0) From owner-dev-commits-src-all@freebsd.org Wed Feb 24 23:59: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 4506E54D76A; Wed, 24 Feb 2021 23:59: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 4DmCZ85bn8z4pdC; Wed, 24 Feb 2021 23:59: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 786A254D1; Wed, 24 Feb 2021 23:59: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 11ONxCU8012962; Wed, 24 Feb 2021 23:59:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ONxCSi012961; Wed, 24 Feb 2021 23:59:12 GMT (envelope-from git) Date: Wed, 24 Feb 2021 23:59:12 GMT Message-Id: <202102242359.11ONxCSi012961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: d8404b7ec36d - main - ddb: just move cursor when the lexer backs up MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8404b7ec36d4974e7ac586df1d74be4ef6b141e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 24 Feb 2021 23:59:13 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=d8404b7ec36d4974e7ac586df1d74be4ef6b141e commit d8404b7ec36d4974e7ac586df1d74be4ef6b141e Author: Ryan Libby AuthorDate: 2021-02-24 23:56:16 +0000 Commit: Ryan Libby CommitDate: 2021-02-24 23:56:16 +0000 ddb: just move cursor when the lexer backs up Get rid of db_look_char because it's not compatible with db_get_line(). This fixes the following issue: db> script lockinfo=show alllocks db> run lockinfo db:0:lockinfo> how alllocks No such command; use "help" to list available commands Reported by: markj Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28725 --- sys/ddb/db_lex.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/sys/ddb/db_lex.c b/sys/ddb/db_lex.c index 457790ee8605..215e7cd7f2ab 100644 --- a/sys/ddb/db_lex.c +++ b/sys/ddb/db_lex.c @@ -97,18 +97,12 @@ db_flush_line() db_endlp = db_line; } -static int db_look_char = 0; - static int db_read_char(void) { int c; - if (db_look_char != 0) { - c = db_look_char; - db_look_char = 0; - } - else if (db_lp >= db_endlp) + if (db_lp >= db_endlp) c = -1; else c = *db_lp++; @@ -116,10 +110,22 @@ db_read_char(void) } static void -db_unread_char(c) - int c; +db_unread_char(int c) { - db_look_char = c; + + if (c == -1) { + /* Unread EOL at EOL is okay. */ + if (db_lp < db_endlp) + db_error("db_unread_char(-1) before end of line\n"); + } else { + if (db_lp > db_line) { + db_lp--; + if (*db_lp != c) + db_error("db_unread_char() wrong char\n"); + } else { + db_error("db_unread_char() at beginning of line\n"); + } + } } static int db_look_token = 0; @@ -155,7 +161,6 @@ void db_flush_lex(void) { db_flush_line(); - db_look_char = 0; db_look_token = 0; } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 01:35: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 A488C5520A2; Thu, 25 Feb 2021 01:35: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 4DmFjn4GdDz3CwJ; Thu, 25 Feb 2021 01:35: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 858086CB9; Thu, 25 Feb 2021 01:35: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 11P1Zvr1045574; Thu, 25 Feb 2021 01:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P1ZvhN045573; Thu, 25 Feb 2021 01:35:57 GMT (envelope-from git) Date: Thu, 25 Feb 2021 01:35:57 GMT Message-Id: <202102250135.11P1ZvhN045573@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: ef567155d35f - main - Fix powerpc build after 6dd69f0064f1 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: ef567155d35fd8f783d9b907e9a2765640a11527 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 01:35:57 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=ef567155d35fd8f783d9b907e9a2765640a11527 commit ef567155d35fd8f783d9b907e9a2765640a11527 Author: Marcin Wojtas AuthorDate: 2021-02-25 01:29:33 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-25 01:35:41 +0000 Fix powerpc build after 6dd69f0064f1 Commit 6dd69f0064f1 ("iflib: introduce isc_dma_width") failed to build on powerpc due to implicit type conversion error. Fix that. Submitted by: Artur Rojek Obtained from: Semihalf Sponsored by: Amazon, Inc. --- sys/net/iflib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 6fd0ee3751f0..a7d5a8c24658 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1390,7 +1390,7 @@ _iflib_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) } #define DMA_WIDTH_TO_BUS_LOWADDR(width) \ - (((width) == 0) || (width) == flsl(BUS_SPACE_MAXADDR) ? \ + (((width) == 0) || (width) == flsll(BUS_SPACE_MAXADDR) ? \ BUS_SPACE_MAXADDR : (1ULL << (width)) - 1ULL) int @@ -4761,7 +4761,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct _iflib_pre_assert(scctx); ctx->ifc_txrx = *scctx->isc_txrx; - MPASS(scctx->isc_dma_width <= flsl(BUS_SPACE_MAXADDR)); + MPASS(scctx->isc_dma_width <= flsll(BUS_SPACE_MAXADDR)); if (sctx->isc_flags & IFLIB_DRIVER_MEDIA) ctx->ifc_mediap = scctx->isc_media; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 01:40: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 350845524FA; Thu, 25 Feb 2021 01:40: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 4DmFqC14T8z3DbZ; Thu, 25 Feb 2021 01:40: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 17C8369FD; Thu, 25 Feb 2021 01:40: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 11P1edpT055879; Thu, 25 Feb 2021 01:40:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P1edYs055878; Thu, 25 Feb 2021 01:40:39 GMT (envelope-from git) Date: Thu, 25 Feb 2021 01:40:39 GMT Message-Id: <202102250140.11P1edYs055878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 1f3cff343b45 - stable/13 - cxgb(4): Rework my commit 9dc7c250. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f3cff343b451d9fc9c10f4f8c4b416ed5eae23f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 01:40:39 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1f3cff343b451d9fc9c10f4f8c4b416ed5eae23f commit 1f3cff343b451d9fc9c10f4f8c4b416ed5eae23f Author: Alexander Motin AuthorDate: 2021-02-22 22:21:05 +0000 Commit: Alexander Motin CommitDate: 2021-02-25 01:40:29 +0000 cxgb(4): Rework my commit 9dc7c250. The previous implementation was reported to try to coalesce packets in situations when it should not, that resulted in assertion later. This implementation better checks the first packet of the chain for the coallescing elligibility. (cherry picked from commit d510bf133d045d6c83742aeda6949bec150f6cbf) --- sys/dev/cxgb/cxgb_sge.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 491d1a751f4a..f13d2f03180c 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -312,20 +312,22 @@ set_wr_hdr(struct work_request_hdr *wrp, uint32_t wr_hi, uint32_t wr_lo) struct coalesce_info { int count; int nbytes; + int noncoal; }; static int coalesce_check(struct mbuf *m, void *arg) { struct coalesce_info *ci = arg; - int *count = &ci->count; - int *nbytes = &ci->nbytes; - - if ((*nbytes == 0) || ((*nbytes + m->m_len <= 10500) && - (*count < 7) && (m->m_next == NULL) && - ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE))) { - *count += 1; - *nbytes += m->m_len; + + if ((m->m_next != NULL) || + ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len > PAGE_SIZE)) + ci->noncoal = 1; + + if ((ci->count == 0) || (ci->noncoal == 0 && (ci->count < 7) && + (ci->nbytes + m->m_len <= 10500))) { + ci->count++; + ci->nbytes += m->m_len; return (1); } return (0); @@ -342,7 +344,7 @@ cxgb_dequeue(struct sge_qset *qs) return TXQ_RING_DEQUEUE(qs); m_head = m_tail = NULL; - ci.count = ci.nbytes = 0; + ci.count = ci.nbytes = ci.noncoal = 0; do { m = TXQ_RING_DEQUEUE_COND(qs, coalesce_check, &ci); if (m_head == NULL) { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 01:41: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 7139C551EEE; Thu, 25 Feb 2021 01:41: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 4DmFqh2r94z3Dyp; Thu, 25 Feb 2021 01:41: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 546006CC3; Thu, 25 Feb 2021 01:41: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 11P1f4oh056942; Thu, 25 Feb 2021 01:41:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P1f4xc056941; Thu, 25 Feb 2021 01:41:04 GMT (envelope-from git) Date: Thu, 25 Feb 2021 01:41:04 GMT Message-Id: <202102250141.11P1f4xc056941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 2eb9b105f3e4 - stable/12 - cxgb(4): Rework my commit 9dc7c250. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2eb9b105f3e473e1438944cc95e36d7912b3296e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 01:41:04 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2eb9b105f3e473e1438944cc95e36d7912b3296e commit 2eb9b105f3e473e1438944cc95e36d7912b3296e Author: Alexander Motin AuthorDate: 2021-02-22 22:21:05 +0000 Commit: Alexander Motin CommitDate: 2021-02-25 01:40:56 +0000 cxgb(4): Rework my commit 9dc7c250. The previous implementation was reported to try to coalesce packets in situations when it should not, that resulted in assertion later. This implementation better checks the first packet of the chain for the coallescing elligibility. (cherry picked from commit d510bf133d045d6c83742aeda6949bec150f6cbf) --- sys/dev/cxgb/cxgb_sge.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 489d74459ae1..07eb91a4d04c 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -312,20 +312,22 @@ set_wr_hdr(struct work_request_hdr *wrp, uint32_t wr_hi, uint32_t wr_lo) struct coalesce_info { int count; int nbytes; + int noncoal; }; static int coalesce_check(struct mbuf *m, void *arg) { struct coalesce_info *ci = arg; - int *count = &ci->count; - int *nbytes = &ci->nbytes; - - if ((*nbytes == 0) || ((*nbytes + m->m_len <= 10500) && - (*count < 7) && (m->m_next == NULL) && - ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE))) { - *count += 1; - *nbytes += m->m_len; + + if ((m->m_next != NULL) || + ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len > PAGE_SIZE)) + ci->noncoal = 1; + + if ((ci->count == 0) || (ci->noncoal == 0 && (ci->count < 7) && + (ci->nbytes + m->m_len <= 10500))) { + ci->count++; + ci->nbytes += m->m_len; return (1); } return (0); @@ -342,7 +344,7 @@ cxgb_dequeue(struct sge_qset *qs) return TXQ_RING_DEQUEUE(qs); m_head = m_tail = NULL; - ci.count = ci.nbytes = 0; + ci.count = ci.nbytes = ci.noncoal = 0; do { m = TXQ_RING_DEQUEUE_COND(qs, coalesce_check, &ci); if (m_head == NULL) { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 02:25: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 F00055536C5; Thu, 25 Feb 2021 02:25: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 4DmGpf6Qwjz3H99; Thu, 25 Feb 2021 02:25: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 CFCEC7716; Thu, 25 Feb 2021 02:25: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 11P2PECK011967; Thu, 25 Feb 2021 02:25:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P2PE1I011966; Thu, 25 Feb 2021 02:25:14 GMT (envelope-from git) Date: Thu, 25 Feb 2021 02:25:14 GMT Message-Id: <202102250225.11P2PE1I011966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: 1ca8842f3ad9 - main - Use makefs(8) in release VM-image generation instead of md(4) and newfs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ca8842f3ad9725863c9affc044d1974a51818a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 02:25:15 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=1ca8842f3ad9725863c9affc044d1974a51818a9 commit 1ca8842f3ad9725863c9affc044d1974a51818a9 Author: Nathan Whitehorn AuthorDate: 2021-02-25 02:16:56 +0000 Commit: Nathan Whitehorn CommitDate: 2021-02-25 02:16:56 +0000 Use makefs(8) in release VM-image generation instead of md(4) and newfs. Using makefs instead reduces the privileges needed to build VM images, simplifies the script (no need to copy files to a fresh image at the end), and improves portability by allowing generation of cross-endian images. As a result of the last, this patch also adds support for generation of powerpc64 and powerpc64le VM images. No other changes to the output. Tested and working for both amd64 and powerpc64 targets. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D28912 --- release/scripts/mk-vmimage.sh | 2 - release/tools/vmimage.subr | 177 ++++++++++++++++++------------------------ 2 files changed, 77 insertions(+), 102 deletions(-) diff --git a/release/scripts/mk-vmimage.sh b/release/scripts/mk-vmimage.sh index cf795e04655b..d5985ceb0d25 100755 --- a/release/scripts/mk-vmimage.sh +++ b/release/scripts/mk-vmimage.sh @@ -93,8 +93,6 @@ main() { . "${VMCONFIG}" fi - ROOTLABEL="gpt" - vm_create_base vm_install_base vm_extra_install_base diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 7bd971013656..6e0c1ea633e2 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -12,70 +12,17 @@ scriptdir=$(dirname $(realpath $0)) export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" trap "cleanup" INT QUIT TRAP ABRT TERM -write_partition_layout() { - if [ -z "${NOSWAP}" ]; then - SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" - fi - - BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - WITH_UNIFIED_OBJDIR=yes \ - make -C ${WORLDDIR}/stand -V .OBJDIR)" - BOOTFILES="$(realpath ${BOOTFILES})" - - case "${TARGET}:${TARGET_ARCH}" in - amd64:amd64 | i386:i386) - ESP=yes - SCHEME=gpt - BOOTPARTS="-b ${BOOTFILES}/i386/pmbr/pmbr \ - -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot" - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" - ;; - arm64:aarch64 | riscv:riscv64*) - ESP=yes - SCHEME=gpt - BOOTPARTS= - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" - ;; - powerpc:powerpc*) - ESP=no - SCHEME=apm - BOOTPARTS="-p apple-boot/bootfs:=${BOOTFILES}/powerpc/boot1.chrp/boot1.hfs" - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" - ;; - *) - echo "vmimage.subr: unsupported target '${TARGET}:${TARGET_ARCH}'" >&2 - exit 1 - ;; - esac - - if [ ${ESP} = "yes" ]; then - # Create an ESP - espfilename=$(mktemp /tmp/efiboot.XXXXXX) - make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi - BOOTPARTS="${BOOTPARTS} -p efi/efiesp:=${espfilename}" - - # Add this to fstab, requires temporarily remounting the fs - mddev=$(mdconfig -f ${VMBASE}) - mount /dev/${mddev} ${DESTDIR} - mkdir -p ${DESTDIR}/boot/efi - echo "/dev/${ROOTLABEL}/efiesp /boot/efi msdosfs rw 2 2" \ - >> ${DESTDIR}/etc/fstab - umount ${DESTDIR} - mdconfig -d -u ${mddev} - fi - - mkimg -s ${SCHEME} -f ${VMFORMAT} \ - ${BOOTPARTS} \ - ${SWAPOPT} \ - ${ROOTFSPART} \ - -o ${VMIMAGE} - - if [ ${ESP} = "yes" ]; then - rm ${espfilename} - fi - - return 0 -} +# Platform-specific large-scale setup +# Most platforms use GPT, so put that as default, then special cases +PARTSCHEME=gpt +ROOTLABEL="gpt" +case "${TARGET}:${TARGET_ARCH}" in + powerpc:powerpc*) + PARTSCHEME=mbr + ROOTLABEL="ufs" + NOSWAP=yes # Can't label swap partition with MBR, so no swap + ;; +esac err() { printf "${@}\n" @@ -87,10 +34,6 @@ cleanup() { if [ -c "${DESTDIR}/dev/null" ]; then umount_loop ${DESTDIR}/dev 2>/dev/null fi - umount_loop ${DESTDIR} - if [ ! -z "${mddev}" ]; then - mdconfig -d -u ${mddev} - fi return 0 } @@ -100,42 +43,12 @@ vm_create_base() { # written to the formatted disk image with mkimg(1). mkdir -p ${DESTDIR} - truncate -s ${VMSIZE} ${VMBASE} - mddev=$(mdconfig -f ${VMBASE}) - newfs -L rootfs /dev/${mddev} - mount /dev/${mddev} ${DESTDIR} return 0 } vm_copy_base() { - # Creates a new UFS root filesystem and copies the contents of the - # current root filesystem into it. This produces a "clean" disk - # image without any remnants of files which were created temporarily - # during image-creation and have since been deleted (e.g., downloaded - # package archives). - - mkdir -p ${DESTDIR}/old - mdold=$(mdconfig -f ${VMBASE}) - mount /dev/${mdold} ${DESTDIR}/old - - truncate -s ${VMSIZE} ${VMBASE}.tmp - mkdir -p ${DESTDIR}/new - mdnew=$(mdconfig -f ${VMBASE}.tmp) - newfs -L rootfs /dev/${mdnew} - mount /dev/${mdnew} ${DESTDIR}/new - - tar -cf- -C ${DESTDIR}/old . | tar -xUf- -C ${DESTDIR}/new - - umount_loop /dev/${mdold} - rmdir ${DESTDIR}/old - mdconfig -d -u ${mdold} - - umount_loop /dev/${mdnew} - rmdir ${DESTDIR}/new - tunefs -n enable /dev/${mdnew} - mdconfig -d -u ${mdnew} - mv ${VMBASE}.tmp ${VMBASE} + # Defunct } vm_install_base() { @@ -276,7 +189,71 @@ vm_create_disk() { echo "Creating image... Please wait." echo - write_partition_layout || return 1 + if [ -z "${NOSWAP}" ]; then + SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" + fi + + BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + WITH_UNIFIED_OBJDIR=yes \ + make -C ${WORLDDIR}/stand -V .OBJDIR)" + BOOTFILES="$(realpath ${BOOTFILES})" + + case "${TARGET}:${TARGET_ARCH}" in + amd64:amd64 | i386:i386) + ESP=yes + BOOTPARTS="-b ${BOOTFILES}/i386/pmbr/pmbr \ + -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot" + ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" + MAKEFSARGS="-B little" + ;; + arm64:aarch64 | riscv:riscv64*) + ESP=yes + BOOTPARTS= + ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" + MAKEFSARGS="-B little" + ;; + powerpc:powerpc*) + ESP=no + BOOTPARTS="-p prepboot:=${BOOTFILES}/powerpc/boot1.chrp/boot1.elf -a 1" + ROOTFSPART="-p freebsd:=${VMBASE}" + if [ ${TARGET_ARCH} = powerpc64le ]; then + MAKEFSARGS="-B little" + else + MAKEFSARGS="-B big" + fi + ;; + *) + echo "vmimage.subr: unsupported target '${TARGET}:${TARGET_ARCH}'" >&2 + exit 1 + ;; + esac + + if [ ${ESP} = "yes" ]; then + # Create an ESP + espfilename=$(mktemp /tmp/efiboot.XXXXXX) + make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi + BOOTPARTS="${BOOTPARTS} -p efi/efiesp:=${espfilename}" + + # Add this to fstab + mkdir -p ${DESTDIR}/boot/efi + echo "/dev/${ROOTLABEL}/efiesp /boot/efi msdosfs rw 2 2" \ + >> ${DESTDIR}/etc/fstab + fi + + echo "Building filesystem... Please wait." + makefs ${MAKEFSARGS} -o label=rootfs -o version=2 -o softupdates=1 \ + -s ${VMSIZE} ${VMBASE} ${DESTDIR} + + echo "Building final disk image... Please wait." + mkimg -s ${PARTSCHEME} -f ${VMFORMAT} \ + ${BOOTPARTS} \ + ${SWAPOPT} \ + ${ROOTFSPART} \ + -o ${VMIMAGE} + + if [ ${ESP} = "yes" ]; then + rm ${espfilename} + fi return 0 } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 05:12: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 3CFA7556DF0; Thu, 25 Feb 2021 05:12: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 4DmLWk1J9Gz3R56; Thu, 25 Feb 2021 05:12: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 1F4C81201D; Thu, 25 Feb 2021 05:12: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 11P5CYo1037268; Thu, 25 Feb 2021 05:12:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P5CY55037267; Thu, 25 Feb 2021 05:12:34 GMT (envelope-from git) Date: Thu, 25 Feb 2021 05:12:34 GMT Message-Id: <202102250512.11P5CY55037267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: ddfffb41a22d - main - jail: back out 811e27fa3c44 until it doesn't break Jenkins MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddfffb41a22d4798a036fe2d30e59694ba7cdad3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 05:12:34 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=ddfffb41a22d4798a036fe2d30e59694ba7cdad3 commit ddfffb41a22d4798a036fe2d30e59694ba7cdad3 Author: Jamie Gritton AuthorDate: 2021-02-25 05:10:47 +0000 Commit: Jamie Gritton CommitDate: 2021-02-25 05:10:47 +0000 jail: back out 811e27fa3c44 until it doesn't break Jenkins Reported by: arichardson --- sys/kern/kern_jail.c | 258 +++++++++++++++++++-------------------------------- 1 file changed, 93 insertions(+), 165 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 4f434637ccfa..67abfb06d2e5 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -141,13 +141,12 @@ static int get_next_prid(struct prison **insprp); static int do_jail_attach(struct thread *td, struct prison *pr, int drflags); static void prison_complete(void *context, int pending); static void prison_deref(struct prison *pr, int flags); -static void prison_deref_kill(struct prison *pr, struct prisonlist *freeprison); static int prison_lock_xlock(struct prison *pr, int flags); static void prison_free_not_last(struct prison *pr); -static void prison_proc_free_not_last(struct prison *pr); static void prison_set_allow_locked(struct prison *pr, unsigned flag, int enable); static char *prison_path(struct prison *pr1, struct prison *pr2); +static void prison_remove_one(struct prison *pr); #ifdef RACCT static void prison_racct_attach(struct prison *pr); static void prison_racct_modify(struct prison *pr); @@ -157,10 +156,9 @@ static void prison_racct_detach(struct prison *pr); /* Flags for prison_deref */ #define PD_DEREF 0x01 /* Decrement pr_ref */ #define PD_DEUREF 0x02 /* Decrement pr_uref */ -#define PD_KILL 0x04 /* Remove jail, kill processes, etc */ -#define PD_LOCKED 0x10 /* pr_mtx is held */ -#define PD_LIST_SLOCKED 0x20 /* allprison_lock is held shared */ -#define PD_LIST_XLOCKED 0x40 /* allprison_lock is held exclusive */ +#define PD_LOCKED 0x04 /* pr_mtx is held */ +#define PD_LIST_SLOCKED 0x08 /* allprison_lock is held shared */ +#define PD_LIST_XLOCKED 0x10 /* allprison_lock is held exclusive */ /* * Parameter names corresponding to PR_* flag values. Size values are for kvm @@ -1752,12 +1750,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags; mtx_unlock(&pr->pr_mtx); drflags &= ~PD_LOCKED; - /* - * Any errors past this point will need to de-persist newly created - * prisons, as well as call remove methods. - */ - if (born) - drflags |= PD_KILL; #ifdef RACCT if (racct_enable && created) @@ -1817,12 +1809,17 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) /* Let the modules do their work. */ if (born) { error = osd_jail_call(pr, PR_METHOD_CREATE, opts); - if (error) + if (error) { + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); goto done_deref; + } } error = osd_jail_call(pr, PR_METHOD_SET, opts); - if (error) + if (error) { + if (born) + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); goto done_deref; + } /* * A new prison is now ready to be seen; either it has gained a user @@ -1857,7 +1854,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } #endif - drflags &= ~PD_KILL; td->td_retval[0] = pr->pr_id; done_deref: @@ -2281,8 +2277,8 @@ kern_jail_get(struct thread *td, struct uio *optuio, int flags) int sys_jail_remove(struct thread *td, struct jail_remove_args *uap) { - struct prison *pr; - int error; + struct prison *pr, *cpr, *lpr; + int descend, error; error = priv_check(td, PRIV_JAIL_REMOVE); if (error) @@ -2294,16 +2290,90 @@ sys_jail_remove(struct thread *td, struct jail_remove_args *uap) sx_xunlock(&allprison_lock); return (EINVAL); } - if (!prison_isalive(pr)) { - /* Silently ignore already-dying prisons. */ + + /* Remove all descendants of this prison, then remove this prison. */ + prison_hold(pr); + if (!LIST_EMPTY(&pr->pr_children)) { mtx_unlock(&pr->pr_mtx); - sx_xunlock(&allprison_lock); - return (0); + lpr = NULL; + FOREACH_PRISON_DESCENDANT(pr, cpr, descend) { + prison_hold(cpr); + if (lpr != NULL) { + mtx_lock(&lpr->pr_mtx); + prison_remove_one(lpr); + sx_xlock(&allprison_lock); + } + lpr = cpr; + } + if (lpr != NULL) { + mtx_lock(&lpr->pr_mtx); + prison_remove_one(lpr); + sx_xlock(&allprison_lock); + } + mtx_lock(&pr->pr_mtx); } - prison_deref(pr, PD_KILL | PD_LOCKED | PD_LIST_XLOCKED); + prison_remove_one(pr); return (0); } +static void +prison_remove_one(struct prison *pr) +{ + struct proc *p; + int was_alive, drflags; + + drflags = PD_DEREF | PD_LOCKED | PD_LIST_XLOCKED; + + /* + * Mark the prison as doomed, so it doesn't accidentally come back + * to life. It may still be explicitly brought back by jail_set(2). + */ + was_alive = pr->pr_state == PRISON_STATE_ALIVE; + pr->pr_state = PRISON_STATE_DYING; + + /* If the prison was persistent, it is not anymore. */ + if (pr->pr_flags & PR_PERSIST) { + drflags |= PD_DEUREF; + prison_free_not_last(pr); + pr->pr_flags &= ~PR_PERSIST; + } + + /* + * jail_remove added a reference. If that's the only one, remove + * the prison now. refcount(9) doesn't guarantee the cache coherence + * of non-zero counters, so force it here. + */ + KASSERT(refcount_load(&pr->pr_ref) > 0, + ("prison_remove_one removing a dead prison (jid=%d)", pr->pr_id)); + if (atomic_load_acq_int(&pr->pr_ref) == 1) { + prison_deref(pr, drflags); + return; + } + + /* Tell modules this prison has died. */ + mtx_unlock(&pr->pr_mtx); + drflags &= ~PD_LOCKED; + if (was_alive) + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + + sx_xunlock(&allprison_lock); + drflags &= ~PD_LIST_XLOCKED; + /* + * Kill all processes unfortunate enough to be attached to this prison. + */ + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state != PRS_NEW && p->p_ucred && + p->p_ucred->cr_prison == pr) + kern_psignal(p, SIGKILL); + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); + /* Remove the temporary reference added by jail_remove. */ + prison_deref(pr, drflags); +} + /* * struct jail_attach_args { * int jid; @@ -2655,24 +2725,6 @@ prison_proc_free(struct prison *pr) } } -static void -prison_proc_free_not_last(struct prison *pr) -{ -#ifdef INVARIANTS - int lastref; - - KASSERT(refcount_load(&pr->pr_uref) > 0, - ("Trying to free dead prison %p (jid=%d).", - pr, pr->pr_id)); - lastref = refcount_release(&pr->pr_uref); - KASSERT(!lastref, - ("prison_proc_free_not_last freed last uref on prison %p (jid=%d).", - pr, pr->pr_id)); -#else - refcount_release(&pr->pr_uref); -#endif -} - /* * Complete a call to either prison_free or prison_proc_free. */ @@ -2706,25 +2758,14 @@ static void prison_deref(struct prison *pr, int flags) { struct prisonlist freeprison; - struct prison *killpr, *rpr, *ppr, *tpr; - struct proc *p; + struct prison *rpr, *ppr, *tpr; - killpr = NULL; TAILQ_INIT(&freeprison); /* * Release this prison as requested, which may cause its parent * to be released, and then maybe its grandparent, etc. */ for (;;) { - if (flags & PD_KILL) { - /* Kill the prison and its descendents. */ - if (!(flags & PD_DEREF)) { - prison_hold(pr); - flags |= PD_DEREF; - } - flags = prison_lock_xlock(pr, flags); - prison_deref_kill(pr, &freeprison); - } if (flags & PD_DEUREF) { /* Drop a user reference. */ KASSERT(refcount_load(&pr->pr_uref) > 0, @@ -2753,16 +2794,6 @@ prison_deref(struct prison *pr, int flags) } } } - if (flags & PD_KILL) { - flags &= ~PD_KILL; - /* - * Any remaining user references are probably processes - * that need to be killed, either in this prison or its - * descendants. - */ - if (refcount_load(&pr->pr_uref) > 0) - killpr = pr; - } if (flags & PD_DEREF) { /* Drop a reference. */ KASSERT(refcount_load(&pr->pr_ref) > 0, @@ -2815,25 +2846,6 @@ prison_deref(struct prison *pr, int flags) else if (flags & PD_LIST_XLOCKED) sx_xunlock(&allprison_lock); - /* Kill any processes attached to a killed prison. */ - if (killpr != NULL) { - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_state != PRS_NEW && p->p_ucred != NULL) { - for (ppr = p->p_ucred->cr_prison; - ppr != &prison0; - ppr = ppr->pr_parent) - if (ppr == killpr) { - kern_psignal(p, SIGKILL); - break; - } - } - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); - } - /* * Finish removing any unreferenced prisons, which couldn't happen * while allprison_lock was held (to avoid a LOR on vrele). @@ -2864,90 +2876,6 @@ prison_deref(struct prison *pr, int flags) } } -/* - * Kill the prison and its descendants. Mark them as dying, clear the - * persist flag, and call module remove methods. - */ -static void -prison_deref_kill(struct prison *pr, struct prisonlist *freeprison) -{ - struct prison *cpr, *ppr, *rpr; - bool descend; - - /* - * Unlike the descendants, the target prison can be killed - * even if it is currently dying. This is useful for failed - * creation in jail_set(2). - */ - KASSERT(refcount_load(&pr->pr_ref) > 0, - ("Trying to kill dead prison %p (jid=%d).", - pr, pr->pr_id)); - refcount_acquire(&pr->pr_uref); - pr->pr_state = PRISON_STATE_DYING; - mtx_unlock(&pr->pr_mtx); - - rpr = NULL; - FOREACH_PRISON_DESCENDANT_PRE_POST(pr, cpr, descend) { - if (descend) { - if (!prison_isalive(cpr)) { - descend = false; - continue; - } - prison_hold(cpr); - prison_proc_hold(cpr); - mtx_lock(&cpr->pr_mtx); - cpr->pr_state = PRISON_STATE_DYING; - cpr->pr_flags |= PR_REMOVE; - mtx_unlock(&cpr->pr_mtx); - } - if (!(cpr->pr_flags & PR_REMOVE)) - continue; - (void)osd_jail_call(cpr, PR_METHOD_REMOVE, NULL); - mtx_lock(&cpr->pr_mtx); - cpr->pr_flags &= ~PR_REMOVE; - if (cpr->pr_flags & PR_PERSIST) { - cpr->pr_flags &= ~PR_PERSIST; - prison_proc_free_not_last(cpr); - prison_free_not_last(cpr); - } - (void)refcount_release(&cpr->pr_uref); - if (refcount_release(&cpr->pr_ref)) { - /* - * When the last reference goes, unlink the prison - * and set it aside for prison_deref() to handle. - * Delay unlinking the sibling list to keep the loop - * safe. - */ - if (rpr != NULL) - LIST_REMOVE(rpr, pr_sibling); - rpr = cpr; - rpr->pr_state = PRISON_STATE_INVALID; - TAILQ_REMOVE(&allprison, rpr, pr_list); - TAILQ_INSERT_TAIL(freeprison, rpr, pr_list); - /* - * Removing a prison frees references from its parent. - */ - ppr = rpr->pr_parent; - prison_proc_free_not_last(ppr); - prison_free_not_last(ppr); - for (; ppr != NULL; ppr = ppr->pr_parent) - ppr->pr_childcount--; - } - mtx_unlock(&cpr->pr_mtx); - } - if (rpr != NULL) - LIST_REMOVE(rpr, pr_sibling); - - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); - mtx_lock(&pr->pr_mtx); - if (pr->pr_flags & PR_PERSIST) { - pr->pr_flags &= ~PR_PERSIST; - prison_proc_free_not_last(pr); - prison_free_not_last(pr); - } - (void)refcount_release(&pr->pr_uref); -} - /* * Given the current locking state in the flags, make sure allprison_lock * is held exclusive, and the prison is locked. Return flags indicating From owner-dev-commits-src-all@freebsd.org Thu Feb 25 05:29: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 180BF55731F; Thu, 25 Feb 2021 05:29:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmLvQ07lDz3hKH; Thu, 25 Feb 2021 05:29:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id E67AC21BFF; Thu, 25 Feb 2021 05:29:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id z190so4626896qka.9; Wed, 24 Feb 2021 21:29:37 -0800 (PST) X-Gm-Message-State: AOAM532Zk/fs/rror8+1fdUCjgs08bIPmLw5WsGns8oRyRW9+DxLgCKu BZ9n6YAYc+tGbVet1hPVYhlbPh5+2BBMzzUMoog= X-Google-Smtp-Source: ABdhPJy8MMv1F6SETwrljMa0NwLp4vP4wYGTr+3owxPiejj1mZLNLJdsPhSvAmZvO+iR14IFGyQm90wJmJTp10yfr1M= X-Received: by 2002:a37:6484:: with SMTP id y126mr1372123qkb.430.1614230977327; Wed, 24 Feb 2021 21:29:37 -0800 (PST) MIME-Version: 1.0 References: <202102222027.11MKRtcl033616@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 24 Feb 2021 23:29:26 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 811e27fa3c44 - main - jail: Add PD_KILL to remove a prison in prison_deref(). To: Alexander Richardson Cc: Jamie Gritton , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 05:29:38 -0000 On Tue, Feb 23, 2021 at 7:16 AM Alexander Richardson wrote: > > On Mon, 22 Feb 2021 at 20:28, Jamie Gritton wrote: > > > > The branch main has been updated by jamie: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=811e27fa3c445664e36071a7d08228fc7fb85676 > > > > commit 811e27fa3c445664e36071a7d08228fc7fb85676 > > Author: Jamie Gritton > > AuthorDate: 2021-02-22 20:27:44 +0000 > > Commit: Jamie Gritton > > CommitDate: 2021-02-22 20:27:44 +0000 > > > > jail: Add PD_KILL to remove a prison in prison_deref(). > > > > Add the PD_KILL flag that instructs prison_deref() to take steps > > to actively kill a prison and its descendents, namely marking it > > PRISON_STATE_DYING, clearing its PR_PERSIST flag, and killing any > > attached processes. > > > > This replaces a similar loop in sys_jail_remove(), bringing the > > operation under the same single hold on allprison_lock that it already > > has. It is also used to clean up failed jail (re-)creations in > > kern_jail_set(), which didn't generally take all the proper steps. > > > > Differential Revision: https://reviews.freebsd.org/D28473 > > Hi Jamie, > > After this commit running cd /usr/tests/lib/libc/sys && kyua test > cpuset_test renders the entire system unusable: all exec calls > afterwards seem to fail. In Jenkins it's triggering a kernel panic: > https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17630/consoleFull > Reverting this commit fixes the issue. > Based on the backtrace and a wild stab in the dark, the last prison_deref() in do_jail_attach() prior to successful return should explicitly clear the PD_KILL flag from drflags. Thanks, Kyle Evans From owner-dev-commits-src-all@freebsd.org Thu Feb 25 05:50: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 AF0EB557960; Thu, 25 Feb 2021 05:50: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 4DmMMt4VY9z3j2H; Thu, 25 Feb 2021 05:50: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 8DADE123AE; Thu, 25 Feb 2021 05:50: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 11P5ooNX087389; Thu, 25 Feb 2021 05:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P5ooIQ087388; Thu, 25 Feb 2021 05:50:50 GMT (envelope-from git) Date: Thu, 25 Feb 2021 05:50:50 GMT Message-Id: <202102250550.11P5ooIQ087388@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: 19cd12a32afe - main - Disable PIE for MIPS BERI boot loader 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: 19cd12a32afe801dc5e753013993e15e924ceb39 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 05:50:50 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=19cd12a32afe801dc5e753013993e15e924ceb39 commit 19cd12a32afe801dc5e753013993e15e924ceb39 Author: Marcin Wojtas AuthorDate: 2021-02-25 05:41:35 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-25 05:41:35 +0000 Disable PIE for MIPS BERI boot loader MIPS BERI boot loader is built with -mno-abicalls and -fno-pic so prevent adding PIE-related build flags. Fix build after 9a227a2fd642 ("Enable PIE by default on 64-bit architectures") Obtained from: Semihalf Sponsored by: Stormshield --- stand/mips/beri/Makefile.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stand/mips/beri/Makefile.inc b/stand/mips/beri/Makefile.inc index 5a7b18e393c0..a95ca3dc1861 100644 --- a/stand/mips/beri/Makefile.inc +++ b/stand/mips/beri/Makefile.inc @@ -2,4 +2,8 @@ LDFLAGS+= -nostdlib +# BERI boot loader is built with '-mno-abicalls' flag, +# which is incompatible with PIE +MK_PIE= no + .include "../Makefile.inc" From owner-dev-commits-src-all@freebsd.org Thu Feb 25 05:53: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 B72525579E6; Thu, 25 Feb 2021 05:53:34 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.3 with cipher TLS_AES_256_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 4DmMR240vCz3jmr; Thu, 25 Feb 2021 05:53:34 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) (authenticated bits=0) by gritton.org (8.15.2/8.15.2) with ESMTPA id 11P5lwgI012007; Wed, 24 Feb 2021 21:47:58 -0800 (PST) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 24 Feb 2021 21:47:58 -0800 From: James Gritton To: Kyle Evans Cc: Alexander Richardson , src-committers , , dev-commits-src-main@freebsd.org Subject: Re: git: 811e27fa3c44 - main - jail: Add PD_KILL to remove a prison in prison_deref(). In-Reply-To: References: <202102222027.11MKRtcl033616@gitrepo.freebsd.org> User-Agent: Roundcube Webmail/1.4.1 Message-ID: X-Sender: jamie@freebsd.org X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Wed, 24 Feb 2021 21:47:58 -0800 (PST) X-Rspamd-Queue-Id: 4DmMR240vCz3jmr 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, 25 Feb 2021 05:53:34 -0000 On 2021-02-24 21:29, Kyle Evans wrote: > On Tue, Feb 23, 2021 at 7:16 AM Alexander Richardson > wrote: >> >> On Mon, 22 Feb 2021 at 20:28, Jamie Gritton wrote: >> > >> > The branch main has been updated by jamie: >> > >> > URL: https://cgit.FreeBSD.org/src/commit/?id=811e27fa3c445664e36071a7d08228fc7fb85676 >> > >> > commit 811e27fa3c445664e36071a7d08228fc7fb85676 >> > Author: Jamie Gritton >> > AuthorDate: 2021-02-22 20:27:44 +0000 >> > Commit: Jamie Gritton >> > CommitDate: 2021-02-22 20:27:44 +0000 >> > >> > jail: Add PD_KILL to remove a prison in prison_deref(). >> > >> > Add the PD_KILL flag that instructs prison_deref() to take steps >> > to actively kill a prison and its descendents, namely marking it >> > PRISON_STATE_DYING, clearing its PR_PERSIST flag, and killing any >> > attached processes. >> > >> > This replaces a similar loop in sys_jail_remove(), bringing the >> > operation under the same single hold on allprison_lock that it already >> > has. It is also used to clean up failed jail (re-)creations in >> > kern_jail_set(), which didn't generally take all the proper steps. >> > >> > Differential Revision: https://reviews.freebsd.org/D28473 >> >> Hi Jamie, >> >> After this commit running cd /usr/tests/lib/libc/sys && kyua test >> cpuset_test renders the entire system unusable: all exec calls >> afterwards seem to fail. In Jenkins it's triggering a kernel panic: >> https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17630/consoleFull >> Reverting this commit fixes the issue. >> > > Based on the backtrace and a wild stab in the dark, the last > prison_deref() in do_jail_attach() prior to successful return should > explicitly clear the PD_KILL flag from drflags. > > Thanks, > > Kyle Evans Yep, that's what's doing it. Actually, PD_KILL has no business being passed to do_jail_attach in the first place. Running a test on that right now. - Jamie From owner-dev-commits-src-all@freebsd.org Thu Feb 25 05:54: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 1856B557F83; Thu, 25 Feb 2021 05:54: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 4DmMSf0Bk8z3jnh; Thu, 25 Feb 2021 05:54: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 E97D6126B1; Thu, 25 Feb 2021 05:54: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 11P5svvH089653; Thu, 25 Feb 2021 05:54:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P5svqJ089652; Thu, 25 Feb 2021 05:54:57 GMT (envelope-from git) Date: Thu, 25 Feb 2021 05:54:57 GMT Message-Id: <202102250554.11P5svqJ089652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: c861373bdff9 - main - jail: re-commit 811e27fa3c44 with fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c861373bdff90d8167a0d998899ca718ccdb541b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 05:54:58 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=c861373bdff90d8167a0d998899ca718ccdb541b commit c861373bdff90d8167a0d998899ca718ccdb541b Author: Jamie Gritton AuthorDate: 2021-02-25 05:54:49 +0000 Commit: Jamie Gritton CommitDate: 2021-02-25 05:54:49 +0000 jail: re-commit 811e27fa3c44 with fixes Make sure PD_KILL isn't passed to do_jail_attach, where it might end up trying to kill the caller's prison (even prison0). Fix the child jail loop in prison_deref_kill, which was doing the post-order part during the pre-order part. That's not a system- killer, but make jails not always die correctly. --- sys/kern/kern_jail.c | 262 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 168 insertions(+), 94 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 67abfb06d2e5..c58751e6f5fe 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -141,12 +141,13 @@ static int get_next_prid(struct prison **insprp); static int do_jail_attach(struct thread *td, struct prison *pr, int drflags); static void prison_complete(void *context, int pending); static void prison_deref(struct prison *pr, int flags); +static void prison_deref_kill(struct prison *pr, struct prisonlist *freeprison); static int prison_lock_xlock(struct prison *pr, int flags); static void prison_free_not_last(struct prison *pr); +static void prison_proc_free_not_last(struct prison *pr); static void prison_set_allow_locked(struct prison *pr, unsigned flag, int enable); static char *prison_path(struct prison *pr1, struct prison *pr2); -static void prison_remove_one(struct prison *pr); #ifdef RACCT static void prison_racct_attach(struct prison *pr); static void prison_racct_modify(struct prison *pr); @@ -156,9 +157,10 @@ static void prison_racct_detach(struct prison *pr); /* Flags for prison_deref */ #define PD_DEREF 0x01 /* Decrement pr_ref */ #define PD_DEUREF 0x02 /* Decrement pr_uref */ -#define PD_LOCKED 0x04 /* pr_mtx is held */ -#define PD_LIST_SLOCKED 0x08 /* allprison_lock is held shared */ -#define PD_LIST_XLOCKED 0x10 /* allprison_lock is held exclusive */ +#define PD_KILL 0x04 /* Remove jail, kill processes, etc */ +#define PD_LOCKED 0x10 /* pr_mtx is held */ +#define PD_LIST_SLOCKED 0x20 /* allprison_lock is held shared */ +#define PD_LIST_XLOCKED 0x40 /* allprison_lock is held exclusive */ /* * Parameter names corresponding to PR_* flag values. Size values are for kvm @@ -1750,6 +1752,12 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags; mtx_unlock(&pr->pr_mtx); drflags &= ~PD_LOCKED; + /* + * Any errors past this point will need to de-persist newly created + * prisons, as well as call remove methods. + */ + if (born) + drflags |= PD_KILL; #ifdef RACCT if (racct_enable && created) @@ -1809,17 +1817,12 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) /* Let the modules do their work. */ if (born) { error = osd_jail_call(pr, PR_METHOD_CREATE, opts); - if (error) { - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + if (error) goto done_deref; - } } error = osd_jail_call(pr, PR_METHOD_SET, opts); - if (error) { - if (born) - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + if (error) goto done_deref; - } /* * A new prison is now ready to be seen; either it has gained a user @@ -1832,7 +1835,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) /* Attach this process to the prison if requested. */ if (flags & JAIL_ATTACH) { - error = do_jail_attach(td, pr, prison_lock_xlock(pr, drflags)); + error = do_jail_attach(td, pr, + prison_lock_xlock(pr, drflags & ~PD_KILL)); drflags &= ~(PD_LOCKED | PD_LIST_XLOCKED); if (error) { vfs_opterror(opts, "attach failed"); @@ -1854,6 +1858,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } #endif + drflags &= ~PD_KILL; td->td_retval[0] = pr->pr_id; done_deref: @@ -2277,8 +2282,8 @@ kern_jail_get(struct thread *td, struct uio *optuio, int flags) int sys_jail_remove(struct thread *td, struct jail_remove_args *uap) { - struct prison *pr, *cpr, *lpr; - int descend, error; + struct prison *pr; + int error; error = priv_check(td, PRIV_JAIL_REMOVE); if (error) @@ -2290,90 +2295,16 @@ sys_jail_remove(struct thread *td, struct jail_remove_args *uap) sx_xunlock(&allprison_lock); return (EINVAL); } - - /* Remove all descendants of this prison, then remove this prison. */ - prison_hold(pr); - if (!LIST_EMPTY(&pr->pr_children)) { + if (!prison_isalive(pr)) { + /* Silently ignore already-dying prisons. */ mtx_unlock(&pr->pr_mtx); - lpr = NULL; - FOREACH_PRISON_DESCENDANT(pr, cpr, descend) { - prison_hold(cpr); - if (lpr != NULL) { - mtx_lock(&lpr->pr_mtx); - prison_remove_one(lpr); - sx_xlock(&allprison_lock); - } - lpr = cpr; - } - if (lpr != NULL) { - mtx_lock(&lpr->pr_mtx); - prison_remove_one(lpr); - sx_xlock(&allprison_lock); - } - mtx_lock(&pr->pr_mtx); + sx_xunlock(&allprison_lock); + return (0); } - prison_remove_one(pr); + prison_deref(pr, PD_KILL | PD_LOCKED | PD_LIST_XLOCKED); return (0); } -static void -prison_remove_one(struct prison *pr) -{ - struct proc *p; - int was_alive, drflags; - - drflags = PD_DEREF | PD_LOCKED | PD_LIST_XLOCKED; - - /* - * Mark the prison as doomed, so it doesn't accidentally come back - * to life. It may still be explicitly brought back by jail_set(2). - */ - was_alive = pr->pr_state == PRISON_STATE_ALIVE; - pr->pr_state = PRISON_STATE_DYING; - - /* If the prison was persistent, it is not anymore. */ - if (pr->pr_flags & PR_PERSIST) { - drflags |= PD_DEUREF; - prison_free_not_last(pr); - pr->pr_flags &= ~PR_PERSIST; - } - - /* - * jail_remove added a reference. If that's the only one, remove - * the prison now. refcount(9) doesn't guarantee the cache coherence - * of non-zero counters, so force it here. - */ - KASSERT(refcount_load(&pr->pr_ref) > 0, - ("prison_remove_one removing a dead prison (jid=%d)", pr->pr_id)); - if (atomic_load_acq_int(&pr->pr_ref) == 1) { - prison_deref(pr, drflags); - return; - } - - /* Tell modules this prison has died. */ - mtx_unlock(&pr->pr_mtx); - drflags &= ~PD_LOCKED; - if (was_alive) - (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); - - sx_xunlock(&allprison_lock); - drflags &= ~PD_LIST_XLOCKED; - /* - * Kill all processes unfortunate enough to be attached to this prison. - */ - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_state != PRS_NEW && p->p_ucred && - p->p_ucred->cr_prison == pr) - kern_psignal(p, SIGKILL); - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); - /* Remove the temporary reference added by jail_remove. */ - prison_deref(pr, drflags); -} - /* * struct jail_attach_args { * int jid; @@ -2725,6 +2656,24 @@ prison_proc_free(struct prison *pr) } } +static void +prison_proc_free_not_last(struct prison *pr) +{ +#ifdef INVARIANTS + int lastref; + + KASSERT(refcount_load(&pr->pr_uref) > 0, + ("Trying to free dead prison %p (jid=%d).", + pr, pr->pr_id)); + lastref = refcount_release(&pr->pr_uref); + KASSERT(!lastref, + ("prison_proc_free_not_last freed last uref on prison %p (jid=%d).", + pr, pr->pr_id)); +#else + refcount_release(&pr->pr_uref); +#endif +} + /* * Complete a call to either prison_free or prison_proc_free. */ @@ -2758,14 +2707,25 @@ static void prison_deref(struct prison *pr, int flags) { struct prisonlist freeprison; - struct prison *rpr, *ppr, *tpr; + struct prison *killpr, *rpr, *ppr, *tpr; + struct proc *p; + killpr = NULL; TAILQ_INIT(&freeprison); /* * Release this prison as requested, which may cause its parent * to be released, and then maybe its grandparent, etc. */ for (;;) { + if (flags & PD_KILL) { + /* Kill the prison and its descendents. */ + if (!(flags & PD_DEREF)) { + prison_hold(pr); + flags |= PD_DEREF; + } + flags = prison_lock_xlock(pr, flags); + prison_deref_kill(pr, &freeprison); + } if (flags & PD_DEUREF) { /* Drop a user reference. */ KASSERT(refcount_load(&pr->pr_uref) > 0, @@ -2794,6 +2754,16 @@ prison_deref(struct prison *pr, int flags) } } } + if (flags & PD_KILL) { + flags &= ~PD_KILL; + /* + * Any remaining user references are probably processes + * that need to be killed, either in this prison or its + * descendants. + */ + if (refcount_load(&pr->pr_uref) > 0) + killpr = pr; + } if (flags & PD_DEREF) { /* Drop a reference. */ KASSERT(refcount_load(&pr->pr_ref) > 0, @@ -2846,6 +2816,25 @@ prison_deref(struct prison *pr, int flags) else if (flags & PD_LIST_XLOCKED) sx_xunlock(&allprison_lock); + /* Kill any processes attached to a killed prison. */ + if (killpr != NULL) { + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state != PRS_NEW && p->p_ucred != NULL) { + for (ppr = p->p_ucred->cr_prison; + ppr != &prison0; + ppr = ppr->pr_parent) + if (ppr == killpr) { + kern_psignal(p, SIGKILL); + break; + } + } + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); + } + /* * Finish removing any unreferenced prisons, which couldn't happen * while allprison_lock was held (to avoid a LOR on vrele). @@ -2876,6 +2865,91 @@ prison_deref(struct prison *pr, int flags) } } +/* + * Kill the prison and its descendants. Mark them as dying, clear the + * persist flag, and call module remove methods. + */ +static void +prison_deref_kill(struct prison *pr, struct prisonlist *freeprison) +{ + struct prison *cpr, *ppr, *rpr; + bool descend; + + /* + * Unlike the descendants, the target prison can be killed + * even if it is currently dying. This is useful for failed + * creation in jail_set(2). + */ + KASSERT(refcount_load(&pr->pr_ref) > 0, + ("Trying to kill dead prison %p (jid=%d).", + pr, pr->pr_id)); + refcount_acquire(&pr->pr_uref); + pr->pr_state = PRISON_STATE_DYING; + mtx_unlock(&pr->pr_mtx); + + rpr = NULL; + FOREACH_PRISON_DESCENDANT_PRE_POST(pr, cpr, descend) { + if (descend) { + if (!prison_isalive(cpr)) { + descend = false; + continue; + } + prison_hold(cpr); + prison_proc_hold(cpr); + mtx_lock(&cpr->pr_mtx); + cpr->pr_state = PRISON_STATE_DYING; + cpr->pr_flags |= PR_REMOVE; + mtx_unlock(&cpr->pr_mtx); + continue; + } + if (!(cpr->pr_flags & PR_REMOVE)) + continue; + (void)osd_jail_call(cpr, PR_METHOD_REMOVE, NULL); + mtx_lock(&cpr->pr_mtx); + cpr->pr_flags &= ~PR_REMOVE; + if (cpr->pr_flags & PR_PERSIST) { + cpr->pr_flags &= ~PR_PERSIST; + prison_proc_free_not_last(cpr); + prison_free_not_last(cpr); + } + (void)refcount_release(&cpr->pr_uref); + if (refcount_release(&cpr->pr_ref)) { + /* + * When the last reference goes, unlink the prison + * and set it aside for prison_deref() to handle. + * Delay unlinking the sibling list to keep the loop + * safe. + */ + if (rpr != NULL) + LIST_REMOVE(rpr, pr_sibling); + rpr = cpr; + rpr->pr_state = PRISON_STATE_INVALID; + TAILQ_REMOVE(&allprison, rpr, pr_list); + TAILQ_INSERT_TAIL(freeprison, rpr, pr_list); + /* + * Removing a prison frees references from its parent. + */ + ppr = rpr->pr_parent; + prison_proc_free_not_last(ppr); + prison_free_not_last(ppr); + for (; ppr != NULL; ppr = ppr->pr_parent) + ppr->pr_childcount--; + } + mtx_unlock(&cpr->pr_mtx); + } + if (rpr != NULL) + LIST_REMOVE(rpr, pr_sibling); + + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + mtx_lock(&pr->pr_mtx); + if (pr->pr_flags & PR_PERSIST) { + pr->pr_flags &= ~PR_PERSIST; + prison_proc_free_not_last(pr); + prison_free_not_last(pr); + } + (void)refcount_release(&pr->pr_uref); +} + /* * Given the current locking state in the flags, make sure allprison_lock * is held exclusive, and the prison is locked. Return flags indicating From owner-dev-commits-src-all@freebsd.org Thu Feb 25 06:03: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 4C5D5557C7A; Thu, 25 Feb 2021 06:03:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmMf11cZhz3k8b; Thu, 25 Feb 2021 06:03:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 2A6D221AD5; Thu, 25 Feb 2021 06:03:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id l132so3460999qke.7; Wed, 24 Feb 2021 22:03:05 -0800 (PST) X-Gm-Message-State: AOAM5327wWeSWNIJC5t4gEuXj70n/gqSB46IDV6AG77hw5u8XRqFn2+b e9q30JLLxE32El8O3ifbxX0sF56RK4/Dseyc5N0= X-Google-Smtp-Source: ABdhPJzZrGqSydT3HTRDZTq4/2RmDQGvpL17YdIvhVookpop9C/y6J6aWMWy1dXBTVU+ba+JE3DEM4+C+c287AZ1KiY= X-Received: by 2002:a37:a3c9:: with SMTP id m192mr1293846qke.103.1614232984780; Wed, 24 Feb 2021 22:03:04 -0800 (PST) MIME-Version: 1.0 References: <202102222027.11MKRtcl033616@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Thu, 25 Feb 2021 00:02:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 811e27fa3c44 - main - jail: Add PD_KILL to remove a prison in prison_deref(). To: James Gritton Cc: Alexander Richardson , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 06:03:05 -0000 On Wed, Feb 24, 2021 at 11:53 PM James Gritton wrote: > > On 2021-02-24 21:29, Kyle Evans wrote: > > On Tue, Feb 23, 2021 at 7:16 AM Alexander Richardson > > wrote: > >> > >> On Mon, 22 Feb 2021 at 20:28, Jamie Gritton wrote: > >> > > >> > The branch main has been updated by jamie: > >> > > >> > URL: https://cgit.FreeBSD.org/src/commit/?id=811e27fa3c445664e36071a7d08228fc7fb85676 > >> > > >> > commit 811e27fa3c445664e36071a7d08228fc7fb85676 > >> > Author: Jamie Gritton > >> > AuthorDate: 2021-02-22 20:27:44 +0000 > >> > Commit: Jamie Gritton > >> > CommitDate: 2021-02-22 20:27:44 +0000 > >> > > >> > jail: Add PD_KILL to remove a prison in prison_deref(). > >> > > >> > Add the PD_KILL flag that instructs prison_deref() to take steps > >> > to actively kill a prison and its descendents, namely marking it > >> > PRISON_STATE_DYING, clearing its PR_PERSIST flag, and killing any > >> > attached processes. > >> > > >> > This replaces a similar loop in sys_jail_remove(), bringing the > >> > operation under the same single hold on allprison_lock that it already > >> > has. It is also used to clean up failed jail (re-)creations in > >> > kern_jail_set(), which didn't generally take all the proper steps. > >> > > >> > Differential Revision: https://reviews.freebsd.org/D28473 > >> > >> Hi Jamie, > >> > >> After this commit running cd /usr/tests/lib/libc/sys && kyua test > >> cpuset_test renders the entire system unusable: all exec calls > >> afterwards seem to fail. In Jenkins it's triggering a kernel panic: > >> https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17630/consoleFull > >> Reverting this commit fixes the issue. > >> > > > > Based on the backtrace and a wild stab in the dark, the last > > prison_deref() in do_jail_attach() prior to successful return should > > explicitly clear the PD_KILL flag from drflags. > > > > Thanks, > > > > Kyle Evans > > Yep, that's what's doing it. Actually, PD_KILL has no business being > passed to do_jail_attach in the first place. Running a test on that > right now. > Ah, good point! IMHO we should KASSERT() that as well in do_jail_attach(); it doesn't feel like we can do anything sensible with the flag there, so we might as well raise awareness that the caller needs to be more careful if attach failure is significant to the lifetime of the target. From owner-dev-commits-src-all@freebsd.org Thu Feb 25 06:57: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 B072C558FA7; Thu, 25 Feb 2021 06:57: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 4DmNsH4f5Gz3mBQ; Thu, 25 Feb 2021 06:57: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 9243312CED; Thu, 25 Feb 2021 06:57: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 11P6vtTh069283; Thu, 25 Feb 2021 06:57:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P6vtIj069282; Thu, 25 Feb 2021 06:57:55 GMT (envelope-from git) Date: Thu, 25 Feb 2021 06:57:55 GMT Message-Id: <202102250657.11P6vtIj069282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang Subject: git: 12c27808888b - stable/13 - pwrite(2): add a BUGS section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12c27808888b05db09b58af735fbc342080bdb37 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 06:57:55 -0000 The branch stable/13 has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=12c27808888b05db09b58af735fbc342080bdb37 commit 12c27808888b05db09b58af735fbc342080bdb37 Author: Guangyuan Yang AuthorDate: 2021-02-20 08:03:15 +0000 Commit: Guangyuan Yang CommitDate: 2021-02-25 06:57:35 +0000 pwrite(2): add a BUGS section Add a BUGS section about using pwrite(2) when O_APPEND is set on the fd. Submitted by: Ka Ho Ng Reviewed by: gbe, yuripv Differential Revision: https://reviews.freebsd.org/D28372 (cherry picked from commit 504e64af32ba6c62fdcc894a3b1da76061c64796) --- lib/libc/sys/write.2 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2 index f05db0de81c4..937e95b53a14 100644 --- a/lib/libc/sys/write.2 +++ b/lib/libc/sys/write.2 @@ -28,7 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -.Dd October 25, 2020 +.Dd February 11, 2021 .Dt WRITE 2 .Os .Sh NAME @@ -298,3 +298,17 @@ The .Fn write function appeared in .At v1 . +.Sh BUGS +The +.Fn pwrite +system call appends the file without changing the file offset if +.Dv O_APPEND +is set, contrary to +.St -p1003.1-2008 +where +.Fn pwrite +writes into +.Fa offset +regardless of whether +.Dv O_APPEND +is set. From owner-dev-commits-src-all@freebsd.org Thu Feb 25 07:53: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 9D39B559FDC; Thu, 25 Feb 2021 07:53: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 4DmQ4s45Y7z3q8B; Thu, 25 Feb 2021 07:53: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 7F72013F8A; Thu, 25 Feb 2021 07:53: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 11P7r179047111; Thu, 25 Feb 2021 07:53:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P7r1TG047110; Thu, 25 Feb 2021 07:53:01 GMT (envelope-from git) Date: Thu, 25 Feb 2021 07:53:01 GMT Message-Id: <202102250753.11P7r1TG047110@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: 5d66edf463a0 - stable/12 - ether: add older ethertype definitions for QinQ 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: 5d66edf463a053a840a08322107363cf79249f6f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 07:53:01 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=5d66edf463a053a840a08322107363cf79249f6f commit 5d66edf463a053a840a08322107363cf79249f6f Author: Philip Paeps AuthorDate: 2019-10-17 00:34:53 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 07:51:39 +0000 ether: add older ethertype definitions for QinQ Older network equipment used the ethertypes 0x9100, 0x9200, and 0x9300 for outer VLANs, before standardisation introduced 0x88a8. Submitted by: Lutz Donnerhacke Differential Revision: https://reviews.freebsd.org/D21846 (cherry picked from commit 579b70db8922b1debf3bd99bb2b822d60b95575d) --- sys/net/ethernet.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index 5e46f124a0f2..fdfc41b55037 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -360,10 +360,13 @@ struct ether_vlan_header { #define ETHERTYPE_PBB 0x88E7 /* 802.1Q Provider Backbone Bridges */ #define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */ +#define ETHERTYPE_8021Q9100 0x9100 /* IEEE 802.1Q stacking (proprietary) */ #define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */ #define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */ #define ETHERTYPE_TCPSM 0x9002 /* 3Com (Formerly Bridge Communications), TCP/IP Systems Management */ #define ETHERTYPE_BCLOOP 0x9003 /* 3Com (Formerly Bridge Communications), loopback detection */ +#define ETHERTYPE_8021Q9200 0x9200 /* IEEE 802.1Q stacking (proprietary) */ +#define ETHERTYPE_8021Q9300 0x9300 /* IEEE 802.1Q stacking (proprietary) */ #define ETHERTYPE_DEBNI 0xAAAA /* DECNET? Used by VAX 6220 DEBNI */ #define ETHERTYPE_SONIX 0xFAF5 /* Sonix Arpeggio */ #define ETHERTYPE_VITAL 0xFF00 /* BBN VITAL-LanBridge cache wakeups */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 07:53: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 B38F855A20E; Thu, 25 Feb 2021 07:53: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 4DmQ4t4Xnsz3q2w; Thu, 25 Feb 2021 07:53: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 8D927140E3; Thu, 25 Feb 2021 07:53: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 11P7r2XR047134; Thu, 25 Feb 2021 07:53:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P7r2S4047133; Thu, 25 Feb 2021 07:53:02 GMT (envelope-from git) Date: Thu, 25 Feb 2021 07:53:02 GMT Message-Id: <202102250753.11P7r2S4047133@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: a0e2fe87031a - stable/12 - netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type 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: a0e2fe87031a63f336d2a66c383cc017b6207cd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 07:53:02 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=a0e2fe87031a63f336d2a66c383cc017b6207cd1 commit a0e2fe87031a63f336d2a66c383cc017b6207cd1 Author: Lutz Donnerhacke AuthorDate: 2021-01-26 15:50:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 07:51:58 +0000 netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type This node is part of an A10-NSP (L2-BSA) development. Carrier networks tend to stack three or more tags for internal purposes and therefore hiding the service tags deep inside of the stack. When decomposing such an access network frame, the processing order is typically reversed: First distinguish by service, than by other means. This new netgragh node allows to bring the relevant VLAN in front (to the out-most position). This way other netgraph nodes (like ng_vlan) can operate on this specific type. Reviewed by: manpages (gbe), brueffer (manpages), kp Relnotes: yes Sponsored by: IKS Service GmbH Differential Revision: https://reviews.freebsd.org/D22076 (cherry picked from commit cfd6422a5217410fbd66f7a7a8a64d9d85e61229) --- share/man/man4/Makefile | 1 + share/man/man4/ng_vlan_rotate.4 | 252 +++++++++++++++ sys/conf/files | 1 + sys/modules/netgraph/Makefile | 3 +- sys/modules/netgraph/vlan_rotate/Makefile | 6 + sys/netgraph/ng_vlan_rotate.c | 510 ++++++++++++++++++++++++++++++ sys/netgraph/ng_vlan_rotate.h | 67 ++++ 7 files changed, 839 insertions(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index f3b227efcfde..1ea16db94550 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -391,6 +391,7 @@ MAN= aac.4 \ ng_uni.4 \ ng_vjc.4 \ ng_vlan.4 \ + ng_vlan_rotate.4 \ nmdm.4 \ nsp.4 \ ${_ntb.4} \ diff --git a/share/man/man4/ng_vlan_rotate.4 b/share/man/man4/ng_vlan_rotate.4 new file mode 100644 index 000000000000..4640737c7d54 --- /dev/null +++ b/share/man/man4/ng_vlan_rotate.4 @@ -0,0 +1,252 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2019-2021 IKS Service GmbH +.\" +.\" 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. +.\" +.\" Author: Lutz Donnerhacke +.\" +.\" $FreeBSD$ +.\" +.Dd January 26, 2021 +.Dt NG_VLAN_ROTATE 4 +.Os +.Sh NAME +.Nm ng_vlan_rotate +.Nd IEEE 802.1ad VLAN manipulation netgraph node type +.Sh SYNOPSIS +.In sys/types.h +.In netgraph.h +.In netgraph/ng_vlan_rotate.h +.Sh DESCRIPTION +The +.Nm +node type manipulates the order of VLAN tags of frames tagged +according to the IEEE 802.1ad (an extension of IEEE 802.1Q) standard +between different hooks. +.Pp +Each node has four special hooks, +.Va original , +.Va ordered , +.Va excessive , +and +.Va incomplete . +.Pp +A frame tagged with an arbitrary number of +.Dv ETHERTYPE_VLAN , +.Dv ETHERTYPE_QINQ , +and +.Dv 0x9100 +tags received on the +.Va original +hook will be rearranged to a new order of those tags and is sent out +the +.Dq ordered +hook. +After successful processing the +.Va histogram +counter for the observed stack size increments. +.Pp +If it contains fewer VLANs in the stack than the configured +.Va min +limit, the frame is sent out to the +.Va incomplete +hook and the +.Va incomplete +counter increments. +.Pp +If there are more VLANs in the stack than the configured +.Va max +limit, the frame is sent out to the +.Va excessive +hook and the +.Va excessive +counter increments. +.Pp +If the destination hook is not connected, the frame is dropped and the +.Va drops +counter increments. +.Pp +For Ethernet frames received on the +.Va ordered +hook, the transformation is reversed and is passed to the +.Va original +hook. +Please note that this process is identical to the one described +above, besides the ordered/original hooks are swapped and the +transformation is reversed. +.Pp +An Ethernet frame received on the +.Va incomplete +or +.Va excessive +hook is forwarded to the +.Va original +hook without any modification. +.Pp +This node supports only one operation at the moment: Rotation of the +VLANs in the stack. +Setting the configuration parameter +.Va rot +to a positive value, the stack will roll up by this amount. +Negative values will roll down. +A typical scenario is setting the value to 1 in order to bring the +innermost VLAN tag to the outmost level. +Rotation includes the VLAN id, the ether type, and the QOS parameters +pcp and cfi. +Typical QOS handling refers to the outmost setting, so be careful to +keep your QOS intact. +.Sh HOOKS +This node type supports the following hooks: +.Bl -tag -width incomplete +.It Va original +Typically this hook would be connected to a +.Xr ng_ether 4 +node, using the +.Va lower +hook connected to a carrier network. +.It Va ordered +Typically this hook would be connected to a +.Xr ng_vlan 4 +type node using the +.Va downstream +hook in order to separate services. +.It Va excessive +see below. +.It Va incomplete +Typically those hooks would be attached to a +.Xr ng_eiface 4 +type node using the +.Va ether +hook for anomaly monitoring purposes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_VLANROTATE_GET_CONF Pq Ic getconf +Read the current configuration. +.It Dv NGM_VLANROTATE_SET_CONF Pq Ic setconf +Set the current configuration. +.It Dv NGM_VLANROTATE_GET_STAT Pq Ic getstat +Read the current statistics. +.It Dv NGM_VLANROTATE_CLR_STAT Pq Ic clrstat +Zeroize the statistics. +.It Dv NGM_VLANROTATE_GETCLR_STAT Pq Ic getclrstat +Read the current statistics and zeroize it in one step. +.El +.Sh EXAMPLES +The first example demonstrates how to rotate double or triple tagged +frames so that the innermost C-VLAN can be used as service +discriminator. +The single or double tagged frames (C-VLAN removed) are sent out to an +interface pointing to different infrastucture. +.Bd -literal +#!/bin/sh + +BNG_IF=ixl3 +VOIP_IF=bge2 + +ngctl -f- < 00:01:02:03:04:05, + ethertype 802.1Q-9100 (0x9100), length 110: vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype 802.1Q, vlan 123, p 7, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The frame ejected on the +.Va ordered +hook will look like this: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q (0x8100), length 110: vlan 123, p 7, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +Hence, the frame pushed out to the +.Dv VOIP_IF +will have this form: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The second example distinguishes between double tagged and single +tagged frames. +.Bd -literal +#!/bin/sh + +IN_IF=bge1 + +ngctl -f- < diff --git a/sys/netgraph/ng_vlan_rotate.c b/sys/netgraph/ng_vlan_rotate.c new file mode 100644 index 000000000000..e6de782d9bb3 --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.c @@ -0,0 +1,510 @@ +/*- + * Spdx-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +/* + * This section contains the netgraph method declarations for the + * sample node. These methods define the netgraph 'type'. + */ + +static ng_constructor_t ng_vlanrotate_constructor; +static ng_rcvmsg_t ng_vlanrotate_rcvmsg; +static ng_shutdown_t ng_vlanrotate_shutdown; +static ng_newhook_t ng_vlanrotate_newhook; +static ng_rcvdata_t ng_vlanrotate_rcvdata; +static ng_disconnect_t ng_vlanrotate_disconnect; + +/* Parse type for struct ng_vlanrotate_conf */ +static const struct ng_parse_struct_field ng_vlanrotate_conf_fields[] = { + {"rot", &ng_parse_int8_type}, + {"min", &ng_parse_uint8_type}, + {"max", &ng_parse_uint8_type}, + {NULL} +}; +static const struct ng_parse_type ng_vlanrotate_conf_type = { + &ng_parse_struct_type, + &ng_vlanrotate_conf_fields +}; + +/* Parse type for struct ng_vlanrotate_stat */ +static struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info = { + &ng_parse_uint64_type, + NG_VLANROTATE_MAX_VLANS +}; +static struct ng_parse_type ng_vlanrotate_stat_hist = { + &ng_parse_fixedarray_type, + &ng_vlanrotate_stat_hist_info +}; +static const struct ng_parse_struct_field ng_vlanrotate_stat_fields[] = { + {"drops", &ng_parse_uint64_type}, + {"excessive", &ng_parse_uint64_type}, + {"incomplete", &ng_parse_uint64_type}, + {"histogram", &ng_vlanrotate_stat_hist}, + {NULL} +}; +static struct ng_parse_type ng_vlanrotate_stat_type = { + &ng_parse_struct_type, + &ng_vlanrotate_stat_fields +}; + + +/* List of commands and how to convert arguments to/from ASCII */ +static const struct ng_cmdlist ng_vlanrotate_cmdlist[] = { + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_CONF, + "getconf", + NULL, + &ng_vlanrotate_conf_type, + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_SET_CONF, + "setconf", + &ng_vlanrotate_conf_type, + NULL + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_STAT, + "getstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_CLR_STAT, + "clrstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GETCLR_STAT, + "getclrstat", + NULL, + &ng_vlanrotate_stat_type + }, + {0} +}; + +/* Netgraph node type descriptor */ +static struct ng_type typestruct = { + .version = NG_ABI_VERSION, + .name = NG_VLANROTATE_NODE_TYPE, + .constructor = ng_vlanrotate_constructor, + .rcvmsg = ng_vlanrotate_rcvmsg, + .shutdown = ng_vlanrotate_shutdown, + .newhook = ng_vlanrotate_newhook, + .rcvdata = ng_vlanrotate_rcvdata, + .disconnect = ng_vlanrotate_disconnect, + .cmdlist = ng_vlanrotate_cmdlist, +}; +NETGRAPH_INIT(vlanrotate, &typestruct); + +struct ng_vlanrotate_kernel_stats { + counter_u64_t drops, excessive, incomplete; + counter_u64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Information we store for each node */ +struct vlanrotate { + hook_p original_hook; + hook_p ordered_hook; + hook_p excessive_hook; + hook_p incomplete_hook; + struct ng_vlanrotate_conf conf; + struct ng_vlanrotate_kernel_stats stats; +}; +typedef struct vlanrotate *vlanrotate_p; + +/* + * Set up the private data structure. + */ +static int +ng_vlanrotate_constructor(node_p node) +{ + int i; + + vlanrotate_p vrp = malloc(sizeof(*vrp), M_NETGRAPH, M_WAITOK | M_ZERO); + + vrp->conf.max = NG_VLANROTATE_MAX_VLANS; + + vrp->stats.drops = counter_u64_alloc(M_WAITOK); + vrp->stats.excessive = counter_u64_alloc(M_WAITOK); + vrp->stats.incomplete = counter_u64_alloc(M_WAITOK); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + vrp->stats.histogram[i] = counter_u64_alloc(M_WAITOK); + + NG_NODE_SET_PRIVATE(node, vrp); + return (0); +} + +/* + * Give our ok for a hook to be added. + */ +static int +ng_vlanrotate_newhook(node_p node, hook_p hook, const char *name) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + hook_p *dst = NULL; + + if (strcmp(name, NG_VLANROTATE_HOOK_ORDERED) == 0) { + dst = &vrp->ordered_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_ORIGINAL) == 0) { + dst = &vrp->original_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_EXCESSIVE) == 0) { + dst = &vrp->excessive_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_INCOMPLETE) == 0) { + dst = &vrp->incomplete_hook; + } else + return (EINVAL); /* not a hook we know about */ + + if (*dst != NULL) + return (EADDRINUSE); /* don't override */ + + *dst = hook; + return (0); +} + +/* + * Get a netgraph control message. + * A response is not required. + */ +static int +ng_vlanrotate_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + struct ng_mesg *resp = NULL; + struct ng_mesg *msg; + struct ng_vlanrotate_conf *pcf; + int error = 0; + + NGI_GET_MSG(item, msg); + /* Deal with message according to cookie and command */ + switch (msg->header.typecookie) { + case NGM_VLANROTATE_COOKIE: + switch (msg->header.cmd) { + case NGM_VLANROTATE_GET_CONF: + NG_MKRESPONSE(resp, msg, sizeof(vrp->conf), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + *((struct ng_vlanrotate_conf *)resp->data) = vrp->conf; + break; + case NGM_VLANROTATE_SET_CONF: + if (msg->header.arglen != sizeof(*pcf)) { + error = EINVAL; + break; + } + + pcf = (struct ng_vlanrotate_conf *)msg->data; + + if (pcf->max == 0) /* keep current value */ + pcf->max = vrp->conf.max; + + if ((pcf->max > NG_VLANROTATE_MAX_VLANS) || + (pcf->min > pcf->max) || + (abs(pcf->rot) >= pcf->max)) { + error = EINVAL; + break; + } + + vrp->conf = *pcf; + break; + case NGM_VLANROTATE_GET_STAT: + case NGM_VLANROTATE_GETCLR_STAT: + { + struct ng_vlanrotate_stat *p; + int i; + + NG_MKRESPONSE(resp, msg, sizeof(*p), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + p = (struct ng_vlanrotate_stat *)resp->data; + p->drops = counter_u64_fetch(vrp->stats.drops); + p->excessive = counter_u64_fetch(vrp->stats.excessive); + p->incomplete = counter_u64_fetch(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + p->histogram[i] = counter_u64_fetch(vrp->stats.histogram[i]); + if (msg->header.cmd != NGM_VLANROTATE_GETCLR_STAT) + break; + } + case NGM_VLANROTATE_CLR_STAT: + { + int i; + + counter_u64_zero(vrp->stats.drops); + counter_u64_zero(vrp->stats.excessive); + counter_u64_zero(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_zero(vrp->stats.histogram[i]); + break; + } + default: + error = EINVAL; /* unknown command */ + break; + } + break; + default: + error = EINVAL; /* unknown cookie type */ + break; + } + + /* Take care of synchronous response, if any */ + NG_RESPOND_MSG(error, node, item, resp); + /* Free the message and return */ + NG_FREE_MSG(msg); + return (error); +} + +/* + * Receive data, and do rotate the vlans as desired. + * + * Rotating is quite complicated if the rotation offset and the number + * of vlans are not relativly prime. In this case multiple slices need + * to be rotated separately. + * + * Rotation can be additive or subtractive. Some examples: + * 01234 5 vlans given + * ----- + * 34012 +2 rotate + * 12340 +4 rotate + * 12340 -1 rotate + * + * First some helper functions ... + */ + +struct ether_vlan_stack_entry { + uint16_t proto; + uint16_t tag; +} __packed; + +struct ether_vlan_stack_header { + uint8_t dst[ETHER_ADDR_LEN]; + uint8_t src[ETHER_ADDR_LEN]; + struct ether_vlan_stack_entry vlan_stack[1]; +} __packed; + +static int +ng_vlanrotate_gcd(int a, int b) +{ + if (b == 0) + return a; + else + return ng_vlanrotate_gcd(b, a % b); +} + +static void +ng_vlanrotate_rotate(struct ether_vlan_stack_entry arr[], int d, int n) +{ + int i, j, k; + struct ether_vlan_stack_entry temp; + + /* for each commensurable slice */ + for (i = ng_vlanrotate_gcd(d, n); i-- > 0;) { + /* rotate left aka downwards */ + temp = arr[i]; + j = i; + + while (1) { + k = j + d; + if (k >= n) + k = k - n; + if (k == i) + break; + arr[j] = arr[k]; + j = k; + } + + arr[j] = temp; + } +} + +static int +ng_vlanrotate_rcvdata(hook_p hook, item_p item) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct ether_vlan_stack_header *evsh; + struct mbuf *m = NULL; + hook_p dst_hook; + int8_t rotate; + int8_t vlans = 0; + int error = ENOSYS; + + NGI_GET_M(item, m); + + if (hook == vrp->ordered_hook) { + rotate = +vrp->conf.rot; + dst_hook = vrp->original_hook; + } else if (hook == vrp->original_hook) { + rotate = -vrp->conf.rot; + dst_hook = vrp->ordered_hook; + } else { + dst_hook = vrp->original_hook; + goto send; /* everything else goes out unmodified */ + } + + if (dst_hook == NULL) { + error = ENETDOWN; + goto fail; + } + + /* count the vlans */ + for (vlans = 0; vlans <= NG_VLANROTATE_MAX_VLANS; vlans++) { + size_t expected_len = sizeof(struct ether_vlan_stack_header) + + vlans * sizeof(struct ether_vlan_stack_entry); + + if (m->m_len < expected_len) { + m = m_pullup(m, expected_len); + if (m == NULL) { + error = EINVAL; + goto fail; + } + } + + evsh = mtod(m, struct ether_vlan_stack_header *); + switch (ntohs(evsh->vlan_stack[vlans].proto)) { + case ETHERTYPE_VLAN: + case ETHERTYPE_QINQ: + case ETHERTYPE_8021Q9100: + case ETHERTYPE_8021Q9200: + case ETHERTYPE_8021Q9300: + break; + default: + goto out; + } + } +out: + if ((vlans > vrp->conf.max) || (vlans >= NG_VLANROTATE_MAX_VLANS)) { + counter_u64_add(vrp->stats.excessive, 1); + dst_hook = vrp->excessive_hook; + goto send; + } + + if ((vlans < vrp->conf.min) || (vlans <= abs(rotate))) { + counter_u64_add(vrp->stats.incomplete, 1); + dst_hook = vrp->incomplete_hook; + goto send; + } + counter_u64_add(vrp->stats.histogram[vlans], 1); + + /* rotating upwards always (using modular arithmetics) */ + if (rotate == 0) { + /* nothing to do */ + } else if (rotate > 0) { + ng_vlanrotate_rotate(evsh->vlan_stack, rotate, vlans); + } else { + ng_vlanrotate_rotate(evsh->vlan_stack, vlans + rotate, vlans); + } + +send: + if (dst_hook == NULL) + goto fail; + NG_FWD_NEW_DATA(error, item, dst_hook, m); + return 0; + +fail: + counter_u64_add(vrp->stats.drops, 1); + if (m != NULL) + m_freem(m); + NG_FREE_ITEM(item); + return (error); +} + +/* + * Do local shutdown processing.. + * All our links and the name have already been removed. + */ +static int +ng_vlanrotate_shutdown(node_p node) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + int i; + + NG_NODE_SET_PRIVATE(node, NULL); + + counter_u64_free(vrp->stats.drops); + counter_u64_free(vrp->stats.excessive); + counter_u64_free(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_free(vrp->stats.histogram[i]); + + free(vrp, M_NETGRAPH); + + NG_NODE_UNREF(node); + return (0); +} + +/* + * Hook disconnection + * For this type, removal of the last link destroys the node + */ +static int +ng_vlanrotate_disconnect(hook_p hook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (vrp->original_hook == hook) + vrp->original_hook = NULL; + if (vrp->ordered_hook == hook) + vrp->ordered_hook = NULL; + if (vrp->excessive_hook == hook) + vrp->excessive_hook = NULL; + if (vrp->incomplete_hook == hook) + vrp->incomplete_hook = NULL; + + /* during shutdown the node is invalid, don't shutdown twice */ + if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) && + (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) + ng_rmnode_self(NG_HOOK_NODE(hook)); + return (0); +} diff --git a/sys/netgraph/ng_vlan_rotate.h b/sys/netgraph/ng_vlan_rotate.h new file mode 100644 index 000000000000..ef6dfd6b506a --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.h @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_NG_VLAN_ROTATE_H_ +#define _NETGRAPH_NG_VLAN_ROTATE_H_ + +#define NG_VLANROTATE_NODE_TYPE "vlan_rotate" +#define NGM_VLANROTATE_COOKIE 1568378766 + +/* Hook names */ +#define NG_VLANROTATE_HOOK_ORDERED "ordered" +#define NG_VLANROTATE_HOOK_ORIGINAL "original" +#define NG_VLANROTATE_HOOK_EXCESSIVE "excessive" +#define NG_VLANROTATE_HOOK_INCOMPLETE "incomplete" + +/* Limits */ +#define NG_VLANROTATE_MAX_VLANS 10 + +/* Datastructures for netgraph commands */ +struct ng_vlanrotate_conf { + int8_t rot; + uint8_t min, max; +}; + +struct ng_vlanrotate_stat { + uint64_t drops, excessive, incomplete; + uint64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Netgraph commands understood by this node type */ +enum { + NGM_VLANROTATE_GET_CONF = 1, + NGM_VLANROTATE_SET_CONF, + NGM_VLANROTATE_GET_STAT, + NGM_VLANROTATE_CLR_STAT, + NGM_VLANROTATE_GETCLR_STAT +}; + +#endif /* _NETGRAPH_NG_VLAN_ROTATE_H_ */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 07:59: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 10D9555A5B6; Thu, 25 Feb 2021 07:59:34 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmQDP5fJhz3qX8; Thu, 25 Feb 2021 07:59:33 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 11P7xHL8009209 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 25 Feb 2021 08:59:17 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 11P7xHoQ029807; Thu, 25 Feb 2021 08:59:17 +0100 Date: Thu, 25 Feb 2021 08:59:17 +0100 From: Lutz Donnerhacke To: Lutz Donnerhacke Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 5d66edf463a0 - stable/12 - ether: add older ethertype definitions for QinQ Message-ID: <20210225075917.GA29787@belenus.iks-jena.de> References: <202102250753.11P7r1TG047110@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102250753.11P7r1TG047110@gitrepo.freebsd.org> X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DmQDP5fJhz3qX8 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, 25 Feb 2021 07:59:34 -0000 On Thu, Feb 25, 2021 at 07:53:01AM +0000, Lutz Donnerhacke wrote: > The branch stable/12 has been updated by donner: > > URL: https://cgit.FreeBSD.org/src/commit/?id=5d66edf463a053a840a08322107363cf79249f6f > > commit 5d66edf463a053a840a08322107363cf79249f6f > Author: Philip Paeps > AuthorDate: 2019-10-17 00:34:53 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-25 07:51:39 +0000 > > ether: add older ethertype definitions for QinQ > > Older network equipment used the ethertypes 0x9100, 0x9200, and 0x9300 for > outer VLANs, before standardisation introduced 0x88a8. > > Submitted by: Lutz Donnerhacke > Differential Revision: https://reviews.freebsd.org/D21846 > > (cherry picked from commit 579b70db8922b1debf3bd99bb2b822d60b95575d) That's a prerequisite for the next commit. So I commited it in a bundle with the MFCed one. From owner-dev-commits-src-all@freebsd.org Thu Feb 25 08: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 332A855AC42; Thu, 25 Feb 2021 08: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 4DmQLX0xc7z3rBF; Thu, 25 Feb 2021 08: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 1316814304; Thu, 25 Feb 2021 08: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 11P84q4a061693; Thu, 25 Feb 2021 08:04:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P84qCj061692; Thu, 25 Feb 2021 08:04:52 GMT (envelope-from git) Date: Thu, 25 Feb 2021 08:04:52 GMT Message-Id: <202102250804.11P84qCj061692@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: 522a0b7d029f - stable/13 - netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type 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: 522a0b7d029f4bf966081c10673405c946fe3dc0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 08:04:52 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=522a0b7d029f4bf966081c10673405c946fe3dc0 commit 522a0b7d029f4bf966081c10673405c946fe3dc0 Author: Lutz Donnerhacke AuthorDate: 2021-01-26 15:50:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 08:04:24 +0000 netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type This node is part of an A10-NSP (L2-BSA) development. Carrier networks tend to stack three or more tags for internal purposes and therefore hiding the service tags deep inside of the stack. When decomposing such an access network frame, the processing order is typically reversed: First distinguish by service, than by other means. This new netgragh node allows to bring the relevant VLAN in front (to the out-most position). This way other netgraph nodes (like ng_vlan) can operate on this specific type. Reviewed by: manpages (gbe), brueffer (manpages), kp Relnotes: yes Sponsored by: IKS Service GmbH Differential Revision: https://reviews.freebsd.org/D22076 (cherry picked from commit cfd6422a5217410fbd66f7a7a8a64d9d85e61229) --- share/man/man4/Makefile | 1 + share/man/man4/ng_vlan_rotate.4 | 252 +++++++++++++++ sys/conf/files | 1 + sys/modules/netgraph/Makefile | 3 +- sys/modules/netgraph/vlan_rotate/Makefile | 6 + sys/netgraph/ng_vlan_rotate.c | 510 ++++++++++++++++++++++++++++++ sys/netgraph/ng_vlan_rotate.h | 67 ++++ 7 files changed, 839 insertions(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index b66dcf135733..5ccb42181482 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -393,6 +393,7 @@ MAN= aac.4 \ ng_uni.4 \ ng_vjc.4 \ ng_vlan.4 \ + ng_vlan_rotate.4 \ nmdm.4 \ ${_ntb.4} \ ${_ntb_hw_amd.4} \ diff --git a/share/man/man4/ng_vlan_rotate.4 b/share/man/man4/ng_vlan_rotate.4 new file mode 100644 index 000000000000..4640737c7d54 --- /dev/null +++ b/share/man/man4/ng_vlan_rotate.4 @@ -0,0 +1,252 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2019-2021 IKS Service GmbH +.\" +.\" 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. +.\" +.\" Author: Lutz Donnerhacke +.\" +.\" $FreeBSD$ +.\" +.Dd January 26, 2021 +.Dt NG_VLAN_ROTATE 4 +.Os +.Sh NAME +.Nm ng_vlan_rotate +.Nd IEEE 802.1ad VLAN manipulation netgraph node type +.Sh SYNOPSIS +.In sys/types.h +.In netgraph.h +.In netgraph/ng_vlan_rotate.h +.Sh DESCRIPTION +The +.Nm +node type manipulates the order of VLAN tags of frames tagged +according to the IEEE 802.1ad (an extension of IEEE 802.1Q) standard +between different hooks. +.Pp +Each node has four special hooks, +.Va original , +.Va ordered , +.Va excessive , +and +.Va incomplete . +.Pp +A frame tagged with an arbitrary number of +.Dv ETHERTYPE_VLAN , +.Dv ETHERTYPE_QINQ , +and +.Dv 0x9100 +tags received on the +.Va original +hook will be rearranged to a new order of those tags and is sent out +the +.Dq ordered +hook. +After successful processing the +.Va histogram +counter for the observed stack size increments. +.Pp +If it contains fewer VLANs in the stack than the configured +.Va min +limit, the frame is sent out to the +.Va incomplete +hook and the +.Va incomplete +counter increments. +.Pp +If there are more VLANs in the stack than the configured +.Va max +limit, the frame is sent out to the +.Va excessive +hook and the +.Va excessive +counter increments. +.Pp +If the destination hook is not connected, the frame is dropped and the +.Va drops +counter increments. +.Pp +For Ethernet frames received on the +.Va ordered +hook, the transformation is reversed and is passed to the +.Va original +hook. +Please note that this process is identical to the one described +above, besides the ordered/original hooks are swapped and the +transformation is reversed. +.Pp +An Ethernet frame received on the +.Va incomplete +or +.Va excessive +hook is forwarded to the +.Va original +hook without any modification. +.Pp +This node supports only one operation at the moment: Rotation of the +VLANs in the stack. +Setting the configuration parameter +.Va rot +to a positive value, the stack will roll up by this amount. +Negative values will roll down. +A typical scenario is setting the value to 1 in order to bring the +innermost VLAN tag to the outmost level. +Rotation includes the VLAN id, the ether type, and the QOS parameters +pcp and cfi. +Typical QOS handling refers to the outmost setting, so be careful to +keep your QOS intact. +.Sh HOOKS +This node type supports the following hooks: +.Bl -tag -width incomplete +.It Va original +Typically this hook would be connected to a +.Xr ng_ether 4 +node, using the +.Va lower +hook connected to a carrier network. +.It Va ordered +Typically this hook would be connected to a +.Xr ng_vlan 4 +type node using the +.Va downstream +hook in order to separate services. +.It Va excessive +see below. +.It Va incomplete +Typically those hooks would be attached to a +.Xr ng_eiface 4 +type node using the +.Va ether +hook for anomaly monitoring purposes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_VLANROTATE_GET_CONF Pq Ic getconf +Read the current configuration. +.It Dv NGM_VLANROTATE_SET_CONF Pq Ic setconf +Set the current configuration. +.It Dv NGM_VLANROTATE_GET_STAT Pq Ic getstat +Read the current statistics. +.It Dv NGM_VLANROTATE_CLR_STAT Pq Ic clrstat +Zeroize the statistics. +.It Dv NGM_VLANROTATE_GETCLR_STAT Pq Ic getclrstat +Read the current statistics and zeroize it in one step. +.El +.Sh EXAMPLES +The first example demonstrates how to rotate double or triple tagged +frames so that the innermost C-VLAN can be used as service +discriminator. +The single or double tagged frames (C-VLAN removed) are sent out to an +interface pointing to different infrastucture. +.Bd -literal +#!/bin/sh + +BNG_IF=ixl3 +VOIP_IF=bge2 + +ngctl -f- < 00:01:02:03:04:05, + ethertype 802.1Q-9100 (0x9100), length 110: vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype 802.1Q, vlan 123, p 7, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The frame ejected on the +.Va ordered +hook will look like this: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q (0x8100), length 110: vlan 123, p 7, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +Hence, the frame pushed out to the +.Dv VOIP_IF +will have this form: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The second example distinguishes between double tagged and single +tagged frames. +.Bd -literal +#!/bin/sh + +IN_IF=bge1 + +ngctl -f- < diff --git a/sys/netgraph/ng_vlan_rotate.c b/sys/netgraph/ng_vlan_rotate.c new file mode 100644 index 000000000000..e6de782d9bb3 --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.c @@ -0,0 +1,510 @@ +/*- + * Spdx-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +/* + * This section contains the netgraph method declarations for the + * sample node. These methods define the netgraph 'type'. + */ + +static ng_constructor_t ng_vlanrotate_constructor; +static ng_rcvmsg_t ng_vlanrotate_rcvmsg; +static ng_shutdown_t ng_vlanrotate_shutdown; +static ng_newhook_t ng_vlanrotate_newhook; +static ng_rcvdata_t ng_vlanrotate_rcvdata; +static ng_disconnect_t ng_vlanrotate_disconnect; + +/* Parse type for struct ng_vlanrotate_conf */ +static const struct ng_parse_struct_field ng_vlanrotate_conf_fields[] = { + {"rot", &ng_parse_int8_type}, + {"min", &ng_parse_uint8_type}, + {"max", &ng_parse_uint8_type}, + {NULL} +}; +static const struct ng_parse_type ng_vlanrotate_conf_type = { + &ng_parse_struct_type, + &ng_vlanrotate_conf_fields +}; + +/* Parse type for struct ng_vlanrotate_stat */ +static struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info = { + &ng_parse_uint64_type, + NG_VLANROTATE_MAX_VLANS +}; +static struct ng_parse_type ng_vlanrotate_stat_hist = { + &ng_parse_fixedarray_type, + &ng_vlanrotate_stat_hist_info +}; +static const struct ng_parse_struct_field ng_vlanrotate_stat_fields[] = { + {"drops", &ng_parse_uint64_type}, + {"excessive", &ng_parse_uint64_type}, + {"incomplete", &ng_parse_uint64_type}, + {"histogram", &ng_vlanrotate_stat_hist}, + {NULL} +}; +static struct ng_parse_type ng_vlanrotate_stat_type = { + &ng_parse_struct_type, + &ng_vlanrotate_stat_fields +}; + + +/* List of commands and how to convert arguments to/from ASCII */ +static const struct ng_cmdlist ng_vlanrotate_cmdlist[] = { + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_CONF, + "getconf", + NULL, + &ng_vlanrotate_conf_type, + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_SET_CONF, + "setconf", + &ng_vlanrotate_conf_type, + NULL + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_STAT, + "getstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_CLR_STAT, + "clrstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GETCLR_STAT, + "getclrstat", + NULL, + &ng_vlanrotate_stat_type + }, + {0} +}; + +/* Netgraph node type descriptor */ +static struct ng_type typestruct = { + .version = NG_ABI_VERSION, + .name = NG_VLANROTATE_NODE_TYPE, + .constructor = ng_vlanrotate_constructor, + .rcvmsg = ng_vlanrotate_rcvmsg, + .shutdown = ng_vlanrotate_shutdown, + .newhook = ng_vlanrotate_newhook, + .rcvdata = ng_vlanrotate_rcvdata, + .disconnect = ng_vlanrotate_disconnect, + .cmdlist = ng_vlanrotate_cmdlist, +}; +NETGRAPH_INIT(vlanrotate, &typestruct); + +struct ng_vlanrotate_kernel_stats { + counter_u64_t drops, excessive, incomplete; + counter_u64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Information we store for each node */ +struct vlanrotate { + hook_p original_hook; + hook_p ordered_hook; + hook_p excessive_hook; + hook_p incomplete_hook; + struct ng_vlanrotate_conf conf; + struct ng_vlanrotate_kernel_stats stats; +}; +typedef struct vlanrotate *vlanrotate_p; + +/* + * Set up the private data structure. + */ +static int +ng_vlanrotate_constructor(node_p node) +{ + int i; + + vlanrotate_p vrp = malloc(sizeof(*vrp), M_NETGRAPH, M_WAITOK | M_ZERO); + + vrp->conf.max = NG_VLANROTATE_MAX_VLANS; + + vrp->stats.drops = counter_u64_alloc(M_WAITOK); + vrp->stats.excessive = counter_u64_alloc(M_WAITOK); + vrp->stats.incomplete = counter_u64_alloc(M_WAITOK); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + vrp->stats.histogram[i] = counter_u64_alloc(M_WAITOK); + + NG_NODE_SET_PRIVATE(node, vrp); + return (0); +} + +/* + * Give our ok for a hook to be added. + */ +static int +ng_vlanrotate_newhook(node_p node, hook_p hook, const char *name) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + hook_p *dst = NULL; + + if (strcmp(name, NG_VLANROTATE_HOOK_ORDERED) == 0) { + dst = &vrp->ordered_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_ORIGINAL) == 0) { + dst = &vrp->original_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_EXCESSIVE) == 0) { + dst = &vrp->excessive_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_INCOMPLETE) == 0) { + dst = &vrp->incomplete_hook; + } else + return (EINVAL); /* not a hook we know about */ + + if (*dst != NULL) + return (EADDRINUSE); /* don't override */ + + *dst = hook; + return (0); +} + +/* + * Get a netgraph control message. + * A response is not required. + */ +static int +ng_vlanrotate_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + struct ng_mesg *resp = NULL; + struct ng_mesg *msg; + struct ng_vlanrotate_conf *pcf; + int error = 0; + + NGI_GET_MSG(item, msg); + /* Deal with message according to cookie and command */ + switch (msg->header.typecookie) { + case NGM_VLANROTATE_COOKIE: + switch (msg->header.cmd) { + case NGM_VLANROTATE_GET_CONF: + NG_MKRESPONSE(resp, msg, sizeof(vrp->conf), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + *((struct ng_vlanrotate_conf *)resp->data) = vrp->conf; + break; + case NGM_VLANROTATE_SET_CONF: + if (msg->header.arglen != sizeof(*pcf)) { + error = EINVAL; + break; + } + + pcf = (struct ng_vlanrotate_conf *)msg->data; + + if (pcf->max == 0) /* keep current value */ + pcf->max = vrp->conf.max; + + if ((pcf->max > NG_VLANROTATE_MAX_VLANS) || + (pcf->min > pcf->max) || + (abs(pcf->rot) >= pcf->max)) { + error = EINVAL; + break; + } + + vrp->conf = *pcf; + break; + case NGM_VLANROTATE_GET_STAT: + case NGM_VLANROTATE_GETCLR_STAT: + { + struct ng_vlanrotate_stat *p; + int i; + + NG_MKRESPONSE(resp, msg, sizeof(*p), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + p = (struct ng_vlanrotate_stat *)resp->data; + p->drops = counter_u64_fetch(vrp->stats.drops); + p->excessive = counter_u64_fetch(vrp->stats.excessive); + p->incomplete = counter_u64_fetch(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + p->histogram[i] = counter_u64_fetch(vrp->stats.histogram[i]); + if (msg->header.cmd != NGM_VLANROTATE_GETCLR_STAT) + break; + } + case NGM_VLANROTATE_CLR_STAT: + { + int i; + + counter_u64_zero(vrp->stats.drops); + counter_u64_zero(vrp->stats.excessive); + counter_u64_zero(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_zero(vrp->stats.histogram[i]); + break; + } + default: + error = EINVAL; /* unknown command */ + break; + } + break; + default: + error = EINVAL; /* unknown cookie type */ + break; + } + + /* Take care of synchronous response, if any */ + NG_RESPOND_MSG(error, node, item, resp); + /* Free the message and return */ + NG_FREE_MSG(msg); + return (error); +} + +/* + * Receive data, and do rotate the vlans as desired. + * + * Rotating is quite complicated if the rotation offset and the number + * of vlans are not relativly prime. In this case multiple slices need + * to be rotated separately. + * + * Rotation can be additive or subtractive. Some examples: + * 01234 5 vlans given + * ----- + * 34012 +2 rotate + * 12340 +4 rotate + * 12340 -1 rotate + * + * First some helper functions ... + */ + +struct ether_vlan_stack_entry { + uint16_t proto; + uint16_t tag; +} __packed; + +struct ether_vlan_stack_header { + uint8_t dst[ETHER_ADDR_LEN]; + uint8_t src[ETHER_ADDR_LEN]; + struct ether_vlan_stack_entry vlan_stack[1]; +} __packed; + +static int +ng_vlanrotate_gcd(int a, int b) +{ + if (b == 0) + return a; + else + return ng_vlanrotate_gcd(b, a % b); +} + +static void +ng_vlanrotate_rotate(struct ether_vlan_stack_entry arr[], int d, int n) +{ + int i, j, k; + struct ether_vlan_stack_entry temp; + + /* for each commensurable slice */ + for (i = ng_vlanrotate_gcd(d, n); i-- > 0;) { + /* rotate left aka downwards */ + temp = arr[i]; + j = i; + + while (1) { + k = j + d; + if (k >= n) + k = k - n; + if (k == i) + break; + arr[j] = arr[k]; + j = k; + } + + arr[j] = temp; + } +} + +static int +ng_vlanrotate_rcvdata(hook_p hook, item_p item) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct ether_vlan_stack_header *evsh; + struct mbuf *m = NULL; + hook_p dst_hook; + int8_t rotate; + int8_t vlans = 0; + int error = ENOSYS; + + NGI_GET_M(item, m); + + if (hook == vrp->ordered_hook) { + rotate = +vrp->conf.rot; + dst_hook = vrp->original_hook; + } else if (hook == vrp->original_hook) { + rotate = -vrp->conf.rot; + dst_hook = vrp->ordered_hook; + } else { + dst_hook = vrp->original_hook; + goto send; /* everything else goes out unmodified */ + } + + if (dst_hook == NULL) { + error = ENETDOWN; + goto fail; + } + + /* count the vlans */ + for (vlans = 0; vlans <= NG_VLANROTATE_MAX_VLANS; vlans++) { + size_t expected_len = sizeof(struct ether_vlan_stack_header) + + vlans * sizeof(struct ether_vlan_stack_entry); + + if (m->m_len < expected_len) { + m = m_pullup(m, expected_len); + if (m == NULL) { + error = EINVAL; + goto fail; + } + } + + evsh = mtod(m, struct ether_vlan_stack_header *); + switch (ntohs(evsh->vlan_stack[vlans].proto)) { + case ETHERTYPE_VLAN: + case ETHERTYPE_QINQ: + case ETHERTYPE_8021Q9100: + case ETHERTYPE_8021Q9200: + case ETHERTYPE_8021Q9300: + break; + default: + goto out; + } + } +out: + if ((vlans > vrp->conf.max) || (vlans >= NG_VLANROTATE_MAX_VLANS)) { + counter_u64_add(vrp->stats.excessive, 1); + dst_hook = vrp->excessive_hook; + goto send; + } + + if ((vlans < vrp->conf.min) || (vlans <= abs(rotate))) { + counter_u64_add(vrp->stats.incomplete, 1); + dst_hook = vrp->incomplete_hook; + goto send; + } + counter_u64_add(vrp->stats.histogram[vlans], 1); + + /* rotating upwards always (using modular arithmetics) */ + if (rotate == 0) { + /* nothing to do */ + } else if (rotate > 0) { + ng_vlanrotate_rotate(evsh->vlan_stack, rotate, vlans); + } else { + ng_vlanrotate_rotate(evsh->vlan_stack, vlans + rotate, vlans); + } + +send: + if (dst_hook == NULL) + goto fail; + NG_FWD_NEW_DATA(error, item, dst_hook, m); + return 0; + +fail: + counter_u64_add(vrp->stats.drops, 1); + if (m != NULL) + m_freem(m); + NG_FREE_ITEM(item); + return (error); +} + +/* + * Do local shutdown processing.. + * All our links and the name have already been removed. + */ +static int +ng_vlanrotate_shutdown(node_p node) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + int i; + + NG_NODE_SET_PRIVATE(node, NULL); + + counter_u64_free(vrp->stats.drops); + counter_u64_free(vrp->stats.excessive); + counter_u64_free(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_free(vrp->stats.histogram[i]); + + free(vrp, M_NETGRAPH); + + NG_NODE_UNREF(node); + return (0); +} + +/* + * Hook disconnection + * For this type, removal of the last link destroys the node + */ +static int +ng_vlanrotate_disconnect(hook_p hook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (vrp->original_hook == hook) + vrp->original_hook = NULL; + if (vrp->ordered_hook == hook) + vrp->ordered_hook = NULL; + if (vrp->excessive_hook == hook) + vrp->excessive_hook = NULL; + if (vrp->incomplete_hook == hook) + vrp->incomplete_hook = NULL; + + /* during shutdown the node is invalid, don't shutdown twice */ + if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) && + (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) + ng_rmnode_self(NG_HOOK_NODE(hook)); + return (0); +} diff --git a/sys/netgraph/ng_vlan_rotate.h b/sys/netgraph/ng_vlan_rotate.h new file mode 100644 index 000000000000..ef6dfd6b506a --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.h @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_NG_VLAN_ROTATE_H_ +#define _NETGRAPH_NG_VLAN_ROTATE_H_ + +#define NG_VLANROTATE_NODE_TYPE "vlan_rotate" +#define NGM_VLANROTATE_COOKIE 1568378766 + +/* Hook names */ +#define NG_VLANROTATE_HOOK_ORDERED "ordered" +#define NG_VLANROTATE_HOOK_ORIGINAL "original" +#define NG_VLANROTATE_HOOK_EXCESSIVE "excessive" +#define NG_VLANROTATE_HOOK_INCOMPLETE "incomplete" + +/* Limits */ +#define NG_VLANROTATE_MAX_VLANS 10 + +/* Datastructures for netgraph commands */ +struct ng_vlanrotate_conf { + int8_t rot; + uint8_t min, max; +}; + +struct ng_vlanrotate_stat { + uint64_t drops, excessive, incomplete; + uint64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Netgraph commands understood by this node type */ +enum { + NGM_VLANROTATE_GET_CONF = 1, + NGM_VLANROTATE_SET_CONF, + NGM_VLANROTATE_GET_STAT, + NGM_VLANROTATE_CLR_STAT, + NGM_VLANROTATE_GETCLR_STAT +}; + +#endif /* _NETGRAPH_NG_VLAN_ROTATE_H_ */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 08:15: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 CD52055AD79; Thu, 25 Feb 2021 08:15: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 4DmQZS5Rvgz3rRR; Thu, 25 Feb 2021 08:15: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 ADD3B14432; Thu, 25 Feb 2021 08:15: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 11P8FCeX074617; Thu, 25 Feb 2021 08:15:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P8FC2H074616; Thu, 25 Feb 2021 08:15:12 GMT (envelope-from git) Date: Thu, 25 Feb 2021 08:15:12 GMT Message-Id: <202102250815.11P8FC2H074616@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: 08f47db5d580 - stable/12 - netgraph/ng_bridge: Introduce "uplink" ports without MAC learning 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: 08f47db5d580e6c7bf1ed91b7488e4d529502731 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 08:15:12 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=08f47db5d580e6c7bf1ed91b7488e4d529502731 commit 08f47db5d580e6c7bf1ed91b7488e4d529502731 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:08:24 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 08:10:30 +0000 netgraph/ng_bridge: Introduce "uplink" ports without MAC learning The ng_bridge(4) node is designed to work in moderately small environments. Connecting such a node to a larger network rapidly fills the MAC table for no reason. It even become complicated to obtain data from the gettable message, because the result is too large to transmit. This patch introduces, two new functionality bits on the hooks: - Allow or disallow MAC address learning for incoming patckets. - Allow or disallow sending unknown MACs through this hook. Uplinks are characterized by denied learning while sending out unknowns. Normal links are charaterized by allowed learning and sending out unknowns. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D23963 (cherry picked from commit f961caf2184c94d6f59c8d522207156b3533d977) --- share/man/man4/ng_bridge.4 | 30 +++++++++++++-- sys/netgraph/ng_bridge.c | 95 +++++++++++++++++++++++++++++----------------- sys/netgraph/ng_bridge.h | 2 + 3 files changed, 89 insertions(+), 38 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 85c2d8871c7c..b5937375e87a 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2019 +.Dd February 6, 2021 .Dt NG_BRIDGE 4 .Os .Sh NAME @@ -92,6 +92,23 @@ To connect the host machine to a bridged network, simply connect the hook of an .Xr ng_ether 4 node to the bridge node. +.Pp +Instead of naming a hook +.Dv linkX +the hook might be also named +.Dv uplinkX . +The node does not learn MAC addresses on uplink hooks, which keeps +the internal address table small. +This way it is desirable to connect the +.Dv lower +hook of an +.Xr ng_ether 4 +node to an +.Dv uplink +hook of the bridge, and ignore the complexity of the outside world. +Frames with unknown MACs are always sent out to +.Dv uplink +hooks, so no functionality is lost. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: @@ -141,8 +158,9 @@ The node configuration is not changed. This command takes a four byte link number as an argument and returns a .Dv "struct ng_bridge_link_stats" -containing statistics for the corresponding link, which must be -currently connected: +containing statistics for the corresponding +.Dv link , +which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ struct ng_bridge_link_stats { @@ -162,6 +180,12 @@ struct ng_bridge_link_stats { uint64_t memoryFailures; /* times couldn't get mem or mbuf */ }; .Ed +.Pp +Negative numbers refer to the +.Dv uplink +hooks. +So querying for -7 will get the statistics for hook +.Dv uplink7 . .It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats This command takes a four byte link number as an argument and clears the statistics for that link. diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index e2e533be2c1e..ac1a0f61a89f 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -91,6 +91,8 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ + unsigned int learnMac : 1, /* autolearn macs */ + sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_stats stats; /* link stats */ }; @@ -334,38 +336,49 @@ static int ng_bridge_newhook(node_p node, hook_p hook, const char *name) { const priv_p priv = NG_NODE_PRIVATE(node); + char linkName[NG_HOOKSIZ]; + u_int32_t linkNum; + link_p link; + const char *prefix = NG_BRIDGE_HOOK_LINK_PREFIX; + bool isUplink; /* Check for a link hook */ - if (strlen(name) > strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) { - char linkName[NG_HOOKSIZ]; - u_int32_t linkNum; - link_p link; - - /* primitive parsing */ - linkNum = strtoul(name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); - /* validation by comparing against the reconstucted name */ - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - linkNum); - if (strcmp(linkName, name) != 0) - return (EINVAL); - - if(NG_PEER_NODE(hook) == node) - return (ELOOP); - - link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, - M_WAITOK|M_ZERO); - if (link == NULL) - return (ENOMEM); - link->hook = hook; - NG_HOOK_SET_PRIVATE(hook, link); - priv->numLinks++; - return (0); + if (strlen(name) <= strlen(prefix)) + return (EINVAL); /* Unknown hook name */ + + isUplink = (name[0] == 'u'); + if (isUplink) + prefix = NG_BRIDGE_HOOK_UPLINK_PREFIX; + + /* primitive parsing */ + linkNum = strtoul(name + strlen(prefix), NULL, 10); + /* validation by comparing against the reconstucted name */ + snprintf(linkName, sizeof(linkName), "%s%u", prefix, linkNum); + if (strcmp(linkName, name) != 0) + return (EINVAL); + + if (linkNum == 0 && isUplink) + return (EINVAL); + + if(NG_PEER_NODE(hook) == node) + return (ELOOP); + + link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_ZERO); + if (link == NULL) + return (ENOMEM); + + link->hook = hook; + if (isUplink) { + link->learnMac = 0; + link->sendUnknown = 1; + } else { + link->learnMac = 1; + link->sendUnknown = 1; } - /* Unknown hook name */ - return (EINVAL); + NG_HOOK_SET_PRIVATE(hook, link); + priv->numLinks++; + return (0); } /* @@ -439,6 +452,11 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) i = 0; for (bucket = 0; bucket < priv->numBuckets; bucket++) { SLIST_FOREACH(hent, &priv->tab[bucket], next) { + const char *name = NG_HOOK_NAME(hent->host.link->hook); + const char *prefix = name[0] == 'u' ? + NG_BRIDGE_HOOK_UPLINK_PREFIX : + NG_BRIDGE_HOOK_LINK_PREFIX; + memcpy(ary->hosts[i].addr, hent->host.addr, sizeof(ary->hosts[i].addr)); @@ -446,9 +464,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary->hosts[i].staleness = hent->host.staleness; ary->hosts[i].linkNum = strtol( - NG_HOOK_NAME(hent->host.link->hook) + - strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); + name + strlen(prefix), NULL, 10); i++; } } @@ -507,15 +523,20 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; link_p link; char linkName[NG_HOOKSIZ]; + int linkNum; /* Get link number */ if (msg->header.arglen != sizeof(u_int32_t)) { error = EINVAL; break; } - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - *((u_int32_t *)msg->data)); + linkNum = *((int32_t *)msg->data); + if (linkNum < 0) + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_UPLINK_PREFIX, -linkNum); + else + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, linkNum); if ((hook = ng_findhook(node, linkName)) == NULL) { error = ENOTCONN; @@ -610,6 +631,10 @@ ng_bridge_send_ctx(hook_p dst, void *arg) return (1); } + /* Skip sending unknowns to undesired links */ + if (!ctx->manycast && !destLink->sendUnknown) + return (1); + if (ctx->foundFirst == NULL) { /* * This is the first usable link we have found. @@ -755,7 +780,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) host->link = ctx.incoming; host->age = 0; } - } else { + } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index fa4736370e92..b34bc0f5f55e 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -64,6 +64,8 @@ /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ +#define NG_BRIDGE_HOOK_UPLINK_PREFIX "uplink" /* append decimal integer */ +#define NG_BRIDGE_HOOK_UPLINK_FMT "uplink%d" /* for use with printf(3) */ /* Node configuration structure */ struct ng_bridge_config { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 08:15: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 ED10B55B0A7; Thu, 25 Feb 2021 08:15: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 4DmQZT6Lz1z3rRS; Thu, 25 Feb 2021 08:15: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 CCCAB14338; Thu, 25 Feb 2021 08:15: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 11P8FDOT074639; Thu, 25 Feb 2021 08:15:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P8FDva074638; Thu, 25 Feb 2021 08:15:13 GMT (envelope-from git) Date: Thu, 25 Feb 2021 08:15:13 GMT Message-Id: <202102250815.11P8FDva074638@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: d148e95cdfb7 - stable/12 - netgraph/ng_bridge: Derive forwarding mode from first attached hook 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: d148e95cdfb78cf3992d71b076a776503979da62 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 08:15:14 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=d148e95cdfb78cf3992d71b076a776503979da62 commit d148e95cdfb78cf3992d71b076a776503979da62 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:25:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 08:11:45 +0000 netgraph/ng_bridge: Derive forwarding mode from first attached hook Handling of unknown MACs on an bridge with incomplete learning capabilites (aka uplink ports) can be defined in different ways. The classical approach is to broadcast unicast frames send to an unknown MAC, because the unknown devices can be everywhere. This mode is default for ng_bridge(4). In the case of dedicated uplink ports, which prohibit learning of MAC addresses in order to save memory and CPU cycles, the broadcast approach is dangerous. All traffic to the uplink port is broadcasted to every downlink port, too. In this case, it's better to restrict the distribution of frames to unknown MAC to the uplink ports only. In order to keep the chance small and the handling as natural as possible, the first attached link is used to determine the behaviour of the bridge: If it is an "uplink" port, then the bridge switch from classical mode to restricted mode. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28487 (cherry picked from commit c869d905baa4e329dfd6793e7487b5985248ddb6) --- share/man/man4/ng_bridge.4 | 16 ++++++++++++++++ sys/netgraph/ng_bridge.c | 8 ++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index b5937375e87a..1451773711e9 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -109,6 +109,22 @@ hook of the bridge, and ignore the complexity of the outside world. Frames with unknown MACs are always sent out to .Dv uplink hooks, so no functionality is lost. +.Pp +Frames with unknown destination MAC addresses are replicated to any +available hook, unless the first connected hook is an +.Ar uplink +hook. +In this case the node assumes, that all unknown MAC addresses are +located soley on the +.Ar uplink +hooks and only those hooks will be used to send out frames with +unknown destination MACs. +If the first connected hook is an +.Ar link +hook, the node will replicate such frames to all types of hooks, +even if +.Ar uplink +hooks are connected later. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index ac1a0f61a89f..a6d78690f371 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -105,7 +105,8 @@ struct ng_bridge_private { u_int numBuckets; /* num buckets in table */ u_int hashMask; /* numBuckets - 1 */ int numLinks; /* num connected links */ - int persistent; /* can exist w/o hooks */ + unsigned int persistent : 1, /* can exist w/o hooks */ + sendUnknown : 1;/* links receive unknowns by default */ struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; @@ -309,6 +310,7 @@ ng_bridge_constructor(node_p node) priv->conf.loopTimeout = DEFAULT_LOOP_TIMEOUT; priv->conf.maxStaleness = DEFAULT_MAX_STALENESS; priv->conf.minStableAge = DEFAULT_MIN_STABLE_AGE; + priv->sendUnknown = 1; /* classic bridge */ /* * This node has all kinds of stuff that could be screwed by SMP. @@ -371,9 +373,11 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (isUplink) { link->learnMac = 0; link->sendUnknown = 1; + if (priv->numLinks == 0) /* if the first link is an uplink */ + priv->sendUnknown = 0; /* switch to restrictive mode */ } else { link->learnMac = 1; - link->sendUnknown = 1; + link->sendUnknown = priv->sendUnknown; } NG_HOOK_SET_PRIVATE(hook, link); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 08:15: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 90A2855AF19; Thu, 25 Feb 2021 08:15: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 4DmQZW06Lrz3rTw; Thu, 25 Feb 2021 08:15: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 E71BB13D68; Thu, 25 Feb 2021 08:15: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 11P8FEqr074658; Thu, 25 Feb 2021 08:15:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P8FEce074657; Thu, 25 Feb 2021 08:15:14 GMT (envelope-from git) Date: Thu, 25 Feb 2021 08:15:14 GMT Message-Id: <202102250815.11P8FEce074657@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: bfe0d8ca0b88 - stable/12 - netgraph/ng_bridge: switch stats to counter framework 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: bfe0d8ca0b88ec72b35ca2b57c5d4bc14063fccf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 08:15:16 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=bfe0d8ca0b88ec72b35ca2b57c5d4bc14063fccf commit bfe0d8ca0b88ec72b35ca2b57c5d4bc14063fccf Author: Lutz Donnerhacke AuthorDate: 2021-01-13 06:16:34 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 08:12:30 +0000 netgraph/ng_bridge: switch stats to counter framework This is the first patch of a series of necessary steps to make ng_bridge(4) multithreaded. Reviewed by: melifaro (network), afedorov Differential Revision: https://reviews.freebsd.org/D28125 (cherry picked from commit 66c72859f66dc6c852234589f3508ce5d36d0336) --- sys/netgraph/ng_bridge.c | 133 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index a6d78690f371..ab4e50f51277 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -65,6 +65,8 @@ #include #include #include +#include +#include #include #include @@ -87,13 +89,31 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", #define M_NETGRAPH_BRIDGE M_NETGRAPH #endif +/* Counter based stats */ +struct ng_bridge_link_kernel_stats { + counter_u64_t recvOctets; /* total octets rec'd on link */ + counter_u64_t recvPackets; /* total pkts rec'd on link */ + counter_u64_t recvMulticasts; /* multicast pkts rec'd on link */ + counter_u64_t recvBroadcasts; /* broadcast pkts rec'd on link */ + counter_u64_t recvUnknown; /* pkts rec'd with unknown dest addr */ + counter_u64_t recvRunts; /* pkts rec'd less than 14 bytes */ + counter_u64_t recvInvalid; /* pkts rec'd with bogus source addr */ + counter_u64_t xmitOctets; /* total octets xmit'd on link */ + counter_u64_t xmitPackets; /* total pkts xmit'd on link */ + counter_u64_t xmitMulticasts; /* multicast pkts xmit'd on link */ + counter_u64_t xmitBroadcasts; /* broadcast pkts xmit'd on link */ + counter_u64_t loopDrops; /* pkts dropped due to loopback */ + counter_u64_t loopDetects; /* number of loop detections */ + counter_u64_t memoryFailures; /* times couldn't get mem or mbuf */ +}; + /* Per-link private data */ struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ unsigned int learnMac : 1, /* autolearn macs */ sendUnknown : 1;/* send unknown macs out */ - struct ng_bridge_link_stats stats; /* link stats */ + struct ng_bridge_link_kernel_stats stats; /* link stats */ }; /* Per-node private data */ @@ -369,6 +389,21 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (link == NULL) return (ENOMEM); + link->stats.recvOctets = counter_u64_alloc(M_WAITOK); + link->stats.recvPackets = counter_u64_alloc(M_WAITOK); + link->stats.recvMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.recvBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.recvUnknown = counter_u64_alloc(M_WAITOK); + link->stats.recvRunts = counter_u64_alloc(M_WAITOK); + link->stats.recvInvalid = counter_u64_alloc(M_WAITOK); + link->stats.xmitOctets = counter_u64_alloc(M_WAITOK); + link->stats.xmitPackets = counter_u64_alloc(M_WAITOK); + link->stats.xmitMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.xmitBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.loopDrops = counter_u64_alloc(M_WAITOK); + link->stats.loopDetects = counter_u64_alloc(M_WAITOK); + link->stats.memoryFailures = counter_u64_alloc(M_WAITOK); + link->hook = hook; if (isUplink) { link->learnMac = 0; @@ -388,14 +423,31 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) /* * Receive a control message */ +static void ng_bridge_clear_link_stats(struct ng_bridge_link_kernel_stats * p) +{ + counter_u64_zero(p->recvOctets); + counter_u64_zero(p->recvPackets); + counter_u64_zero(p->recvMulticasts); + counter_u64_zero(p->recvBroadcasts); + counter_u64_zero(p->recvUnknown); + counter_u64_zero(p->recvRunts); + counter_u64_zero(p->recvInvalid); + counter_u64_zero(p->xmitOctets); + counter_u64_zero(p->xmitPackets); + counter_u64_zero(p->xmitMulticasts); + counter_u64_zero(p->xmitBroadcasts); + counter_u64_zero(p->loopDrops); + counter_u64_zero(p->loopDetects); + counter_u64_zero(p->memoryFailures); +}; + static int ng_bridge_reset_link(hook_p hook, void *arg __unused) { link_p priv = NG_HOOK_PRIVATE(hook); priv->loopCount = 0; - bzero(&priv->stats, sizeof(priv->stats)); - + ng_bridge_clear_link_stats(&priv->stats); return (1); } @@ -550,17 +602,34 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) /* Get/clear stats */ if (msg->header.cmd != NGM_BRIDGE_CLR_STATS) { + struct ng_bridge_link_stats *rs; + NG_MKRESPONSE(resp, msg, sizeof(link->stats), M_NOWAIT); if (resp == NULL) { error = ENOMEM; break; } - bcopy(&link->stats, - resp->data, sizeof(link->stats)); + rs = (struct ng_bridge_link_stats *)resp->data; +#define FETCH(x) rs->x = counter_u64_fetch(link->stats.x) + FETCH(recvOctets); + FETCH(recvPackets); + FETCH(recvMulticasts); + FETCH(recvBroadcasts); + FETCH(recvUnknown); + FETCH(recvRunts); + FETCH(recvInvalid); + FETCH(xmitOctets); + FETCH(xmitPackets); + FETCH(xmitMulticasts); + FETCH(xmitBroadcasts); + FETCH(loopDrops); + FETCH(loopDetects); + FETCH(memoryFailures); +#undef FETCH } if (msg->header.cmd != NGM_BRIDGE_GET_STATS) - bzero(&link->stats, sizeof(link->stats)); + ng_bridge_clear_link_stats(&link->stats); break; } case NGM_BRIDGE_GET_TABLE: @@ -655,23 +724,23 @@ ng_bridge_send_ctx(hook_p dst, void *arg) */ m2 = m_dup(ctx->m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { - ctx->incoming->stats.memoryFailures++; + counter_u64_add(ctx->incoming->stats.memoryFailures, 1); ctx->error = ENOBUFS; return (0); /* abort loop */ } /* Update stats */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m2->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, m2->m_pkthdr.len); switch (ctx->manycast) { default: /* unknown unicast */ break; case 1: /* multicast */ - destLink->stats.xmitMulticasts++; + counter_u64_add(destLink->stats.xmitMulticasts, 1); break; case 2: /* broadcast */ - destLink->stats.xmitBroadcasts++; + counter_u64_add(destLink->stats.xmitBroadcasts, 1); break; } @@ -697,19 +766,19 @@ ng_bridge_rcvdata(hook_p hook, item_p item) ctx.incoming = NG_HOOK_PRIVATE(hook); /* Sanity check packet and pull up header */ if (ctx.m->m_pkthdr.len < ETHER_HDR_LEN) { - ctx.incoming->stats.recvRunts++; + counter_u64_add(ctx.incoming->stats.recvRunts, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); } if (ctx.m->m_len < ETHER_HDR_LEN && !(ctx.m = m_pullup(ctx.m, ETHER_HDR_LEN))) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); return (ENOBUFS); } eh = mtod(ctx.m, struct ether_header *); if ((eh->ether_shost[0] & 1) != 0) { - ctx.incoming->stats.recvInvalid++; + counter_u64_add(ctx.incoming->stats.recvInvalid, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); @@ -717,21 +786,21 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Is link disabled due to a loopback condition? */ if (ctx.incoming->loopCount != 0) { - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX is this an appropriate error? */ } /* Update stats */ - ctx.incoming->stats.recvPackets++; - ctx.incoming->stats.recvOctets += ctx.m->m_pkthdr.len; + counter_u64_add(ctx.incoming->stats.recvPackets, 1); + counter_u64_add(ctx.incoming->stats.recvOctets, ctx.m->m_pkthdr.len); if ((ctx.manycast = (eh->ether_dhost[0] & 1)) != 0) { if (ETHER_EQUAL(eh->ether_dhost, ng_bridge_bcast_addr)) { - ctx.incoming->stats.recvBroadcasts++; + counter_u64_add(ctx.incoming->stats.recvBroadcasts, 1); ctx.manycast = 2; } else - ctx.incoming->stats.recvMulticasts++; + counter_u64_add(ctx.incoming->stats.recvMulticasts, 1); } /* Look up packet's source Ethernet address in hashtable */ @@ -768,13 +837,13 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Mark link as linka non grata */ ctx.incoming->loopCount = priv->conf.loopTimeout; - ctx.incoming->stats.loopDetects++; + counter_u64_add(ctx.incoming->stats.loopDetects, 1); /* Forget all hosts on this link */ ng_bridge_remove_hosts(priv, ctx.incoming); /* Drop packet */ - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX appropriate? */ @@ -786,7 +855,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ENOMEM); @@ -818,14 +887,14 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Deliver packet out the destination link */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += ctx.m->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, ctx.m->m_pkthdr.len); NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); return (ctx.error); } /* Destination host is not known */ - ctx.incoming->stats.recvUnknown++; + counter_u64_add(ctx.incoming->stats.recvUnknown, 1); } /* Distribute unknown, multicast, broadcast pkts to all other links */ @@ -885,6 +954,20 @@ ng_bridge_disconnect(hook_p hook) ng_bridge_remove_hosts(priv, link); /* Free associated link information */ + counter_u64_free(link->stats.recvOctets); + counter_u64_free(link->stats.recvPackets); + counter_u64_free(link->stats.recvMulticasts); + counter_u64_free(link->stats.recvBroadcasts); + counter_u64_free(link->stats.recvUnknown); + counter_u64_free(link->stats.recvRunts); + counter_u64_free(link->stats.recvInvalid); + counter_u64_free(link->stats.xmitOctets); + counter_u64_free(link->stats.xmitPackets); + counter_u64_free(link->stats.xmitMulticasts); + counter_u64_free(link->stats.xmitBroadcasts); + counter_u64_free(link->stats.loopDrops); + counter_u64_free(link->stats.loopDetects); + counter_u64_free(link->stats.memoryFailures); free(link, M_NETGRAPH_BRIDGE); priv->numLinks--; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 08:15: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 E423F55AC7F; Thu, 25 Feb 2021 08:15: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 4DmQZX4Mn6z3rb9; Thu, 25 Feb 2021 08:15: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 19F8314339; Thu, 25 Feb 2021 08:15: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 11P8FGQc074680; Thu, 25 Feb 2021 08:15:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11P8FGpf074679; Thu, 25 Feb 2021 08:15:16 GMT (envelope-from git) Date: Thu, 25 Feb 2021 08:15:16 GMT Message-Id: <202102250815.11P8FGpf074679@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: 3de9c792eebe - stable/12 - netgraph/ng_bridge: Make simple internal functions read-only 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: 3de9c792eebe77ef2cdf1f6aad28cc4df9e8c37d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 08:15:17 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=3de9c792eebe77ef2cdf1f6aad28cc4df9e8c37d commit 3de9c792eebe77ef2cdf1f6aad28cc4df9e8c37d Author: Lutz Donnerhacke AuthorDate: 2021-01-13 22:18:55 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 08:13:32 +0000 netgraph/ng_bridge: Make simple internal functions read-only The data path in netgraph is designed to work on an read only state of the whole netgraph network. Currently this is achived by convention, there is no technical enforcment. In the case of NETGRAPH_DEBUG all nodes can be annotated for debugging purposes, so the strict enforcment needs to be lifted for this purpose. This patch is part of a series to make ng_bridge multithreaded, which is done by rewrite the data path to operate on const. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28141 (cherry picked from commit 6117aa58fa4f5891badf58b13c759976983f4f04) --- sys/netgraph/netgraph.h | 9 ++++++++- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index c7b0e67902cf..452be7c72f0a 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -88,6 +88,13 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; +typedef struct ng_item const *item_cp; +typedef struct ng_hook const *hook_cp; +#ifdef NETGRAPH_DEBUG +typedef struct ng_node *node_cp; /* annotated during debug */ +#else /* NETGRAPH_DEBUG */ +typedef struct ng_node const *node_cp; +#endif /* NETGRAPH_DEBUG */ /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1143,7 +1150,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_p node); +ng_ID_t ng_node2ID(node_cp node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index cc8df1e45aa6..271397f669be 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -835,7 +835,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_p node) +ng_node2ID(node_cp node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index ab4e50f51277..c2d0f79a6ca5 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,6 +115,7 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; +typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -130,6 +131,7 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; +typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_p node); +static const char *ng_bridge_nodename(node_cp node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -995,7 +997,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_p priv, const u_char *addr) +ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1207,7 +1209,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_p node) +ng_bridge_nodename(node_cp node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:00: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 5E09555D351; Thu, 25 Feb 2021 10:00: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 4DmSvc2C1Tz4STG; Thu, 25 Feb 2021 10:00: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 3E965155E2; Thu, 25 Feb 2021 10:00: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 11PA0CVP010805; Thu, 25 Feb 2021 10:00:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PA0CQf010798; Thu, 25 Feb 2021 10:00:12 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:00:12 GMT Message-Id: <202102251000.11PA0CQf010798@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: 9a972281e7f1 - stable/12 - netgraph/ng_bridge: Merge internal structures 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: 9a972281e7f1fbd3b1ecf9c5d5bad8880227f0ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:00:12 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=9a972281e7f1fbd3b1ecf9c5d5bad8880227f0ff commit 9a972281e7f1fbd3b1ecf9c5d5bad8880227f0ff Author: Lutz Donnerhacke AuthorDate: 2021-02-25 09:59:45 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 09:59:45 +0000 netgraph/ng_bridge: Merge internal structures In a earlier version of ng_bridge(4) the exernal visible host entry structure was a strict subset of the internal one. So internal view was a direct annotation of the external structure. This strict inheritance was lost many versions ago. There is no need to encapsulate a part of the internal represntation as a separate structure. This patch is a preparation to make the internal structure read only in the data path in order to make ng_bridge(4) multithreaded. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28545 (cherry picked from commit ccf4cd2e7830394467d5f6cf546ab453f9657b69) --- sys/netgraph/ng_bridge.c | 99 ++++++++++++++++++++++++------------------------ sys/netgraph/ng_bridge.h | 7 ---- 2 files changed, 50 insertions(+), 56 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index c2d0f79a6ca5..0b2b7f5ca6a3 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -134,13 +134,16 @@ typedef struct ng_bridge_private *priv_p; typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ -struct ng_bridge_hent { - struct ng_bridge_host host; /* actual host info */ - SLIST_ENTRY(ng_bridge_hent) next; /* next entry in bucket */ +struct ng_bridge_host { + u_char addr[6]; /* ethernet address */ + link_p link; /* link where addr can be found */ + u_int16_t age; /* seconds ago entry was created */ + u_int16_t staleness; /* seconds ago host last heard from */ + SLIST_ENTRY(ng_bridge_host) next; /* next entry in bucket */ }; /* Hash table bucket declaration */ -SLIST_HEAD(ng_bridge_bucket, ng_bridge_hent); +SLIST_HEAD(ng_bridge_bucket, ng_bridge_host); /* Netgraph node methods */ static ng_constructor_t ng_bridge_constructor; @@ -496,7 +499,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_BRIDGE_GET_TABLE: { struct ng_bridge_host_tbl_ary *ary; - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; int i, bucket; NG_MKRESPONSE(resp, msg, sizeof(*ary) + @@ -509,18 +512,16 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary->numHosts = priv->numHosts; i = 0; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - const char *name = NG_HOOK_NAME(hent->host.link->hook); + SLIST_FOREACH(host, &priv->tab[bucket], next) { + const char *name = NG_HOOK_NAME(host->link->hook); const char *prefix = name[0] == 'u' ? NG_BRIDGE_HOOK_UPLINK_PREFIX : NG_BRIDGE_HOOK_LINK_PREFIX; - memcpy(ary->hosts[i].addr, - hent->host.addr, + memcpy(ary->hosts[i].addr, host->addr, sizeof(ary->hosts[i].addr)); - ary->hosts[i].age = hent->host.age; - ary->hosts[i].staleness = - hent->host.staleness; + ary->hosts[i].age = host->age; + ary->hosts[i].staleness = host->staleness; ary->hosts[i].linkNum = strtol( name + strlen(prefix), NULL, 10); i++; @@ -637,7 +638,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_BRIDGE_GET_TABLE: { struct ng_bridge_host_ary *ary; - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; int i = 0, bucket; NG_MKRESPONSE(resp, msg, sizeof(*ary) @@ -649,14 +650,14 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary = (struct ng_bridge_host_ary *)resp->data; ary->numHosts = priv->numHosts; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) { + SLIST_FOREACH(host, &priv->tab[bucket], next) { memcpy(ary->hosts[i].addr, - hent->host.addr, + host->addr, sizeof(ary->hosts[i].addr)); - ary->hosts[i].age = hent->host.age; - ary->hosts[i].staleness = hent->host.staleness; + ary->hosts[i].age = host->age; + ary->hosts[i].staleness = host->staleness; strncpy(ary->hosts[i].hook, - NG_HOOK_NAME(hent->host.link->hook), + NG_HOOK_NAME(host->link->hook), sizeof(ary->hosts[i].hook)); i++; } @@ -1000,11 +1001,11 @@ static struct ng_bridge_host * ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - if (ETHER_EQUAL(hent->host.addr, addr)) - return (&hent->host); + SLIST_FOREACH(host, &priv->tab[bucket], next) { + if (ETHER_EQUAL(host->addr, addr)) + return (host); } return (NULL); } @@ -1018,27 +1019,27 @@ static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link) { const int bucket = HASH(addr, priv->hashMask); - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; #ifdef INVARIANTS /* Assert that entry does not already exist in hashtable */ - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - KASSERT(!ETHER_EQUAL(hent->host.addr, addr), + SLIST_FOREACH(host, &priv->tab[bucket], next) { + KASSERT(!ETHER_EQUAL(host->addr, addr), ("%s: entry %6D exists in table", __func__, addr, ":")); } #endif /* Allocate and initialize new hashtable entry */ - hent = malloc(sizeof(*hent), M_NETGRAPH_BRIDGE, M_NOWAIT); - if (hent == NULL) + host = malloc(sizeof(*host), M_NETGRAPH_BRIDGE, M_NOWAIT); + if (host == NULL) return (0); - bcopy(addr, hent->host.addr, ETHER_ADDR_LEN); - hent->host.link = link; - hent->host.staleness = 0; - hent->host.age = 0; + bcopy(addr, host->addr, ETHER_ADDR_LEN); + host->link = link; + host->staleness = 0; + host->age = 0; /* Add new element to hash bucket */ - SLIST_INSERT_HEAD(&priv->tab[bucket], hent, next); + SLIST_INSERT_HEAD(&priv->tab[bucket], host, next); priv->numHosts++; /* Resize table if necessary */ @@ -1083,12 +1084,12 @@ ng_bridge_rehash(priv_p priv) struct ng_bridge_bucket *const oldList = &priv->tab[oldBucket]; while (!SLIST_EMPTY(oldList)) { - struct ng_bridge_hent *const hent + struct ng_bridge_host *const host = SLIST_FIRST(oldList); SLIST_REMOVE_HEAD(oldList, next); - newBucket = HASH(hent->host.addr, newMask); - SLIST_INSERT_HEAD(&newTab[newBucket], hent, next); + newBucket = HASH(host->addr, newMask); + SLIST_INSERT_HEAD(&newTab[newBucket], host, next); } } @@ -1120,17 +1121,17 @@ ng_bridge_remove_hosts(priv_p priv, link_p link) int bucket; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]); + struct ng_bridge_host **hptr = &SLIST_FIRST(&priv->tab[bucket]); while (*hptr != NULL) { - struct ng_bridge_hent *const hent = *hptr; + struct ng_bridge_host *const host = *hptr; - if (link == NULL || hent->host.link == link) { - *hptr = SLIST_NEXT(hent, next); - free(hent, M_NETGRAPH_BRIDGE); + if (link == NULL || host->link == link) { + *hptr = SLIST_NEXT(host, next); + free(host, M_NETGRAPH_BRIDGE); priv->numHosts--; } else - hptr = &SLIST_NEXT(hent, next); + hptr = &SLIST_NEXT(host, next); } } } @@ -1171,20 +1172,20 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) /* Update host time counters and remove stale entries */ for (bucket = 0; bucket < priv->numBuckets; bucket++) { - struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]); + struct ng_bridge_host **hptr = &SLIST_FIRST(&priv->tab[bucket]); while (*hptr != NULL) { - struct ng_bridge_hent *const hent = *hptr; + struct ng_bridge_host *const host = *hptr; /* Remove hosts we haven't heard from in a while */ - if (++hent->host.staleness >= priv->conf.maxStaleness) { - *hptr = SLIST_NEXT(hent, next); - free(hent, M_NETGRAPH_BRIDGE); + if (++host->staleness >= priv->conf.maxStaleness) { + *hptr = SLIST_NEXT(host, next); + free(host, M_NETGRAPH_BRIDGE); priv->numHosts--; } else { - if (hent->host.age < 0xffff) - hent->host.age++; - hptr = &SLIST_NEXT(hent, next); + if (host->age < 0xffff) + host->age++; + hptr = &SLIST_NEXT(host, next); counter++; } } diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index b34bc0f5f55e..790e9c5da11e 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -130,13 +130,6 @@ struct ng_bridge_link_stats { struct ng_bridge_link; typedef struct ng_bridge_link *link_p; -/* Structure describing a single host */ -struct ng_bridge_host { - u_char addr[6]; /* ethernet address */ - link_p link; /* link where addr can be found */ - u_int16_t age; /* seconds ago entry was created */ - u_int16_t staleness; /* seconds ago host last heard from */ -}; #ifdef NGM_BRIDGE_TABLE_ABI struct ng_bridge_host_tbl { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:02: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 82D6855D369; Thu, 25 Feb 2021 10:02: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 4DmSyB3Lq2z4SpK; Thu, 25 Feb 2021 10:02: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 65FCA15564; Thu, 25 Feb 2021 10:02: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 11PA2QrF019021; Thu, 25 Feb 2021 10:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PA2Qt9019006; Thu, 25 Feb 2021 10:02:26 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:02:26 GMT Message-Id: <202102251002.11PA2Qt9019006@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: 1c0b19f9966d - stable/12 - netgraph/ng_bridge: Document staleness in multithreaded operation 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: 1c0b19f9966dd13db7202b44ca79d2170b4f7b8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:02:26 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=1c0b19f9966dd13db7202b44ca79d2170b4f7b8f commit 1c0b19f9966dd13db7202b44ca79d2170b4f7b8f Author: Lutz Donnerhacke AuthorDate: 2021-02-09 11:32:46 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 10:02:06 +0000 netgraph/ng_bridge: Document staleness in multithreaded operation In the data path of ng_bridge(4), the only value of the host struct, which needs to be modified, is the staleness, which is reset every time a frame is received. It's save to leave the code as it is. This patch is part of a series to make ng_bridge(4) multithreaded. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28546 (cherry picked from commit 011b7317dbb5038a95b9b4fca050325a62f3991e) --- sys/netgraph/ng_bridge.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 0b2b7f5ca6a3..3d1dc88af3c2 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -808,8 +808,10 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Look up packet's source Ethernet address in hashtable */ if ((host = ng_bridge_get(priv, eh->ether_shost)) != NULL) { - - /* Update time since last heard from this host */ + /* Update time since last heard from this host. + * This is safe without locking, because it's + * the only operation during shared access. + */ host->staleness = 0; /* Did host jump to a different link? */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:05: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 6B40555D37C; Thu, 25 Feb 2021 10:05: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 4DmT192gMMz4Sf4; Thu, 25 Feb 2021 10:05: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 4E50615955; Thu, 25 Feb 2021 10:05: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 11PA51HA019705; Thu, 25 Feb 2021 10:05:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PA51Zw019704; Thu, 25 Feb 2021 10:05:01 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:05:01 GMT Message-Id: <202102251005.11PA51Zw019704@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: d02939510276 - stable/12 - netgraph/ng_bridge: Add counters for the first link, too 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: d02939510276106d3244ce95528245f2114a091a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:05:01 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=d02939510276106d3244ce95528245f2114a091a commit d02939510276106d3244ce95528245f2114a091a Author: Lutz Donnerhacke AuthorDate: 2021-02-10 10:47:38 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 10:04:47 +0000 netgraph/ng_bridge: Add counters for the first link, too For broadcast, multicast and unknown unicast, the replication loop sends a copy of the packet to each link, beside the first one. This special path is handled later, but the counters are not updated. Factor out the common send and count actions as a function. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28537 (cherry picked from commit 3c958f5fdfc01b7579ea0fbfc3f15f8a85bebee9) --- sys/netgraph/ng_bridge.c | 60 ++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 3d1dc88af3c2..5917c1084527 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -694,6 +694,41 @@ struct ng_bridge_send_ctx { int manycast, error; }; +/* + * Update stats and send out + */ +static inline int +ng_bridge_send_data(link_cp dst, int manycast, struct mbuf *m, item_p item) { + int error = 0; + size_t len = m->m_pkthdr.len; + + if(item != NULL) + NG_FWD_NEW_DATA(error, item, dst->hook, m); + else + NG_SEND_DATA_ONLY(error, dst->hook, m); + + if (error == 0) { + counter_u64_add(dst->stats.xmitPackets, 1); + counter_u64_add(dst->stats.xmitOctets, len); + switch (manycast) { + default: /* unknown unicast */ + break; + case 1: /* multicast */ + counter_u64_add(dst->stats.xmitMulticasts, 1); + break; + case 2: /* broadcast */ + counter_u64_add(dst->stats.xmitBroadcasts, 1); + break; + } + } + + return (error); +} + +/* + * Loop body for sending to multiple destinations + * return 0 to stop looping + */ static int ng_bridge_send_ctx(hook_p dst, void *arg) { @@ -732,23 +767,8 @@ ng_bridge_send_ctx(hook_p dst, void *arg) return (0); /* abort loop */ } - - /* Update stats */ - counter_u64_add(destLink->stats.xmitPackets, 1); - counter_u64_add(destLink->stats.xmitOctets, m2->m_pkthdr.len); - switch (ctx->manycast) { - default: /* unknown unicast */ - break; - case 1: /* multicast */ - counter_u64_add(destLink->stats.xmitMulticasts, 1); - break; - case 2: /* broadcast */ - counter_u64_add(destLink->stats.xmitBroadcasts, 1); - break; - } - /* Send packet */ - NG_SEND_DATA_ONLY(error, destLink->hook, m2); + error = ng_bridge_send_data(destLink, ctx->manycast, m2, NULL); if(error) ctx->error = error; return (1); @@ -892,10 +912,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Deliver packet out the destination link */ - counter_u64_add(destLink->stats.xmitPackets, 1); - counter_u64_add(destLink->stats.xmitOctets, ctx.m->m_pkthdr.len); - NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); - return (ctx.error); + return (ng_bridge_send_data(destLink, ctx.manycast, ctx.m, item)); } /* Destination host is not known */ @@ -916,8 +933,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) * If we've sent all the others, send the original * on the first link we found. */ - NG_FWD_NEW_DATA(ctx.error, item, ctx.foundFirst->hook, ctx.m); - return (ctx.error); + return (ng_bridge_send_data(ctx.foundFirst, ctx.manycast, ctx.m, item)); } /* From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:07: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 D12C355DA02; Thu, 25 Feb 2021 10:07: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 4DmT4b513Nz4Srd; Thu, 25 Feb 2021 10:07: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 9EECF15AF0; Thu, 25 Feb 2021 10:07: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 11PA7xSe020257; Thu, 25 Feb 2021 10:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PA7xHQ020256; Thu, 25 Feb 2021 10:07:59 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:07:59 GMT Message-Id: <202102251007.11PA7xHQ020256@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: 8790393123f1 - stable/12 - netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support 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: 8790393123f13c4c5a301939ea65c564033a53b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:07:59 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=8790393123f13c4c5a301939ea65c564033a53b6 commit 8790393123f13c4c5a301939ea65c564033a53b6 Author: Neel Chauhan AuthorDate: 2021-01-24 19:23:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 10:07:08 +0000 netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support This extends upon the RFC 6598 support to libalias/ipfw in r357092. Reviewed By: manpages (bcr), donner, adrian, kp Differential Revision: https://reviews.freebsd.org/D23461 (cherry picked from commit 5fe433a6e4d8cab6b64284698301afc0c55a9db2) --- share/man/man4/ng_nat.4 | 8 +++++++- sys/netgraph/ng_nat.c | 2 ++ sys/netgraph/ng_nat.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_nat.4 b/share/man/man4/ng_nat.4 index 3baa25a8637c..b2f3780e1002 100644 --- a/share/man/man4/ng_nat.4 +++ b/share/man/man4/ng_nat.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2018 +.Dd January 24, 2021 .Dt NG_NAT 4 .Os .Sh NAME @@ -75,7 +75,13 @@ struct ng_nat_mode { #define NG_NAT_RESET_ON_ADDR_CHANGE 0x20 #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 +#define NG_NAT_UNREGISTERED_CGN 0x100 .Ed +.Pp +The corresponding libalias flags can be found by replacing the +.Vt "NG_NAT" +prefix with +.Vt "PKT_ALIAS" . .It Dv NGM_NAT_SET_TARGET Pq Ic settarget Configure target address for a node. When an incoming packet not associated with any pre-existing aliasing diff --git a/sys/netgraph/ng_nat.c b/sys/netgraph/ng_nat.c index 4b6039d33654..76da4214f644 100644 --- a/sys/netgraph/ng_nat.c +++ b/sys/netgraph/ng_nat.c @@ -961,6 +961,8 @@ ng_nat_translate_flags(unsigned int x) res |= PKT_ALIAS_PROXY_ONLY; if (x & NG_NAT_REVERSE) res |= PKT_ALIAS_REVERSE; + if (x & NG_NAT_UNREGISTERED_CGN) + res |= PKT_ALIAS_UNREGISTERED_CGN; return (res); } diff --git a/sys/netgraph/ng_nat.h b/sys/netgraph/ng_nat.h index 46c9609772ff..b56d45c10671 100644 --- a/sys/netgraph/ng_nat.h +++ b/sys/netgraph/ng_nat.h @@ -54,6 +54,7 @@ struct ng_nat_mode { #define NG_NAT_RESET_ON_ADDR_CHANGE 0x20 #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 +#define NG_NAT_UNREGISTERED_CGN 0x100 #define NG_NAT_DESC_LENGTH 64 #define NG_NAT_REDIRPROTO_ADDR (IPPROTO_MAX + 3) /* LibAlias' LINK_ADDR, also unused in in.h */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:09: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 F350155DB01; Thu, 25 Feb 2021 10:09: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 4DmT6t6dMVz4Sy5; Thu, 25 Feb 2021 10:09: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 D69A115956; Thu, 25 Feb 2021 10:09: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 11PA9w8o020659; Thu, 25 Feb 2021 10:09:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PA9wDj020658; Thu, 25 Feb 2021 10:09:58 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:09:58 GMT Message-Id: <202102251009.11PA9wDj020658@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: e600af01eeba - stable/11 - netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support 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: e600af01eeba79f7cc407a778f1d7b4f004900c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:09:59 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=e600af01eeba79f7cc407a778f1d7b4f004900c1 commit e600af01eeba79f7cc407a778f1d7b4f004900c1 Author: Neel Chauhan AuthorDate: 2021-01-24 19:23:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 10:09:38 +0000 netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support This extends upon the RFC 6598 support to libalias/ipfw in r357092. Reviewed By: manpages (bcr), donner, adrian, kp Differential Revision: https://reviews.freebsd.org/D23461 (cherry picked from commit 5fe433a6e4d8cab6b64284698301afc0c55a9db2) --- share/man/man4/ng_nat.4 | 8 +++++++- sys/netgraph/ng_nat.c | 2 ++ sys/netgraph/ng_nat.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_nat.4 b/share/man/man4/ng_nat.4 index 3baa25a8637c..b2f3780e1002 100644 --- a/share/man/man4/ng_nat.4 +++ b/share/man/man4/ng_nat.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2018 +.Dd January 24, 2021 .Dt NG_NAT 4 .Os .Sh NAME @@ -75,7 +75,13 @@ struct ng_nat_mode { #define NG_NAT_RESET_ON_ADDR_CHANGE 0x20 #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 +#define NG_NAT_UNREGISTERED_CGN 0x100 .Ed +.Pp +The corresponding libalias flags can be found by replacing the +.Vt "NG_NAT" +prefix with +.Vt "PKT_ALIAS" . .It Dv NGM_NAT_SET_TARGET Pq Ic settarget Configure target address for a node. When an incoming packet not associated with any pre-existing aliasing diff --git a/sys/netgraph/ng_nat.c b/sys/netgraph/ng_nat.c index 6ebfd06bf88a..0806abfbb01b 100644 --- a/sys/netgraph/ng_nat.c +++ b/sys/netgraph/ng_nat.c @@ -959,6 +959,8 @@ ng_nat_translate_flags(unsigned int x) res |= PKT_ALIAS_PROXY_ONLY; if (x & NG_NAT_REVERSE) res |= PKT_ALIAS_REVERSE; + if (x & NG_NAT_UNREGISTERED_CGN) + res |= PKT_ALIAS_UNREGISTERED_CGN; return (res); } diff --git a/sys/netgraph/ng_nat.h b/sys/netgraph/ng_nat.h index df3607540f00..8abeef262489 100644 --- a/sys/netgraph/ng_nat.h +++ b/sys/netgraph/ng_nat.h @@ -52,6 +52,7 @@ struct ng_nat_mode { #define NG_NAT_RESET_ON_ADDR_CHANGE 0x20 #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 +#define NG_NAT_UNREGISTERED_CGN 0x100 #define NG_NAT_DESC_LENGTH 64 #define NG_NAT_REDIRPROTO_ADDR (IPPROTO_MAX + 3) /* LibAlias' LINK_ADDR, also unused in in.h */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:12: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 AA8A555D9DC; Thu, 25 Feb 2021 10:12: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 4DmTB44SYvz4TJN; Thu, 25 Feb 2021 10:12: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 8BD2115D8E; Thu, 25 Feb 2021 10:12: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 11PACiRR033230; Thu, 25 Feb 2021 10:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PACicJ033229; Thu, 25 Feb 2021 10:12:44 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:12:44 GMT Message-Id: <202102251012.11PACicJ033229@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: ea5ebe9cde3c - stable/11 - ether: add older ethertype definitions for QinQ 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: ea5ebe9cde3c4c3ef11b90a15881749125974cfa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:12:44 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=ea5ebe9cde3c4c3ef11b90a15881749125974cfa commit ea5ebe9cde3c4c3ef11b90a15881749125974cfa Author: Philip Paeps AuthorDate: 2019-10-17 00:34:53 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 10:12:01 +0000 ether: add older ethertype definitions for QinQ Older network equipment used the ethertypes 0x9100, 0x9200, and 0x9300 for outer VLANs, before standardisation introduced 0x88a8. Submitted by: Lutz Donnerhacke Differential Revision: https://reviews.freebsd.org/D21846 (cherry picked from commit 579b70db8922b1debf3bd99bb2b822d60b95575d) --- sys/net/ethernet.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index 5e46f124a0f2..fdfc41b55037 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -360,10 +360,13 @@ struct ether_vlan_header { #define ETHERTYPE_PBB 0x88E7 /* 802.1Q Provider Backbone Bridges */ #define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */ +#define ETHERTYPE_8021Q9100 0x9100 /* IEEE 802.1Q stacking (proprietary) */ #define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */ #define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */ #define ETHERTYPE_TCPSM 0x9002 /* 3Com (Formerly Bridge Communications), TCP/IP Systems Management */ #define ETHERTYPE_BCLOOP 0x9003 /* 3Com (Formerly Bridge Communications), loopback detection */ +#define ETHERTYPE_8021Q9200 0x9200 /* IEEE 802.1Q stacking (proprietary) */ +#define ETHERTYPE_8021Q9300 0x9300 /* IEEE 802.1Q stacking (proprietary) */ #define ETHERTYPE_DEBNI 0xAAAA /* DECNET? Used by VAX 6220 DEBNI */ #define ETHERTYPE_SONIX 0xFAF5 /* Sonix Arpeggio */ #define ETHERTYPE_VITAL 0xFF00 /* BBN VITAL-LanBridge cache wakeups */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:12: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 C86CA55DB11; Thu, 25 Feb 2021 10:12: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 4DmTB55Dnzz4TWs; Thu, 25 Feb 2021 10:12: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 A6DA515B40; Thu, 25 Feb 2021 10:12: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 11PACjxu033253; Thu, 25 Feb 2021 10:12:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PACjQf033252; Thu, 25 Feb 2021 10:12:45 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:12:45 GMT Message-Id: <202102251012.11PACjQf033252@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: b2c14db4f8fd - stable/11 - netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type 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: b2c14db4f8fda2c015a9b58f6d8b0e29fea3779d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:12:45 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=b2c14db4f8fda2c015a9b58f6d8b0e29fea3779d commit b2c14db4f8fda2c015a9b58f6d8b0e29fea3779d Author: Lutz Donnerhacke AuthorDate: 2021-01-26 15:50:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 10:12:17 +0000 netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type This node is part of an A10-NSP (L2-BSA) development. Carrier networks tend to stack three or more tags for internal purposes and therefore hiding the service tags deep inside of the stack. When decomposing such an access network frame, the processing order is typically reversed: First distinguish by service, than by other means. This new netgragh node allows to bring the relevant VLAN in front (to the out-most position). This way other netgraph nodes (like ng_vlan) can operate on this specific type. Reviewed by: manpages (gbe), brueffer (manpages), kp Relnotes: yes Sponsored by: IKS Service GmbH Differential Revision: https://reviews.freebsd.org/D22076 (cherry picked from commit cfd6422a5217410fbd66f7a7a8a64d9d85e61229) --- share/man/man4/Makefile | 1 + share/man/man4/ng_vlan_rotate.4 | 252 +++++++++++++++ sys/conf/files | 1 + sys/modules/netgraph/Makefile | 3 +- sys/modules/netgraph/vlan_rotate/Makefile | 6 + sys/netgraph/ng_vlan_rotate.c | 510 ++++++++++++++++++++++++++++++ sys/netgraph/ng_vlan_rotate.h | 67 ++++ 7 files changed, 839 insertions(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 44e0c3ab22f9..837e667217b3 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -391,6 +391,7 @@ MAN= aac.4 \ ng_uni.4 \ ng_vjc.4 \ ng_vlan.4 \ + ng_vlan_rotate.4 \ nmdm.4 \ nsp.4 \ ${_ntb.4} \ diff --git a/share/man/man4/ng_vlan_rotate.4 b/share/man/man4/ng_vlan_rotate.4 new file mode 100644 index 000000000000..4640737c7d54 --- /dev/null +++ b/share/man/man4/ng_vlan_rotate.4 @@ -0,0 +1,252 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2019-2021 IKS Service GmbH +.\" +.\" 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. +.\" +.\" Author: Lutz Donnerhacke +.\" +.\" $FreeBSD$ +.\" +.Dd January 26, 2021 +.Dt NG_VLAN_ROTATE 4 +.Os +.Sh NAME +.Nm ng_vlan_rotate +.Nd IEEE 802.1ad VLAN manipulation netgraph node type +.Sh SYNOPSIS +.In sys/types.h +.In netgraph.h +.In netgraph/ng_vlan_rotate.h +.Sh DESCRIPTION +The +.Nm +node type manipulates the order of VLAN tags of frames tagged +according to the IEEE 802.1ad (an extension of IEEE 802.1Q) standard +between different hooks. +.Pp +Each node has four special hooks, +.Va original , +.Va ordered , +.Va excessive , +and +.Va incomplete . +.Pp +A frame tagged with an arbitrary number of +.Dv ETHERTYPE_VLAN , +.Dv ETHERTYPE_QINQ , +and +.Dv 0x9100 +tags received on the +.Va original +hook will be rearranged to a new order of those tags and is sent out +the +.Dq ordered +hook. +After successful processing the +.Va histogram +counter for the observed stack size increments. +.Pp +If it contains fewer VLANs in the stack than the configured +.Va min +limit, the frame is sent out to the +.Va incomplete +hook and the +.Va incomplete +counter increments. +.Pp +If there are more VLANs in the stack than the configured +.Va max +limit, the frame is sent out to the +.Va excessive +hook and the +.Va excessive +counter increments. +.Pp +If the destination hook is not connected, the frame is dropped and the +.Va drops +counter increments. +.Pp +For Ethernet frames received on the +.Va ordered +hook, the transformation is reversed and is passed to the +.Va original +hook. +Please note that this process is identical to the one described +above, besides the ordered/original hooks are swapped and the +transformation is reversed. +.Pp +An Ethernet frame received on the +.Va incomplete +or +.Va excessive +hook is forwarded to the +.Va original +hook without any modification. +.Pp +This node supports only one operation at the moment: Rotation of the +VLANs in the stack. +Setting the configuration parameter +.Va rot +to a positive value, the stack will roll up by this amount. +Negative values will roll down. +A typical scenario is setting the value to 1 in order to bring the +innermost VLAN tag to the outmost level. +Rotation includes the VLAN id, the ether type, and the QOS parameters +pcp and cfi. +Typical QOS handling refers to the outmost setting, so be careful to +keep your QOS intact. +.Sh HOOKS +This node type supports the following hooks: +.Bl -tag -width incomplete +.It Va original +Typically this hook would be connected to a +.Xr ng_ether 4 +node, using the +.Va lower +hook connected to a carrier network. +.It Va ordered +Typically this hook would be connected to a +.Xr ng_vlan 4 +type node using the +.Va downstream +hook in order to separate services. +.It Va excessive +see below. +.It Va incomplete +Typically those hooks would be attached to a +.Xr ng_eiface 4 +type node using the +.Va ether +hook for anomaly monitoring purposes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_VLANROTATE_GET_CONF Pq Ic getconf +Read the current configuration. +.It Dv NGM_VLANROTATE_SET_CONF Pq Ic setconf +Set the current configuration. +.It Dv NGM_VLANROTATE_GET_STAT Pq Ic getstat +Read the current statistics. +.It Dv NGM_VLANROTATE_CLR_STAT Pq Ic clrstat +Zeroize the statistics. +.It Dv NGM_VLANROTATE_GETCLR_STAT Pq Ic getclrstat +Read the current statistics and zeroize it in one step. +.El +.Sh EXAMPLES +The first example demonstrates how to rotate double or triple tagged +frames so that the innermost C-VLAN can be used as service +discriminator. +The single or double tagged frames (C-VLAN removed) are sent out to an +interface pointing to different infrastucture. +.Bd -literal +#!/bin/sh + +BNG_IF=ixl3 +VOIP_IF=bge2 + +ngctl -f- < 00:01:02:03:04:05, + ethertype 802.1Q-9100 (0x9100), length 110: vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype 802.1Q, vlan 123, p 7, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The frame ejected on the +.Va ordered +hook will look like this: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q (0x8100), length 110: vlan 123, p 7, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +Hence, the frame pushed out to the +.Dv VOIP_IF +will have this form: +.Bd -literal +00:00:00:00:01:01 > 00:01:02:03:04:05, + ethertype 802.1Q-9100, vlan 2, p 1, + ethertype 802.1Q-QinQ, vlan 101, p 0, + ethertype IPv4, (tos 0x0, ttl 64, id 15994, offset 0, flags [none], + proto ICMP (1), length 84) 192.168.140.101 > 192.168.140.1: + ICMP echo request, id 40234, seq 0, length 64 +.Ed +.Pp +The second example distinguishes between double tagged and single +tagged frames. +.Bd -literal +#!/bin/sh + +IN_IF=bge1 + +ngctl -f- < diff --git a/sys/netgraph/ng_vlan_rotate.c b/sys/netgraph/ng_vlan_rotate.c new file mode 100644 index 000000000000..e6de782d9bb3 --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.c @@ -0,0 +1,510 @@ +/*- + * Spdx-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +/* + * This section contains the netgraph method declarations for the + * sample node. These methods define the netgraph 'type'. + */ + +static ng_constructor_t ng_vlanrotate_constructor; +static ng_rcvmsg_t ng_vlanrotate_rcvmsg; +static ng_shutdown_t ng_vlanrotate_shutdown; +static ng_newhook_t ng_vlanrotate_newhook; +static ng_rcvdata_t ng_vlanrotate_rcvdata; +static ng_disconnect_t ng_vlanrotate_disconnect; + +/* Parse type for struct ng_vlanrotate_conf */ +static const struct ng_parse_struct_field ng_vlanrotate_conf_fields[] = { + {"rot", &ng_parse_int8_type}, + {"min", &ng_parse_uint8_type}, + {"max", &ng_parse_uint8_type}, + {NULL} +}; +static const struct ng_parse_type ng_vlanrotate_conf_type = { + &ng_parse_struct_type, + &ng_vlanrotate_conf_fields +}; + +/* Parse type for struct ng_vlanrotate_stat */ +static struct ng_parse_fixedarray_info ng_vlanrotate_stat_hist_info = { + &ng_parse_uint64_type, + NG_VLANROTATE_MAX_VLANS +}; +static struct ng_parse_type ng_vlanrotate_stat_hist = { + &ng_parse_fixedarray_type, + &ng_vlanrotate_stat_hist_info +}; +static const struct ng_parse_struct_field ng_vlanrotate_stat_fields[] = { + {"drops", &ng_parse_uint64_type}, + {"excessive", &ng_parse_uint64_type}, + {"incomplete", &ng_parse_uint64_type}, + {"histogram", &ng_vlanrotate_stat_hist}, + {NULL} +}; +static struct ng_parse_type ng_vlanrotate_stat_type = { + &ng_parse_struct_type, + &ng_vlanrotate_stat_fields +}; + + +/* List of commands and how to convert arguments to/from ASCII */ +static const struct ng_cmdlist ng_vlanrotate_cmdlist[] = { + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_CONF, + "getconf", + NULL, + &ng_vlanrotate_conf_type, + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_SET_CONF, + "setconf", + &ng_vlanrotate_conf_type, + NULL + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GET_STAT, + "getstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_CLR_STAT, + "clrstat", + NULL, + &ng_vlanrotate_stat_type + }, + { + NGM_VLANROTATE_COOKIE, + NGM_VLANROTATE_GETCLR_STAT, + "getclrstat", + NULL, + &ng_vlanrotate_stat_type + }, + {0} +}; + +/* Netgraph node type descriptor */ +static struct ng_type typestruct = { + .version = NG_ABI_VERSION, + .name = NG_VLANROTATE_NODE_TYPE, + .constructor = ng_vlanrotate_constructor, + .rcvmsg = ng_vlanrotate_rcvmsg, + .shutdown = ng_vlanrotate_shutdown, + .newhook = ng_vlanrotate_newhook, + .rcvdata = ng_vlanrotate_rcvdata, + .disconnect = ng_vlanrotate_disconnect, + .cmdlist = ng_vlanrotate_cmdlist, +}; +NETGRAPH_INIT(vlanrotate, &typestruct); + +struct ng_vlanrotate_kernel_stats { + counter_u64_t drops, excessive, incomplete; + counter_u64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Information we store for each node */ +struct vlanrotate { + hook_p original_hook; + hook_p ordered_hook; + hook_p excessive_hook; + hook_p incomplete_hook; + struct ng_vlanrotate_conf conf; + struct ng_vlanrotate_kernel_stats stats; +}; +typedef struct vlanrotate *vlanrotate_p; + +/* + * Set up the private data structure. + */ +static int +ng_vlanrotate_constructor(node_p node) +{ + int i; + + vlanrotate_p vrp = malloc(sizeof(*vrp), M_NETGRAPH, M_WAITOK | M_ZERO); + + vrp->conf.max = NG_VLANROTATE_MAX_VLANS; + + vrp->stats.drops = counter_u64_alloc(M_WAITOK); + vrp->stats.excessive = counter_u64_alloc(M_WAITOK); + vrp->stats.incomplete = counter_u64_alloc(M_WAITOK); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + vrp->stats.histogram[i] = counter_u64_alloc(M_WAITOK); + + NG_NODE_SET_PRIVATE(node, vrp); + return (0); +} + +/* + * Give our ok for a hook to be added. + */ +static int +ng_vlanrotate_newhook(node_p node, hook_p hook, const char *name) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + hook_p *dst = NULL; + + if (strcmp(name, NG_VLANROTATE_HOOK_ORDERED) == 0) { + dst = &vrp->ordered_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_ORIGINAL) == 0) { + dst = &vrp->original_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_EXCESSIVE) == 0) { + dst = &vrp->excessive_hook; + } else if (strcmp(name, NG_VLANROTATE_HOOK_INCOMPLETE) == 0) { + dst = &vrp->incomplete_hook; + } else + return (EINVAL); /* not a hook we know about */ + + if (*dst != NULL) + return (EADDRINUSE); /* don't override */ + + *dst = hook; + return (0); +} + +/* + * Get a netgraph control message. + * A response is not required. + */ +static int +ng_vlanrotate_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + struct ng_mesg *resp = NULL; + struct ng_mesg *msg; + struct ng_vlanrotate_conf *pcf; + int error = 0; + + NGI_GET_MSG(item, msg); + /* Deal with message according to cookie and command */ + switch (msg->header.typecookie) { + case NGM_VLANROTATE_COOKIE: + switch (msg->header.cmd) { + case NGM_VLANROTATE_GET_CONF: + NG_MKRESPONSE(resp, msg, sizeof(vrp->conf), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + *((struct ng_vlanrotate_conf *)resp->data) = vrp->conf; + break; + case NGM_VLANROTATE_SET_CONF: + if (msg->header.arglen != sizeof(*pcf)) { + error = EINVAL; + break; + } + + pcf = (struct ng_vlanrotate_conf *)msg->data; + + if (pcf->max == 0) /* keep current value */ + pcf->max = vrp->conf.max; + + if ((pcf->max > NG_VLANROTATE_MAX_VLANS) || + (pcf->min > pcf->max) || + (abs(pcf->rot) >= pcf->max)) { + error = EINVAL; + break; + } + + vrp->conf = *pcf; + break; + case NGM_VLANROTATE_GET_STAT: + case NGM_VLANROTATE_GETCLR_STAT: + { + struct ng_vlanrotate_stat *p; + int i; + + NG_MKRESPONSE(resp, msg, sizeof(*p), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + p = (struct ng_vlanrotate_stat *)resp->data; + p->drops = counter_u64_fetch(vrp->stats.drops); + p->excessive = counter_u64_fetch(vrp->stats.excessive); + p->incomplete = counter_u64_fetch(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + p->histogram[i] = counter_u64_fetch(vrp->stats.histogram[i]); + if (msg->header.cmd != NGM_VLANROTATE_GETCLR_STAT) + break; + } + case NGM_VLANROTATE_CLR_STAT: + { + int i; + + counter_u64_zero(vrp->stats.drops); + counter_u64_zero(vrp->stats.excessive); + counter_u64_zero(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_zero(vrp->stats.histogram[i]); + break; + } + default: + error = EINVAL; /* unknown command */ + break; + } + break; + default: + error = EINVAL; /* unknown cookie type */ + break; + } + + /* Take care of synchronous response, if any */ + NG_RESPOND_MSG(error, node, item, resp); + /* Free the message and return */ + NG_FREE_MSG(msg); + return (error); +} + +/* + * Receive data, and do rotate the vlans as desired. + * + * Rotating is quite complicated if the rotation offset and the number + * of vlans are not relativly prime. In this case multiple slices need + * to be rotated separately. + * + * Rotation can be additive or subtractive. Some examples: + * 01234 5 vlans given + * ----- + * 34012 +2 rotate + * 12340 +4 rotate + * 12340 -1 rotate + * + * First some helper functions ... + */ + +struct ether_vlan_stack_entry { + uint16_t proto; + uint16_t tag; +} __packed; + +struct ether_vlan_stack_header { + uint8_t dst[ETHER_ADDR_LEN]; + uint8_t src[ETHER_ADDR_LEN]; + struct ether_vlan_stack_entry vlan_stack[1]; +} __packed; + +static int +ng_vlanrotate_gcd(int a, int b) +{ + if (b == 0) + return a; + else + return ng_vlanrotate_gcd(b, a % b); +} + +static void +ng_vlanrotate_rotate(struct ether_vlan_stack_entry arr[], int d, int n) +{ + int i, j, k; + struct ether_vlan_stack_entry temp; + + /* for each commensurable slice */ + for (i = ng_vlanrotate_gcd(d, n); i-- > 0;) { + /* rotate left aka downwards */ + temp = arr[i]; + j = i; + + while (1) { + k = j + d; + if (k >= n) + k = k - n; + if (k == i) + break; + arr[j] = arr[k]; + j = k; + } + + arr[j] = temp; + } +} + +static int +ng_vlanrotate_rcvdata(hook_p hook, item_p item) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct ether_vlan_stack_header *evsh; + struct mbuf *m = NULL; + hook_p dst_hook; + int8_t rotate; + int8_t vlans = 0; + int error = ENOSYS; + + NGI_GET_M(item, m); + + if (hook == vrp->ordered_hook) { + rotate = +vrp->conf.rot; + dst_hook = vrp->original_hook; + } else if (hook == vrp->original_hook) { + rotate = -vrp->conf.rot; + dst_hook = vrp->ordered_hook; + } else { + dst_hook = vrp->original_hook; + goto send; /* everything else goes out unmodified */ + } + + if (dst_hook == NULL) { + error = ENETDOWN; + goto fail; + } + + /* count the vlans */ + for (vlans = 0; vlans <= NG_VLANROTATE_MAX_VLANS; vlans++) { + size_t expected_len = sizeof(struct ether_vlan_stack_header) + + vlans * sizeof(struct ether_vlan_stack_entry); + + if (m->m_len < expected_len) { + m = m_pullup(m, expected_len); + if (m == NULL) { + error = EINVAL; + goto fail; + } + } + + evsh = mtod(m, struct ether_vlan_stack_header *); + switch (ntohs(evsh->vlan_stack[vlans].proto)) { + case ETHERTYPE_VLAN: + case ETHERTYPE_QINQ: + case ETHERTYPE_8021Q9100: + case ETHERTYPE_8021Q9200: + case ETHERTYPE_8021Q9300: + break; + default: + goto out; + } + } +out: + if ((vlans > vrp->conf.max) || (vlans >= NG_VLANROTATE_MAX_VLANS)) { + counter_u64_add(vrp->stats.excessive, 1); + dst_hook = vrp->excessive_hook; + goto send; + } + + if ((vlans < vrp->conf.min) || (vlans <= abs(rotate))) { + counter_u64_add(vrp->stats.incomplete, 1); + dst_hook = vrp->incomplete_hook; + goto send; + } + counter_u64_add(vrp->stats.histogram[vlans], 1); + + /* rotating upwards always (using modular arithmetics) */ + if (rotate == 0) { + /* nothing to do */ + } else if (rotate > 0) { + ng_vlanrotate_rotate(evsh->vlan_stack, rotate, vlans); + } else { + ng_vlanrotate_rotate(evsh->vlan_stack, vlans + rotate, vlans); + } + +send: + if (dst_hook == NULL) + goto fail; + NG_FWD_NEW_DATA(error, item, dst_hook, m); + return 0; + +fail: + counter_u64_add(vrp->stats.drops, 1); + if (m != NULL) + m_freem(m); + NG_FREE_ITEM(item); + return (error); +} + +/* + * Do local shutdown processing.. + * All our links and the name have already been removed. + */ +static int +ng_vlanrotate_shutdown(node_p node) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(node); + int i; + + NG_NODE_SET_PRIVATE(node, NULL); + + counter_u64_free(vrp->stats.drops); + counter_u64_free(vrp->stats.excessive); + counter_u64_free(vrp->stats.incomplete); + for (i = 0; i < NG_VLANROTATE_MAX_VLANS; i++) + counter_u64_free(vrp->stats.histogram[i]); + + free(vrp, M_NETGRAPH); + + NG_NODE_UNREF(node); + return (0); +} + +/* + * Hook disconnection + * For this type, removal of the last link destroys the node + */ +static int +ng_vlanrotate_disconnect(hook_p hook) +{ + const vlanrotate_p vrp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (vrp->original_hook == hook) + vrp->original_hook = NULL; + if (vrp->ordered_hook == hook) + vrp->ordered_hook = NULL; + if (vrp->excessive_hook == hook) + vrp->excessive_hook = NULL; + if (vrp->incomplete_hook == hook) + vrp->incomplete_hook = NULL; + + /* during shutdown the node is invalid, don't shutdown twice */ + if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) && + (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) + ng_rmnode_self(NG_HOOK_NODE(hook)); + return (0); +} diff --git a/sys/netgraph/ng_vlan_rotate.h b/sys/netgraph/ng_vlan_rotate.h new file mode 100644 index 000000000000..ef6dfd6b506a --- /dev/null +++ b/sys/netgraph/ng_vlan_rotate.h @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2021 IKS Service GmbH + * + * 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. + * + * Author: Lutz Donnerhacke + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_NG_VLAN_ROTATE_H_ +#define _NETGRAPH_NG_VLAN_ROTATE_H_ + +#define NG_VLANROTATE_NODE_TYPE "vlan_rotate" +#define NGM_VLANROTATE_COOKIE 1568378766 + +/* Hook names */ +#define NG_VLANROTATE_HOOK_ORDERED "ordered" +#define NG_VLANROTATE_HOOK_ORIGINAL "original" +#define NG_VLANROTATE_HOOK_EXCESSIVE "excessive" +#define NG_VLANROTATE_HOOK_INCOMPLETE "incomplete" + +/* Limits */ +#define NG_VLANROTATE_MAX_VLANS 10 + +/* Datastructures for netgraph commands */ +struct ng_vlanrotate_conf { + int8_t rot; + uint8_t min, max; +}; + +struct ng_vlanrotate_stat { + uint64_t drops, excessive, incomplete; + uint64_t histogram[NG_VLANROTATE_MAX_VLANS]; +}; + +/* Netgraph commands understood by this node type */ +enum { + NGM_VLANROTATE_GET_CONF = 1, + NGM_VLANROTATE_SET_CONF, + NGM_VLANROTATE_GET_STAT, + NGM_VLANROTATE_CLR_STAT, + NGM_VLANROTATE_GETCLR_STAT +}; + +#endif /* _NETGRAPH_NG_VLAN_ROTATE_H_ */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 10:21: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 E415B55DFBD; Thu, 25 Feb 2021 10:21: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 4DmTN96B23z4VCL; Thu, 25 Feb 2021 10:21: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 C734515BAD; Thu, 25 Feb 2021 10:21: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 11PALTtr043572; Thu, 25 Feb 2021 10:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PALTHG043571; Thu, 25 Feb 2021 10:21:29 GMT (envelope-from git) Date: Thu, 25 Feb 2021 10:21:29 GMT Message-Id: <202102251021.11PALTHG043571@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: d65b86dd9325 - stable/13 - netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support 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: d65b86dd9325ce8d46fb7e82efb03c73c9957a77 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 10:21:30 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=d65b86dd9325ce8d46fb7e82efb03c73c9957a77 commit d65b86dd9325ce8d46fb7e82efb03c73c9957a77 Author: Neel Chauhan AuthorDate: 2021-01-24 19:23:39 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-25 10:21:03 +0000 netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support This extends upon the RFC 6598 support to libalias/ipfw in r357092. Reviewed By: manpages (bcr), donner, adrian, kp Differential Revision: https://reviews.freebsd.org/D23461 (cherry picked from commit 5fe433a6e4d8cab6b64284698301afc0c55a9db2) --- share/man/man4/ng_nat.4 | 8 +++++++- sys/netgraph/ng_nat.c | 2 ++ sys/netgraph/ng_nat.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ng_nat.4 b/share/man/man4/ng_nat.4 index b7c65fe89b20..e9c0f2acbcee 100644 --- a/share/man/man4/ng_nat.4 +++ b/share/man/man4/ng_nat.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2018 +.Dd January 24, 2021 .Dt NG_NAT 4 .Os .Sh NAME @@ -75,7 +75,13 @@ struct ng_nat_mode { #define NG_NAT_RESET_ON_ADDR_CHANGE 0x20 #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 +#define NG_NAT_UNREGISTERED_CGN 0x100 .Ed +.Pp +The corresponding libalias flags can be found by replacing the +.Vt "NG_NAT" +prefix with +.Vt "PKT_ALIAS" . .It Dv NGM_NAT_SET_TARGET Pq Ic settarget Configure target address for a node. When an incoming packet not associated with any pre-existing aliasing diff --git a/sys/netgraph/ng_nat.c b/sys/netgraph/ng_nat.c index a5c776ef6db6..cd3442914311 100644 --- a/sys/netgraph/ng_nat.c +++ b/sys/netgraph/ng_nat.c @@ -961,6 +961,8 @@ ng_nat_translate_flags(unsigned int x) res |= PKT_ALIAS_PROXY_ONLY; if (x & NG_NAT_REVERSE) res |= PKT_ALIAS_REVERSE; + if (x & NG_NAT_UNREGISTERED_CGN) + res |= PKT_ALIAS_UNREGISTERED_CGN; return (res); } diff --git a/sys/netgraph/ng_nat.h b/sys/netgraph/ng_nat.h index 46c9609772ff..b56d45c10671 100644 --- a/sys/netgraph/ng_nat.h +++ b/sys/netgraph/ng_nat.h @@ -54,6 +54,7 @@ struct ng_nat_mode { #define NG_NAT_RESET_ON_ADDR_CHANGE 0x20 #define NG_NAT_PROXY_ONLY 0x40 #define NG_NAT_REVERSE 0x80 +#define NG_NAT_UNREGISTERED_CGN 0x100 #define NG_NAT_DESC_LENGTH 64 #define NG_NAT_REDIRPROTO_ADDR (IPPROTO_MAX + 3) /* LibAlias' LINK_ADDR, also unused in in.h */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:31: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 12065561659; Thu, 25 Feb 2021 12:31: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 4DmXFx75JDz4cgF; Thu, 25 Feb 2021 12:31: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 E63ED17899; Thu, 25 Feb 2021 12:31: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 11PCVHC9013098; Thu, 25 Feb 2021 12:31:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCVH5v013097; Thu, 25 Feb 2021 12:31:17 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:31:17 GMT Message-Id: <202102251231.11PCVH5v013097@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: f5537cd0693c - main - bridgestp: Ensure we send STP on VLAN interfaces 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: f5537cd0693c85efdb2180a0a107c51eae15ba39 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:31:18 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5537cd0693c85efdb2180a0a107c51eae15ba39 commit f5537cd0693c85efdb2180a0a107c51eae15ba39 Author: Kristof Provost AuthorDate: 2021-02-24 15:38:53 +0000 Commit: Kristof Provost CommitDate: 2021-02-25 09:16:25 +0000 bridgestp: Ensure we send STP on VLAN interfaces Reviewed by: donner@ MFC after: 1 week X-MFC-with: 711ed156b94562c3dcb2ee9c1b3f240f960a75d2 Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28916 --- sys/net/bridgestp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 82524440c241..9e3a3e14ecda 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -2052,7 +2052,7 @@ bstp_reinit(struct bstp_state *bs) */ NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifp->if_type != IFT_ETHER) + if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN) continue; /* Not Ethernet */ if (ifp->if_bridge != bridgeptr) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:31: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 074A35614F5; Thu, 25 Feb 2021 12:31: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 4DmXFw6mVCz4cR2; Thu, 25 Feb 2021 12:31: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 D09511746F; Thu, 25 Feb 2021 12:31: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 11PCVGeX013076; Thu, 25 Feb 2021 12:31:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCVGrU013075; Thu, 25 Feb 2021 12:31:16 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:31:16 GMT Message-Id: <202102251231.11PCVGrU013075@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: f3245be3499b - main - net: remove legacy in_addmulti() 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: f3245be3499b60e790f59f84ebe24f9cc91dd982 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:31:17 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f3245be3499b60e790f59f84ebe24f9cc91dd982 commit f3245be3499b60e790f59f84ebe24f9cc91dd982 Author: Kristof Provost AuthorDate: 2021-02-23 19:21:19 +0000 Commit: Kristof Provost CommitDate: 2021-02-25 09:13:52 +0000 net: remove legacy in_addmulti() Despite the comment to the contrary neither pf nor carp use in_addmulti(). Nothing does, so get rid of it. Carp stopped using it in 08b68b0e4c6b132127919cfbaf7275c727ca7843 (2011). It's unclear when pf stopped using it, but before d6d3f01e0a3395c1fae34a3c4be7b051cb2d7581 (2012). Reviewed by: bz@, melifaro@ Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28918 --- sys/netinet/in_mcast.c | 29 ----------------------------- sys/netinet/in_var.h | 2 -- 2 files changed, 31 deletions(-) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 6d390a0b263c..392856785dd2 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -120,8 +120,6 @@ int ifma_restart; * Functions with non-static linkage defined in this file should be * declared in in_var.h: * imo_multi_filter() - * in_addmulti() - * in_delmulti() * in_joingroup() * in_joingroup_locked() * in_leavegroup() @@ -130,9 +128,6 @@ int ifma_restart; * inp_freemoptions() * inp_getmoptions() * inp_setmoptions() - * - * XXX: Both carp and pf need to use the legacy (*,G) KPIs in_addmulti() - * and in_delmulti(). */ static void imf_commit(struct in_mfilter *); static int imf_get_source(struct in_mfilter *imf, @@ -1367,30 +1362,6 @@ in_leavegroup_locked(struct in_multi *inm, /*const*/ struct in_mfilter *imf) } /*#ifndef BURN_BRIDGES*/ -/* - * Join an IPv4 multicast group in (*,G) exclusive mode. - * The group must be a 224.0.0.0/24 link-scope group. - * This KPI is for legacy kernel consumers only. - */ -struct in_multi * -in_addmulti(struct in_addr *ap, struct ifnet *ifp) -{ - struct in_multi *pinm; - int error; -#ifdef INVARIANTS - char addrbuf[INET_ADDRSTRLEN]; -#endif - - KASSERT(IN_LOCAL_GROUP(ntohl(ap->s_addr)), - ("%s: %s not in 224.0.0.0/24", __func__, - inet_ntoa_r(*ap, addrbuf))); - - error = in_joingroup(ifp, ap, NULL, &pinm); - if (error != 0) - pinm = NULL; - - return (pinm); -} /* * Block or unblock an ASM multicast source on an inpcb. diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index c7ebff80e56d..b42ca00d5ae7 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -450,8 +450,6 @@ int inm_record_source(struct in_multi *inm, const in_addr_t); void inm_release_deferred(struct in_multi *); void inm_release_list_deferred(struct in_multi_head *); void inm_release_wait(void *); -struct in_multi * -in_addmulti(struct in_addr *, struct ifnet *); int in_joingroup(struct ifnet *, const struct in_addr *, /*const*/ struct in_mfilter *, struct in_multi **); int in_joingroup_locked(struct ifnet *, const struct in_addr *, From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:31: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 50D53561888; Thu, 25 Feb 2021 12:31: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 4DmXFz1LRrz4cnT; Thu, 25 Feb 2021 12:31: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 1F3641789B; Thu, 25 Feb 2021 12:31: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 11PCVJvm013117; Thu, 25 Feb 2021 12:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCVJrg013116; Thu, 25 Feb 2021 12:31:19 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:31:19 GMT Message-Id: <202102251231.11PCVJrg013116@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: 7a4dbffa4205 - main - bridge tests: Test that we also forward on some interfaces 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: 7a4dbffa4205fc274b4884a6332d4831c5791320 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:31:19 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a4dbffa4205fc274b4884a6332d4831c5791320 commit 7a4dbffa4205fc274b4884a6332d4831c5791320 Author: Kristof Provost AuthorDate: 2021-02-24 15:40:37 +0000 Commit: Kristof Provost CommitDate: 2021-02-25 09:17:03 +0000 bridge tests: Test that we also forward on some interfaces Ensure that we not only block on some interfaces, but also forward on some. Without the previous commit we wound up discarding on all ports, rather than only on the ports needed to break the loop. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28917 --- tests/sys/net/if_bridge_test.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index bc9add68ce25..1f10fe325a2c 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -117,6 +117,15 @@ stp_body() then atf_fail "STP failed to detect bridging loop" fi + + # We must also have at least some forwarding interfaces + a_forwarding=$(jexec a ifconfig ${bridge_a} | grep forwarding) + b_forwarding=$(jexec b ifconfig ${bridge_b} | grep forwarding) + + if [ -z "${a_forwarding}" ] && [ -z "${b_forwarding}" ] + then + atf_fail "STP failed to detect bridging loop" + fi } stp_cleanup() @@ -182,6 +191,15 @@ stp_vlan_body() then atf_fail "STP failed to detect bridging loop" fi + + # We must also have at least some forwarding interfaces + a_forwarding=$(jexec a ifconfig ${bridge_a} | grep forwarding) + b_forwarding=$(jexec b ifconfig ${bridge_b} | grep forwarding) + + if [ -z "${a_forwarding}" ] && [ -z "${b_forwarding}" ] + then + atf_fail "STP failed to detect bridging loop" + fi } stp_vlan_cleanup() From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:46:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39903561F78; Thu, 25 Feb 2021 12:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmXbY171tz4fF9; Thu, 25 Feb 2021 12:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1941C17AEA; Thu, 25 Feb 2021 12:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PCkXCj030690; Thu, 25 Feb 2021 12:46:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCkXOm030689; Thu, 25 Feb 2021 12:46:33 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:46:33 GMT Message-Id: <202102251246.11PCkXOm030689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 59f6ddb2bc9c - main - Use pmap_qenter in the N1SDP PCIe driver 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/main X-Git-Reftype: branch X-Git-Commit: 59f6ddb2bc9c560c84b6ac30a2e1f140325f0a86 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:46:33 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=59f6ddb2bc9c560c84b6ac30a2e1f140325f0a86 commit 59f6ddb2bc9c560c84b6ac30a2e1f140325f0a86 Author: Andrew Turner AuthorDate: 2021-02-23 12:34:45 +0000 Commit: Andrew Turner CommitDate: 2021-02-25 12:38:05 +0000 Use pmap_qenter in the N1SDP PCIe driver In the Neoverse N1 SDP PCIe driver we need to map a page shared between the firmware and the kernel. Previously we would use pmap_kenter for this, however as this is not standardised between architectures switch to the common pmap_qenter. While here fix the error handling code to clean up on failure. Reviewed by: br Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D28890 --- sys/dev/pci/controller/pci_n1sdp.c | 39 +++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/sys/dev/pci/controller/pci_n1sdp.c b/sys/dev/pci/controller/pci_n1sdp.c index d51641c432f4..74d893ff1288 100644 --- a/sys/dev/pci/controller/pci_n1sdp.c +++ b/sys/dev/pci/controller/pci_n1sdp.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -66,6 +67,9 @@ __FBSDID("$FreeBSD$"); #define BDF_TABLE_SIZE (16 * 1024) #define PCI_CFG_SPACE_SIZE 0x1000 +_Static_assert(BDF_TABLE_SIZE >= PAGE_SIZE, + "pci_n1sdp.c assumes a 4k or 16k page size when mapping the shared data"); + struct pcie_discovery_data { uint32_t rc_base_addr; uint32_t nr_bdfs; @@ -85,30 +89,40 @@ n1sdp_init(struct generic_pcie_n1sdp_softc *sc) vm_offset_t vaddr; vm_paddr_t paddr_rc; vm_paddr_t paddr; + vm_page_t m[BDF_TABLE_SIZE / PAGE_SIZE]; int table_count; int bdfs_size; int error, i; paddr = AP_NS_SHARED_MEM_BASE + sc->acpi.segment * BDF_TABLE_SIZE; + vm_phys_fictitious_reg_range(paddr, paddr + BDF_TABLE_SIZE, + VM_MEMATTR_UNCACHEABLE); + + for (i = 0; i < nitems(m); i++) { + m[i] = PHYS_TO_VM_PAGE(paddr + i * PAGE_SIZE); + MPASS(m[i] != NULL); + } + vaddr = kva_alloc((vm_size_t)BDF_TABLE_SIZE); if (vaddr == 0) { printf("%s: Can't allocate KVA memory.", __func__); - return (ENXIO); + error = ENXIO; + goto out; } - pmap_kenter(vaddr, (vm_size_t)BDF_TABLE_SIZE, paddr, - VM_MEMATTR_UNCACHEABLE); + pmap_qenter(vaddr, m, nitems(m)); shared_data = (struct pcie_discovery_data *)vaddr; - bdfs_size = sizeof(struct pcie_discovery_data) + - sizeof(uint32_t) * shared_data->nr_bdfs; - sc->n1_discovery_data = malloc(bdfs_size, M_DEVBUF, M_WAITOK | M_ZERO); - memcpy(sc->n1_discovery_data, shared_data, bdfs_size); - paddr_rc = (vm_offset_t)shared_data->rc_base_addr; error = bus_space_map(sc->acpi.base.bst, paddr_rc, PCI_CFG_SPACE_SIZE, 0, &sc->n1_bsh); if (error != 0) - return (error); + goto out_pmap; + + bdfs_size = sizeof(struct pcie_discovery_data) + + sizeof(uint32_t) * shared_data->nr_bdfs; + sc->n1_discovery_data = malloc(bdfs_size, M_DEVBUF, + M_WAITOK | M_ZERO); + memcpy(sc->n1_discovery_data, shared_data, bdfs_size); if (bootverbose) { table_count = sc->n1_discovery_data->nr_bdfs; @@ -117,10 +131,13 @@ n1sdp_init(struct generic_pcie_n1sdp_softc *sc) sc->n1_discovery_data->valid_bdfs[i]); } - pmap_kremove(vaddr); +out_pmap: + pmap_qremove(vaddr, nitems(m)); kva_free(vaddr, (vm_size_t)BDF_TABLE_SIZE); - return (0); +out: + vm_phys_fictitious_unreg_range(paddr, paddr + BDF_TABLE_SIZE); + return (error); } static int From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:46: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 5700B562300; Thu, 25 Feb 2021 12:46: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 4DmXbZ249cz4fFB; Thu, 25 Feb 2021 12:46: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 39E5517B52; Thu, 25 Feb 2021 12:46: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 11PCkY9L030710; Thu, 25 Feb 2021 12:46:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCkYss030709; Thu, 25 Feb 2021 12:46:34 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:46:34 GMT Message-Id: <202102251246.11PCkYss030709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3fd63ddfdf35 - main - Limit when we call DELAY from KCSAN on amd64 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/main X-Git-Reftype: branch X-Git-Commit: 3fd63ddfdf3541faea762143365dbc70c16fa49e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:46:34 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3fd63ddfdf3541faea762143365dbc70c16fa49e commit 3fd63ddfdf3541faea762143365dbc70c16fa49e Author: Andrew Turner AuthorDate: 2021-02-05 11:41:17 +0000 Commit: Andrew Turner CommitDate: 2021-02-25 12:38:05 +0000 Limit when we call DELAY from KCSAN on amd64 In some cases the DELAY implementation on amd64 can recurse on a spin mutex in the i8254 early delay code. Detect when this is going to happen and don't call delay in this case. It is safe to not delay here with the only issue being KCSAN may not detect data races. Reviewed by: kib Tested by: arichardson Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D28895 --- sys/amd64/include/csan.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/amd64/include/csan.h b/sys/amd64/include/csan.h index c886daa12f69..9daf8275492c 100644 --- a/sys/amd64/include/csan.h +++ b/sys/amd64/include/csan.h @@ -31,6 +31,9 @@ * $FreeBSD$ */ +#include + +#include #include #include #include @@ -64,7 +67,14 @@ kcsan_md_enable_intrs(uint64_t *state) static inline void kcsan_md_delay(uint64_t us) { - DELAY(us); + /* + * Only call DELAY if not using the early delay code. The i8254 + * early delay function may cause us to recurse on a spin lock + * leading to a panic. + */ + if ((tsc_is_invariant && tsc_freq != 0) || + timecounter->tc_quality > 0) + DELAY(us); } static void From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:58: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 DF04D562648; Thu, 25 Feb 2021 12:58: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 4DmXsK5tMlz4gMQ; Thu, 25 Feb 2021 12:58: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 BC6591800E; Thu, 25 Feb 2021 12:58: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 11PCwTiA043888; Thu, 25 Feb 2021 12:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCwTdr043887; Thu, 25 Feb 2021 12:58:29 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:58:29 GMT Message-Id: <202102251258.11PCwTdr043887@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: fd61ccfeb448 - stable/13 - ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ() 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: fd61ccfeb448ff77ff84978df68d9c2b025e0091 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:58:29 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fd61ccfeb448ff77ff84978df68d9c2b025e0091 commit fd61ccfeb448ff77ff84978df68d9c2b025e0091 Author: Konstantin Belousov AuthorDate: 2021-02-19 12:37:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 12:55:18 +0000 ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ() (cherry picked from commit cc9958bf22f1426faf4be8bf492ce69587a9008f) --- sys/ufs/ffs/ffs_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 3b652ea14303..c7a1e2dec15e 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -543,7 +543,7 @@ ffs_reallocblks(ap) * here. Instead we simply fail to reallocate blocks if this * rare condition arises. */ - if (DOINGSOFTDEP(ap->a_vp)) + if (DOINGSUJ(ap->a_vp)) if (softdep_prealloc(ap->a_vp, MNT_NOWAIT) != 0) return (ENOSPC); if (ump->um_fstype == UFS1) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:58: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 0A6F656264F; Thu, 25 Feb 2021 12:58: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 4DmXsL6pkgz4gB6; Thu, 25 Feb 2021 12:58: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 DBC1317E91; Thu, 25 Feb 2021 12:58: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 11PCwUfa043906; Thu, 25 Feb 2021 12:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCwUcI043905; Thu, 25 Feb 2021 12:58:30 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:58:30 GMT Message-Id: <202102251258.11PCwUcI043905@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: 94412c2d00d6 - stable/13 - ffs: do not call softdep_prealloc() from UFS_BALLOC() 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: 94412c2d00d641fc2f0892e4b9b2f598c48c4eaa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:58:31 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=94412c2d00d641fc2f0892e4b9b2f598c48c4eaa commit 94412c2d00d641fc2f0892e4b9b2f598c48c4eaa Author: Konstantin Belousov AuthorDate: 2021-02-18 14:51:50 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 12:55:18 +0000 ffs: do not call softdep_prealloc() from UFS_BALLOC() (cherry picked from commit 49831462794690155ce8dbe02679e6d9390f3d7d) --- sys/ufs/ffs/ffs_balloc.c | 5 ----- sys/ufs/ffs/ffs_vnops.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index daa897dfe032..1b53a90a48c4 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -128,8 +128,6 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size, return (EFBIG); gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; - if (DOINGSOFTDEP(vp)) - softdep_prealloc(vp, MNT_WAIT); /* * If the next write will extend the file into a new block, * and the file is currently composed of a fragment @@ -621,9 +619,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size, return (EFBIG); gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; - if (DOINGSOFTDEP(vp)) - softdep_prealloc(vp, MNT_WAIT); - /* * Check for allocating external data. */ diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 1dfdf5182a42..c00469c4c7e3 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -834,6 +834,11 @@ ffs_write(ap) int blkoffset, error, flags, ioflag, size, xfersize; vp = ap->a_vp; + if (DOINGSUJ(vp)) + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + uio = ap->a_uio; ioflag = ap->a_ioflag; if (ap->a_ioflag & IO_EXT) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:58:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4250562359; Thu, 25 Feb 2021 12:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmXsP1qtJz4gKC; Thu, 25 Feb 2021 12:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B11717E92; Thu, 25 Feb 2021 12:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PCwXlD043951; Thu, 25 Feb 2021 12:58:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCwXuT043950; Thu, 25 Feb 2021 12:58:33 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:58:33 GMT Message-Id: <202102251258.11PCwXuT043950@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: e2827f8a1345 - stable/13 - ffs_close_ea: do not relock vnode under lock_ea 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: e2827f8a13451f9f6409d111b40fcf6c83b119c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:58:34 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e2827f8a13451f9f6409d111b40fcf6c83b119c5 commit e2827f8a13451f9f6409d111b40fcf6c83b119c5 Author: Konstantin Belousov AuthorDate: 2021-02-21 10:10:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 12:55:18 +0000 ffs_close_ea: do not relock vnode under lock_ea (cherry picked from commit 5e198e7646a27412c0541719f7bf1bbc0bd89223) --- sys/ufs/ffs/ffs_vnops.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index f9a6a36d178a..64c72f3d3cc4 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1422,9 +1422,10 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td { struct inode *ip; struct uio luio; - struct iovec liovec; + struct iovec *liovec; struct ufs2_dinode *dp; - int error; + size_t ea_len, tlen; + int error, i, lcnt; ip = VTOI(vp); @@ -1439,18 +1440,31 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td ASSERT_VOP_ELOCKED(vp, "ffs_close_ea commit"); if (cred == NOCRED) cred = vp->v_mount->mnt_cred; - liovec.iov_base = ip->i_ea_area; - liovec.iov_len = ip->i_ea_len; - luio.uio_iov = &liovec; - luio.uio_iovcnt = 1; + + ea_len = MAX(ip->i_ea_len, dp->di_extsize); + for (lcnt = 1, tlen = ea_len - ip->i_ea_len; tlen > 0;) { + tlen -= MIN(ZERO_REGION_SIZE, tlen); + lcnt++; + } + + liovec = __builtin_alloca(lcnt * sizeof(struct iovec)); + luio.uio_iovcnt = lcnt; + + liovec[0].iov_base = ip->i_ea_area; + liovec[0].iov_len = ip->i_ea_len; + for (i = 1, tlen = ea_len; i < lcnt; i++) { + liovec[i].iov_base = __DECONST(void *, zero_region); + liovec[i].iov_len = MIN(ZERO_REGION_SIZE, tlen); + tlen -= liovec[i].iov_len; + } + MPASS(tlen == ip->i_ea_len); + + luio.uio_iov = liovec; luio.uio_offset = 0; - luio.uio_resid = ip->i_ea_len; + luio.uio_resid = ea_len; luio.uio_segflg = UIO_SYSSPACE; luio.uio_rw = UIO_WRITE; luio.uio_td = td; - /* XXX: I'm not happy about truncating to zero size */ - if (ip->i_ea_len < dp->di_extsize) - error = ffs_truncate(vp, 0, IO_EXT, cred); error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred); } if (--ip->i_ea_refs == 0) { @@ -1460,6 +1474,9 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td ip->i_ea_error = 0; } ffs_unlock_ea(vp); + + if (commit && error == 0 && ip->i_ea_len == 0) + ffs_truncate(vp, 0, IO_EXT, cred); return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12: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 A4F1256245E; Thu, 25 Feb 2021 12: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 4DmXsN1Hl2z4gPp; Thu, 25 Feb 2021 12: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 143B71800F; Thu, 25 Feb 2021 12: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 11PCwVqC043929; Thu, 25 Feb 2021 12:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCwVe0043928; Thu, 25 Feb 2021 12:58:31 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:58:31 GMT Message-Id: <202102251258.11PCwVe0043928@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: 120c4f6405be - stable/13 - ffs_vnops.c: style 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: 120c4f6405bede7dc5eefe7e63d7acec22fa1d2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:58:33 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=120c4f6405bede7dc5eefe7e63d7acec22fa1d2f commit 120c4f6405bede7dc5eefe7e63d7acec22fa1d2f Author: Konstantin Belousov AuthorDate: 2021-02-20 17:01:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 12:55:18 +0000 ffs_vnops.c: style (cherry picked from commit c6d68ca842a3f5b6814cdd5c87e406bad579b792) --- sys/ufs/ffs/ffs_vnops.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index c00469c4c7e3..f9a6a36d178a 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1423,8 +1423,8 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td struct inode *ip; struct uio luio; struct iovec liovec; - int error; struct ufs2_dinode *dp; + int error; ip = VTOI(vp); @@ -1527,14 +1527,15 @@ struct vop_closeextattr_args { }; */ { + struct vnode *vp; - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + vp = ap->a_vp; + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - - if (ap->a_commit && (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)) + if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); - return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred, ap->a_td)); + return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } /* @@ -1552,6 +1553,7 @@ vop_deleteextattr { }; */ { + struct vnode *vp; struct inode *ip; struct extattr *eap; uint32_t ul; @@ -1559,18 +1561,17 @@ vop_deleteextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); - - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1582,7 +1583,7 @@ vop_deleteextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1596,7 +1597,7 @@ vop_deleteextattr { if (olen == -1) { /* delete but nonexistent */ free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); return (ENOATTR); } ul = eap->ea_length; @@ -1608,7 +1609,7 @@ vop_deleteextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); } @@ -1741,6 +1742,7 @@ vop_setextattr { }; */ { + struct vnode *vp; struct inode *ip; struct fs *fs; struct extattr *eap; @@ -1750,12 +1752,12 @@ vop_setextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); fs = ITOFS(ip); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); @@ -1763,14 +1765,14 @@ vop_setextattr { if (ap->a_uio == NULL) return (EOPNOTSUPP); - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); ealen = ap->a_uio->uio_resid; if (ealen < 0 || ealen > lblktosize(fs, UFS_NXADDR)) return (EINVAL); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1782,7 +1784,7 @@ vop_setextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1819,7 +1821,7 @@ vop_setextattr { } if (easize > lblktosize(fs, UFS_NXADDR)) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = ENOSPC; return (ENOSPC); @@ -1833,7 +1835,7 @@ vop_setextattr { error = uiomove(EXTATTR_CONTENT(eap), ealen, ap->a_uio); if (error) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = error; return (error); @@ -1844,7 +1846,7 @@ vop_setextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:58: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 E46A656227F; Thu, 25 Feb 2021 12:58: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 4DmXsQ3YQCz4gRq; Thu, 25 Feb 2021 12:58: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 38BFA1808B; Thu, 25 Feb 2021 12:58: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 11PCwYu8043969; Thu, 25 Feb 2021 12:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCwYWX043968; Thu, 25 Feb 2021 12:58:34 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:58:34 GMT Message-Id: <202102251258.11PCwYWX043968@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: ffa424772e9f - stable/13 - Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing 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: ffa424772e9f679c59610e4a6173cfab8d0b4943 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:58:35 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ffa424772e9f679c59610e4a6173cfab8d0b4943 commit ffa424772e9f679c59610e4a6173cfab8d0b4943 Author: Konstantin Belousov AuthorDate: 2021-02-21 10:11:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 12:55:18 +0000 Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing (cherry picked from commit 6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba) --- sys/ufs/ffs/ffs_vnops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 64c72f3d3cc4..af03b369a280 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1552,6 +1552,12 @@ struct vop_closeextattr_args { if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); + if (ap->a_commit && DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_closeextattr commit"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } @@ -1600,6 +1606,13 @@ vop_deleteextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1801,6 +1814,13 @@ vop_setextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 12:58: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 C746656235B; Thu, 25 Feb 2021 12:58: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 4DmXsS2PZtz4fxV; Thu, 25 Feb 2021 12:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BE8917D94; Thu, 25 Feb 2021 12:58: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 11PCwZ12043991; Thu, 25 Feb 2021 12:58:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PCwZlI043990; Thu, 25 Feb 2021 12:58:35 GMT (envelope-from git) Date: Thu, 25 Feb 2021 12:58:35 GMT Message-Id: <202102251258.11PCwZlI043990@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: 66308a13dddc - stable/13 - Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash 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: 66308a13dddcf4282521c044ee668c15a638cdd6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 12:58:39 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66308a13dddcf4282521c044ee668c15a638cdd6 commit 66308a13dddcf4282521c044ee668c15a638cdd6 Author: Kirk McKusick AuthorDate: 2021-02-12 05:31:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 12:56:20 +0000 Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash PR: 253158 (cherry picked from commit 8563de2f2799b2cb6f2f06e3c9dddd48dca2a986) (cherry picked from commit c31480a1f66537e59b02e935a547bcfc76715278) --- sys/ufs/ffs/ffs_snapshot.c | 141 ++++++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 67 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 72c8061917d8..6da84fb46bb0 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -316,21 +319,21 @@ restart: ip = VTOI(vp); devvp = ITODEVVP(ip); /* - * Allocate and copy the last block contents so as to be able - * to set size to that of the filesystem. + * Calculate the size of the filesystem then allocate the block + * immediately following the last block of the filesystem that + * will contain the snapshot list. This operation allows us to + * set the size of the snapshot. */ numblks = howmany(fs->fs_size, fs->fs_frag); - error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(numblks - 1)), + error = UFS_BALLOC(vp, lblktosize(fs, (off_t)numblks), fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); if (error) goto out; - ip->i_size = lblktosize(fs, (off_t)numblks); + bawrite(bp); + ip->i_size = lblktosize(fs, (off_t)(numblks + 1)); + vnode_pager_setsize(vp, ip->i_size); DIP_SET(ip, i_size, ip->i_size); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); - error = readblock(vp, bp, numblks - 1); - bawrite(bp); - if (error != 0) - goto out; /* * Preallocate critical data structures so that we can copy * them in without further allocation after we suspend all @@ -452,23 +455,13 @@ restart: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (ip->i_effnlink == 0) { error = ENOENT; /* Snapshot file unlinked */ - goto out1; + goto resumefs; } #ifdef DIAGNOSTIC if (collectsnapstats) nanotime(&starttime); #endif - /* The last block might have changed. Copy it again to be sure. */ - error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(numblks - 1)), - fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); - if (error != 0) - goto out1; - error = readblock(vp, bp, numblks - 1); - bp->b_flags |= B_VALIDSUSPWRT; - bawrite(bp); - if (error != 0) - goto out1; /* * First, copy all the cylinder group maps that have changed. */ @@ -479,11 +472,11 @@ restart: error = UFS_BALLOC(vp, lfragtosize(fs, cgtod(fs, cg)), fs->fs_bsize, KERNCRED, 0, &nbp); if (error) - goto out1; + goto resumefs; error = cgaccount(cg, vp, nbp, 2); bawrite(nbp); if (error) - goto out1; + goto resumefs; } /* * Grab a copy of the superblock and its summary information. @@ -513,11 +506,7 @@ restart: if ((error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + loc), len, KERNCRED, &bp)) != 0) { brelse(bp); - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; - goto out1; + goto resumefs; } bcopy(bp->b_data, space, (u_int)len); space = (char *)space + len; @@ -539,10 +528,27 @@ restart: * Note that we skip unlinked snapshot files as they will * be handled separately below. * - * We also calculate the needed size for the snapshot list. + * We also calculate the size needed for the snapshot list. + * Initial number of entries is composed of: + * - one for each cylinder group map + * - one for each block used by superblock summary table + * - one for each snapshot inode block + * - one for the superblock + * - one for the snapshot list + * The direct block entries in the snapshot are always + * copied (see reason below). Note that the superblock and + * the first cylinder group will almost always be allocated + * in the direct blocks, but we add the slop for them in case + * they do not end up there. The snapshot list size may get + * expanded by one because of an update of an inode block for + * an unlinked but still open file when it is expunged. + * + * Because the direct block pointers are always copied, they + * are not added to the list. Instead ffs_copyonwrite() + * explicitly checks for them before checking the snapshot list. */ snaplistsize = fs->fs_ncg + howmany(fs->fs_cssize, fs->fs_bsize) + - FSMAXSNAP + 1 /* superblock */ + 1 /* last block */ + 1 /* size */; + FSMAXSNAP + /* superblock */ 1 + /* snaplist */ 1; MNT_ILOCK(mp); mp->mnt_kern_flag &= ~MNTK_SUSPENDED; MNT_IUNLOCK(mp); @@ -624,12 +630,8 @@ loop: VOP_UNLOCK(xvp); vdrop(xvp); if (error) { - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); - goto out1; + goto resumefs; } } /* @@ -637,13 +639,8 @@ loop: */ if (fs->fs_flags & FS_SUJ) { error = softdep_journal_lookup(mp, &xvp); - if (error) { - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; - goto out1; - } + if (error) + goto resumefs; xp = VTOI(xvp); if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1, @@ -694,6 +691,27 @@ loop: sn->sn_listsize = blkp - snapblklist; VI_UNLOCK(devvp); } + /* + * Preallocate all the direct blocks in the snapshot inode so + * that we never have to write the inode itself to commit an + * update to the contents of the snapshot. Note that once + * created, the size of the snapshot will never change, so + * there will never be a need to write the inode except to + * update the non-integrity-critical time fields and + * allocated-block count. + */ + for (blockno = 0; blockno < UFS_NDADDR; blockno++) { + if (DIP(ip, i_db[blockno]) != 0) + continue; + error = UFS_BALLOC(vp, lblktosize(fs, blockno), + fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); + if (error) + goto resumefs; + error = readblock(vp, bp, blockno); + bawrite(bp); + if (error != 0) + goto resumefs; + } /* * Record snapshot inode. Since this is the newest snapshot, * it must be placed at the end of the list. @@ -706,11 +724,16 @@ loop: TAILQ_INSERT_TAIL(&sn->sn_head, ip, i_nextsnap); devvp->v_vflag |= VV_COPYONWRITE; VI_UNLOCK(devvp); +resumefs: ASSERT_VOP_LOCKED(vp, "ffs_snapshot vp"); -out1: - KASSERT((sn != NULL && copy_fs != NULL && error == 0) || - (sn == NULL && copy_fs == NULL && error != 0), - ("email phk@ and mckusick@")); + if (error != 0 && copy_fs != NULL) { + free(copy_fs->fs_csp, M_UFSMNT); + free(copy_fs->fs_si, M_UFSMNT); + free(copy_fs, M_UFSMNT); + copy_fs = NULL; + } + KASSERT(error != 0 || (sn != NULL && copy_fs != NULL), + ("missing snapshot setup parameters")); /* * Resume operation on filesystem. */ @@ -786,7 +809,7 @@ out1: aiov.iov_base = (void *)snapblklist; aiov.iov_len = snaplistsize * sizeof(daddr_t); auio.uio_resid = aiov.iov_len; - auio.uio_offset = ip->i_size; + auio.uio_offset = lblktosize(fs, (off_t)numblks); auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; auio.uio_td = td; @@ -835,27 +858,6 @@ out1: VI_UNLOCK(devvp); if (space != NULL) free(space, M_UFSMNT); - /* - * Preallocate all the direct blocks in the snapshot inode so - * that we never have to write the inode itself to commit an - * update to the contents of the snapshot. Note that once - * created, the size of the snapshot will never change, so - * there will never be a need to write the inode except to - * update the non-integrity-critical time fields and - * allocated-block count. - */ - for (blockno = 0; blockno < UFS_NDADDR; blockno++) { - if (DIP(ip, i_db[blockno]) != 0) - continue; - error = UFS_BALLOC(vp, lblktosize(fs, blockno), - fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); - if (error) - break; - error = readblock(vp, bp, blockno); - bawrite(bp); - if (error != 0) - break; - } done: free(copy_fs->fs_csp, M_UFSMNT); free(copy_fs->fs_si, M_UFSMNT); @@ -1573,7 +1575,8 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype) blkno = *oldblkp; if (blkno == 0 || blkno == BLK_NOCOPY) continue; - if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP) + if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP && + lblkno >= UFS_NDADDR) *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); @@ -2320,6 +2323,10 @@ ffs_copyonwrite(devvp, bp) ip = TAILQ_FIRST(&sn->sn_head); fs = ITOFS(ip); lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno)); + if (lbn < UFS_NDADDR) { + VI_UNLOCK(devvp); + return (0); /* Direct blocks are always copied */ + } snapblklist = sn->sn_blklist; upper = sn->sn_listsize - 1; lower = 1; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 13:27: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 B5214562DFA; Thu, 25 Feb 2021 13:27: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 4DmYVG4krXz4j8S; Thu, 25 Feb 2021 13:27: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 9536F1858D; Thu, 25 Feb 2021 13:27: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 11PDR2IP083798; Thu, 25 Feb 2021 13:27:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PDR2W2083797; Thu, 25 Feb 2021 13:27:02 GMT (envelope-from git) Date: Thu, 25 Feb 2021 13:27:02 GMT Message-Id: <202102251327.11PDR2W2083797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 61f66a1f4403 - main - ncurses: Add support for terminfo database MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61f66a1f4403fded9aae14d890ad96914a3c0bc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 13:27:02 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=61f66a1f4403fded9aae14d890ad96914a3c0bc1 commit 61f66a1f4403fded9aae14d890ad96914a3c0bc1 Author: Baptiste Daroussin AuthorDate: 2021-01-12 16:34:49 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 13:25:11 +0000 ncurses: Add support for terminfo database Along with the termcap database, ncurses will now lookup for the terminfo database, note that the terminfo database is being looked up first and then it fallsback on the termcap one. While here drop our custom reader for the termcap database, over the time it is needed maintenance to be able to catchup with changes on ncurses side. Install the ncurses tools which are needed to deal with the terminfo database: tic, infocmp, toe Replace our termcap only aware tools with the ncurses counterpart: tput, tabs, tset, clear and reset In particular they can your the extra capabilities described in the terminfo database, which does not exist in termcap Note that to add a new terminfo information to the database from ports the ports will just need to add their extra information into: /usr/local/share/site-terminfo// Tested by: jbeich, manu --- lib/ncurses/config.mk | 14 +- lib/ncurses/ncurses/Makefile | 9 +- lib/ncurses/ncurses/ncurses_cfg.h | 63 +++--- lib/ncurses/ncurses/termcap.c | 266 ------------------------ share/mk/src.tools.mk | 1 + usr.bin/Makefile | 4 +- usr.bin/ncurses/Makefile | 40 ++++ usr.bin/ncurses/transform.h | 10 + usr.bin/tput/Makefile | 9 - usr.bin/tput/Makefile.depend | 18 -- usr.bin/tput/clear.sh | 37 ---- usr.bin/tput/tput.1 | 179 ---------------- usr.bin/tput/tput.c | 214 ------------------- usr.bin/tset/Makefile | 11 - usr.bin/tset/Makefile.depend | 18 -- usr.bin/tset/extern.h | 51 ----- usr.bin/tset/map.c | 254 ----------------------- usr.bin/tset/misc.c | 68 ------ usr.bin/tset/set.c | 324 ----------------------------- usr.bin/tset/term.c | 158 -------------- usr.bin/tset/tset.1 | 421 -------------------------------------- usr.bin/tset/tset.c | 299 --------------------------- usr.bin/tset/wrterm.c | 116 ----------- 23 files changed, 98 insertions(+), 2486 deletions(-) diff --git a/lib/ncurses/config.mk b/lib/ncurses/config.mk index f199c5829b65..7a64a7b948ee 100644 --- a/lib/ncurses/config.mk +++ b/lib/ncurses/config.mk @@ -3,8 +3,11 @@ # This Makefile is shared by libncurses, libform, libmenu, libpanel. NCURSES_DIR= ${SRCTOP}/contrib/ncurses +NCURSES_MAJOR= 6 +NCURSES_MINOR= 2 +NCURSES_PATCH= 20200215 -CFLAGS+= -D_XOPEN_SOURCE_EXTENDED -DENABLE_WIDEC +CFLAGS+= -D_XOPEN_SOURCE_EXTENDED NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h CFLAGS+= -I. @@ -41,5 +44,12 @@ MANFILTER= sed -e 's%@TERMINFO@%${TERMINFODIR}/terminfo%g' \ -e 's%@NCURSES_MAJOR@%${NCURSES_MAJOR}%g' \ -e 's%@NCURSES_MINOR@%${NCURSES_MINOR}%g' \ -e 's%@NCURSES_PATCH@%${NCURSES_PATCH}%g' \ + -e 's%@TSET@%tset%g' \ + -e 's%@RESET@%reset%g' \ + -e 's%@CLEAR@%clear%g' \ + -e 's%@TABS@%tabs%g' \ -e 's%@TIC@%tic%g' \ - -e 's%@INFOCMP@%infocmp%g' + -e 's%@TOE@%toe%g' \ + -e 's%@INFOCMP@%infocmp%g' \ + -e 's%@CAPTOINFO@%captoinfo%g' \ + -e 's%@INFOTOCAP@%infotocap%g' diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 6f03d93a9ac6..aff569a79845 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -216,6 +216,7 @@ SRCS+= \ obsolete.c \ parse_entry.c \ read_entry.c \ + read_termcap.c \ strings.c \ trim_sgr0.c \ write_entry.c @@ -270,14 +271,10 @@ DBGSRCS= \ trace_xnames.c \ varargs.c -# From our old libtermcap. -# Used instead of the hideous read_termcap.c abomination. -SRCS+= termcap.c - CLEANFILES= ${GENSRCS} ${GENHDRS} keys.list make_hash term.h.new \ make_keys MKterm.h.awk comp_captab.c curses.head -CFLAGS+= -DFREEBSD_NATIVE -DTERMIOS +CFLAGS+= -DTERMIOS # Installed HEADERS= curses.h term.h termcap.h unctrl.h @@ -416,7 +413,7 @@ make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} MKterm.h.awk: MKterm.h.awk.in sed <${NCURSES_DIR}/include/MKterm.h.awk.in >$@ \ -e "/@BROKEN_LINKER@/s%%${BROKEN_LINKER}%" \ - -e "s%@NCURSES_USE_DATABASE@%0%g" \ + -e "s%@NCURSES_USE_DATABASE@%1%g" \ -e "s%@NCURSES_USE_TERMCAP@%1%g" \ -e "/@NCURSES_MAJOR@/s%%${NCURSES_MAJOR}%" \ -e "/@NCURSES_MINOR@/s%%${NCURSES_MINOR}%" \ diff --git a/lib/ncurses/ncurses/ncurses_cfg.h b/lib/ncurses/ncurses/ncurses_cfg.h index 0a92c2f23ba4..49cef464b803 100644 --- a/lib/ncurses/ncurses/ncurses_cfg.h +++ b/lib/ncurses/ncurses/ncurses_cfg.h @@ -59,6 +59,8 @@ #define HAVE_LONG_FILE_NAMES 1 #define MIXEDCASE_FILENAMES 1 #define USE_SYSMOUSE 1 +#define TERMINFO_DIRS "/usr/share/terminfo:/usr/local/share/site-terminfo" +#define TERMINFO "/usr/share/terminfo" #define HAVE_BIG_CORE 1 #define TERMPATH "/etc/termcap:/usr/share/misc/termcap" #define USE_GETCAP 1 @@ -70,6 +72,23 @@ #define USE_LINKS 1 #define BSD_TPUTS 1 #define HAVE_LANGINFO_CODESET 1 +#define USE_WIDEC_SUPPORT 1 +#define NCURSES_WIDECHAR 1 +#define HAVE_WCHAR_H 1 +#define HAVE_WCTYPE_H 1 +#define HAVE_PUTWC 1 +#define HAVE_BTOWC 1 +#define HAVE_WCTOB 1 +#define HAVE_MBTOWC 1 +#define HAVE_WCTOMB 1 +#define HAVE_MBLEN 1 +#define HAVE_MBRLEN 1 +#define HAVE_MBRTOWC 1 +#define HAVE_WCSRTOMBS 1 +#define HAVE_MBSRTOWCS 1 +#define HAVE_WCSTOMBS 1 +#define HAVE_MBSTOWCS 1 +#define NEED_WCHAR_H 1 #define HAVE_FSEEKO 1 #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 @@ -96,6 +115,10 @@ #define HAVE_WRESIZE 1 #define NCURSES_SP_FUNCS 1 #define HAVE_TPUTS_SP 1 +#define NCURSES_EXT_COLORS 1 +#define HAVE_ALLOC_PAIR 1 +#define HAVE_INIT_EXTENDED_COLOR 1 +#define HAVE_RESET_COLOR_PAIRS 1 #define NCURSES_EXT_PUTWIN 1 #define NCURSES_NO_PADDING 1 #define USE_SIGWINCH 1 @@ -133,6 +156,11 @@ #define HAVE_UNISTD_H 1 #define HAVE_GETOPT_H 1 #define HAVE_GETOPT_HEADER 1 +#define DECL_ENVIRON 1 +#define HAVE_ENVIRON 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_STRDUP 1 #define HAVE_SYS_TIME_SELECT 1 #define SIG_ATOMIC_T volatile sig_atomic_t #define HAVE_ERRNO 1 @@ -153,6 +181,7 @@ #define HAVE_SETVBUF 1 #define HAVE_SIGACTION 1 #define HAVE_SIGVEC 1 +#define HAVE_SNPRINTF 1 #define HAVE_STRDUP 1 #define HAVE_STRSTR 1 #define HAVE_SYSCONF 1 @@ -181,11 +210,12 @@ #define USE_FOPEN_BIN_R 1 #define USE_OPENPTY_HEADER #define USE_XTERM_PTY 1 -#define USE_HASHED_DB 1 #define HAVE_TYPEINFO 1 #define HAVE_IOSTREAM 1 #define IOSTREAM_NAMESPACE 1 +#define SIZEOF_BOOL 1 #define CPP_HAS_STATIC_CAST 1 +#define SIZEOF_WCHAR_T 4 #define HAVE_SLK_COLOR 1 #define HAVE_PANEL_H 1 #define HAVE_LIBPANEL 1 @@ -198,37 +228,6 @@ #define NCURSES_OSPEED_COMPAT 1 #define HAVE_CURSES_DATA_BOOLNAMES 1 -/* - * Begin FreeBSD-specific changes - */ -/* Support ENABLE_WIDEC */ -#ifdef ENABLE_WIDEC -#define USE_WIDEC_SUPPORT 1 -#define NCURSES_WIDECHAR 1 -#define NCURSES_EXT_FUNCS 1 -#define NCURSES_EXT_COLORS 1 -#define HAVE_ALLOC_PAIR 1 -#define HAVE_INIT_EXTENDED_COLOR 1 -#define HAVE_RESET_COLOR_PAIRS 1 -#define HAVE_PUTWC 1 -#define HAVE_BTOWC 1 -#define HAVE_WCTOB 1 -#define HAVE_MBTOWC 1 -#define HAVE_WCTOMB 1 -#define HAVE_MBLEN 1 -#define HAVE_MBRLEN 1 -#define HAVE_MBRTOWC 1 -#define HAVE_WCSRTOMBS 1 -#define HAVE_MBSRTOWCS 1 -#define HAVE_WCSTOMBS 1 -#define HAVE_MBSTOWCS 1 -#define NEED_WCHAR_H 1 -#define SIZEOF_WCHAR_T 4 -#endif -/* - * End FreeBSD-specific changes - */ - #include /* The C compiler may not treat these properly but C++ has to */ diff --git a/lib/ncurses/ncurses/termcap.c b/lib/ncurses/ncurses/termcap.c deleted file mode 100644 index 535301a1b474..000000000000 --- a/lib/ncurses/ncurses/termcap.c +++ /dev/null @@ -1,266 +0,0 @@ -/* A portion of this file is from ncurses: */ -/*************************************************************************** -* COPYRIGHT NOTICE * -**************************************************************************** -* ncurses is copyright (C) 1992-1995 * -* Zeyd M. Ben-Halim * -* zmbenhal@netcom.com * -* Eric S. Raymond * -* esr@snark.thyrsus.com * -* * -* Permission is hereby granted to reproduce and distribute ncurses * -* by any means and for any fee, whether alone or as part of a * -* larger distribution, in source or in binary form, PROVIDED * -* this notice is included with any such distribution, and is not * -* removed from any of its header files. Mention of ncurses in any * -* applications linked with it is highly appreciated. * -* * -* ncurses comes AS IS with no warranty, implied or expressed. * -* * -***************************************************************************/ - -#include - -#include -#include -#include -#include - -/* The rest is from BSD */ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1980, 1993 - * The Regents of the University of California. 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. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#if 0 -#ifndef lint -static const char sccsid[] = "@(#)termcap.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ -#endif - -#include -#include -#include -#include -#include -#include -#include "pathnames.h" - -#define PBUFSIZ MAXPATHLEN /* max length of filename path */ -#define PVECSIZ 32 /* max number of names in path */ -#define TBUFSIZ 1024 /* max length of _nc_tgetent buffer */ - -char _nc_termcap[TBUFSIZ + 1]; /* Last getcap, provided to tgetent() emul */ - -/* - * termcap - routines for dealing with the terminal capability data base - * - * BUG: Should use a "last" pointer in tbuf, so that searching - * for capabilities alphabetically would not be a n**2/2 - * process when large numbers of capabilities are given. - * Note: If we add a last pointer now we will screw up the - * tc capability. We really should compile termcap. - * - * Essentially all the work here is scanning and decoding escapes - * in string capabilities. We don't use stdio because the editor - * doesn't, and because living w/o it is not hard. - */ - -/* - * Get an entry for terminal name in buffer _nc_termcap from the termcap - * file. - */ -int -_nc_read_termcap_entry(const char *const name, TERMTYPE2 *const tp) -{ - ENTRY *ep; - char *p; - char *cp; - char *dummy; - char **fname; - char *home; - int i; - char pathbuf[PBUFSIZ]; /* holds raw path of filenames */ - char *pathvec[PVECSIZ]; /* to point to names in pathbuf */ - char **pvec; /* holds usable tail of path vector */ - char *termpath; - - _nc_termcap[0] = '\0'; /* in case */ - dummy = NULL; - fname = pathvec; - pvec = pathvec; - p = pathbuf; - cp = getenv("TERMCAP"); - /* - * TERMCAP can have one of two things in it. It can be the - * name of a file to use instead of /etc/termcap. In this - * case it better start with a "/". Or it can be an entry to - * use so we don't have to read the file. In this case it - * has to already have the newlines crunched out. If TERMCAP - * does not hold a file name then a path of names is searched - * instead. The path is found in the TERMPATH variable, or - * becomes "$HOME/.termcap /etc/termcap" if no TERMPATH exists. - */ - if (!cp || *cp != '/') { /* no TERMCAP or it holds an entry */ - if ( (termpath = getenv("TERMPATH")) ) - strncpy(pathbuf, termpath, PBUFSIZ); - else { - if ( (home = getenv("HOME")) ) {/* set up default */ - strncpy(pathbuf, home, PBUFSIZ - 1); /* $HOME first */ - pathbuf[PBUFSIZ - 2] = '\0'; /* -2 because we add a slash */ - p += strlen(pathbuf); /* path, looking in */ - *p++ = '/'; - } /* if no $HOME look in current directory */ - strncpy(p, _PATH_DEF, PBUFSIZ - (p - pathbuf)); - } - } - else /* user-defined name in TERMCAP */ - strncpy(pathbuf, cp, PBUFSIZ); /* still can be tokenized */ - - /* For safety */ - if (issetugid()) - strcpy(pathbuf, _PATH_DEF_SEC); - - pathbuf[PBUFSIZ - 1] = '\0'; - - *fname++ = pathbuf; /* tokenize path into vector of names */ - while (*++p) - if (*p == ' ' || *p == ':') { - *p = '\0'; - while (*++p) - if (*p != ' ' && *p != ':') - break; - if (*p == '\0') - break; - *fname++ = p; - if (fname >= pathvec + PVECSIZ) { - fname--; - break; - } - } - *fname = (char *) 0; /* mark end of vector */ - if (cp && *cp && *cp != '/') - if (cgetset(cp) < 0) - return(-2); - - i = cgetent(&dummy, pathvec, (char *)name); - - if (i == 0) { - char *pd, *ps, *tok, *s, *tcs; - size_t len; - - pd = _nc_termcap; - ps = dummy; - if ((tok = strchr(ps, ':')) == NULL) { - len = strlen(ps); - if (len >= TBUFSIZ) - i = -1; - else - strcpy(pd, ps); - goto done; - } - len = tok - ps + 1; - if (pd + len + 1 - _nc_termcap >= TBUFSIZ) { - i = -1; - goto done; - } - memcpy(pd, ps, len); - ps += len; - pd += len; - *pd = '\0'; - tcs = pd - 1; - for (;;) { - while ((tok = strsep(&ps, ":")) != NULL && - *(tok - 2) != '\\' && - (*tok == '\0' || *tok == '\\' || !isgraph(UChar(*tok)))) - ; - if (tok == NULL) - break; - for (s = tcs; s != NULL && s[1] != '\0'; - s = strchr(s, ':')) { - s++; - if (s[0] == tok[0] && s[1] == tok[1]) - goto skip_it; - } - len = strlen(tok); - if (pd + len + 1 - _nc_termcap >= TBUFSIZ) { - i = -1; - break; - } - memcpy(pd, tok, len); - pd += len; - *pd++ = ':'; - *pd = '\0'; - skip_it: ; - } - } -done: - if (dummy) - free(dummy); - - -/* - * From here on is ncurses-specific glue code - */ - - if (i < 0) - return(TGETENT_ERR); - - _nc_set_source("TERMCAP"); - _nc_read_entry_source((FILE *)NULL, _nc_termcap, FALSE, TRUE, NULLHOOK); - - if (_nc_head == (ENTRY *)NULL) - return(TGETENT_ERR); - - /* resolve all use references */ - _nc_resolve_uses2(TRUE, FALSE); - - for_entry_list(ep) - if (_nc_name_match(ep->tterm.term_names, name, "|:")) - { - /* - * Make a local copy of the terminal capabilities, delinked - * from the list. - */ - memcpy(tp, &ep->tterm, sizeof(TERMTYPE)); - _nc_delink_entry(_nc_head, &(ep->tterm)); - free(ep); - _nc_free_entries(_nc_head); - _nc_head = _nc_tail = NULL; /* do not reuse! */ - - return TGETENT_YES; /* OK */ - } - - _nc_free_entries(_nc_head); - _nc_head = _nc_tail = NULL; /* do not reuse! */ - return(TGETENT_NO); /* not found */ -} diff --git a/share/mk/src.tools.mk b/share/mk/src.tools.mk index 722734bbfc1a..5e3b7048409b 100644 --- a/share/mk/src.tools.mk +++ b/share/mk/src.tools.mk @@ -20,6 +20,7 @@ MTREE_CMD?= mtree PWD_MKDB_CMD?= pwd_mkdb SERVICES_MKDB_CMD?= services_mkdb CAP_MKDB_CMD?= cap_mkdb +TIC_CMD?= tic ____: .endif # !target(____) diff --git a/usr.bin/Makefile b/usr.bin/Makefile index fcc406d2efc5..3e71dbb30e6b 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -97,6 +97,7 @@ SUBDIR= alias \ mkuzip \ mt \ ncal \ + ncurses \ netstat \ newgrp \ nfsstat \ @@ -146,7 +147,6 @@ SUBDIR= alias \ strings \ su \ systat \ - tabs \ tail \ tar \ tcopy \ @@ -156,11 +156,9 @@ SUBDIR= alias \ tip \ top \ touch \ - tput \ tr \ true \ truncate \ - tset \ tsort \ tty \ uname \ diff --git a/usr.bin/ncurses/Makefile b/usr.bin/ncurses/Makefile new file mode 100644 index 000000000000..cd8344aa1a97 --- /dev/null +++ b/usr.bin/ncurses/Makefile @@ -0,0 +1,40 @@ +PACKAGE= runtime + +.include +.include "${SRCTOP}/lib/ncurses/config.mk" + +.PATH: ${NCURSES_DIR}/progs ${NCURSES_DIR}/man + +PROGS= tic tput infocmp toe tabs clear tset +SRCS.tic= tic.c transform.c dump_entry.c tparm_type.c +SRCS.tput= tput.c tparm_type.c transform.c dump_entry.c clear_cmd.c reset_cmd.c \ + tty_settings.c +SRCS.infocmp= infocmp.c dump_entry.c +SRCS.tabs= tabs.c tty_settings.c +SRCS.clear= clear.c clear_cmd.c tty_settings.c +SRCS.tset= tset.c tty_settings.c transform.c reset_cmd.c +CFLAGS+= -I${NCURSES_DIR}/progs \ + -I${NCURSES_DIR}/include \ + -I${SRCTOP}/lib/ncurses/ncurses \ + -I${OBJTOP}/lib/ncurses/ncurses \ + -I${.CURDIR} +LIBADD= ncursesw +CLEANFILES= termsort.c + +termsort.c: MKtermsort.sh + sh ${NCURSES_DIR}/progs/MKtermsort.sh ${AWK} ${NCURSES_DIR}/include/Caps > ${.TARGET} +dump_entry.c: termsort.c + +LINKS.tic= ${BINDIR}/tic ${BINDIR}/captoinfo \ + ${BINDIR}/tic ${BINDIR}/infotocap +LINKS.tset= ${BINDIR}/tset ${BINDIR}/reset + +MLINKS.tic= tic.1 captoinfo.1 \ + tic.1 infotocap.1 +MLINKS.tset= tset.1 reset.1 + +.include + +.SUFFIXES: .1 .1m +.1m.1: + cat ${.IMPSRC} > ${.TARGET} diff --git a/usr.bin/ncurses/transform.h b/usr.bin/ncurses/transform.h new file mode 100644 index 000000000000..ec255c05c4dd --- /dev/null +++ b/usr.bin/ncurses/transform.h @@ -0,0 +1,10 @@ +#ifndef __TRANSFORM_H +#define __TRANSFORM_H 1 +#include +extern bool same_program(const char *, const char *); +#define PROG_CAPTOINFO "captoinfo" +#define PROG_INFOTOCAP "infotocap" +#define PROG_CLEAR "clear" +#define PROG_RESET "reset" +#define PROG_INIT "init" +#endif /* __TRANSFORM_H */ diff --git a/usr.bin/tput/Makefile b/usr.bin/tput/Makefile deleted file mode 100644 index d3171dab7ef0..000000000000 --- a/usr.bin/tput/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $FreeBSD$ - -PROG= tput -LIBADD= ncursesw -SCRIPTS=clear.sh -MLINKS= tput.1 clear.1 - -.include diff --git a/usr.bin/tput/Makefile.depend b/usr.bin/tput/Makefile.depend deleted file mode 100644 index 9b2a343de2dc..000000000000 --- a/usr.bin/tput/Makefile.depend +++ /dev/null @@ -1,18 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/ncurses/ncursesw \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/tput/clear.sh b/usr.bin/tput/clear.sh deleted file mode 100644 index 2c6e093e10c7..000000000000 --- a/usr.bin/tput/clear.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright (c) 1989, 1993 -# The Regents of the University of California. 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. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# $FreeBSD$ -# -# @(#)clear.sh 8.1 (Berkeley) 6/6/93 -# - -exec tput clear diff --git a/usr.bin/tput/tput.1 b/usr.bin/tput/tput.1 deleted file mode 100644 index 996575bb622e..000000000000 --- a/usr.bin/tput/tput.1 +++ /dev/null @@ -1,179 +0,0 @@ -.\" Copyright (c) 1989, 1990, 1993 -.\" The Regents of the University of California. 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. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" @(#)tput.1 8.2 (Berkeley) 3/19/94 -.\" $FreeBSD$ -.\" -.Dd June 15, 2002 -.Dt TPUT 1 -.Os -.Sh NAME -.Nm tput , -.Nm clear -.Nd terminal capability interface -.Sh SYNOPSIS -.Nm -.Op Fl T Ar term -.Op Ar attribute ... -.Nm clear -.Sh DESCRIPTION -The -.Nm -utility makes terminal-dependent information available to users or shell -applications. -.Pp -The -.Nm clear -utility executes the -.Dl tput clear -command, ignoring any arguments. -.Pp -The only option to -.Nm -is: -.Bl -tag -width 2n -.It Fl T -The terminal name as specified in the -.Xr termcap 5 -database, for example, -.Dq vt100 -or -.Dq xterm . -If not specified, -.Nm -retrieves the -.Dq Ev TERM -variable from the environment unless that too is not specified, -in which case an error message will be sent to standard error and -the error status will be 2. -.El -.Pp -The -.Nm -utility outputs a string for each -.Ar attribute -that is of type string; a number for each of type integer. -Otherwise, -.Nm -exits 0 if the terminal has the capability and 1 if it does not, -without further action. -.Pp -If an -.Ar attribute -is of type string, and takes arguments (e.g.\& cursor movement, -the termcap -.Dq cm -capability) the arguments are taken from the command line immediately -following the attribute. -.Pp -The following special attributes are available. -The first three use the capabilities of the specified terminal, -and only work if compatible with the utility's terminal. -.Bl -tag -width Ar -.It Cm clear -Clear the screen (the -.Xr termcap 5 -.Dq cl -capability). -.It Cm init -Initialize the terminal (the -.Xr termcap 5 -.Dq is -capability). -.It Cm reset -Reset the terminal (the -.Xr termcap 5 -.Dq rs -capability). -.It Cm longname -Print the descriptive name of the user's terminal type. -.El -.Sh ENVIRONMENT -.Bl -tag -width ".Ev TERM" -.It Ev TERM -The terminal name, if set and -.Fl T -is not used. -.El -.Sh EXIT STATUS -The exit status of -.Nm -is as follows: -.Bl -tag -width indent -.It 0 -If the last -.Ar attribute -is of type string or integer, its value was successfully written -to standard output. -If the -.Ar attribute -is of type boolean, the terminal does have the -.Ar attribute . -Otherwise, no -.Ar attribute -was specified. -.It 1 -If the last -.Ar attribute -is of type boolean, -this terminal does not have the -.Ar attribute . -.It 2 -Usage error. -For example, see -.Fl T -description. -.It 3 -No information is available about the specified terminal type. -.El -.Sh SEE ALSO -.Xr termcap 5 , -.Xr terminfo 5 -.Sh STANDARDS -The -.Nm -utility conforms to -.St -p1003.1-2001 . -.Sh HISTORY -The -.Nm -utility appeared in -.Bx 4.4 . -.Sh BUGS -The -.Nm -utility cannot really distinguish between different types of attributes. -.Pp -Some termcap entries depend upon having a -.Sq % -in them that is just a -.Sq % -and nothing more. -Right now we just warn about them if they do not -have a valid type declaration. -These warnings are sent to -stderr. diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c deleted file mode 100644 index 8f678f61b1a0..000000000000 --- a/usr.bin/tput/tput.c +++ /dev/null @@ -1,214 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1980, 1988, 1993 - * The Regents of the University of California. 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. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -__FBSDID("$FreeBSD$"); - -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1980, 1988, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif - -#ifndef lint -static const char sccsid[] = "@(#)tput.c 8.2 (Berkeley) 3/19/94"; -#endif - -#include - -#include -#include -#include -#include -#include -#include - -#undef putchar -#define outc putchar - -static void prlongname(char *); -static void usage(void); -static char **process(const char *, char *, char **); - -int -main(int argc, char **argv) -{ - int ch, exitval, n; - char *cptr, *term, buf[1024], tbuf[1024]; - const char *p; - - term = NULL; - while ((ch = getopt(argc, argv, "T:")) != -1) - switch(ch) { - case 'T': - term = optarg; - break; - case '?': - default: - usage(); - } - argc -= optind; - argv += optind; - - if (argc < 1) - usage(); - - if (!term && !(term = getenv("TERM"))) -errx(2, "no terminal type specified and no TERM environmental variable."); - if (tgetent(tbuf, term) != 1) - err(3, "tgetent failure"); *** 1906 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Feb 25 13:27: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 D204E562E6A; Thu, 25 Feb 2021 13:27: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 4DmYVH5gVrz4jH9; Thu, 25 Feb 2021 13:27: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 B5BA218611; Thu, 25 Feb 2021 13:27: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 11PDR3TN083821; Thu, 25 Feb 2021 13:27:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PDR3LC083820; Thu, 25 Feb 2021 13:27:03 GMT (envelope-from git) Date: Thu, 25 Feb 2021 13:27:03 GMT Message-Id: <202102251327.11PDR3LC083820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 0af562d7e185 - main - bootstrap: add tic to the bootstrap tools MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0af562d7e1850bbef230d30805c101b26588a3ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 13:27:03 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0af562d7e1850bbef230d30805c101b26588a3ed commit 0af562d7e1850bbef230d30805c101b26588a3ed Author: Baptiste Daroussin AuthorDate: 2021-02-23 06:21:52 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 13:25:28 +0000 bootstrap: add tic to the bootstrap tools tic is necessary early in the build to be able to build the terminfo database later on. Tested by: manu, jbeich --- Makefile.inc1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 005d9d25afb3..839d4d9db02b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2433,6 +2433,9 @@ ${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_lex_depend} # since "make" will usually point to GNU make there. _other_bootstrap_tools+=usr.bin/bmake +_other_bootstrap_tools+=lib/ncurses/ncurses +${_bt}-usr.bin/ncurses: ${_bt}-lib/ncurses/ncurses + # Avoid dependency on host bz2 headers: _other_bootstrap_tools+=lib/libbz2 ${_bt}-usr.bin/grep: ${_bt}-lib/libbz2 @@ -2479,6 +2482,7 @@ bootstrap-tools: ${_bt}-links .PHONY lib/libopenbsd \ usr.bin/mandoc \ usr.bin/rpcgen \ + lib/ncurses/ncurses \ ${_yacc} \ ${_m4} \ ${_lex} \ @@ -2493,6 +2497,7 @@ bootstrap-tools: ${_bt}-links .PHONY ${_nmtree} \ ${_vtfontcvt} \ ${_localedef} \ + usr.bin/ncurses \ ${LOCAL_BSTOOL_DIRS} ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ @@ -2514,6 +2519,9 @@ ${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd ${_bt}-sbin/md5: ${_bt}-lib/libmd .endif +if target(${_bt}-usr.bin/ncurses) +${_bt}-usr.bin/ncurses: ${_bt}-lib/ncurses/ncurses +.endif # # build-tools: Build special purpose build tools From owner-dev-commits-src-all@freebsd.org Thu Feb 25 13:27: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 63BE95630BE; Thu, 25 Feb 2021 13:27: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 4DmYVJ6fzFz4jFK; Thu, 25 Feb 2021 13:27: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 D108B17FF9; Thu, 25 Feb 2021 13:27: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 11PDR474083843; Thu, 25 Feb 2021 13:27:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PDR4eC083842; Thu, 25 Feb 2021 13:27:04 GMT (envelope-from git) Date: Thu, 25 Feb 2021 13:27:04 GMT Message-Id: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 2a50a9de8340 - main - terminfo: add terminfo database MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a50a9de8340f08bd876e9e5993332ae14376f80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 13:27:06 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae14376f80 commit 2a50a9de8340f08bd876e9e5993332ae14376f80 Author: Baptiste Daroussin AuthorDate: 2021-02-23 16:17:32 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 13:25:32 +0000 terminfo: add terminfo database Tested by: manu, jbeich --- share/Makefile | 1 + share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/share/Makefile b/share/Makefile index c4e12b05f7db..d6854b230ae5 100644 --- a/share/Makefile +++ b/share/Makefile @@ -26,6 +26,7 @@ SUBDIR= ${_colldef} \ ${_syscons} \ tabset \ termcap \ + terminfo \ ${_timedef} \ ${_vt} \ ${_zoneinfo} diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile new file mode 100644 index 000000000000..7bb11f3fdf24 --- /dev/null +++ b/share/terminfo/Makefile @@ -0,0 +1,34 @@ +PACKAGE= runtime + +.PATH: ${SRCTOP}/contrib/ncurses/misc +TINFOBUILDDIR= ${.OBJDIR}/builddir +CLEANDIRS+= builddir + +.include + +.if !defined(_SKIP_BUILD) +all: terminfo +.endif +META_TARGETS+= terminfo install-terminfo + +terminfo: terminfo.src + mkdir -p ${TINFOBUILDDIR} + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} + +.if make(*install*) +TINFOS!= cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=C sort +TINFOSDIRS= ${TINFOS:C/(.).*/\1/g:O:u} +.endif + +beforeinstall: install-terminfo +install-terminfo: + mkdir -p ${DESTDIR}/usr/share/terminfo + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} +.for f in ${TINFOS} + ${INSTALL} ${TAG_ARGS} \ + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} +.endfor + +.include + From owner-dev-commits-src-all@freebsd.org Thu Feb 25 13:53: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 F22A8563E47; Thu, 25 Feb 2021 13:53: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 4DmZ4c5slqz4lD5; Thu, 25 Feb 2021 13:53: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 BC68418C65; Thu, 25 Feb 2021 13:53: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 11PDrKfe022027; Thu, 25 Feb 2021 13:53:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PDrK0V022026; Thu, 25 Feb 2021 13:53:20 GMT (envelope-from git) Date: Thu, 25 Feb 2021 13:53:20 GMT Message-Id: <202102251353.11PDrK0V022026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: b6a51d39e3a2 - main - bootstrap: fix a last edit typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6a51d39e3a2e2f75d5b42a8c17a531063258a15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 13:53:21 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b6a51d39e3a2e2f75d5b42a8c17a531063258a15 commit b6a51d39e3a2e2f75d5b42a8c17a531063258a15 Author: Baptiste Daroussin AuthorDate: 2021-02-25 13:52:43 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 13:53:00 +0000 bootstrap: fix a last edit typo Reported by: cy --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 839d4d9db02b..fd5097d1f8dd 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2519,7 +2519,7 @@ ${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd ${_bt}-sbin/md5: ${_bt}-lib/libmd .endif -if target(${_bt}-usr.bin/ncurses) +.if target(${_bt}-usr.bin/ncurses) ${_bt}-usr.bin/ncurses: ${_bt}-lib/ncurses/ncurses .endif From owner-dev-commits-src-all@freebsd.org Thu Feb 25 14:04:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEB4C5641B3; Thu, 25 Feb 2021 14:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmZKd4PxTz4m9h; Thu, 25 Feb 2021 14:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85E3518AD4; Thu, 25 Feb 2021 14:04: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 11PE4boJ036541; Thu, 25 Feb 2021 14:04:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PE4bu0036540; Thu, 25 Feb 2021 14:04:37 GMT (envelope-from git) Date: Thu, 25 Feb 2021 14:04:37 GMT Message-Id: <202102251404.11PE4bu0036540@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: 0486986ad81d - stable/13 - vm_kern: Avoid sign extension in the KVA_QUANTUM definition 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: 0486986ad81dbbfca291acf5b15f94d67d8a61bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 14:04:37 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0486986ad81dbbfca291acf5b15f94d67d8a61bd commit 0486986ad81dbbfca291acf5b15f94d67d8a61bd Author: Mark Johnston AuthorDate: 2021-02-22 20:50:09 +0000 Commit: Mark Johnston CommitDate: 2021-02-25 13:56:54 +0000 vm_kern: Avoid sign extension in the KVA_QUANTUM definition Otherwise, on a powerpc64 NUMA system with hashed page tables, the first-level superpage reservation size is large enough that the value of the kernel KVA arena import quantum, KVA_NUMA_IMPORT_QUANTUM, is negative and gets sign-extended when passed to vmem_set_import(). This results in a boot-time hang on such platforms. Reported by: bdragon (cherry picked from commit 23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f) --- sys/vm/vm_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index f1704f834157..0677d901d408 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -127,7 +127,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, /* On non-superpage architectures we want large import sizes. */ #define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) #endif -#define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) +#define KVA_QUANTUM (1ul << KVA_QUANTUM_SHIFT) #define KVA_NUMA_IMPORT_QUANTUM (KVA_QUANTUM * 128) extern void uma_startup2(void); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 14:04: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 1FE595641B4; Thu, 25 Feb 2021 14:04: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 4DmZKf5lT3z4lrh; Thu, 25 Feb 2021 14:04: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 A3D5318E0D; Thu, 25 Feb 2021 14:04: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 11PE4cFN036559; Thu, 25 Feb 2021 14:04:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PE4cnb036558; Thu, 25 Feb 2021 14:04:38 GMT (envelope-from git) Date: Thu, 25 Feb 2021 14:04:38 GMT Message-Id: <202102251404.11PE4cnb036558@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: e2c9871f6a7b - stable/13 - arm64: Include NUMA locality info in the CPU topology 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: e2c9871f6a7ba8a14b2c377a860cfaf1adcdff83 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 14:04:39 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e2c9871f6a7ba8a14b2c377a860cfaf1adcdff83 commit e2c9871f6a7ba8a14b2c377a860cfaf1adcdff83 Author: Mark Johnston AuthorDate: 2021-02-18 15:50:57 +0000 Commit: Mark Johnston CommitDate: 2021-02-25 13:57:08 +0000 arm64: Include NUMA locality info in the CPU topology The scheduler uses this topology to try and preserve locality when migrating threads between CPUs and when performing work stealing. Ensure that on NUMA systems it will at least take the NUMA topology into account. Reviewed by: mmel Submitted by: Klara, Inc. Sponsored by: Ampere Computing Differential Revision: https://reviews.freebsd.org/D28579 (cherry picked from commit 17d0f830dddf38724068f4139b6bef9a5dab70c5) --- sys/arm64/arm64/mp_machdep.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 8f1118d36bf5..8d5d82879571 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -437,8 +437,35 @@ ipi_stop(void *dummy __unused) struct cpu_group * cpu_topo(void) { + struct cpu_group *dom, *root; + int i; + + root = smp_topo_alloc(1); + dom = smp_topo_alloc(vm_ndomains); + + root->cg_parent = NULL; + root->cg_child = dom; + CPU_COPY(&all_cpus, &root->cg_mask); + root->cg_count = mp_ncpus; + root->cg_children = vm_ndomains; + root->cg_level = CG_SHARE_NONE; + root->cg_flags = 0; + + /* + * Redundant layers will be collapsed by the caller so we don't need a + * special case for a single domain. + */ + for (i = 0; i < vm_ndomains; i++, dom++) { + dom->cg_parent = root; + dom->cg_child = NULL; + CPU_COPY(&cpuset_domain[i], &dom->cg_mask); + dom->cg_count = CPU_COUNT(&dom->cg_mask); + dom->cg_children = 0; + dom->cg_level = CG_SHARE_L3; + dom->cg_flags = 0; + } - return (smp_topo_none()); + return (root); } /* Determine if we running MP machine */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 14:06: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 B9D61564266; Thu, 25 Feb 2021 14:06: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 4DmZN04xbcz4mHf; Thu, 25 Feb 2021 14:06: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 9D26418E0E; Thu, 25 Feb 2021 14:06: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 11PE6eW1036974; Thu, 25 Feb 2021 14:06:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PE6eWB036973; Thu, 25 Feb 2021 14:06:40 GMT (envelope-from git) Date: Thu, 25 Feb 2021 14:06:40 GMT Message-Id: <202102251406.11PE6eWB036973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 13ad237a19b7 - main - ipfw: make algo name argument optional for some table types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13ad237a19b7368124483d9d1dc3258c27880fef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 14:06:40 -0000 The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=13ad237a19b7368124483d9d1dc3258c27880fef commit 13ad237a19b7368124483d9d1dc3258c27880fef Author: Andrey V. Elsukov AuthorDate: 2021-02-25 13:57:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-02-25 13:57:47 +0000 ipfw: make algo name argument optional for some table types Most of table types currently supported by ipfw have only one algorithm implementation. When user creates such tables, allow to omit algo name in arguments. E.g. now it is possible: ipfw table T1 create type number ipfw table T2 create type iface ipfw table T3 create type flow PR: 233072 MFC after: 1 week Sponsored by: Yandex LLC --- sbin/ipfw/tables.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 57b8cef00889..81cf7e392586 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -83,6 +83,15 @@ static struct _s_x tabletypes[] = { { NULL, 0 } }; +/* Default algorithms for various table types */ +static struct _s_x tablealgos[] = { + { "addr:radix", IPFW_TABLE_ADDR }, + { "flow:hash", IPFW_TABLE_FLOW }, + { "iface:array", IPFW_TABLE_INTERFACE }, + { "number:array", IPFW_TABLE_NUMBER }, + { NULL, 0 } +}; + static struct _s_x tablevaltypes[] = { { "skipto", IPFW_VTYPE_SKIPTO }, { "pipe", IPFW_VTYPE_PIPE }, @@ -468,8 +477,15 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) } /* Set some defaults to preserve compatibility. */ - if (xi.algoname[0] == '\0' && xi.type == 0) - xi.type = IPFW_TABLE_ADDR; + if (xi.algoname[0] == '\0') { + const char *algo; + + if (xi.type == 0) + xi.type = IPFW_TABLE_ADDR; + algo = match_value(tablealgos, xi.type); + if (algo != NULL) + strlcpy(xi.algoname, algo, sizeof(xi.algoname)); + } if (xi.vmask == 0) xi.vmask = IPFW_VTYPE_LEGACY; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 15:05: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 0F6A8565F24; Thu, 25 Feb 2021 15:05: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 4DmbhF71yXz4r50; Thu, 25 Feb 2021 15:05: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 E3A0919AF2; Thu, 25 Feb 2021 15:05: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 11PF5nIE015591; Thu, 25 Feb 2021 15:05:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PF5nOs015589; Thu, 25 Feb 2021 15:05:49 GMT (envelope-from git) Date: Thu, 25 Feb 2021 15:05:49 GMT Message-Id: <202102251505.11PF5nOs015589@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: faa998f6ff69 - main - sendfile: Use the pager size to determine the file extent when possible 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: faa998f6ff69573fe82765c77c7268ee89ac945e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 15:05:50 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=faa998f6ff69573fe82765c77c7268ee89ac945e commit faa998f6ff69573fe82765c77c7268ee89ac945e Author: Mark Johnston AuthorDate: 2021-02-25 15:04:44 +0000 Commit: Mark Johnston CommitDate: 2021-02-25 15:04:44 +0000 sendfile: Use the pager size to determine the file extent when possible Previously sendfile would issue a VOP_GETATTR and use the returned size, i.e., the file size. When paging in file data, sendfile_swapin() will use the pager to determine whether it needs to zero-fill, most often because of a hole in a sparse file. An attempt to page in beyond the end of a file is treated this way, and occurs when the requested page is past the end of the pager. In other words, both the file size and pager size were used interchangeably. With ZFS, updates to the pager and file sizes are not synchronized by the exclusive vnode lock, at least partially due to its use of MNTK_SHARED_WRITES. In particular, the pager size is updated after the file size, so in the presence of a writer concurrently extending the file, sendfile could incorrectly instantiate "holes" in the page cache pages backing the file, which manifests as data corruption when reading the file back from the page cache. The on-disk copy is unaffected. Fix this by consistently using the pager size when available. Reported by: dumbbell Reviewed by: chs, kib Tested by: dumbbell, pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28811 --- sys/kern/kern_sendfile.c | 55 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 7d7be6f072e9..95bfba0538dc 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -588,28 +588,40 @@ sendfile_getobj(struct thread *td, struct file *fp, vm_object_t *obj_res, goto out; } *bsize = vp->v_mount->mnt_stat.f_iosize; - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0) - goto out; - *obj_size = va.va_size; obj = vp->v_object; if (obj == NULL) { error = EINVAL; goto out; } + + /* + * Use the pager size when available to simplify synchronization + * with filesystems, which otherwise must atomically update both + * the vnode pager size and file size. + */ + if (obj->type == OBJT_VNODE) { + VM_OBJECT_RLOCK(obj); + *obj_size = obj->un_pager.vnp.vnp_size; + } else { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) + goto out; + *obj_size = va.va_size; + VM_OBJECT_RLOCK(obj); + } } else if (fp->f_type == DTYPE_SHM) { error = 0; shmfd = fp->f_data; obj = shmfd->shm_object; + VM_OBJECT_RLOCK(obj); *obj_size = shmfd->shm_size; } else { error = EINVAL; goto out; } - VM_OBJECT_WLOCK(obj); if ((obj->flags & OBJ_DEAD) != 0) { - VM_OBJECT_WUNLOCK(obj); + VM_OBJECT_RUNLOCK(obj); error = EBADF; goto out; } @@ -620,7 +632,7 @@ sendfile_getobj(struct thread *td, struct file *fp, vm_object_t *obj_res, * immediately destroy it. */ vm_object_reference_locked(obj); - VM_OBJECT_WUNLOCK(obj); + VM_OBJECT_RUNLOCK(obj); *obj_res = obj; *vp_res = vp; *shmfd_res = shmfd; @@ -679,7 +691,7 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct shmfd *shmfd; struct sendfile_sync *sfs; struct vattr va; - off_t off, sbytes, rem, obj_size; + off_t off, sbytes, rem, obj_size, nobj_size; int bsize, error, ext_pgs_idx, hdrlen, max_pgs, softerr; #ifdef KERN_TLS int tls_enq_cnt; @@ -852,15 +864,30 @@ retry_space: error = vn_lock(vp, LK_SHARED); if (error != 0) goto done; - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0 || off >= va.va_size) { + + /* + * Check to see if the file size has changed. + */ + if (obj->type == OBJT_VNODE) { + VM_OBJECT_RLOCK(obj); + nobj_size = obj->un_pager.vnp.vnp_size; + VM_OBJECT_RUNLOCK(obj); + } else { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) { + VOP_UNLOCK(vp); + goto done; + } + nobj_size = va.va_size; + } + if (off >= nobj_size) { VOP_UNLOCK(vp); goto done; } - if (va.va_size != obj_size) { - obj_size = va.va_size; - rem = nbytes ? - omin(nbytes + offset, obj_size) : obj_size; + if (nobj_size != obj_size) { + obj_size = nobj_size; + rem = nbytes ? omin(nbytes + offset, obj_size) : + obj_size; rem -= off; } } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 15:05: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 36B8B565F26; Thu, 25 Feb 2021 15:05: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 4DmbhH18pYz4r2T; Thu, 25 Feb 2021 15:05: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 1AA3119B0A; Thu, 25 Feb 2021 15:05: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 11PF5pID015612; Thu, 25 Feb 2021 15:05:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PF5pfW015611; Thu, 25 Feb 2021 15:05:51 GMT (envelope-from git) Date: Thu, 25 Feb 2021 15:05:51 GMT Message-Id: <202102251505.11PF5pfW015611@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: 369706a6f887 - main - buf: Fix the dirtybufthresh check 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: 369706a6f887f8ffe1037d78bc31565ec701d72b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 15:05:51 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=369706a6f887f8ffe1037d78bc31565ec701d72b commit 369706a6f887f8ffe1037d78bc31565ec701d72b Author: Mark Johnston AuthorDate: 2021-02-25 15:04:44 +0000 Commit: Mark Johnston CommitDate: 2021-02-25 15:04:44 +0000 buf: Fix the dirtybufthresh check dirtybufthresh is a watermark, slightly below the high watermark for dirty buffers. When a delayed write is issued, the dirtying thread will start flushing buffers if the dirtybufthresh watermark is reached. This helps ensure that the high watermark is not reached, otherwise performance will degrade as clustering and other optimizations are disabled (see buf_dirty_count_severe()). When the buffer cache was partitioned into "domains", the dirtybufthresh threshold checks were not updated. Fix this. Reported by: Shrikanth R Kamath Reviewed by: rlibby, mckusick, kib, bdrewery Sponsored by: Juniper Networks, Inc., Klara, Inc. Fixes: 3cec5c77d6 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28901 --- sys/kern/vfs_bio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 45be14b47207..8e8cf3f083d4 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2325,11 +2325,13 @@ void bufbdflush(struct bufobj *bo, struct buf *bp) { struct buf *nbp; + struct bufdomain *bd; - if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) { + bd = &bdomain[bo->bo_domain]; + if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh + 10) { (void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread); altbufferflushes++; - } else if (bo->bo_dirty.bv_cnt > dirtybufthresh) { + } else if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh) { BO_LOCK(bo); /* * Try to find a buffer to flush. From owner-dev-commits-src-all@freebsd.org Thu Feb 25 15:37: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 99C50567003; Thu, 25 Feb 2021 15:37: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 4DmcNp3cpVz4tcR; Thu, 25 Feb 2021 15:37: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 6F5C319CFC; Thu, 25 Feb 2021 15:37: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 11PFbUAm055046; Thu, 25 Feb 2021 15:37:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PFbUed055045; Thu, 25 Feb 2021 15:37:30 GMT (envelope-from git) Date: Thu, 25 Feb 2021 15:37:30 GMT Message-Id: <202102251537.11PFbUed055045@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: 3b6268bb9e4a - main - mkimg: We always want the last block of the last inserted partition 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: 3b6268bb9e4aea939c4ce7f37353174aa90e6751 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 15:37:30 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3b6268bb9e4aea939c4ce7f37353174aa90e6751 commit 3b6268bb9e4aea939c4ce7f37353174aa90e6751 Author: Emmanuel Vadot AuthorDate: 2021-02-25 15:34:28 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-25 15:34:28 +0000 mkimg: We always want the last block of the last inserted partition Even with an absolute offset we want to know the last block the partition otherwise we endup with an image the size of the metadata. This allow to create image with the ESP placed at a specific position which is useful on arm/arm64 where u-boot have always a hard time to read the ESP if it's not aligned on 512k. mkimg -v -o sdcard -s gpt -p efi::54M:1M -p freebsd-ufs::1G now works. MFC after: 3 days --- usr.bin/mkimg/mkimg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index d870f3a8f0c3..c4f0acbe3927 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -528,10 +528,8 @@ mkimg(void) (long long)blkoffset); } } - if (!abs_offset) { - block = scheme_metadata(SCHEME_META_PART_AFTER, - part->block + part->size); - } + block = scheme_metadata(SCHEME_META_PART_AFTER, + part->block + part->size); } mkimg_validate(); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 15:54: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 0A5E85673E0; Thu, 25 Feb 2021 15:54: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 4DmcmJ6G1wz4vr9; Thu, 25 Feb 2021 15:54: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 AF00E1A074; Thu, 25 Feb 2021 15:54: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 11PFsOvg080924; Thu, 25 Feb 2021 15:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PFsOGj080923; Thu, 25 Feb 2021 15:54:24 GMT (envelope-from git) Date: Thu, 25 Feb 2021 15:54:24 GMT Message-Id: <202102251554.11PFsOGj080923@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: 5ad3a9988cc8 - releng/13.0 - vm_kern: Avoid sign extension in the KVA_QUANTUM definition 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5ad3a9988cc89e41f4c471d7ca5d8b19d216144f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 15:54:25 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5ad3a9988cc89e41f4c471d7ca5d8b19d216144f commit 5ad3a9988cc89e41f4c471d7ca5d8b19d216144f Author: Mark Johnston AuthorDate: 2021-02-22 20:50:09 +0000 Commit: Mark Johnston CommitDate: 2021-02-25 15:54:17 +0000 vm_kern: Avoid sign extension in the KVA_QUANTUM definition Otherwise, on a powerpc64 NUMA system with hashed page tables, the first-level superpage reservation size is large enough that the value of the kernel KVA arena import quantum, KVA_NUMA_IMPORT_QUANTUM, is negative and gets sign-extended when passed to vmem_set_import(). This results in a boot-time hang on such platforms. Approved by: re (gjb) Reported by: bdragon (cherry picked from commit 23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f) (cherry picked from commit 0486986ad81dbbfca291acf5b15f94d67d8a61bd) --- sys/vm/vm_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index f1704f834157..0677d901d408 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -127,7 +127,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, /* On non-superpage architectures we want large import sizes. */ #define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) #endif -#define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) +#define KVA_QUANTUM (1ul << KVA_QUANTUM_SHIFT) #define KVA_NUMA_IMPORT_QUANTUM (KVA_QUANTUM * 128) extern void uma_startup2(void); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 16: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 9477D567988; Thu, 25 Feb 2021 16: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 4Dmcy13bQjz4w9T; Thu, 25 Feb 2021 16: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 6E1831A2C9; Thu, 25 Feb 2021 16: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 11PG2npI094385; Thu, 25 Feb 2021 16: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 11PG2n9U094384; Thu, 25 Feb 2021 16:02:49 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:02:49 GMT Message-Id: <202102251602.11PG2n9U094384@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: ba7ede0b9b3d - main - Add UPDATING entry for PIE default 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: ba7ede0b9b3d0c3a64e6e7d8cbfe26b6f882f39f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 16:02:49 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ba7ede0b9b3d0c3a64e6e7d8cbfe26b6f882f39f commit ba7ede0b9b3d0c3a64e6e7d8cbfe26b6f882f39f Author: Ed Maste AuthorDate: 2021-02-25 15:59:54 +0000 Commit: Ed Maste CommitDate: 2021-02-25 16:02:09 +0000 Add UPDATING entry for PIE default As of commit 9a227a2fd642 PIE is on by default for 64-bit architectures. Relnotes: yes --- UPDATING | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPDATING b/UPDATING index 31ec79ed8437..edad902d0ab1 100644 --- a/UPDATING +++ b/UPDATING @@ -26,6 +26,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".) +20210225: + For 64-bit architectures the base system is now built with Position + Independent Executable (PIE) support enabled by default. It may be + disabled using the WITHOUT_PIE knob. A clean build is required. + 20210128: Various LinuxKPI functionality was added which conflicts with DRM. Please update your drm-kmod port to after the __FreeBSD_verison 1400003 From owner-dev-commits-src-all@freebsd.org Thu Feb 25 16:05: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 C971C567D0A; Thu, 25 Feb 2021 16:05: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 4Dmd1G5PDNz4wDv; Thu, 25 Feb 2021 16:05: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 AC6591A53A; Thu, 25 Feb 2021 16:05: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 11PG5cUO094927; Thu, 25 Feb 2021 16:05:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PG5cGZ094926; Thu, 25 Feb 2021 16:05:38 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:05:38 GMT Message-Id: <202102251605.11PG5cGZ094926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: e680f3c0bd2b - releng/13.0 - loader: autoload_font will hung loader when there is no local console MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: e680f3c0bd2b6c6d3c76588c7693294d49fa965b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 16:05:38 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=e680f3c0bd2b6c6d3c76588c7693294d49fa965b commit e680f3c0bd2b6c6d3c76588c7693294d49fa965b Author: Toomas Soome AuthorDate: 2021-02-21 10:32:18 +0000 Commit: Toomas Soome CommitDate: 2021-02-25 16:05:24 +0000 loader: autoload_font will hung loader when there is no local console If we start with console set to comconsole, the local console (vidconsole, efi) is never initialized and attempt to use the data can render the loader hung. (cherry picked from commit 61c50cbc096d28e44cb8b627e524ae58158c423a) Reported by: Kamigishi Rei Approved by: re (gjb) --- stand/efi/libefi/efi_console.c | 3 +++ stand/i386/libi386/vidconsole.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 7024f9c8b2f2..3cbd121c41da 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -886,6 +886,9 @@ cons_update_mode(bool use_gfx_mode) EFI_STATUS status; char env[10], *ptr; + if (!efi_started) + return (false); + /* * Despite the use_gfx_mode, we want to make sure we call * efi_find_framebuffer(). This will populate the fb data, diff --git a/stand/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c index f94ed2d26712..b933a7807687 100644 --- a/stand/i386/libi386/vidconsole.c +++ b/stand/i386/libi386/vidconsole.c @@ -53,7 +53,7 @@ static int vidc_getchar(void); static int vidc_ischar(void); static void cons_draw_frame(teken_attr_t *); -static int vidc_started; +static bool vidc_started; static uint16_t *vgatext; static tf_bell_t vidc_cons_bell; @@ -877,6 +877,10 @@ cons_update_mode(bool use_gfx_mode) char env[10], *ptr; int format, roff, goff, boff; + /* vidc_init() is not called yet. */ + if (!vidc_started) + return (false); + gfx_state.tg_tp.tp_row = TEXT_ROWS; gfx_state.tg_tp.tp_col = TEXT_COLS; @@ -996,7 +1000,7 @@ vidc_init(int arg) if (vidc_started && arg == 0) return (0); - vidc_started = 1; + vidc_started = true; vbe_init(); /* From owner-dev-commits-src-all@freebsd.org Thu Feb 25 16:20: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 283E2567F62; Thu, 25 Feb 2021 16:20: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 4DmdL40gCdz4xX7; Thu, 25 Feb 2021 16:20: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 09E9D1A7EE; Thu, 25 Feb 2021 16:20: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 11PGKBtZ012128; Thu, 25 Feb 2021 16:20:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PGKBeA012118; Thu, 25 Feb 2021 16:20:11 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:20:11 GMT Message-Id: <202102251620.11PGKBeA012118@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: ee0b7e05e72c - releng/13.0 - zfs: fix panic if scrubbing after removing a slog device 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: ee0b7e05e72c8820441faff29a9df99b47aed6a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 16:20:12 -0000 The branch releng/13.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=ee0b7e05e72c8820441faff29a9df99b47aed6a0 commit ee0b7e05e72c8820441faff29a9df99b47aed6a0 Author: Martin Matuska AuthorDate: 2021-02-22 17:05:07 +0000 Commit: Martin Matuska CommitDate: 2021-02-25 16:19:49 +0000 zfs: fix panic if scrubbing after removing a slog device From openzfs-master 11f2e9a4 commit message: vdev_ops: don't try to call vdev_op_hold or vdev_op_rele when NULL This prevents a panic after a SLOG add/removal on the root pool followed by a zpool scrub. When a SLOG is removed, a hole takes its place - the vdev_ops for a hole is vdev_hole_ops, which defines the handler functions of vdev_op_hold and vdev_op_rele as NULL. Patch Author: Patrick Mooney Obtained from: openzfs/zfs@11f2e9a491baa2ae3fc00f6b8b892fa91a852ca1 PR: 252396 Approved by: re (gjb) (cherry picked from commit 64649f0285424435634c2dfd39f49536fc2b50dd) --- sys/contrib/openzfs/module/zfs/vdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/vdev.c b/sys/contrib/openzfs/module/zfs/vdev.c index 7ffe924212da..5b83f8c22fed 100644 --- a/sys/contrib/openzfs/module/zfs/vdev.c +++ b/sys/contrib/openzfs/module/zfs/vdev.c @@ -2393,7 +2393,7 @@ vdev_hold(vdev_t *vd) for (int c = 0; c < vd->vdev_children; c++) vdev_hold(vd->vdev_child[c]); - if (vd->vdev_ops->vdev_op_leaf) + if (vd->vdev_ops->vdev_op_leaf && vd->vdev_ops->vdev_op_hold != NULL) vd->vdev_ops->vdev_op_hold(vd); } @@ -2404,7 +2404,7 @@ vdev_rele(vdev_t *vd) for (int c = 0; c < vd->vdev_children; c++) vdev_rele(vd->vdev_child[c]); - if (vd->vdev_ops->vdev_op_leaf) + if (vd->vdev_ops->vdev_op_leaf && vd->vdev_ops->vdev_op_rele != NULL) vd->vdev_ops->vdev_op_rele(vd); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 16:20: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 C4FFE5682A5; Thu, 25 Feb 2021 16:20: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 4DmdLh5BVSz4xVV; Thu, 25 Feb 2021 16:20: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 A56191A9E3; Thu, 25 Feb 2021 16:20: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 11PGKiN0017141; Thu, 25 Feb 2021 16:20:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PGKiGM017140; Thu, 25 Feb 2021 16:20:44 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:20:44 GMT Message-Id: <202102251620.11PGKiGM017140@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: 442719c0c6de - releng/13.0 - zfs: disable use of hardware crypto offload drivers 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 442719c0c6de93051d4bf9820420e9863ed3de53 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 16:20:44 -0000 The branch releng/13.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=442719c0c6de93051d4bf9820420e9863ed3de53 commit 442719c0c6de93051d4bf9820420e9863ed3de53 Author: Martin Matuska AuthorDate: 2021-02-22 17:37:47 +0000 Commit: Martin Matuska CommitDate: 2021-02-25 16:20:20 +0000 zfs: disable use of hardware crypto offload drivers From openzfs-master e7adccf7f commit message: First, the crypto request completion handler contains a bug in that it fails to reset fs_done correctly after the request is completed. This is only a problem for asynchronous drivers. Second, some hardware drivers have input constraints which ZFS does not satisfy. For instance, ccp(4) apparently requires the AAD length for AES-GCM to be a multiple of the cipher block size, and with qat(4) the AES-GCM AAD length may not be longer than 240 bytes. FreeBSD's generic crypto framework doesn't have a mechanism to automatically fall back to a software implementation if a hardware driver cannot process a request, and ZFS does not tolerate such errors. Patch Author: Mark Johnston Obtained from: openzfs/zfs@e7adccf7f537a4d07281a2b74b360154bae367bc PR: 252981, 253595 Approved by: re (gjb) (cherry picked from commit 940415f20a784156ec0e247989796385896f32a8) --- sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c index b86ffc59a21d..0a7241699842 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c @@ -293,8 +293,19 @@ freebsd_crypt_newsession(freebsd_crypt_session_t *sessp, error = ENOTSUP; goto bad; } - error = crypto_newsession(&sessp->fs_sid, &csp, - CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE); + + /* + * Disable the use of hardware drivers on FreeBSD 13 and later since + * common crypto offload drivers impose constraints on AES-GCM AAD + * lengths that make them unusable for ZFS, and we currently do not have + * a mechanism to fall back to a software driver for requests not + * handled by a hardware driver. + * + * On 12 we continue to permit the use of hardware drivers since + * CPU-accelerated drivers such as aesni(4) register themselves as + * hardware drivers. + */ + error = crypto_newsession(&sessp->fs_sid, &csp, CRYPTOCAP_F_SOFTWARE); mtx_init(&sessp->fs_lock, "FreeBSD Cryptographic Session Lock", NULL, MTX_DEF); crypt_sessions++; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 16:26: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 BAAA0568CA1; Thu, 25 Feb 2021 16:26: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 4DmdTW4yxlz4yXk; Thu, 25 Feb 2021 16:26: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 9DBF01AB8C; Thu, 25 Feb 2021 16:26: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 11PGQdNu021201; Thu, 25 Feb 2021 16:26:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PGQd5D021200; Thu, 25 Feb 2021 16:26:39 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:26:39 GMT Message-Id: <202102251626.11PGQd5D021200@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: 3d66df702668 - releng/13.0 - zfs: restore FreeBSD resource usage accounting 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 3d66df70266822405db0f5eda235e0bca1ba05ec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 16:26:39 -0000 The branch releng/13.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=3d66df70266822405db0f5eda235e0bca1ba05ec commit 3d66df70266822405db0f5eda235e0bca1ba05ec Author: Martin Matuska AuthorDate: 2021-02-22 20:57:22 +0000 Commit: Martin Matuska CommitDate: 2021-02-25 16:20:53 +0000 zfs: restore FreeBSD resource usage accounting With the switch to OpenZFS 2.0 the platform-dependent resource usage accounting code got missing. Patch author: Ryan Moeller Obtained from: openzfs/zfs@64e0fe14fff465604952d576051ca80c2f1be898 Approved by: re (gjb) (cherry picked from commit 21269625733f591c998f7d26790179e922ffbde0) --- cddl/lib/libzpool/Makefile | 1 + sys/conf/files | 1 + sys/contrib/openzfs/include/sys/Makefile.am | 1 + sys/contrib/openzfs/include/sys/zfs_racct.h | 37 +++++++++++++++ sys/contrib/openzfs/lib/libzpool/Makefile.am | 1 + sys/contrib/openzfs/module/Makefile.bsd | 1 + .../openzfs/module/os/freebsd/zfs/zfs_racct.c | 55 ++++++++++++++++++++++ .../openzfs/module/os/linux/zfs/Makefile.in | 1 + .../openzfs/module/os/linux/zfs/zfs_racct.c | 36 ++++++++++++++ sys/contrib/openzfs/module/zfs/arc.c | 2 + sys/contrib/openzfs/module/zfs/dmu.c | 5 ++ sys/modules/zfs/Makefile | 1 + 12 files changed, 142 insertions(+) diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index 0e2cc9456faa..2cb1b0446ade 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -161,6 +161,7 @@ KERNEL_C = \ zfs_debug.c \ zfs_fm.c \ zfs_fuid.c \ + zfs_racct.c \ zfs_sa.c \ zfs_znode.c \ zfs_ratelimit.c \ diff --git a/sys/conf/files b/sys/conf/files index f0bf574b3236..1c52f16ff2e1 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -217,6 +217,7 @@ contrib/openzfs/module/os/freebsd/zfs/zfs_dir.c optional zfs compile-with "${ZF contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_compat.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c optional zfs compile-with "${ZFS_C}" diff --git a/sys/contrib/openzfs/include/sys/Makefile.am b/sys/contrib/openzfs/include/sys/Makefile.am index c3ebf17b5288..385c82c926ae 100644 --- a/sys/contrib/openzfs/include/sys/Makefile.am +++ b/sys/contrib/openzfs/include/sys/Makefile.am @@ -111,6 +111,7 @@ COMMON_H = \ zfs_fuid.h \ zfs_project.h \ zfs_quota.h \ + zfs_racct.h \ zfs_ratelimit.h \ zfs_refcount.h \ zfs_rlock.h \ diff --git a/sys/contrib/openzfs/include/sys/zfs_racct.h b/sys/contrib/openzfs/include/sys/zfs_racct.h new file mode 100644 index 000000000000..cfcdd336ea42 --- /dev/null +++ b/sys/contrib/openzfs/include/sys/zfs_racct.h @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Portions Copyright 2021 iXsystems, Inc. + */ + +#ifndef _SYS_ZFS_RACCT_H +#define _SYS_ZFS_RACCT_H + +#include + +/* + * Platform-dependent resource accounting hooks + */ +void zfs_racct_read(uint64_t size, uint64_t iops); +void zfs_racct_write(uint64_t size, uint64_t iops); + +#endif /* _SYS_ZFS_RACCT_H */ diff --git a/sys/contrib/openzfs/lib/libzpool/Makefile.am b/sys/contrib/openzfs/lib/libzpool/Makefile.am index 7aa7e80985aa..b66e933657ab 100644 --- a/sys/contrib/openzfs/lib/libzpool/Makefile.am +++ b/sys/contrib/openzfs/lib/libzpool/Makefile.am @@ -163,6 +163,7 @@ KERNEL_C = \ zfs_debug.c \ zfs_fm.c \ zfs_fuid.c \ + zfs_racct.c \ zfs_sa.c \ zfs_znode.c \ zfs_ratelimit.c \ diff --git a/sys/contrib/openzfs/module/Makefile.bsd b/sys/contrib/openzfs/module/Makefile.bsd index e7cddcc5bb5e..8aa4ed22275e 100644 --- a/sys/contrib/openzfs/module/Makefile.bsd +++ b/sys/contrib/openzfs/module/Makefile.bsd @@ -153,6 +153,7 @@ SRCS+= abd_os.c \ zfs_dir.c \ zfs_ioctl_compat.c \ zfs_ioctl_os.c \ + zfs_racct.c \ zfs_vfsops.c \ zfs_vnops_os.c \ zfs_znode.c \ diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c new file mode 100644 index 000000000000..b46cc046268e --- /dev/null +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_racct.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 iXsystems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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 + +void +zfs_racct_read(uint64_t size, uint64_t iops) +{ + curthread->td_ru.ru_inblock += iops; +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_force(curproc, RACCT_READBPS, size); + racct_add_force(curproc, RACCT_READIOPS, iops); + PROC_UNLOCK(curproc); + } +#endif /* RACCT */ +} + +void +zfs_racct_write(uint64_t size, uint64_t iops) +{ + curthread->td_ru.ru_oublock += iops; +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_force(curproc, RACCT_WRITEBPS, size); + racct_add_force(curproc, RACCT_WRITEIOPS, iops); + PROC_UNLOCK(curproc); + } +#endif /* RACCT */ +} diff --git a/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in b/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in index 75bec52c94e2..fa990776db83 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in +++ b/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in @@ -22,6 +22,7 @@ $(MODULE)-objs += ../os/linux/zfs/zfs_debug.o $(MODULE)-objs += ../os/linux/zfs/zfs_dir.o $(MODULE)-objs += ../os/linux/zfs/zfs_file_os.o $(MODULE)-objs += ../os/linux/zfs/zfs_ioctl_os.o +$(MODULE)-objs += ../os/linux/zfs/zfs_racct.o $(MODULE)-objs += ../os/linux/zfs/zfs_sysfs.o $(MODULE)-objs += ../os/linux/zfs/zfs_uio.o $(MODULE)-objs += ../os/linux/zfs/zfs_vfsops.o diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c b/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c new file mode 100644 index 000000000000..7897e0f9edc1 --- /dev/null +++ b/sys/contrib/openzfs/module/os/linux/zfs/zfs_racct.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 iXsystems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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 + +void +zfs_racct_read(uint64_t size, uint64_t iops) +{ +} + +void +zfs_racct_write(uint64_t size, uint64_t iops) +{ +} diff --git a/sys/contrib/openzfs/module/zfs/arc.c b/sys/contrib/openzfs/module/zfs/arc.c index fecc752e16ff..b01ccd13a0db 100644 --- a/sys/contrib/openzfs/module/zfs/arc.c +++ b/sys/contrib/openzfs/module/zfs/arc.c @@ -308,6 +308,7 @@ #include #include #include +#include #include #ifndef _KERNEL @@ -6296,6 +6297,7 @@ top: ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr), demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data, metadata, misses); + zfs_racct_read(size, 1); } /* Check if the spa even has l2 configured */ diff --git a/sys/contrib/openzfs/module/zfs/dmu.c b/sys/contrib/openzfs/module/zfs/dmu.c index a02f43df13fd..5d6e98d245da 100644 --- a/sys/contrib/openzfs/module/zfs/dmu.c +++ b/sys/contrib/openzfs/module/zfs/dmu.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #ifdef _KERNEL #include @@ -551,6 +552,9 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length, dbp[i] = &db->db; } + if (!read) + zfs_racct_write(length, nblks); + if ((flags & DMU_READ_NO_PREFETCH) == 0 && DNODE_META_IS_CACHEABLE(dn) && length <= zfetch_array_rd_sz) { dmu_zfetch(&dn->dn_zfetch, blkid, nblks, @@ -1448,6 +1452,7 @@ dmu_assign_arcbuf_by_dnode(dnode_t *dn, uint64_t offset, arc_buf_t *buf, * same size as the dbuf. */ if (offset == db->db.db_offset && blksz == db->db.db_size) { + zfs_racct_write(blksz, 1); dbuf_assign_arcbuf(db, buf, tx); dbuf_rele(db, FTAG); } else { diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index e4b92db764ef..7050a40758a3 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -126,6 +126,7 @@ SRCS+= abd_os.c \ zfs_ioctl_compat.c \ zfs_ioctl_os.c \ zfs_log.c \ + zfs_racct.c \ zfs_replay.c \ zfs_vfsops.c \ zfs_vnops_os.c \ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 16:45: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 D9492569260; Thu, 25 Feb 2021 16:45: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 4Dmdv65qqtz50Ts; Thu, 25 Feb 2021 16:45: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 B6CE11AF0D; Thu, 25 Feb 2021 16:45: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 11PGjMe8047437; Thu, 25 Feb 2021 16:45:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PGjMrC047436; Thu, 25 Feb 2021 16:45:22 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:45:22 GMT Message-Id: <202102251645.11PGjMrC047436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 655fa0440601 - main - Add if_wg.4 MLINK 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/main X-Git-Reftype: branch X-Git-Commit: 655fa04406010e56822802e12bf52f42e333988b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 16:45:22 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=655fa04406010e56822802e12bf52f42e333988b commit 655fa04406010e56822802e12bf52f42e333988b Author: Li-Wen Hsu AuthorDate: 2021-02-25 16:43:15 +0000 Commit: Li-Wen Hsu CommitDate: 2021-02-25 16:43:15 +0000 Add if_wg.4 MLINK --- share/man/man4/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4929ec9fd3f6..686e86cf6897 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -767,6 +767,7 @@ MLINKS+=vr.4 if_vr.4 MLINKS+=vte.4 if_vte.4 MLINKS+=vtnet.4 if_vtnet.4 MLINKS+=watchdog.4 SW_WATCHDOG.4 +MLINKS+=wg.4 if_wg.4 MLINKS+=${_wpi.4} ${_if_wpi.4} MLINKS+=xl.4 if_xl.4 From owner-dev-commits-src-all@freebsd.org Thu Feb 25 16:48: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 9281B569631; Thu, 25 Feb 2021 16:48: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 4Dmdyl3pTHz51Dt; Thu, 25 Feb 2021 16:48: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 756891B055; Thu, 25 Feb 2021 16:48: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 11PGmVs2047997; Thu, 25 Feb 2021 16:48:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PGmV7v047996; Thu, 25 Feb 2021 16:48:31 GMT (envelope-from git) Date: Thu, 25 Feb 2021 16:48:31 GMT Message-Id: <202102251648.11PGmV7v047996@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: 8c3fa20b9dd8 - stable/12 - Skip the vm.pmap.kernel_maps sysctl by default. 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: 8c3fa20b9dd81740a18184d205bf8bdc34ba5373 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 16:48:31 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8c3fa20b9dd81740a18184d205bf8bdc34ba5373 commit 8c3fa20b9dd81740a18184d205bf8bdc34ba5373 Author: John Baldwin AuthorDate: 2020-12-18 20:41:23 +0000 Commit: Mark Johnston CommitDate: 2021-02-25 16:42:30 +0000 Skip the vm.pmap.kernel_maps sysctl by default. This sysctl node can generate very verbose output, so don't trigger it for sysctl -a or sysctl vm.pmap. Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D27504 (cherry picked from commit 1dce7d9e7eefead038610df6a8d6c86a0fdbebb8) --- sys/amd64/amd64/pmap.c | 2 +- sys/arm64/arm64/pmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 4a4c50385ca2..876a77902eea 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -10412,7 +10412,7 @@ restart: return (error); } SYSCTL_OID(_vm_pmap, OID_AUTO, kernel_maps, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_SKIP, NULL, 0, sysctl_kmaps, "A", "Dump kernel address layout"); diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index e18e13701203..d74479a15ab0 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -6169,6 +6169,6 @@ sysctl_kmaps(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_OID(_vm_pmap, OID_AUTO, kernel_maps, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_SKIP, NULL, 0, sysctl_kmaps, "A", "Dump kernel address layout"); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 17:03: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 E1CCE569987; Thu, 25 Feb 2021 17:03: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 4DmfHT5vS1z5247; Thu, 25 Feb 2021 17:03: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 BD6A61B498; Thu, 25 Feb 2021 17:03: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 11PH31Sf074582; Thu, 25 Feb 2021 17:03:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PH31Yk074581; Thu, 25 Feb 2021 17:03:01 GMT (envelope-from git) Date: Thu, 25 Feb 2021 17:03:01 GMT Message-Id: <202102251703.11PH31Yk074581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: d6cb4c5669da - releng/13.0 - cxgb(4): Rework my commit 9dc7c250. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: d6cb4c5669da4f5a904db15963766930ee92af6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 17:03:01 -0000 The branch releng/13.0 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=d6cb4c5669da4f5a904db15963766930ee92af6d commit d6cb4c5669da4f5a904db15963766930ee92af6d Author: Alexander Motin AuthorDate: 2021-02-22 22:21:05 +0000 Commit: Alexander Motin CommitDate: 2021-02-25 17:02:34 +0000 cxgb(4): Rework my commit 9dc7c250. The previous implementation was reported to try to coalesce packets in situations when it should not, that resulted in assertion later. This implementation better checks the first packet of the chain for the coallescing elligibility. Approved by: re (gjb@) (cherry picked from commit d510bf133d045d6c83742aeda6949bec150f6cbf) (cherry picked from commit 1f3cff343b451d9fc9c10f4f8c4b416ed5eae23f) --- sys/dev/cxgb/cxgb_sge.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 491d1a751f4a..f13d2f03180c 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -312,20 +312,22 @@ set_wr_hdr(struct work_request_hdr *wrp, uint32_t wr_hi, uint32_t wr_lo) struct coalesce_info { int count; int nbytes; + int noncoal; }; static int coalesce_check(struct mbuf *m, void *arg) { struct coalesce_info *ci = arg; - int *count = &ci->count; - int *nbytes = &ci->nbytes; - - if ((*nbytes == 0) || ((*nbytes + m->m_len <= 10500) && - (*count < 7) && (m->m_next == NULL) && - ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE))) { - *count += 1; - *nbytes += m->m_len; + + if ((m->m_next != NULL) || + ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len > PAGE_SIZE)) + ci->noncoal = 1; + + if ((ci->count == 0) || (ci->noncoal == 0 && (ci->count < 7) && + (ci->nbytes + m->m_len <= 10500))) { + ci->count++; + ci->nbytes += m->m_len; return (1); } return (0); @@ -342,7 +344,7 @@ cxgb_dequeue(struct sge_qset *qs) return TXQ_RING_DEQUEUE(qs); m_head = m_tail = NULL; - ci.count = ci.nbytes = 0; + ci.count = ci.nbytes = ci.noncoal = 0; do { m = TXQ_RING_DEQUEUE_COND(qs, coalesce_check, &ci); if (m_head == NULL) { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 17:12: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 05F5C569AE6; Thu, 25 Feb 2021 17:12: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 4DmfTr6hSBz52CN; Thu, 25 Feb 2021 17:12: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 CEB281B653; Thu, 25 Feb 2021 17:12: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 11PHC0lR088413; Thu, 25 Feb 2021 17:12:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PHC0gJ088412; Thu, 25 Feb 2021 17:12:00 GMT (envelope-from git) Date: Thu, 25 Feb 2021 17:12:00 GMT Message-Id: <202102251712.11PHC0gJ088412@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: 8f3c71c85e5f - main - mkimg: Add support for offset if the source is an image 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: 8f3c71c85e5f6a4d2bddbfead225d33b96dbd7d7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 17:12:01 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=8f3c71c85e5f6a4d2bddbfead225d33b96dbd7d7 commit 8f3c71c85e5f6a4d2bddbfead225d33b96dbd7d7 Author: Emmanuel Vadot AuthorDate: 2021-02-25 17:10:19 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-25 17:11:50 +0000 mkimg: Add support for offset if the source is an image This allow us to create image with the following format: mkimg -v -o sdcard -s gpt -p efi:=esp_aarch64.img:1M -p freebsd-ufs::1G Which will add a efi partition at a 1M offset on the image with its content coming from the esp_aarch64.img file. MFC after: 3 days --- usr.bin/mkimg/mkimg.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index c4f0acbe3927..e5e6c036575b 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -174,8 +174,10 @@ usage(const char *why) fprintf(stderr, "\t[/]::[:[+]]\t- " "empty partition of given size and\n\t\t\t\t\t" " optional relative or absolute offset\n"); - fprintf(stderr, "\t[/]:=\t\t- partition content and size " - "are\n\t\t\t\t\t determined by the named file\n"); + fprintf(stderr, "\t[/]:=[:[+]offset]\t- partition " + "content and size are\n\t\t\t\t\t" + " determined by the named file and\n" + "\t\t\t\t\t optional relative or absolute offset\n"); fprintf(stderr, "\t[/]:-\t\t- partition content and size " "are taken\n\t\t\t\t\t from the output of the command to run\n"); fprintf(stderr, "\t-\t\t\t\t- unused partition entry\n"); @@ -459,9 +461,11 @@ mkimg(void) /* Look for an offset. Set size too if we can. */ switch (part->kind) { case PART_KIND_SIZE: + case PART_KIND_FILE: offset = part->contents; size = strsep(&offset, ":"); - if (expand_number(size, &bytesize) == -1) + if (part->kind == PART_KIND_SIZE && + expand_number(size, &bytesize) == -1) error = errno; if (offset != NULL) { if (*offset != '+') @@ -476,14 +480,13 @@ mkimg(void) /* Work out exactly where the partition starts. */ blkoffset = (byteoffset + secsz - 1) / secsz; - if (abs_offset) { - part->block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, + if (abs_offset) + block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, blkoffset); - } else { + else block = scheme_metadata(SCHEME_META_PART_BEFORE, block + blkoffset); - part->block = block; - } + part->block = block; if (verbose) fprintf(stderr, "partition %d: starting block %llu " From owner-dev-commits-src-all@freebsd.org Thu Feb 25 17:28: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 0663B56A4C1 for ; Thu, 25 Feb 2021 17:28: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 4Dmfrt6psSz53c5; Thu, 25 Feb 2021 17: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 DC19E1B37B; Thu, 25 Feb 2021 17:28: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 11PHSUpW002388; Thu, 25 Feb 2021 17:28:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PHSUGM002387; Thu, 25 Feb 2021 17:28:30 GMT (envelope-from git) Date: Thu, 25 Feb 2021 17:28:30 GMT Message-Id: <202102251728.11PHSUGM002387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Baptiste Daroussin Subject: git: bcab42db22e9 - Create tag vendor/ncurses/6.2-20210220 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/tags/vendor/ncurses/6.2-20210220 X-Git-Reftype: annotated tag X-Git-Commit: bcab42db22e9949ebe961199cc88db822d0aba33 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 17:28:31 -0000 The annotated tag vendor/ncurses/6.2-20210220 has been created by bapt: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/ncurses/6.2-20210220 tag vendor/ncurses/6.2-20210220 Tagger: Baptiste Daroussin TaggerDate: 2021-02-25 17:22:25 +0000 Tag import of ncurses 6.2-20210220 commit bf0ab54638a5ef969749f6ceae30e864f9556ea8 Author: Baptiste Daroussin AuthorDate: 2021-02-25 17:22:00 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 17:22:00 +0000 Vendor import ncurses 6.2-20210220 From owner-dev-commits-src-all@freebsd.org Thu Feb 25 17: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 194E756A3BB for ; Thu, 25 Feb 2021 17: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 4Dmfrs5xqVz53R7; Thu, 25 Feb 2021 17:28: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 BBC4C1B4FD; Thu, 25 Feb 2021 17: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 11PHSTAh002366; Thu, 25 Feb 2021 17: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 11PHSSxY002360; Thu, 25 Feb 2021 17:28:28 GMT (envelope-from git) Date: Thu, 25 Feb 2021 17:28:28 GMT Message-Id: <202102251728.11PHSSxY002360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Baptiste Daroussin Subject: git: bf0ab54638a5 - vendor/ncurses - Vendor import ncurses 6.2-20210220 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/vendor/ncurses X-Git-Reftype: branch X-Git-Commit: bf0ab54638a5ef969749f6ceae30e864f9556ea8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 17:28:30 -0000 The branch vendor/ncurses has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=bf0ab54638a5ef969749f6ceae30e864f9556ea8 commit bf0ab54638a5ef969749f6ceae30e864f9556ea8 Author: Baptiste Daroussin AuthorDate: 2021-02-25 17:22:00 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 17:22:00 +0000 Vendor import ncurses 6.2-20210220 --- Ada95/Makefile.in | 14 +- Ada95/aclocal.m4 | 858 +- Ada95/configure | 7521 ++++--- Ada95/configure.in | 23 +- Ada95/doc/Makefile.in | 6 +- Ada95/gen/Makefile.in | 17 +- Ada95/gen/gen.c | 210 +- Ada95/package/debian/compat | 2 +- Ada95/package/debian/copyright | 7 +- Ada95/samples/Makefile.in | 14 +- Ada95/src/Makefile.in | 89 +- Ada95/src/library.gpr.in | 16 +- Ada95/src/terminal_interface-curses-mouse.adb | 5 +- COPYING | 4 +- INSTALL | 116 +- MANIFEST | 11 +- NEWS | 469 +- README.MinGW | 139 +- VERSION | 2 +- aclocal.m4 | 1536 +- announce.html.in | 10 +- c++/Makefile.in | 63 +- c++/cursesapp.cc | 11 +- c++/cursesapp.h | 21 +- c++/cursesf.cc | 13 +- c++/cursesf.h | 39 +- c++/cursesm.h | 12 +- c++/cursesmain.cc | 4 +- c++/cursesp.h | 4 +- c++/cursesw.h | 21 +- c++/cursslk.cc | 6 +- c++/cursslk.h | 20 +- c++/demo.cc | 22 +- c++/etip.h.in | 17 +- c++/internal.h | 8 +- configure | 21719 ++++++++++--------- configure.in | 275 +- convert_configure.pl | 120 - dist.mk | 8 +- doc/html/ada/funcs/M.htm | 2 +- doc/html/ada/funcs/U.htm | 2 +- doc/html/ada/funcs/W.htm | 2 +- .../ada/terminal_interface-curses-mouse__adb.htm | 43 +- .../ada/terminal_interface-curses-mouse__ads.htm | 18 +- doc/html/announce.html | 11 +- doc/html/man/adacurses6-config.1.html | 2 +- doc/html/man/captoinfo.1m.html | 14 +- doc/html/man/clear.1.html | 41 +- doc/html/man/curs_add_wch.3x.html | 132 +- doc/html/man/curs_add_wchstr.3x.html | 5 +- doc/html/man/curs_addch.3x.html | 101 +- doc/html/man/curs_addchstr.3x.html | 21 +- doc/html/man/curs_addstr.3x.html | 23 +- doc/html/man/curs_addwstr.3x.html | 3 +- doc/html/man/curs_attr.3x.html | 4 +- doc/html/man/curs_beep.3x.html | 14 +- doc/html/man/curs_bkgd.3x.html | 32 +- doc/html/man/curs_bkgrnd.3x.html | 12 +- doc/html/man/curs_border.3x.html | 34 +- doc/html/man/curs_clear.3x.html | 40 +- doc/html/man/curs_color.3x.html | 24 +- doc/html/man/curs_delch.3x.html | 20 +- doc/html/man/curs_deleteln.3x.html | 26 +- doc/html/man/curs_extend.3x.html | 14 +- doc/html/man/curs_get_wch.3x.html | 3 +- doc/html/man/curs_get_wstr.3x.html | 3 +- doc/html/man/curs_getcchar.3x.html | 16 +- doc/html/man/curs_getch.3x.html | 12 +- doc/html/man/curs_getstr.3x.html | 19 +- doc/html/man/curs_getyx.3x.html | 33 +- doc/html/man/curs_in_wch.3x.html | 9 +- doc/html/man/curs_in_wchstr.3x.html | 3 +- doc/html/man/curs_inch.3x.html | 21 +- doc/html/man/curs_inchstr.3x.html | 19 +- doc/html/man/curs_initscr.3x.html | 4 +- doc/html/man/curs_inopts.3x.html | 137 +- doc/html/man/curs_ins_wch.3x.html | 9 +- doc/html/man/curs_ins_wstr.3x.html | 3 +- doc/html/man/curs_insch.3x.html | 19 +- doc/html/man/curs_insstr.3x.html | 31 +- doc/html/man/curs_instr.3x.html | 27 +- doc/html/man/curs_inwstr.3x.html | 19 +- doc/html/man/curs_kernel.3x.html | 6 +- doc/html/man/curs_legacy.3x.html | 43 +- doc/html/man/curs_memleaks.3x.html | 50 +- doc/html/man/curs_mouse.3x.html | 13 +- doc/html/man/curs_move.3x.html | 6 +- doc/html/man/curs_opaque.3x.html | 32 +- doc/html/man/curs_outopts.3x.html | 82 +- doc/html/man/curs_print.3x.html | 14 +- doc/html/man/curs_printw.3x.html | 60 +- doc/html/man/curs_refresh.3x.html | 11 +- doc/html/man/curs_scanw.3x.html | 77 +- doc/html/man/curs_scr_dump.3x.html | 10 +- doc/html/man/curs_scroll.3x.html | 9 +- doc/html/man/curs_slk.3x.html | 3 +- doc/html/man/curs_sp_funcs.3x.html | 275 +- doc/html/man/curs_termattrs.3x.html | 25 +- doc/html/man/curs_termcap.3x.html | 88 +- doc/html/man/curs_terminfo.3x.html | 145 +- doc/html/man/curs_threads.3x.html | 26 +- doc/html/man/curs_touch.3x.html | 18 +- doc/html/man/curs_util.3x.html | 52 +- doc/html/man/curs_variables.3x.html | 2 +- doc/html/man/default_colors.3x.html | 50 +- doc/html/man/define_key.3x.html | 12 +- doc/html/man/form.3x.html | 43 +- doc/html/man/form_cursor.3x.html | 9 +- doc/html/man/form_data.3x.html | 11 +- doc/html/man/form_driver.3x.html | 31 +- doc/html/man/form_field.3x.html | 25 +- doc/html/man/form_field_attributes.3x.html | 25 +- doc/html/man/form_field_buffer.3x.html | 32 +- doc/html/man/form_field_info.3x.html | 34 +- doc/html/man/form_field_just.3x.html | 15 +- doc/html/man/form_field_new.3x.html | 23 +- doc/html/man/form_field_opts.3x.html | 28 +- doc/html/man/form_field_userptr.3x.html | 17 +- doc/html/man/form_field_validation.3x.html | 159 +- doc/html/man/form_fieldtype.3x.html | 140 +- doc/html/man/form_hook.3x.html | 26 +- doc/html/man/form_new.3x.html | 13 +- doc/html/man/form_new_page.3x.html | 11 +- doc/html/man/form_opts.3x.html | 16 +- doc/html/man/form_page.3x.html | 22 +- doc/html/man/form_post.3x.html | 15 +- doc/html/man/form_requestname.3x.html | 26 +- doc/html/man/form_userptr.3x.html | 13 +- doc/html/man/form_variables.3x.html | 9 +- doc/html/man/form_win.3x.html | 35 +- doc/html/man/infocmp.1m.html | 223 +- doc/html/man/infotocap.1m.html | 6 +- doc/html/man/key_defined.3x.html | 4 +- doc/html/man/keybound.3x.html | 8 +- doc/html/man/keyok.3x.html | 4 +- doc/html/man/legacy_coding.3x.html | 8 +- doc/html/man/menu.3x.html | 41 +- doc/html/man/menu_attributes.3x.html | 30 +- doc/html/man/menu_cursor.3x.html | 17 +- doc/html/man/menu_driver.3x.html | 25 +- doc/html/man/menu_format.3x.html | 17 +- doc/html/man/menu_hook.3x.html | 26 +- doc/html/man/menu_items.3x.html | 15 +- doc/html/man/menu_mark.3x.html | 13 +- doc/html/man/menu_new.3x.html | 13 +- doc/html/man/menu_opts.3x.html | 23 +- doc/html/man/menu_pattern.3x.html | 13 +- doc/html/man/menu_post.3x.html | 15 +- doc/html/man/menu_requestname.3x.html | 13 +- doc/html/man/menu_spacing.3x.html | 23 +- doc/html/man/menu_userptr.3x.html | 13 +- doc/html/man/menu_win.3x.html | 35 +- doc/html/man/mitem_current.3x.html | 21 +- doc/html/man/mitem_name.3x.html | 13 +- doc/html/man/mitem_new.3x.html | 13 +- doc/html/man/mitem_opts.3x.html | 16 +- doc/html/man/mitem_userptr.3x.html | 17 +- doc/html/man/mitem_value.3x.html | 11 +- doc/html/man/mitem_visible.3x.html | 9 +- doc/html/man/ncurses.3x.html | 892 +- doc/html/man/ncurses6-config.1.html | 8 +- doc/html/man/new_pair.3x.html | 60 +- doc/html/man/panel.3x.html | 44 +- doc/html/man/resizeterm.3x.html | 32 +- doc/html/man/scr_dump.5.html | 85 +- doc/html/man/tabs.1.html | 113 +- doc/html/man/term.5.html | 288 +- doc/html/man/term.7.html | 56 +- doc/html/man/terminfo.5.html | 1493 +- doc/html/man/tic.1m.html | 276 +- doc/html/man/toe.1m.html | 48 +- doc/html/man/tput.1.html | 184 +- doc/html/man/tset.1.html | 187 +- doc/html/man/user_caps.5.html | 136 +- doc/html/man/wresize.3x.html | 4 +- form/Makefile.in | 39 +- form/f_trace.c | 12 +- form/fld_arg.c | 8 +- form/fld_attr.c | 16 +- form/fld_current.c | 10 +- form/fld_def.c | 18 +- form/fld_dup.c | 15 +- form/fld_ftchoice.c | 4 +- form/fld_ftlink.c | 4 +- form/fld_info.c | 10 +- form/fld_just.c | 12 +- form/fld_link.c | 8 +- form/fld_max.c | 4 +- form/fld_move.c | 10 +- form/fld_newftyp.c | 8 +- form/fld_opts.c | 12 +- form/fld_pad.c | 8 +- form/fld_page.c | 10 +- form/fld_stat.c | 10 +- form/fld_type.c | 8 +- form/fld_user.c | 10 +- form/form.h | 203 +- form/form.priv.h | 76 +- form/frm_cursor.c | 4 +- form/frm_data.c | 8 +- form/frm_def.c | 82 +- form/frm_driver.c | 78 +- form/frm_hook.c | 6 +- form/frm_opts.c | 18 +- form/frm_page.c | 6 +- form/frm_post.c | 6 +- form/frm_req_name.c | 6 +- form/frm_scale.c | 4 +- form/frm_sub.c | 6 +- form/frm_user.c | 10 +- form/frm_win.c | 6 +- form/fty_alnum.c | 12 +- form/fty_alpha.c | 12 +- form/fty_enum.c | 11 +- form/fty_generic.c | 19 +- form/fty_int.c | 15 +- form/fty_ipv4.c | 8 +- form/fty_num.c | 15 +- form/fty_regex.c | 12 +- include/Caps | 10 +- include/Caps-ncurses | 12 +- include/Caps.aix4 | 10 +- include/Caps.hpux11 | 10 +- include/Caps.keys | 10 +- include/Caps.osf1r5 | 10 +- include/Caps.uwin | 10 +- include/MKkey_defs.sh | 14 +- include/MKterm.h.awk.in | 37 +- include/Makefile.in | 20 +- include/curses.events | 55 + include/curses.h.in | 54 +- include/headers | 4 +- include/nc_alloc.h | 4 +- include/nc_mingw.h | 23 +- include/nc_termios.h | 8 +- include/nc_tparm.h | 14 +- include/nc_win32.h | 183 + include/ncurses_cfg.hin | 4 +- include/ncurses_defs | 6 +- include/ncurses_dll.h.in | 70 +- include/term_entry.h | 6 +- include/win32_curses.h | 75 + man/curs_add_wch.3x | 23 +- man/curs_add_wchstr.3x | 8 +- man/curs_addch.3x | 38 +- man/curs_addchstr.3x | 24 +- man/curs_addstr.3x | 20 +- man/curs_addwstr.3x | 4 +- man/curs_bkgd.3x | 6 +- man/curs_bkgrnd.3x | 6 +- man/curs_border.3x | 38 +- man/curs_clear.3x | 36 +- man/curs_color.3x | 20 +- man/curs_delch.3x | 8 +- man/curs_deleteln.3x | 14 +- man/curs_extend.3x | 4 +- man/curs_get_wch.3x | 4 +- man/curs_get_wstr.3x | 4 +- man/curs_getch.3x | 10 +- man/curs_getstr.3x | 20 +- man/curs_getyx.3x | 10 +- man/curs_in_wch.3x | 6 +- man/curs_in_wchstr.3x | 4 +- man/curs_inch.3x | 10 +- man/curs_inchstr.3x | 20 +- man/curs_initscr.3x | 6 +- man/curs_inopts.3x | 79 +- man/curs_ins_wch.3x | 10 +- man/curs_ins_wstr.3x | 4 +- man/curs_insch.3x | 12 +- man/curs_insstr.3x | 20 +- man/curs_instr.3x | 20 +- man/curs_inwstr.3x | 4 +- man/curs_kernel.3x | 10 +- man/curs_legacy.3x | 28 +- man/curs_memleaks.3x | 23 +- man/curs_mouse.3x | 17 +- man/curs_move.3x | 6 +- man/curs_opaque.3x | 32 +- man/curs_outopts.3x | 101 +- man/curs_print.3x | 6 +- man/curs_printw.3x | 52 +- man/curs_refresh.3x | 12 +- man/curs_scanw.3x | 54 +- man/curs_scr_dump.3x | 10 +- man/curs_scroll.3x | 10 +- man/curs_slk.3x | 4 +- man/curs_sp_funcs.3x | 289 +- man/curs_termcap.3x | 83 +- man/curs_terminfo.3x | 60 +- man/curs_threads.3x | 14 +- man/curs_touch.3x | 22 +- man/curs_util.3x | 37 +- man/curs_variables.3x | 4 +- man/default_colors.3x | 8 +- man/define_key.3x | 4 +- man/form.3x | 12 +- man/form_cursor.3x | 6 +- man/form_data.3x | 8 +- man/form_driver.3x | 6 +- man/form_field.3x | 14 +- man/form_field_attributes.3x | 20 +- man/form_field_buffer.3x | 18 +- man/form_field_info.3x | 18 +- man/form_field_just.3x | 8 +- man/form_field_new.3x | 20 +- man/form_field_opts.3x | 14 +- man/form_field_userptr.3x | 11 +- man/form_field_validation.3x | 104 +- man/form_fieldtype.3x | 119 +- man/form_hook.3x | 26 +- man/form_new.3x | 10 +- man/form_new_page.3x | 8 +- man/form_opts.3x | 14 +- man/form_page.3x | 22 +- man/form_post.3x | 8 +- man/form_requestname.3x | 17 +- man/form_userptr.3x | 10 +- man/form_variables.3x | 5 +- man/form_win.3x | 18 +- man/infocmp.1m | 6 +- man/infotocap.1m | 6 +- man/key_defined.3x | 4 +- man/keybound.3x | 4 +- man/keyok.3x | 4 +- man/legacy_coding.3x | 4 +- man/manhtml.aliases | 11 +- man/manhtml.externs | 4 +- man/manlinks.sed | 8 +- man/menu_attributes.3x | 26 +- man/menu_cursor.3x | 6 +- man/menu_driver.3x | 10 +- man/menu_format.3x | 8 +- man/menu_hook.3x | 26 +- man/menu_items.3x | 12 +- man/menu_mark.3x | 10 +- man/menu_new.3x | 10 +- man/menu_opts.3x | 14 +- man/menu_pattern.3x | 10 +- man/menu_post.3x | 8 +- man/menu_requestname.3x | 12 +- man/menu_spacing.3x | 20 +- man/menu_userptr.3x | 10 +- man/menu_win.3x | 18 +- man/mitem_current.3x | 20 +- man/mitem_name.3x | 10 +- man/mitem_new.3x | 10 +- man/mitem_opts.3x | 14 +- man/mitem_userptr.3x | 10 +- man/mitem_value.3x | 8 +- man/mitem_visible.3x | 6 +- man/ncurses.3x | 185 +- man/new_pair.3x | 8 +- man/resizeterm.3x | 8 +- man/tabs.1 | 4 +- man/term.5 | 124 +- man/terminfo.tail | 6 +- man/tic.1m | 4 +- man/toe.1m | 6 +- man/tput.1 | 8 +- man/user_caps.5 | 19 +- man/wresize.3x | 4 +- menu/Makefile.in | 31 +- menu/m_attribs.c | 6 +- menu/m_cursor.c | 16 +- menu/m_driver.c | 10 +- menu/m_format.c | 10 +- menu/m_global.c | 62 +- menu/m_hook.c | 6 +- menu/m_item_cur.c | 16 +- menu/m_item_nam.c | 10 +- menu/m_item_new.c | 24 +- menu/m_item_opt.c | 18 +- menu/m_item_top.c | 12 +- menu/m_item_use.c | 10 +- menu/m_item_val.c | 10 +- menu/m_item_vis.c | 6 +- menu/m_items.c | 16 +- menu/m_new.c | 19 +- menu/m_opts.c | 20 +- menu/m_pad.c | 12 +- menu/m_pattern.c | 10 +- menu/m_post.c | 22 +- menu/m_req_name.c | 6 +- menu/m_scale.c | 6 +- menu/m_spacing.c | 10 +- menu/m_sub.c | 10 +- menu/m_trace.c | 20 +- menu/m_userptr.c | 10 +- menu/m_win.c | 10 +- menu/menu.h | 330 +- menu/menu.priv.h | 40 +- misc/Makefile.in | 8 +- misc/gen-pkgconfig.in | 58 +- misc/ncurses-config.in | 45 +- misc/terminfo.src | 2071 +- mk-1st.awk | 36 +- mk-2nd.awk | 11 +- mk-hdr.awk | 11 +- ncurses/Makefile.in | 46 +- ncurses/base/MKlib_gen.sh | 17 +- ncurses/base/lib_addch.c | 18 +- ncurses/base/lib_addstr.c | 10 +- ncurses/base/lib_bkgd.c | 74 +- ncurses/base/lib_color.c | 45 +- ncurses/base/lib_driver.c | 4 +- ncurses/base/lib_getch.c | 74 +- ncurses/base/lib_getstr.c | 3 +- ncurses/base/lib_initscr.c | 9 +- ncurses/base/lib_mouse.c | 62 +- ncurses/base/lib_newterm.c | 13 +- ncurses/base/lib_screen.c | 8 +- ncurses/base/lib_set_term.c | 29 +- ncurses/base/new_pair.c | 27 +- ncurses/base/wresize.c | 12 +- ncurses/curses.priv.h | 79 +- ncurses/llib-lncurses | 283 +- ncurses/llib-lncursest | 283 +- ncurses/llib-lncursestw | 419 +- ncurses/llib-lncursesw | 419 +- ncurses/llib-ltinfo | 17 + ncurses/llib-ltinfot | 17 + ncurses/llib-ltinfotw | 17 + ncurses/llib-ltinfow | 17 + ncurses/modules | 8 +- ncurses/new_pair.h | 5 +- ncurses/report_hashing.c | 73 + ncurses/tinfo/MKcaptab.sh | 0 ncurses/tinfo/MKfallback.sh | 16 +- ncurses/tinfo/access.c | 12 +- ncurses/tinfo/captoinfo.c | 13 +- ncurses/tinfo/comp_parse.c | 4 +- ncurses/tinfo/doalloc.c | 4 +- ncurses/tinfo/lib_baudrate.c | 20 +- ncurses/tinfo/lib_cur_term.c | 7 +- ncurses/tinfo/lib_data.c | 7 +- ncurses/tinfo/lib_kernel.c | 12 +- ncurses/tinfo/lib_napms.c | 4 +- ncurses/tinfo/lib_options.c | 6 +- ncurses/tinfo/lib_print.c | 6 +- ncurses/tinfo/lib_raw.c | 11 +- ncurses/tinfo/lib_setup.c | 29 +- ncurses/tinfo/lib_tgoto.c | 4 +- ncurses/tinfo/lib_tparm.c | 459 +- ncurses/tinfo/lib_tputs.c | 16 +- ncurses/tinfo/lib_ttyflags.c | 6 +- ncurses/tinfo/lib_win32con.c | 1256 ++ ncurses/tinfo/lib_win32util.c | 134 + ncurses/tinfo/parse_entry.c | 10 +- ncurses/tinfo/read_entry.c | 16 +- ncurses/tinfo/tinfo_driver.c | 137 +- ncurses/tinfo/trim_sgr0.c | 4 +- ncurses/tinfo/write_entry.c | 4 +- ncurses/trace/lib_trace.c | 6 +- ncurses/trace/lib_tracebits.c | 42 +- ncurses/tty/hashmap.c | 4 +- ncurses/tty/lib_mvcur.c | 105 +- ncurses/tty/lib_twait.c | 4 +- ncurses/tty/lib_vidattr.c | 22 +- ncurses/tty/tty_update.c | 62 +- ncurses/wcwidth.h | 8 +- ncurses/widechar/lib_cchar.c | 16 +- ncurses/widechar/lib_ins_wch.c | 6 +- ncurses/widechar/lib_vid_attr.c | 23 +- ncurses/widechar/widechars.c | 6 +- ncurses/win32con/gettimeofday.c | 4 +- ncurses/win32con/wcwidth.c | 10 +- ncurses/win32con/win32_driver.c | 1221 ++ ncurses/win32con/win_driver.c | 22 +- package/debian-mingw/changelog | 4 +- package/debian-mingw/compat | 2 +- package/debian-mingw/copyright | 5 +- package/debian-mingw64/changelog | 4 +- package/debian-mingw64/compat | 2 +- package/debian-mingw64/copyright | 5 +- package/debian/changelog | 4 +- package/debian/compat | 2 +- package/debian/copyright | 5 +- package/debian/rules | 24 +- package/mingw-ncurses.nsi | 8 +- package/mingw-ncurses.spec | 2 +- package/ncurses.map | 9 +- package/ncurses.spec | 2 +- package/ncursest.map | 9 +- package/ncursest.spec | 2 +- package/ncursestw.map | 9 +- package/ncursesw.map | 9 +- panel/Makefile.in | 28 +- panel/llib-lpanel | 3 +- panel/llib-lpanelt | 3 +- panel/llib-lpaneltw | 3 +- panel/llib-lpanelw | 3 +- panel/p_above.c | 6 +- panel/p_below.c | 6 +- panel/p_bottom.c | 6 +- panel/p_delete.c | 17 +- panel/p_hidden.c | 4 +- panel/p_hide.c | 6 +- panel/p_move.c | 4 +- panel/p_new.c | 54 +- panel/p_replace.c | 4 +- panel/p_show.c | 6 +- panel/p_top.c | 4 +- panel/p_update.c | 6 +- panel/p_user.c | 6 +- panel/p_win.c | 4 +- panel/panel.c | 34 +- panel/panel.h | 49 +- panel/panel.priv.h | 22 +- progs/Makefile.in | 24 +- progs/dump_entry.c | 22 +- progs/dump_entry.h | 4 +- progs/infocmp.c | 9 +- progs/progs.priv.h | 20 +- progs/reset_cmd.c | 43 +- progs/tabs.c | 4 +- progs/tic.c | 124 +- progs/tparm_type.c | 30 +- progs/tparm_type.h | 6 +- progs/tput.c | 20 +- progs/tset.c | 15 +- test/Makefile.in | 25 +- test/README | 154 +- test/aclocal.m4 | 720 +- test/back_ground.c | 300 + test/background.c | 5 +- test/clip_printw.c | 7 +- test/color_name.h | 4 +- test/configure | 10358 +++++---- test/configure.in | 18 +- test/demo_defkey.c | 6 +- test/demo_forms.c | 32 +- test/demo_new_pair.c | 44 +- test/demo_terminfo.c | 6 +- test/dots.c | 23 +- test/dots_curses.c | 26 +- test/dots_mvcur.c | 23 +- test/dots_termcap.c | 29 +- test/dots_xcurses.c | 25 +- test/dup_field.c | 394 + test/filter.c | 3 +- test/modules | 16 +- test/move_field.c | 524 + test/ncurses.c | 13 +- test/package/debian-mingw/compat | 2 +- test/package/debian-mingw/copyright | 5 +- test/package/debian-mingw64/compat | 2 +- test/package/debian-mingw64/copyright | 5 +- test/package/debian/compat | 2 +- test/package/debian/copyright | 3 +- test/picsmap.c | 20 +- test/programs | 8 +- test/railroad.c | 6 +- test/rain.c | 4 +- test/tclock.c | 4 +- test/test.priv.h | 44 +- test/test_tparm.c | 388 + test/tracemunch | 974 +- test/widechars.h | 4 +- 559 files changed, 41822 insertions(+), 27048 deletions(-) diff --git a/Ada95/Makefile.in b/Ada95/Makefile.in index 67625d7e9cda..8d78bbf4f19c 100644 --- a/Ada95/Makefile.in +++ b/Ada95/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.23 2020/02/02 23:34:34 tom Exp $ +# $Id: Makefile.in,v 1.26 2021/01/23 20:34:50 tom Exp $ ############################################################################## -# Copyright 2020 Thomas E. Dickey # +# Copyright 2020,2021 Thomas E. Dickey # # Copyright 1998-2010,2015 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -31,7 +31,7 @@ # Author: Juergen Pfeifer, 1996 # # Version Control -# $Revision: 1.23 $ +# $Revision: 1.26 $ # SHELL = @SHELL@ VPATH = @srcdir@ @@ -39,7 +39,7 @@ THIS = Makefile SUBDIRS = @ADA_SUBDIRS@ -CF_MFLAGS = @cf_cv_makeflags@ +TOP_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)" @SET_MAKE@ all \ @@ -50,19 +50,19 @@ install.libs \ uninstall \ uninstall.libs :: for d in $(SUBDIRS); do \ - (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ + ( cd $$d && $(MAKE) $(TOP_MFLAGS) $@ ) ;\ done clean \ mostlyclean :: for d in $(SUBDIRS); do \ - (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ + ( cd $$d && $(MAKE) $(TOP_MFLAGS) $@ ) ;\ done distclean \ realclean :: for d in $(SUBDIRS); do \ - (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ + ( cd $$d && $(MAKE) $(TOP_MFLAGS) $@ ) ;\ done rm -rf lib for lib_kind in static dynamic; do \ diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 7438acc170da..703300c8a247 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2019,2020 Thomas E. Dickey * +dnl Copyright 2018-2020,2021 Thomas E. Dickey * dnl Copyright 2010-2017,2018 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.153 2020/02/08 21:04:00 tom Exp $ +dnl $Id: aclocal.m4,v 1.171 2021/01/06 01:29:44 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -100,10 +100,11 @@ AC_DEFUN([CF_ADD_ADAFLAGS],[ AC_SUBST(ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40 +dnl CF_ADD_CFLAGS version: 15 updated: 2020/12/31 10:54:15 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS -dnl The second parameter if given makes this macro verbose. +dnl $1 = flags to add +dnl $2 = if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily @@ -117,19 +118,19 @@ cf_new_extra_cppflags= for cf_add_cflags in $1 do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then + if test "$cf_fix_cppflags" = yes ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue elif test "${cf_tst_cflags}" = "\"'" ; then @@ -142,7 +143,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) @@ -160,7 +161,7 @@ case $cf_fix_cppflags in (yes) CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[[^"]]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -188,7 +189,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 15 updated: 2018/06/20 20:23:13 +dnl CF_ADD_INCDIR version: 16 updated: 2020/12/31 20:19:42 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, @@ -200,9 +201,9 @@ AC_DEFUN([CF_ADD_INCDIR], if test -n "$1" ; then for cf_add_incdir in $1 do - while test $cf_add_incdir != /usr/include + while test "$cf_add_incdir" != /usr/include do - if test -d $cf_add_incdir + if test -d "$cf_add_incdir" then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then @@ -233,7 +234,7 @@ if test -n "$1" ; then CF_VERBOSE(adding $cf_add_incdir to include-path) ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir" - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else @@ -255,7 +256,7 @@ dnl $1 = library to add, without the "-l" dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBDIR version: 10 updated: 2015/04/18 08:56:57 +dnl CF_ADD_LIBDIR version: 11 updated: 2020/12/31 20:19:42 dnl ------------- dnl Adds to the library-path dnl @@ -269,9 +270,9 @@ AC_DEFUN([CF_ADD_LIBDIR], if test -n "$1" ; then for cf_add_libdir in $1 do - if test $cf_add_libdir = /usr/lib ; then + if test "$cf_add_libdir" = /usr/lib ; then : - elif test -d $cf_add_libdir + elif test -d "$cf_add_libdir" then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then @@ -317,7 +318,7 @@ done ifelse($2,,LIBS,[$2])="$cf_add_libs" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 4 updated: 2013/10/08 17:47:05 +dnl CF_ADD_SUBDIR_PATH version: 5 updated: 2020/12/31 20:19:42 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -329,13 +330,13 @@ AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "x$4" != "x$5" && \ test -d "$4" && \ -ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]) { +ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5"; } &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" - test -d $4/$3 && $1="[$]$1 $4/$3" - test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" - test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" - test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" - test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" + test -d "$4/$3" && $1="[$]$1 $4/$3" + test -d "$4/$3/$2" && $1="[$]$1 $4/$3/$2" + test -d "$4/$3/$2/$3" && $1="[$]$1 $4/$3/$2/$3" + test -d "$4/$2/$3" && $1="[$]$1 $4/$2/$3" + test -d "$4/$2/$3/$2" && $1="[$]$1 $4/$2/$3/$2" } ])dnl dnl --------------------------------------------------------------------------- @@ -355,6 +356,12 @@ dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- +dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 +dnl ------------- +dnl Allow user to enable a normally-off option. +AC_DEFUN([CF_ARG_ENABLE], +[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl +dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus @@ -378,7 +385,7 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_AR_FLAGS version: 6 updated: 2015/10/10 15:25:05 +dnl CF_AR_FLAGS version: 9 updated: 2021/01/01 13:31:04 dnl ----------- dnl Check for suitable "ar" (archiver) options for updating an archive. dnl @@ -389,39 +396,55 @@ AC_DEFUN([CF_AR_FLAGS],[ AC_REQUIRE([CF_PROG_AR]) AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ - cf_cv_ar_flags=unknown - for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv - do + case "$cf_cv_system_name" in + (*-msvc*) + cf_cv_ar_flags='' + cat >mk_static_lib.sh <<-EOF + #!$SHELL + MSVC_BIN="[$]AR" + out="\[$]1" + shift + exec \[$]MSVC_BIN -out:"\[$]out" \[$]@ + EOF + chmod +x mk_static_lib.sh + AR=`pwd`/mk_static_lib.sh + ;; + (*) + cf_cv_ar_flags=unknown + for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv + do - # check if $ARFLAGS already contains this choice - if test "x$ARFLAGS" != "x" ; then - cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` - if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then - cf_cv_ar_flags= - break + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi fi - fi - rm -f conftest.$ac_cv_objext - rm -f conftest.a + rm -f "conftest.$ac_cv_objext" + rm -f conftest.a - cat >conftest.$ac_ext <"conftest.$ac_ext" <&AC_FD_CC - $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null - if test -f conftest.a ; then - cf_cv_ar_flags=$cf_ar_flags + if AC_TRY_EVAL(ac_compile) ; then + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC + $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&AC_FD_CC 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags="$cf_ar_flags" + break + fi + else + CF_VERBOSE(cannot compile test-program) break fi - else - CF_VERBOSE(cannot compile test-program) - break - fi - done - rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext + done + rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext" + ;; + esac ]) if test -n "$ARFLAGS" ; then @@ -435,7 +458,7 @@ fi AC_SUBST(ARFLAGS) ]) dnl --------------------------------------------------------------------------- -dnl CF_BUILD_CC version: 8 updated: 2018/01/04 20:31:04 +dnl CF_BUILD_CC version: 9 updated: 2021/01/02 09:31:20 dnl ----------- dnl If we're cross-compiling, allow the user to override the tools and their dnl options. The configure script is oriented toward identifying the host @@ -501,7 +524,7 @@ if test "$cross_compiling" = yes ; then : ${BUILD_CC:='${CC}'} - if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then + if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then AC_MSG_ERROR([Cross-build requires two compilers. Use --with-build-cc to specify the native compiler.]) fi @@ -527,7 +550,7 @@ AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 9 updated: 2018/07/29 18:03:26 +dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler @@ -542,7 +565,7 @@ dnl outweighs that limitation. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC -: ${CC:=cc} +: "${CC:=cc}" AC_MSG_CHECKING(\$CFLAGS variable) case "x$CFLAGS" in @@ -591,7 +614,7 @@ case "$CC" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CFG_DEFAULTS version: 11 updated: 2015/04/17 21:13:04 +dnl CF_CFG_DEFAULTS version: 16 updated: 2021/01/04 19:33:05 dnl --------------- dnl Determine the default configuration into which we'll install ncurses. This dnl can be overridden by the user's command-line options. There's two items to @@ -604,7 +627,8 @@ dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's dnl programs from a vendor's. AC_DEFUN([CF_CFG_DEFAULTS], -[ +[AC_REQUIRE([AC_PROG_FGREP])dnl + AC_MSG_CHECKING(for prefix) if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in @@ -622,20 +646,20 @@ if test "x$prefix" = "xNONE" ; then AC_MSG_CHECKING(for default include-directory) test -n "$verbose" && echo 1>&AC_FD_MSG for cf_symbol in \ - $includedir \ - $includedir/ncurses \ - $prefix/include \ - $prefix/include/ncurses \ + "$includedir" \ + "$includedir/ncurses" \ + "$prefix/include" \ + "$prefix/include/ncurses" \ /usr/local/include \ /usr/local/include/ncurses \ /usr/include \ /usr/include/ncurses do - cf_dir=`eval echo $cf_symbol` - if test -f $cf_dir/curses.h ; then - if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then + cf_dir=`eval echo "$cf_symbol"` + if test -f "$cf_dir/curses.h" ; then + if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then includedir="$cf_symbol" - test -n "$verbose" && echo $ac_n " found " 1>&AC_FD_MSG + test -n "$verbose" && echo $ECHO_N " found " 1>&AC_FD_MSG break fi fi @@ -645,7 +669,7 @@ AC_MSG_RESULT($includedir) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 +dnl CF_CHECK_CACHE version: 13 updated: 2020/12/31 10:54:15 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. @@ -659,7 +683,7 @@ dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ -if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then +if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" *** 129577 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Feb 25 17:34: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 5CF3356A82B; Thu, 25 Feb 2021 17:34: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 4Dmfzc29v6z53wD; Thu, 25 Feb 2021 17:34: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 331811B772; Thu, 25 Feb 2021 17:34: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 11PHYKx0014730; Thu, 25 Feb 2021 17:34:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PHYKkH014729; Thu, 25 Feb 2021 17:34:20 GMT (envelope-from git) Date: Thu, 25 Feb 2021 17:34:20 GMT Message-Id: <202102251734.11PHYKkH014729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 48396dc77922 - main - Address two incorrect calculations and enhance readability of PRR code 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/main X-Git-Reftype: branch X-Git-Commit: 48396dc77922c68377ecac0ead2f8b0b5453c451 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 17:34:20 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=48396dc77922c68377ecac0ead2f8b0b5453c451 commit 48396dc77922c68377ecac0ead2f8b0b5453c451 Author: Richard Scheffenegger AuthorDate: 2021-02-25 16:59:45 +0000 Commit: Richard Scheffenegger CommitDate: 2021-02-25 17:32:04 +0000 Address two incorrect calculations and enhance readability of PRR code - address second instance of cwnd potentially becoming zero - fix sublte bug due to implicit int to uint typecase in max() - fix bug due to typo in hand-coded CEILING() function by using howmany() macro - use int instead of long, and add a missing long typecast - replace if conditionals with easier to read imax/imin (as in pseudocode) Reviewed By: #transport, kbowling MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28813 --- sys/netinet/tcp_input.c | 60 ++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 59a5a2d6bf34..ca4a4c833dc2 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2570,8 +2570,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (V_tcp_do_prr && IN_FASTRECOVERY(tp->t_flags) && (tp->t_flags & TF_SACK_PERMIT)) { - long snd_cnt = 0, limit = 0; - long del_data = 0, pipe = 0; + int snd_cnt = 0, limit = 0; + int del_data = 0, pipe = 0; /* * In a duplicate ACK del_data is only the * diff_in_sack. If no SACK is used del_data @@ -2588,39 +2588,29 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (pipe > tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = - max(1, tp->snd_nxt - tp->snd_una); - snd_cnt = (tp->sackhint.prr_delivered * - tp->snd_ssthresh / - tp->sackhint.recover_fs) + - 1 - tp->sackhint.sack_bytes_rexmit; + imax(1, tp->snd_nxt - tp->snd_una); + snd_cnt = howmany((long)tp->sackhint.prr_delivered * + tp->snd_ssthresh, tp->sackhint.recover_fs) - + tp->sackhint.sack_bytes_rexmit; } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; else - if ((tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit) > - del_data) - limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit + - maxseg; - else - limit = del_data + maxseg; - if ((tp->snd_ssthresh - pipe) < limit) - snd_cnt = tp->snd_ssthresh - pipe; - else - snd_cnt = limit; + limit = imax(tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit, + del_data) + maxseg; + snd_cnt = imin(tp->snd_ssthresh - pipe, limit); } - snd_cnt = max((snd_cnt / maxseg), 0); + snd_cnt = imax(snd_cnt, 0) / maxseg; /* * Send snd_cnt new data into the network in * response to this ACK. If there is a going * to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + - (snd_cnt * maxseg); + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); } else if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -3948,7 +3938,7 @@ tcp_mssopt(struct in_conninfo *inc) void tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) { - long snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; + int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); @@ -3974,29 +3964,27 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) if (pipe > tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = - max(1, tp->snd_nxt - tp->snd_una); - snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / - tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit; + imax(1, tp->snd_nxt - tp->snd_una); + snd_cnt = howmany((long)tp->sackhint.prr_delivered * + tp->snd_ssthresh, tp->sackhint.recover_fs) - + tp->sackhint.sack_bytes_rexmit; } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; else - if ((tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit) > del_data) - limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit + maxseg; - else - limit = del_data + maxseg; - snd_cnt = min((tp->snd_ssthresh - pipe), limit); + limit = imax(tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit, + del_data) + maxseg; + snd_cnt = imin((tp->snd_ssthresh - pipe), limit); } - snd_cnt = max((snd_cnt / maxseg), 0); + snd_cnt = imax(snd_cnt, 0) / maxseg; /* * Send snd_cnt new data into the network in response to this ack. * If there is going to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = max(maxseg, (int64_t)tp->snd_nxt - tp->snd_recover + + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18: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 8CAE156B1C5; Thu, 25 Feb 2021 18: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 4Dmgkz3JqBz56RF; Thu, 25 Feb 2021 18: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 605711BFC2; Thu, 25 Feb 2021 18: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 11PI8RJ4055144; Thu, 25 Feb 2021 18: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 11PI8R7a055143; Thu, 25 Feb 2021 18:08:27 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:08:27 GMT Message-Id: <202102251808.11PI8R7a055143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 31d7a27c6e88 - main - PRR: Avoid accounting left-edge twice in partial ACK. 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/main X-Git-Reftype: branch X-Git-Commit: 31d7a27c6e88c3d5bd0907774ec70176a92da5bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:08:27 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=31d7a27c6e88c3d5bd0907774ec70176a92da5bb commit 31d7a27c6e88c3d5bd0907774ec70176a92da5bb Author: Richard Scheffenegger AuthorDate: 2021-02-25 17:36:49 +0000 Commit: Richard Scheffenegger CommitDate: 2021-02-25 17:37:47 +0000 PRR: Avoid accounting left-edge twice in partial ACK. Reviewed By: #transport, kbowling MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28819 --- sys/netinet/tcp_input.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index ca4a4c833dc2..bbc93a93810c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3950,9 +3950,7 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) * (del_data) and an estimate of how many bytes are in the * network. */ - if (SEQ_GEQ(th->th_ack, tp->snd_una)) - del_data = BYTES_THIS_ACK(tp, th); - del_data += tp->sackhint.delivered_data; + del_data = tp->sackhint.delivered_data; if (V_tcp_do_rfc6675_pipe) pipe = tcp_compute_pipe(tp); else From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:21: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 13AE556B906; Thu, 25 Feb 2021 18:21: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 4Dmh1S72TVz57lG; Thu, 25 Feb 2021 18:21: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 D9C261C2C1; Thu, 25 Feb 2021 18:21: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 11PIL0uE078841; Thu, 25 Feb 2021 18:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIL060078840; Thu, 25 Feb 2021 18:21:00 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:21:00 GMT Message-Id: <202102251821.11PIL060078840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 2593f858d7d0 - main - A TCP server has to take into consideration, if TCP_NOOPT is preventing the negotiation of TCP features. This affects most TCP options but adherance to RFC7323 with the timestamp option will prevent a session from getting established. 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/main X-Git-Reftype: branch X-Git-Commit: 2593f858d7d078efa85f78f20b6bfa0931cc1dc5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:21:01 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=2593f858d7d078efa85f78f20b6bfa0931cc1dc5 commit 2593f858d7d078efa85f78f20b6bfa0931cc1dc5 Author: Richard Scheffenegger AuthorDate: 2021-02-25 18:10:55 +0000 Commit: Richard Scheffenegger CommitDate: 2021-02-25 18:12:20 +0000 A TCP server has to take into consideration, if TCP_NOOPT is preventing the negotiation of TCP features. This affects most TCP options but adherance to RFC7323 with the timestamp option will prevent a session from getting established. PR: 253576 Reviewed By: tuexen, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28652 --- sys/netinet/tcp_input.c | 12 ++++++++---- sys/netinet/tcp_syncache.c | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index bbc93a93810c..6338b7491a7f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1644,7 +1644,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, TCPSTAT_INC(tcps_ecn_shs); } if ((to.to_flags & TOF_SCALE) && - (tp->t_flags & TF_REQ_SCALE)) { + (tp->t_flags & TF_REQ_SCALE) && + !(tp->t_flags & TF_NOOPT)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; } else @@ -1655,7 +1656,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, */ tp->snd_wnd = th->th_win; if ((to.to_flags & TOF_TS) && - (tp->t_flags & TF_REQ_TSTMP)) { + (tp->t_flags & TF_REQ_TSTMP) && + !(tp->t_flags & TF_NOOPT)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = tcp_ts_getticks(); @@ -1664,10 +1666,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && - (to.to_flags & TOF_SACKPERM) == 0) + (!(to.to_flags & TOF_SACKPERM) || + (tp->t_flags & TF_NOOPT))) tp->t_flags &= ~TF_SACK_PERMIT; if (IS_FASTOPEN(tp->t_flags)) { - if (to.to_flags & TOF_FASTOPEN) { + if ((to.to_flags & TOF_FASTOPEN) && + !(tp->t_flags & TF_NOOPT)) { uint16_t mss; if (to.to_flags & TOF_MSS) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index e59a41fc1102..771ff44b8924 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1655,7 +1655,8 @@ skip_alloc: win = imin(win, TCP_MAXWIN); sc->sc_wnd = win; - if (V_tcp_do_rfc1323) { + if (V_tcp_do_rfc1323 && + !(ltflags & TF_NOOPT)) { /* * A timestamp received in a SYN makes * it ok to send timestamp requests and replies. From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:22: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 7E5EB56BAA8; Thu, 25 Feb 2021 18:22: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 4Dmh3C31PVz58Yg; Thu, 25 Feb 2021 18:22: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 5A7211C54E; Thu, 25 Feb 2021 18:22: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 11PIMVmB080867; Thu, 25 Feb 2021 18:22:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIMVaE080866; Thu, 25 Feb 2021 18:22:31 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:22:31 GMT Message-Id: <202102251822.11PIMVaE080866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Renato Botelho Subject: git: 220c6d922a84 - main - ncurses: Silence MKuserdefs.sh call MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 220c6d922a84f6679d72dfc5bac762b4c4812199 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:22:31 -0000 The branch main has been updated by garga (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=220c6d922a84f6679d72dfc5bac762b4c4812199 commit 220c6d922a84f6679d72dfc5bac762b4c4812199 Author: Renato Botelho AuthorDate: 2021-02-25 18:15:39 +0000 Commit: Renato Botelho CommitDate: 2021-02-25 18:22:17 +0000 ncurses: Silence MKuserdefs.sh call Remove -x flag from sh used to execute MKuserdefs.sh during ncurses build and stop polluting make -s output Reviewed by: bapt, manu Approved by: bapt Differential Revision: https://reviews.freebsd.org/D28885 --- lib/ncurses/ncurses/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index aff569a79845..68ed3b39f458 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -362,7 +362,7 @@ fallback.c: MKfallback.sh mv -f ${.TARGET}.tmp ${.TARGET} comp_userdefs.c: MKuserdefs.sh Caps Caps-ncurses make_hash - env PATH=${BTOOLSPATH:U.}:${PATH} sh -x ${NCURSES_DIR}/ncurses/tinfo/MKuserdefs.sh "${AWK}" \ + env PATH=${BTOOLSPATH:U.}:${PATH} sh ${NCURSES_DIR}/ncurses/tinfo/MKuserdefs.sh "${AWK}" \ ${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > ${.TARGET} # Generated headers From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18: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 C781356BF87; Thu, 25 Feb 2021 18: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 4DmhCt5K3tz58rL; Thu, 25 Feb 2021 18: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 A7CAB1C680; Thu, 25 Feb 2021 18: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 11PIU2HO083355; Thu, 25 Feb 2021 18:30:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIU2KU083352; Thu, 25 Feb 2021 18:30:02 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:30:02 GMT Message-Id: <202102251830.11PIU2KU083352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 705d726338c3 - main - ncurses: ensure we prefer the generated ncurses_dll.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 705d726338c39a225a433d9277f16ba61b613d16 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:30:02 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=705d726338c39a225a433d9277f16ba61b613d16 commit 705d726338c39a225a433d9277f16ba61b613d16 Author: Baptiste Daroussin AuthorDate: 2021-02-25 18:27:29 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 18:27:29 +0000 ncurses: ensure we prefer the generated ncurses_dll.h --- lib/ncurses/config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ncurses/config.mk b/lib/ncurses/config.mk index 7a64a7b948ee..fc77567b2594 100644 --- a/lib/ncurses/config.mk +++ b/lib/ncurses/config.mk @@ -18,6 +18,7 @@ CFLAGS+= -I${.CURDIR:H}/ncurses CFLAGS+= -I${NCURSES_DIR}/include CFLAGS+= -I${NCURSES_DIR}/ncurses +CFLAGS+= -I${.OBJDIR:H}/ncurses/ CFLAGS+= -Wall From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18: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 C61E856BC7C; Thu, 25 Feb 2021 18: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 4DmhCs5BKzz58rJ; Thu, 25 Feb 2021 18: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 A03F41C3AE; Thu, 25 Feb 2021 18: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 11PIU1bf083148; Thu, 25 Feb 2021 18: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 11PIU199083076; Thu, 25 Feb 2021 18:30:01 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:30:01 GMT Message-Id: <202102251830.11PIU199083076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 7a65641922f4 - main - ncurses: import version 6.2-20210220 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a65641922f404b84e9a249d48593de84d8e8d17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:30:01 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7a65641922f404b84e9a249d48593de84d8e8d17 commit 7a65641922f404b84e9a249d48593de84d8e8d17 Merge: 220c6d922a84 bf0ab54638a5 Author: Baptiste Daroussin AuthorDate: 2021-02-25 18:26:18 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 18:26:56 +0000 ncurses: import version 6.2-20210220 contrib/ncurses/COPYING | 4 +- contrib/ncurses/INSTALL | 116 +- contrib/ncurses/MANIFEST | 11 +- contrib/ncurses/NEWS | 469 +- contrib/ncurses/README.MinGW | 139 +- contrib/ncurses/VERSION | 2 +- contrib/ncurses/aclocal.m4 | 1536 +- contrib/ncurses/announce.html.in | 10 +- contrib/ncurses/configure | 21719 ++++++++++++---------- contrib/ncurses/configure.in | 275 +- contrib/ncurses/convert_configure.pl | 120 - contrib/ncurses/dist.mk | 8 +- contrib/ncurses/doc/html/announce.html | 11 +- contrib/ncurses/form/Makefile.in | 39 +- contrib/ncurses/form/f_trace.c | 12 +- contrib/ncurses/form/fld_arg.c | 8 +- contrib/ncurses/form/fld_attr.c | 16 +- contrib/ncurses/form/fld_current.c | 10 +- contrib/ncurses/form/fld_def.c | 18 +- contrib/ncurses/form/fld_dup.c | 15 +- contrib/ncurses/form/fld_ftchoice.c | 4 +- contrib/ncurses/form/fld_ftlink.c | 4 +- contrib/ncurses/form/fld_info.c | 10 +- contrib/ncurses/form/fld_just.c | 12 +- contrib/ncurses/form/fld_link.c | 8 +- contrib/ncurses/form/fld_max.c | 4 +- contrib/ncurses/form/fld_move.c | 10 +- contrib/ncurses/form/fld_newftyp.c | 8 +- contrib/ncurses/form/fld_opts.c | 12 +- contrib/ncurses/form/fld_pad.c | 8 +- contrib/ncurses/form/fld_page.c | 10 +- contrib/ncurses/form/fld_stat.c | 10 +- contrib/ncurses/form/fld_type.c | 8 +- contrib/ncurses/form/fld_user.c | 10 +- contrib/ncurses/form/form.h | 203 +- contrib/ncurses/form/form.priv.h | 76 +- contrib/ncurses/form/frm_cursor.c | 4 +- contrib/ncurses/form/frm_data.c | 8 +- contrib/ncurses/form/frm_def.c | 82 +- contrib/ncurses/form/frm_driver.c | 78 +- contrib/ncurses/form/frm_hook.c | 6 +- contrib/ncurses/form/frm_opts.c | 18 +- contrib/ncurses/form/frm_page.c | 6 +- contrib/ncurses/form/frm_post.c | 6 +- contrib/ncurses/form/frm_req_name.c | 6 +- contrib/ncurses/form/frm_scale.c | 4 +- contrib/ncurses/form/frm_sub.c | 6 +- contrib/ncurses/form/frm_user.c | 10 +- contrib/ncurses/form/frm_win.c | 6 +- contrib/ncurses/form/fty_alnum.c | 12 +- contrib/ncurses/form/fty_alpha.c | 12 +- contrib/ncurses/form/fty_enum.c | 11 +- contrib/ncurses/form/fty_generic.c | 19 +- contrib/ncurses/form/fty_int.c | 15 +- contrib/ncurses/form/fty_ipv4.c | 8 +- contrib/ncurses/form/fty_num.c | 15 +- contrib/ncurses/form/fty_regex.c | 12 +- contrib/ncurses/include/Caps | 10 +- contrib/ncurses/include/Caps-ncurses | 12 +- contrib/ncurses/include/Caps.aix4 | 10 +- contrib/ncurses/include/Caps.hpux11 | 10 +- contrib/ncurses/include/Caps.keys | 10 +- contrib/ncurses/include/Caps.osf1r5 | 10 +- contrib/ncurses/include/Caps.uwin | 10 +- contrib/ncurses/include/MKkey_defs.sh | 14 +- contrib/ncurses/include/MKterm.h.awk.in | 37 +- contrib/ncurses/include/Makefile.in | 20 +- contrib/ncurses/include/curses.events | 55 + contrib/ncurses/include/curses.h.in | 54 +- contrib/ncurses/include/headers | 4 +- contrib/ncurses/include/nc_alloc.h | 4 +- contrib/ncurses/include/nc_mingw.h | 23 +- contrib/ncurses/include/nc_termios.h | 8 +- contrib/ncurses/include/nc_tparm.h | 14 +- contrib/ncurses/include/nc_win32.h | 183 + contrib/ncurses/include/ncurses_cfg.hin | 4 +- contrib/ncurses/include/ncurses_defs | 6 +- contrib/ncurses/include/ncurses_dll.h.in | 70 +- contrib/ncurses/include/term_entry.h | 6 +- contrib/ncurses/include/win32_curses.h | 75 + contrib/ncurses/man/curs_add_wch.3x | 23 +- contrib/ncurses/man/curs_add_wchstr.3x | 8 +- contrib/ncurses/man/curs_addch.3x | 38 +- contrib/ncurses/man/curs_addchstr.3x | 24 +- contrib/ncurses/man/curs_addstr.3x | 20 +- contrib/ncurses/man/curs_addwstr.3x | 4 +- contrib/ncurses/man/curs_bkgd.3x | 6 +- contrib/ncurses/man/curs_bkgrnd.3x | 6 +- contrib/ncurses/man/curs_border.3x | 38 +- contrib/ncurses/man/curs_clear.3x | 36 +- contrib/ncurses/man/curs_color.3x | 20 +- contrib/ncurses/man/curs_delch.3x | 8 +- contrib/ncurses/man/curs_deleteln.3x | 14 +- contrib/ncurses/man/curs_extend.3x | 4 +- contrib/ncurses/man/curs_get_wch.3x | 4 +- contrib/ncurses/man/curs_get_wstr.3x | 4 +- contrib/ncurses/man/curs_getch.3x | 10 +- contrib/ncurses/man/curs_getstr.3x | 20 +- contrib/ncurses/man/curs_getyx.3x | 10 +- contrib/ncurses/man/curs_in_wch.3x | 6 +- contrib/ncurses/man/curs_in_wchstr.3x | 4 +- contrib/ncurses/man/curs_inch.3x | 10 +- contrib/ncurses/man/curs_inchstr.3x | 20 +- contrib/ncurses/man/curs_initscr.3x | 6 +- contrib/ncurses/man/curs_inopts.3x | 79 +- contrib/ncurses/man/curs_ins_wch.3x | 10 +- contrib/ncurses/man/curs_ins_wstr.3x | 4 +- contrib/ncurses/man/curs_insch.3x | 12 +- contrib/ncurses/man/curs_insstr.3x | 20 +- contrib/ncurses/man/curs_instr.3x | 20 +- contrib/ncurses/man/curs_inwstr.3x | 4 +- contrib/ncurses/man/curs_kernel.3x | 10 +- contrib/ncurses/man/curs_legacy.3x | 28 +- contrib/ncurses/man/curs_memleaks.3x | 23 +- contrib/ncurses/man/curs_mouse.3x | 17 +- contrib/ncurses/man/curs_move.3x | 6 +- contrib/ncurses/man/curs_opaque.3x | 32 +- contrib/ncurses/man/curs_outopts.3x | 101 +- contrib/ncurses/man/curs_print.3x | 6 +- contrib/ncurses/man/curs_printw.3x | 52 +- contrib/ncurses/man/curs_refresh.3x | 12 +- contrib/ncurses/man/curs_scanw.3x | 54 +- contrib/ncurses/man/curs_scr_dump.3x | 10 +- contrib/ncurses/man/curs_scroll.3x | 10 +- contrib/ncurses/man/curs_slk.3x | 4 +- contrib/ncurses/man/curs_sp_funcs.3x | 289 +- contrib/ncurses/man/curs_termcap.3x | 83 +- contrib/ncurses/man/curs_terminfo.3x | 60 +- contrib/ncurses/man/curs_threads.3x | 14 +- contrib/ncurses/man/curs_touch.3x | 22 +- contrib/ncurses/man/curs_util.3x | 37 +- contrib/ncurses/man/curs_variables.3x | 4 +- contrib/ncurses/man/default_colors.3x | 8 +- contrib/ncurses/man/define_key.3x | 4 +- contrib/ncurses/man/form.3x | 12 +- contrib/ncurses/man/form_cursor.3x | 6 +- contrib/ncurses/man/form_data.3x | 8 +- contrib/ncurses/man/form_driver.3x | 6 +- contrib/ncurses/man/form_field.3x | 14 +- contrib/ncurses/man/form_field_attributes.3x | 20 +- contrib/ncurses/man/form_field_buffer.3x | 18 +- contrib/ncurses/man/form_field_info.3x | 18 +- contrib/ncurses/man/form_field_just.3x | 8 +- contrib/ncurses/man/form_field_new.3x | 20 +- contrib/ncurses/man/form_field_opts.3x | 14 +- contrib/ncurses/man/form_field_userptr.3x | 11 +- contrib/ncurses/man/form_field_validation.3x | 104 +- contrib/ncurses/man/form_fieldtype.3x | 119 +- contrib/ncurses/man/form_hook.3x | 26 +- contrib/ncurses/man/form_new.3x | 10 +- contrib/ncurses/man/form_new_page.3x | 8 +- contrib/ncurses/man/form_opts.3x | 14 +- contrib/ncurses/man/form_page.3x | 22 +- contrib/ncurses/man/form_post.3x | 8 +- contrib/ncurses/man/form_requestname.3x | 17 +- contrib/ncurses/man/form_userptr.3x | 10 +- contrib/ncurses/man/form_variables.3x | 5 +- contrib/ncurses/man/form_win.3x | 18 +- contrib/ncurses/man/infocmp.1m | 6 +- contrib/ncurses/man/infotocap.1m | 6 +- contrib/ncurses/man/key_defined.3x | 4 +- contrib/ncurses/man/keybound.3x | 4 +- contrib/ncurses/man/keyok.3x | 4 +- contrib/ncurses/man/legacy_coding.3x | 4 +- contrib/ncurses/man/manhtml.aliases | 11 +- contrib/ncurses/man/manhtml.externs | 4 +- contrib/ncurses/man/manlinks.sed | 8 +- contrib/ncurses/man/menu_attributes.3x | 26 +- contrib/ncurses/man/menu_cursor.3x | 6 +- contrib/ncurses/man/menu_driver.3x | 10 +- contrib/ncurses/man/menu_format.3x | 8 +- contrib/ncurses/man/menu_hook.3x | 26 +- contrib/ncurses/man/menu_items.3x | 12 +- contrib/ncurses/man/menu_mark.3x | 10 +- contrib/ncurses/man/menu_new.3x | 10 +- contrib/ncurses/man/menu_opts.3x | 14 +- contrib/ncurses/man/menu_pattern.3x | 10 +- contrib/ncurses/man/menu_post.3x | 8 +- contrib/ncurses/man/menu_requestname.3x | 12 +- contrib/ncurses/man/menu_spacing.3x | 20 +- contrib/ncurses/man/menu_userptr.3x | 10 +- contrib/ncurses/man/menu_win.3x | 18 +- contrib/ncurses/man/mitem_current.3x | 20 +- contrib/ncurses/man/mitem_name.3x | 10 +- contrib/ncurses/man/mitem_new.3x | 10 +- contrib/ncurses/man/mitem_opts.3x | 14 +- contrib/ncurses/man/mitem_userptr.3x | 10 +- contrib/ncurses/man/mitem_value.3x | 8 +- contrib/ncurses/man/mitem_visible.3x | 6 +- contrib/ncurses/man/ncurses.3x | 185 +- contrib/ncurses/man/new_pair.3x | 8 +- contrib/ncurses/man/resizeterm.3x | 8 +- contrib/ncurses/man/tabs.1 | 4 +- contrib/ncurses/man/term.5 | 124 +- contrib/ncurses/man/terminfo.tail | 6 +- contrib/ncurses/man/tic.1m | 4 +- contrib/ncurses/man/toe.1m | 6 +- contrib/ncurses/man/tput.1 | 8 +- contrib/ncurses/man/user_caps.5 | 19 +- contrib/ncurses/man/wresize.3x | 4 +- contrib/ncurses/menu/Makefile.in | 31 +- contrib/ncurses/menu/m_attribs.c | 6 +- contrib/ncurses/menu/m_cursor.c | 16 +- contrib/ncurses/menu/m_driver.c | 10 +- contrib/ncurses/menu/m_format.c | 10 +- contrib/ncurses/menu/m_global.c | 62 +- contrib/ncurses/menu/m_hook.c | 6 +- contrib/ncurses/menu/m_item_cur.c | 16 +- contrib/ncurses/menu/m_item_nam.c | 10 +- contrib/ncurses/menu/m_item_new.c | 24 +- contrib/ncurses/menu/m_item_opt.c | 18 +- contrib/ncurses/menu/m_item_top.c | 12 +- contrib/ncurses/menu/m_item_use.c | 10 +- contrib/ncurses/menu/m_item_val.c | 10 +- contrib/ncurses/menu/m_item_vis.c | 6 +- contrib/ncurses/menu/m_items.c | 16 +- contrib/ncurses/menu/m_new.c | 19 +- contrib/ncurses/menu/m_opts.c | 20 +- contrib/ncurses/menu/m_pad.c | 12 +- contrib/ncurses/menu/m_pattern.c | 10 +- contrib/ncurses/menu/m_post.c | 22 +- contrib/ncurses/menu/m_req_name.c | 6 +- contrib/ncurses/menu/m_scale.c | 6 +- contrib/ncurses/menu/m_spacing.c | 10 +- contrib/ncurses/menu/m_sub.c | 10 +- contrib/ncurses/menu/m_trace.c | 20 +- contrib/ncurses/menu/m_userptr.c | 10 +- contrib/ncurses/menu/m_win.c | 10 +- contrib/ncurses/menu/menu.h | 330 +- contrib/ncurses/menu/menu.priv.h | 40 +- contrib/ncurses/misc/Makefile.in | 8 +- contrib/ncurses/misc/gen-pkgconfig.in | 58 +- contrib/ncurses/misc/ncurses-config.in | 45 +- contrib/ncurses/misc/terminfo.src | 2071 ++- contrib/ncurses/mk-1st.awk | 36 +- contrib/ncurses/mk-2nd.awk | 11 +- contrib/ncurses/mk-hdr.awk | 11 +- contrib/ncurses/ncurses/Makefile.in | 46 +- contrib/ncurses/ncurses/base/MKlib_gen.sh | 17 +- contrib/ncurses/ncurses/base/lib_addch.c | 18 +- contrib/ncurses/ncurses/base/lib_addstr.c | 10 +- contrib/ncurses/ncurses/base/lib_bkgd.c | 74 +- contrib/ncurses/ncurses/base/lib_color.c | 45 +- contrib/ncurses/ncurses/base/lib_driver.c | 4 +- contrib/ncurses/ncurses/base/lib_getch.c | 74 +- contrib/ncurses/ncurses/base/lib_getstr.c | 3 +- contrib/ncurses/ncurses/base/lib_initscr.c | 9 +- contrib/ncurses/ncurses/base/lib_mouse.c | 62 +- contrib/ncurses/ncurses/base/lib_newterm.c | 13 +- contrib/ncurses/ncurses/base/lib_screen.c | 8 +- contrib/ncurses/ncurses/base/lib_set_term.c | 29 +- contrib/ncurses/ncurses/base/new_pair.c | 27 +- contrib/ncurses/ncurses/base/wresize.c | 12 +- contrib/ncurses/ncurses/curses.priv.h | 79 +- contrib/ncurses/ncurses/llib-lncurses | 283 +- contrib/ncurses/ncurses/llib-lncursest | 283 +- contrib/ncurses/ncurses/llib-lncursestw | 419 +- contrib/ncurses/ncurses/llib-lncursesw | 419 +- contrib/ncurses/ncurses/llib-ltinfo | 17 + contrib/ncurses/ncurses/llib-ltinfot | 17 + contrib/ncurses/ncurses/llib-ltinfotw | 17 + contrib/ncurses/ncurses/llib-ltinfow | 17 + contrib/ncurses/ncurses/modules | 8 +- contrib/ncurses/ncurses/new_pair.h | 5 +- contrib/ncurses/ncurses/report_hashing.c | 73 + contrib/ncurses/ncurses/tinfo/MKcaptab.sh | 0 contrib/ncurses/ncurses/tinfo/MKfallback.sh | 16 +- contrib/ncurses/ncurses/tinfo/access.c | 12 +- contrib/ncurses/ncurses/tinfo/captoinfo.c | 13 +- contrib/ncurses/ncurses/tinfo/comp_parse.c | 4 +- contrib/ncurses/ncurses/tinfo/doalloc.c | 4 +- contrib/ncurses/ncurses/tinfo/lib_baudrate.c | 22 +- contrib/ncurses/ncurses/tinfo/lib_cur_term.c | 7 +- contrib/ncurses/ncurses/tinfo/lib_data.c | 7 +- contrib/ncurses/ncurses/tinfo/lib_kernel.c | 12 +- contrib/ncurses/ncurses/tinfo/lib_napms.c | 4 +- contrib/ncurses/ncurses/tinfo/lib_options.c | 6 +- contrib/ncurses/ncurses/tinfo/lib_print.c | 6 +- contrib/ncurses/ncurses/tinfo/lib_raw.c | 11 +- contrib/ncurses/ncurses/tinfo/lib_setup.c | 29 +- contrib/ncurses/ncurses/tinfo/lib_tgoto.c | 4 +- contrib/ncurses/ncurses/tinfo/lib_tparm.c | 459 +- contrib/ncurses/ncurses/tinfo/lib_tputs.c | 16 +- contrib/ncurses/ncurses/tinfo/lib_ttyflags.c | 6 +- contrib/ncurses/ncurses/tinfo/lib_win32con.c | 1256 ++ contrib/ncurses/ncurses/tinfo/lib_win32util.c | 134 + contrib/ncurses/ncurses/tinfo/parse_entry.c | 10 +- contrib/ncurses/ncurses/tinfo/read_entry.c | 16 +- contrib/ncurses/ncurses/tinfo/tinfo_driver.c | 137 +- contrib/ncurses/ncurses/tinfo/trim_sgr0.c | 4 +- contrib/ncurses/ncurses/tinfo/write_entry.c | 4 +- contrib/ncurses/ncurses/trace/lib_trace.c | 6 +- contrib/ncurses/ncurses/trace/lib_tracebits.c | 42 +- contrib/ncurses/ncurses/tty/hashmap.c | 4 +- contrib/ncurses/ncurses/tty/lib_mvcur.c | 105 +- contrib/ncurses/ncurses/tty/lib_twait.c | 4 +- contrib/ncurses/ncurses/tty/lib_vidattr.c | 22 +- contrib/ncurses/ncurses/tty/tty_update.c | 62 +- contrib/ncurses/ncurses/wcwidth.h | 8 +- contrib/ncurses/ncurses/widechar/lib_cchar.c | 16 +- contrib/ncurses/ncurses/widechar/lib_ins_wch.c | 6 +- contrib/ncurses/ncurses/widechar/lib_vid_attr.c | 23 +- contrib/ncurses/ncurses/widechar/widechars.c | 6 +- contrib/ncurses/ncurses/win32con/gettimeofday.c | 4 +- contrib/ncurses/ncurses/win32con/wcwidth.c | 10 +- contrib/ncurses/ncurses/win32con/win32_driver.c | 1221 ++ contrib/ncurses/ncurses/win32con/win_driver.c | 22 +- contrib/ncurses/panel/Makefile.in | 28 +- contrib/ncurses/panel/llib-lpanel | 3 +- contrib/ncurses/panel/llib-lpanelt | 3 +- contrib/ncurses/panel/llib-lpaneltw | 3 +- contrib/ncurses/panel/llib-lpanelw | 3 +- contrib/ncurses/panel/p_above.c | 6 +- contrib/ncurses/panel/p_below.c | 6 +- contrib/ncurses/panel/p_bottom.c | 6 +- contrib/ncurses/panel/p_delete.c | 17 +- contrib/ncurses/panel/p_hidden.c | 4 +- contrib/ncurses/panel/p_hide.c | 6 +- contrib/ncurses/panel/p_move.c | 4 +- contrib/ncurses/panel/p_new.c | 54 +- contrib/ncurses/panel/p_replace.c | 4 +- contrib/ncurses/panel/p_show.c | 6 +- contrib/ncurses/panel/p_top.c | 4 +- contrib/ncurses/panel/p_update.c | 6 +- contrib/ncurses/panel/p_user.c | 6 +- contrib/ncurses/panel/p_win.c | 4 +- contrib/ncurses/panel/panel.c | 34 +- contrib/ncurses/panel/panel.h | 49 +- contrib/ncurses/panel/panel.priv.h | 22 +- contrib/ncurses/progs/Makefile.in | 24 +- contrib/ncurses/progs/dump_entry.c | 22 +- contrib/ncurses/progs/dump_entry.h | 4 +- contrib/ncurses/progs/infocmp.c | 9 +- contrib/ncurses/progs/progs.priv.h | 20 +- contrib/ncurses/progs/reset_cmd.c | 43 +- contrib/ncurses/progs/tabs.c | 4 +- contrib/ncurses/progs/tic.c | 124 +- contrib/ncurses/progs/tparm_type.c | 30 +- contrib/ncurses/progs/tparm_type.h | 6 +- contrib/ncurses/progs/tput.c | 20 +- contrib/ncurses/progs/tset.c | 15 +- contrib/ncurses/test/back_ground.c | 300 + contrib/ncurses/test/dup_field.c | 394 + contrib/ncurses/test/move_field.c | 524 + contrib/ncurses/test/test_tparm.c | 388 + 345 files changed, 24747 insertions(+), 14861 deletions(-) diff --cc contrib/ncurses/include/curses.events index 000000000000,25a2583fc9b5..25a2583fc9b5 mode 000000,100644..100644 --- a/contrib/ncurses/include/curses.events +++ b/contrib/ncurses/include/curses.events diff --cc contrib/ncurses/include/nc_win32.h index 000000000000,790e8dfe9388..790e8dfe9388 mode 000000,100644..100644 --- a/contrib/ncurses/include/nc_win32.h +++ b/contrib/ncurses/include/nc_win32.h diff --cc contrib/ncurses/include/win32_curses.h index 000000000000,5babf47d214a..5babf47d214a mode 000000,100644..100644 --- a/contrib/ncurses/include/win32_curses.h +++ b/contrib/ncurses/include/win32_curses.h diff --cc contrib/ncurses/ncurses/curses.priv.h index 2846791fbdd6,000000000000..4243373f9a7a mode 100644,000000..100644 --- a/contrib/ncurses/ncurses/curses.priv.h +++ b/contrib/ncurses/ncurses/curses.priv.h @@@ -1,2746 -1,0 +1,2793 @@@ +/**************************************************************************** + * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 1998-2017,2018 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * + ****************************************************************************/ + +/* - * $Id: curses.priv.h,v 1.628 2020/02/02 23:34:34 tom Exp $ ++ * $Id: curses.priv.h,v 1.639 2020/11/14 23:37:54 tom Exp $ + * + * curses.priv.h + * + * Header file for curses library objects which are private to + * the library. + * + */ + +#ifndef CURSES_PRIV_H +#define CURSES_PRIV_H 1 +/* *INDENT-OFF* */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#if USE_RCS_IDS +#define MODULE_ID(id) static const char Ident[] = id; +#else +#define MODULE_ID(id) /*nothing*/ +#endif + +#include /* for offsetof */ +#include +#include +#include +#include + +#if HAVE_UNISTD_H +#include +#endif + - #if HAVE_SYS_BSDTYPES_H && !(defined(_WIN32) || defined(_WIN64)) - #include /* needed for ISC */ - #endif - +#if HAVE_LIMITS_H +# include +#elif HAVE_SYS_PARAM_H +# include +#endif + +#include +#include + +#include + +#if defined __hpux +# ifndef EILSEQ +# define EILSEQ 47 +# endif +#endif + +#ifndef PATH_MAX +# if defined(_POSIX_PATH_MAX) +# define PATH_MAX _POSIX_PATH_MAX +# elif defined(MAXPATHLEN) +# define PATH_MAX MAXPATHLEN +# else +# define PATH_MAX 255 /* the Posix minimum path-size */ +# endif +#endif + +#if DECL_ERRNO +extern int errno; +#endif + ++/* Some Windows related defines */ ++#undef _NC_WINDOWS ++#if (defined(_WIN32) || defined(_WIN64)) ++#define _NC_WINDOWS ++#else ++#undef EXP_WIN32_DRIVER ++#endif ++ ++#undef _NC_MINGW ++#if (defined(__MINGW32__) || defined(__MINGW64__)) ++#define _NC_MINGW ++#endif ++ ++#undef _NC_MSC ++#ifdef _MSC_VER ++#define _NC_MSC ++#endif ++ +/* Some systems have a broken 'select()', but workable 'poll()'. Use that */ +#if HAVE_WORKING_POLL +#define USE_FUNC_POLL 1 +#if HAVE_POLL_H +#include +#else +#include +#endif +#else +#define USE_FUNC_POLL 0 +#endif + +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif + +/* include signal.h before curses.h to work-around defect in glibc 2.1.3 */ +#include + +/* Alessandro Rubini's GPM (general-purpose mouse) */ +#if HAVE_LIBGPM && HAVE_GPM_H +#define USE_GPM_SUPPORT 1 +#else +#define USE_GPM_SUPPORT 0 +#endif + +/* QNX mouse support */ +#if defined(__QNX__) && !defined(__QNXNTO__) +#define USE_QNX_MOUSE 1 +#else +#define USE_QNX_MOUSE 0 +#endif + +/* EMX mouse support */ +#ifdef __EMX__ +#define USE_EMX_MOUSE 1 +#else +#define USE_EMX_MOUSE 0 +#endif + +/* kLIBC keyboard/mouse support */ +#if defined(__OS2__) && defined(__KLIBC__) +#define USE_KLIBC_KBD 1 +#define USE_KLIBC_MOUSE 1 +#else +#define USE_KLIBC_KBD 0 +#define USE_KLIBC_MOUSE 0 +#endif + +#define DEFAULT_MAXCLICK 166 +#define EV_MAX 8 /* size of mouse circular event queue */ + +/* + * If we don't have signals to support it, don't add a sigwinch handler. + * In any case, resizing is an extended feature. Use it if we've got it. + */ +#if !NCURSES_EXT_FUNCS +#undef HAVE_SIZECHANGE +#define HAVE_SIZECHANGE 0 +#endif + +#if HAVE_SIZECHANGE && USE_SIGWINCH && defined(SIGWINCH) +#define USE_SIZECHANGE 1 +#else +#define USE_SIZECHANGE 0 +#undef USE_SIGWINCH +#define USE_SIGWINCH 0 +#endif + +/* + * When building in the MSYS2 environment, the automatic discovery of + * the path separator in configure doesn't work properly. So, if building + * for MinGW, we enforce the correct Windows PATH separator + */ - #ifdef _WIN32 ++#if defined(_NC_WINDOWS) +# ifdef NCURSES_PATHSEP +# undef NCURSES_PATHSEP +# endif +# define NCURSES_PATHSEP ';' +#endif + +/* + * If desired, one can configure this, disabling environment variables that + * point to custom terminfo/termcap locations. + */ +#ifdef USE_ROOT_ENVIRON +#define use_terminfo_vars() 1 +#else +#define use_terminfo_vars() _nc_env_access() +extern NCURSES_EXPORT(int) _nc_env_access (void); +#endif + +/* + * Not all platforms have memmove; some have an equivalent bcopy. (Some may + * have neither). + */ +#if USE_OK_BCOPY +#define memmove(d,s,n) bcopy(s,d,n) +#elif USE_MY_MEMMOVE +#define memmove(d,s,n) _nc_memmove(d,s,n) +extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t); +#endif + +/* + * If we have va_copy(), use it for assigning va_list's. + */ +#if defined(HAVE___VA_COPY) +#define begin_va_copy(dst,src) __va_copy(dst, src) +#define end_va_copy(dst) va_end(dst) +#elif defined(va_copy) || defined(HAVE_VA_COPY) +#define begin_va_copy(dst,src) va_copy(dst, src) +#define end_va_copy(dst) va_end(dst) +#else +#define begin_va_copy(dst,src) (dst) = (src) +#define end_va_copy(dst) /* nothing */ +#endif + +/* + * Either/both S_ISxxx and/or S_IFxxx are defined in sys/types.h; some systems + * lack one or the other. + */ +#ifndef S_ISDIR +#define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) +#endif + +#ifndef S_ISREG +#define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG) +#endif + +/* + * POSIX ignores the "b", which c89 specified. Some very old systems do not + * accept it. + */ +#if USE_FOPEN_BIN_R +#define BIN_R "rb" +#define BIN_W "wb" +#else +#define BIN_R "r" +#define BIN_W "w" +#endif + +/* + * Scroll hints are useless when hashmap is used + */ +#if !USE_SCROLL_HINTS +#if !USE_HASHMAP +#define USE_SCROLL_HINTS 1 +#else +#define USE_SCROLL_HINTS 0 +#endif +#endif + +#if USE_SCROLL_HINTS +#define if_USE_SCROLL_HINTS(stmt) stmt +#else +#define if_USE_SCROLL_HINTS(stmt) /*nothing*/ +#endif + +#include + +/* + * Options for terminal drivers, etc... + */ +#ifdef USE_TERM_DRIVER ++#define NO_TERMINAL "unknown" +#define USE_SP_RIPOFF 1 +#define USE_SP_TERMTYPE 1 +#define USE_SP_WINDOWLIST 1 ++#else ++#define NO_TERMINAL 0 +#endif + ++#define VALID_TERM_ENV(term_env, no_terminal) \ ++ (term_env = (NonEmpty(term_env) \ ++ ? term_env \ ++ : no_terminal), \ ++ NonEmpty(term_env)) ++ +/* + * Note: ht/cbt expansion flakes out randomly under Linux 1.1.47, but only + * when we're throwing control codes at the screen at high volume. To see + * this, re-enable USE_HARD_TABS and run worm for a while. Other systems + * probably don't want to define this either due to uncertainties about tab + * delays and expansion in raw mode. + */ + +#define TRIES struct tries +typedef TRIES { + TRIES *child; /* ptr to child. NULL if none */ + TRIES *sibling; /* ptr to sibling. NULL if none */ + unsigned char ch; /* character at this node */ + unsigned short value; /* code of string so far. 0 if none. */ +#undef TRIES +} TRIES; + +/* + * Common/troublesome character definitions + */ +#define StringOf(ch) {ch, 0} + +#define L_BRACE '{' +#define R_BRACE '}' +#define S_QUOTE '\'' +#define D_QUOTE '"' + +#define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~" + +/* + * Structure for palette tables + */ + +#define MAXCOLUMNS 135 +#define MAXLINES 66 +#define FIFO_SIZE MAXCOLUMNS+2 /* for nocbreak mode input */ + +#define ACS_LEN 128 + +#define WINDOWLIST struct _win_list + +#if USE_WIDEC_SUPPORT +#define _nc_bkgd _bkgrnd +#else +#undef _XOPEN_SOURCE_EXTENDED +#undef _XPG5 +#define _nc_bkgd _bkgd +#define wgetbkgrnd(win, wch) ((*wch = win->_bkgd) != 0 ? OK : ERR) +#define wbkgrnd wbkgd +#endif + +#undef NCURSES_OPAQUE +#define NCURSES_INTERNALS 1 +#define NCURSES_OPAQUE 0 + +#include /* we'll use -Ipath directive to get the right one! */ + ++#if !(defined(NCURSES_WGETCH_EVENTS) && defined(NEED_KEY_EVENT)) ++#undef KEY_EVENT /* reduce compiler-warnings with Visual C++ */ ++#endif ++ +typedef struct +{ + int red, green, blue; /* what color_content() returns */ + int r, g, b; /* params to init_color() */ + int init; /* true if we called init_color() */ +} +color_t; + +typedef union { + struct { + unsigned char red; + unsigned char green; + unsigned char blue; + } bits; /* bits per color-value in RGB */ + unsigned value; +} rgb_bits_t; + +/* + * If curses.h did not expose the SCREEN-functions, then we do not need the + * parameter in the corresponding unextended functions. + */ + +#define USE_SP_FUNC_SUPPORT NCURSES_SP_FUNCS +#define USE_EXT_SP_FUNC_SUPPORT (NCURSES_SP_FUNCS && NCURSES_EXT_FUNCS) + +#if NCURSES_SP_FUNCS +#define SP_PARM sp /* use parameter */ +#define NCURSES_SP_ARG SP_PARM +#define NCURSES_SP_DCL SCREEN *NCURSES_SP_ARG +#define NCURSES_SP_DCL0 NCURSES_SP_DCL +#define NCURSES_SP_ARGx NCURSES_SP_ARG, +#define NCURSES_SP_DCLx SCREEN *NCURSES_SP_ARGx +#else +#define SP_PARM SP /* use global variable */ +#define NCURSES_SP_ARG +#define NCURSES_SP_DCL +#define NCURSES_SP_DCL0 void +#define NCURSES_SP_ARGx +#define NCURSES_SP_DCLx +#endif + +#include + +#include +#include + +#define IsPreScreen(sp) (((sp) != 0) && sp->_prescreen) +#define HasTerminal(sp) (((sp) != 0) && (0 != ((sp)->_term))) +#define IsValidScreen(sp) (HasTerminal(sp) && !IsPreScreen(sp)) + +#if USE_REENTRANT +#define CurTerm _nc_prescreen._cur_term +#else +#define CurTerm cur_term +#endif + +#if NCURSES_SP_FUNCS +#define TerminalOf(sp) ((sp) ? ((sp)->_term ? (sp)->_term : CurTerm) : CurTerm) +#else +#define TerminalOf(sp) CurTerm +#endif + +/* + * The legacy layout for TERMTYPE uses "short" for all of the numbers. Moving + * past that, numeric capabilities can be "int" by using a TERMTYPE2 structure + * in TERMINAL, and doing most of the internal work using TERMTYPE2. There are + * a few places (mostly to expose the legacy layout) where the distinction + * needs attention. + */ +#if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR +#define NCURSES_EXT_NUMBERS 1 +#define NCURSES_INT2 int +#define SIZEOF_INT2 4 +#define TerminalType(tp) (tp)->type2 +#else +#define NCURSES_EXT_NUMBERS 0 +#define NCURSES_INT2 short +#define SIZEOF_INT2 2 +#define TerminalType(tp) (tp)->type +#endif + +#define SIZEOF_SHORT 2 + +#ifdef CUR +#undef CUR +#define CUR TerminalType(cur_term). +#endif + +/* + * Reduce dependency on cur_term global by using terminfo data from SCREEN's + * pointer to this data. + */ +#ifdef USE_SP_TERMTYPE +#undef CUR +#endif + +#define SP_TERMTYPE TerminalType(TerminalOf(sp)). + +#include + +#include + +/* + * Simplify ifdef's for the "*_ATTR" macros in case italics are not configured. + */ +#if defined(A_ITALIC) && defined(exit_italics_mode) +#define USE_ITALIC 1 +#else +#define USE_ITALIC 0 +#undef A_ITALIC +#define A_ITALIC 0 +#endif + +/* + * Use these macros internally, to make tracing less verbose. But leave the + * option for compiling the tracing into the library. + */ +#if 1 +#define ColorPair(n) (NCURSES_BITS(n, 0) & A_COLOR) +#define PairNumber(a) (NCURSES_CAST(int,(((unsigned long)(a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) +#else +#define ColorPair(pair) COLOR_PAIR(pair) +#define PairNumber(attr) PAIR_NUMBER(attr) +#endif + +#define unColor(n) unColor2(AttrOf(n)) +#define unColor2(a) ((a) & ALL_BUT_COLOR) + +/* + * Extended-colors stores the color pair in a separate struct-member than the + * attributes. But for compatibility, we handle most cases where a program + * written for non-extended colors stores the color in the attributes by + * checking for a color pair in both places. + */ +#if NCURSES_EXT_COLORS +#define if_EXT_COLORS(stmt) stmt +#define SetPair(value,p) SetPair2((value).ext_color, AttrOf(value), p) +#define SetPair2(c,a,p) c = (p), \ + a = (unColor2(a) | ColorPair(oldColor(c))) +#define GetPair(value) GetPair2((value).ext_color, AttrOf(value)) +#define GetPair2(c,a) ((c) ? (c) : PairNumber(a)) +#define oldColor(p) (((p) > 255) ? 255 : (p)) +#define GET_WINDOW_PAIR(w) GetPair2((w)->_color, (w)->_attrs) +#define SET_WINDOW_PAIR(w,p) (w)->_color = (p) +#define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b)) + +#define VIDPUTS(sp,attr,pair) do { \ + int vid_pair = pair; \ + NCURSES_SP_NAME(vid_puts)( \ + NCURSES_SP_ARGx attr, \ + (NCURSES_PAIRS_T) pair, \ + &vid_pair, \ + NCURSES_OUTC_FUNC); \ + } while (0) + +#else /* !NCURSES_EXT_COLORS */ + +#define if_EXT_COLORS(stmt) /* nothing */ +#define SetPair(value,p) RemAttr(value, A_COLOR), \ + SetAttr(value, AttrOf(value) | ColorPair(p)) +#define GetPair(value) PairNumber(AttrOf(value)) +#define GET_WINDOW_PAIR(w) PairNumber(WINDOW_ATTRS(w)) +#define SET_WINDOW_PAIR(w,p) WINDOW_ATTRS(w) &= ALL_BUT_COLOR, \ + WINDOW_ATTRS(w) |= ColorPair(p) +#define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b)) + +#define VIDPUTS(sp,attr,pair) NCURSES_SP_NAME(vidputs)(NCURSES_SP_ARGx attr, NCURSES_OUTC_FUNC) + +#endif /* NCURSES_EXT_COLORS */ + +#define NCURSES_OUTC_FUNC NCURSES_SP_NAME(_nc_outch) +#define NCURSES_PUTP2(name,value) NCURSES_SP_NAME(_nc_putp)(NCURSES_SP_ARGx name, value) +#define NCURSES_PUTP2_FLUSH(name,value) NCURSES_SP_NAME(_nc_putp_flush)(NCURSES_SP_ARGx name, value) + +#if NCURSES_NO_PADDING +#define GetNoPadding(sp) ((sp) ? (sp)->_no_padding : _nc_prescreen._no_padding) +#define SetNoPadding(sp) _nc_set_no_padding(sp) +extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *); +#else +#define GetNoPadding(sp) FALSE +#define SetNoPadding(sp) /*nothing*/ +#endif + +#define WINDOW_ATTRS(w) ((w)->_attrs) + +#define SCREEN_ATTRS(s) (*((s)->_current_attr)) +#define GET_SCREEN_PAIR(s) GetPair(SCREEN_ATTRS(s)) +#define SET_SCREEN_PAIR(s,p) SetPair(SCREEN_ATTRS(s), p) + +#if USE_REENTRANT || NCURSES_SP_FUNCS +NCURSES_EXPORT(int *) _nc_ptr_Lines (SCREEN *); +NCURSES_EXPORT(int *) _nc_ptr_Cols (SCREEN *); +NCURSES_EXPORT(int *) _nc_ptr_Tabsize (SCREEN *); +NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *); +#endif + +#if USE_REENTRANT + +#define ptrLines(sp) (sp ? &(sp->_LINES) : &(_nc_prescreen._LINES)) +#define ptrCols(sp) (sp ? &(sp->_COLS) : &(_nc_prescreen._COLS)) +#define ptrTabsize(sp) (sp ? &(sp->_TABSIZE) : &(_nc_prescreen._TABSIZE)) +#define ptrEscdelay(sp) (sp ? &(sp->_ESCDELAY) : &(_nc_prescreen._ESCDELAY)) + +#define SET_LINES(value) *_nc_ptr_Lines(SP_PARM) = value +#define SET_COLS(value) *_nc_ptr_Cols(SP_PARM) = value +#define SET_TABSIZE(value) *_nc_ptr_Tabsize(SP_PARM) = value +#define SET_ESCDELAY(value) *_nc_ptr_Escdelay(SP_PARM) = value + +#else + +#define ptrLines(sp) &LINES +#define ptrCols(sp) &COLS +#define ptrTabsize(sp) &TABSIZE +#define ptrEscdelay(sp) &ESCDELAY + +#define SET_LINES(value) LINES = value +#define SET_COLS(value) COLS = value +#define SET_TABSIZE(value) TABSIZE = value +#define SET_ESCDELAY(value) ESCDELAY = value + +#endif + +#define HasHardTabs() (NonEmpty(clear_all_tabs) && NonEmpty(set_tab)) + +#define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \ + __FILE__, __LINE__, \ + (unsigned long) (pthread_self()), \ + data.__data.__lock, \ + data.__data.__count, \ + data.__data.__owner, \ + data.__data.__kind, \ + (data.__data.__nusers > 5) ? " OOPS " : "", \ + data.__data.__nusers) +#define TR_GLOBAL_MUTEX(name) TR_MUTEX(_nc_globals.mutex_##name) *** 2248 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:30: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 EA90A56BE79; Thu, 25 Feb 2021 18:30: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 4DmhCw01whz58rT; Thu, 25 Feb 2021 18: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 D0B6F1C42C; Thu, 25 Feb 2021 18: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 11PIU3BC083564; Thu, 25 Feb 2021 18: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 11PIU3tq083561; Thu, 25 Feb 2021 18:30:03 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:30:03 GMT Message-Id: <202102251830.11PIU3tq083561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 304bc766050d - main - ncurses: update configuration header after update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 304bc766050d1ad0ca1e5e95835babab17494cbd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:30:05 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=304bc766050d1ad0ca1e5e95835babab17494cbd commit 304bc766050d1ad0ca1e5e95835babab17494cbd Author: Baptiste Daroussin AuthorDate: 2021-02-25 18:28:31 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 18:28:31 +0000 ncurses: update configuration header after update --- lib/ncurses/ncurses/ncurses_cfg.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ncurses/ncurses/ncurses_cfg.h b/lib/ncurses/ncurses/ncurses_cfg.h index 49cef464b803..ca4ce6b5f32a 100644 --- a/lib/ncurses/ncurses/ncurses_cfg.h +++ b/lib/ncurses/ncurses/ncurses_cfg.h @@ -1,6 +1,7 @@ /* include/ncurses_cfg.h. Generated automatically by configure. */ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +32,7 @@ * Author: Thomas E. Dickey 1997-on * ****************************************************************************/ /* - * $Id: ncurses_cfg.hin,v 1.11 2017/12/09 20:41:54 tom Exp $ + * $Id: ncurses_cfg.hin,v 1.13 2020/03/08 12:37:59 tom Exp $ * * Both ncurses_cfg.h and ncurses_def.h are internal header-files used when * building ncurses. @@ -43,7 +44,7 @@ * 971222) to autoconf 2.12 or 2.13 to do this. * * See: - * http://invisible-island.net/autoconf/ + * https://invisible-island.net/autoconf/ * ftp://ftp.invisible-island.net/autoconf/ */ @@ -52,6 +53,9 @@ #ifndef NC_CONFIG_H #define NC_CONFIG_H +#define PACKAGE "ncurses" +#define NCURSES_VERSION "6.2" +#define NCURSES_PATCHDATE 20210220 #define SYSTEM_NAME "FreeBSD" #if 0 #include @@ -224,7 +228,7 @@ #define HAVE_FORM_H 1 #define HAVE_LIBFORM 1 #define NCURSES_PATHSEP ':' -#define NCURSES_VERSION_STRING "6.2.20200215" +#define NCURSES_VERSION_STRING "6.2.20210220" #define NCURSES_OSPEED_COMPAT 1 #define HAVE_CURSES_DATA_BOOLNAMES 1 From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:42: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 4268856C642; Thu, 25 Feb 2021 18:42: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 4DmhVf1TWxz3D83; Thu, 25 Feb 2021 18:42: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 259111C88F; Thu, 25 Feb 2021 18:42: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 11PIgo6W006953; Thu, 25 Feb 2021 18:42:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIgoCb006952; Thu, 25 Feb 2021 18:42:50 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:42:50 GMT Message-Id: <202102251842.11PIgoCb006952@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: f848d08e4528 - main - camcontrol: stop pretending cam_cmd is a bitmask 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: f848d08e4528a823aaf79dce173ae87e39f7ee3c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:42:50 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f848d08e4528a823aaf79dce173ae87e39f7ee3c commit f848d08e4528a823aaf79dce173ae87e39f7ee3c Author: Edward Tomasz Napierala AuthorDate: 2021-02-25 18:39:22 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-25 18:40:07 +0000 camcontrol: stop pretending cam_cmd is a bitmask Cleanup only, no functional changes. Reviewed By: imp Sponsored By: NetApp, Inc. Sponsored By: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27813 --- sbin/camcontrol/camcontrol.c | 94 ++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 27d545d924b3..748f54c9ce55 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -66,52 +66,52 @@ __FBSDID("$FreeBSD$"); #endif typedef enum { - CAM_CMD_NONE = 0x00000000, - CAM_CMD_DEVLIST = 0x00000001, - CAM_CMD_TUR = 0x00000002, - CAM_CMD_INQUIRY = 0x00000003, - CAM_CMD_STARTSTOP = 0x00000004, - CAM_CMD_RESCAN = 0x00000005, - CAM_CMD_READ_DEFECTS = 0x00000006, - CAM_CMD_MODE_PAGE = 0x00000007, - CAM_CMD_SCSI_CMD = 0x00000008, - CAM_CMD_DEVTREE = 0x00000009, - CAM_CMD_USAGE = 0x0000000a, - CAM_CMD_DEBUG = 0x0000000b, - CAM_CMD_RESET = 0x0000000c, - CAM_CMD_FORMAT = 0x0000000d, - CAM_CMD_TAG = 0x0000000e, - CAM_CMD_RATE = 0x0000000f, - CAM_CMD_DETACH = 0x00000010, - CAM_CMD_REPORTLUNS = 0x00000011, - CAM_CMD_READCAP = 0x00000012, - CAM_CMD_IDENTIFY = 0x00000013, - CAM_CMD_IDLE = 0x00000014, - CAM_CMD_STANDBY = 0x00000015, - CAM_CMD_SLEEP = 0x00000016, - CAM_CMD_SMP_CMD = 0x00000017, - CAM_CMD_SMP_RG = 0x00000018, - CAM_CMD_SMP_PC = 0x00000019, - CAM_CMD_SMP_PHYLIST = 0x0000001a, - CAM_CMD_SMP_MANINFO = 0x0000001b, - CAM_CMD_DOWNLOAD_FW = 0x0000001c, - CAM_CMD_SECURITY = 0x0000001d, - CAM_CMD_HPA = 0x0000001e, - CAM_CMD_SANITIZE = 0x0000001f, - CAM_CMD_PERSIST = 0x00000020, - CAM_CMD_APM = 0x00000021, - CAM_CMD_AAM = 0x00000022, - CAM_CMD_ATTRIB = 0x00000023, - CAM_CMD_OPCODES = 0x00000024, - CAM_CMD_REPROBE = 0x00000025, - CAM_CMD_ZONE = 0x00000026, - CAM_CMD_EPC = 0x00000027, - CAM_CMD_TIMESTAMP = 0x00000028, - CAM_CMD_MMCSD_CMD = 0x00000029, - CAM_CMD_POWER_MODE = 0x0000002a, - CAM_CMD_DEVTYPE = 0x0000002b, - CAM_CMD_AMA = 0x0000002c, -} cam_cmdmask; + CAM_CMD_NONE, + CAM_CMD_DEVLIST, + CAM_CMD_TUR, + CAM_CMD_INQUIRY, + CAM_CMD_STARTSTOP, + CAM_CMD_RESCAN, + CAM_CMD_READ_DEFECTS, + CAM_CMD_MODE_PAGE, + CAM_CMD_SCSI_CMD, + CAM_CMD_DEVTREE, + CAM_CMD_USAGE, + CAM_CMD_DEBUG, + CAM_CMD_RESET, + CAM_CMD_FORMAT, + CAM_CMD_TAG, + CAM_CMD_RATE, + CAM_CMD_DETACH, + CAM_CMD_REPORTLUNS, + CAM_CMD_READCAP, + CAM_CMD_IDENTIFY, + CAM_CMD_IDLE, + CAM_CMD_STANDBY, + CAM_CMD_SLEEP, + CAM_CMD_SMP_CMD, + CAM_CMD_SMP_RG, + CAM_CMD_SMP_PC, + CAM_CMD_SMP_PHYLIST, + CAM_CMD_SMP_MANINFO, + CAM_CMD_DOWNLOAD_FW, + CAM_CMD_SECURITY, + CAM_CMD_HPA, + CAM_CMD_SANITIZE, + CAM_CMD_PERSIST, + CAM_CMD_APM, + CAM_CMD_AAM, + CAM_CMD_ATTRIB, + CAM_CMD_OPCODES, + CAM_CMD_REPROBE, + CAM_CMD_ZONE, + CAM_CMD_EPC, + CAM_CMD_TIMESTAMP, + CAM_CMD_MMCSD_CMD, + CAM_CMD_POWER_MODE, + CAM_CMD_DEVTYPE, + CAM_CMD_AMA, +} cam_cmd; typedef enum { CAM_ARG_NONE = 0x00000000, @@ -248,7 +248,6 @@ struct cam_devlist { path_id_t path_id; }; -static cam_cmdmask cmdlist; static cam_argmask arglist; static const char *devtype_names[] = { @@ -10285,6 +10284,7 @@ main(int argc, char **argv) int error = 0, optstart = 2; int task_attr = MSG_SIMPLE_Q_TAG; int devopen = 1; + cam_cmd cmdlist; path_id_t bus; target_id_t target; lun_id_t lun; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:46: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 8E66956CC80; Thu, 25 Feb 2021 18:46: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 4DmhZy3c3wz3DP5; Thu, 25 Feb 2021 18:46: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 6AA461C9D7; Thu, 25 Feb 2021 18:46: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 11PIkYde007736; Thu, 25 Feb 2021 18:46:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIkY1Q007735; Thu, 25 Feb 2021 18:46:34 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:46:34 GMT Message-Id: <202102251846.11PIkY1Q007735@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: 22267215d66d - main - camcontrol(8): remove unnecessary CCB zeroing 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: 22267215d66d9bd490ad1a12221472028e3174f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:46:34 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=22267215d66d9bd490ad1a12221472028e3174f4 commit 22267215d66d9bd490ad1a12221472028e3174f4 Author: Edward Tomasz Napierala AuthorDate: 2021-02-24 23:00:25 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-25 18:45:21 +0000 camcontrol(8): remove unnecessary CCB zeroing After 3e404b8c53d, cam_getccb(3) clears the returned CCB, making a number of calls to CCB_CLEAR_ALL_EXCEPT_HDR(3) unnecessary. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27812 --- sbin/camcontrol/attrib.c | 2 -- sbin/camcontrol/camcontrol.c | 45 -------------------------------------------- sbin/camcontrol/epc.c | 2 -- sbin/camcontrol/fwdownload.c | 7 ------- sbin/camcontrol/persist.c | 2 -- sbin/camcontrol/zone.c | 2 -- 6 files changed, 60 deletions(-) diff --git a/sbin/camcontrol/attrib.c b/sbin/camcontrol/attrib.c index 52fd4be41060..05cabb1b8145 100644 --- a/sbin/camcontrol/attrib.c +++ b/sbin/camcontrol/attrib.c @@ -138,8 +138,6 @@ scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt, goto bailout; } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - STAILQ_INIT(&write_attr_list); /* diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 748f54c9ce55..69939715898e 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -1021,9 +1021,6 @@ scsiinquiry(struct cam_device *device, int task_attr, int retry_count, return (1); } - /* cam_getccb cleans up the header, caller has to zero the payload */ - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - inq_buf = (struct scsi_inquiry_data *)malloc( sizeof(struct scsi_inquiry_data)); @@ -1131,9 +1128,6 @@ scsiserial(struct cam_device *device, int task_attr, int retry_count, return (1); } - /* cam_getccb cleans up the header, caller has to zero the payload */ - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - serial_buf = (struct scsi_vpd_unit_serial_number *) malloc(sizeof(*serial_buf)); @@ -1218,8 +1212,6 @@ camxferrate(struct cam_device *device) return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); - ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; ccb->cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -4480,8 +4472,6 @@ mode_select(struct cam_device *device, int cdb_len, int save_pages, if (ccb == NULL) errx(1, "mode_select: couldn't allocate CCB"); - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - scsi_mode_select_len(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, @@ -4620,8 +4610,6 @@ scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(ccb); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { case 'a': @@ -5106,7 +5094,6 @@ tagcontrol(struct cam_device *device, int argc, char **argv, cam_path_string(device, pathstr, sizeof(pathstr)); if (numtags >= 0) { - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->crs); ccb->ccb_h.func_code = XPT_REL_SIMQ; ccb->ccb_h.flags = CAM_DEV_QFREEZE; ccb->crs.release_flags = RELSIM_ADJUST_OPENINGS; @@ -5350,7 +5337,6 @@ get_cpi(struct cam_device *device, struct ccb_pathinq *cpi) warnx("get_cpi: couldn't allocate CCB"); return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); ccb->ccb_h.func_code = XPT_PATH_INQ; if (cam_send_ccb(device, ccb) < 0) { warn("get_cpi: error sending Path Inquiry CCB"); @@ -5385,7 +5371,6 @@ get_cgd(struct cam_device *device, struct ccb_getdev *cgd) warnx("get_cgd: couldn't allocate CCB"); return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); ccb->ccb_h.func_code = XPT_GDEV_TYPE; if (cam_send_ccb(device, ccb) < 0) { warn("get_cgd: error sending Get type information CCB"); @@ -5426,9 +5411,6 @@ dev_has_vpd_page(struct cam_device *dev, uint8_t page_id, int retry_count, goto bailout; } - /* cam_getccb cleans up the header, caller has to zero the payload */ - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - bzero(&sup_pages, sizeof(sup_pages)); scsi_inquiry(&ccb->csio, @@ -5963,8 +5945,6 @@ get_print_cts(struct cam_device *device, int user_settings, int quiet, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); - ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; if (user_settings == 0) @@ -6107,7 +6087,6 @@ ratecontrol(struct cam_device *device, int task_attr, int retry_count, */ if ((retval = get_cpi(device, &cpi)) != 0) goto ratecontrol_bailout; - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); if (quiet == 0) { fprintf(stdout, "%s parameters:\n", user_settings ? "User" : "Current"); @@ -6356,8 +6335,6 @@ scsiformat(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { case 'q': @@ -6851,8 +6828,6 @@ sanitize(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { case 'a': @@ -7209,8 +7184,6 @@ scsireportluns(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - countonly = 0; lunsonly = 0; @@ -7453,8 +7426,6 @@ scsireadcapacity(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'b': @@ -7654,8 +7625,6 @@ smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'R': @@ -8203,8 +8172,6 @@ smpreportgeneral(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'l': @@ -8347,8 +8314,6 @@ smpphycontrol(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'a': @@ -8604,8 +8569,6 @@ smpmaninfo(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'l': @@ -8698,8 +8661,6 @@ getdevid(struct cam_devitem *item) goto bailout; } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cdai); - /* * On the first try, we just probe for the size of the data, and * then allocate that much memory and try again. @@ -8983,7 +8944,6 @@ smpphylist(struct cam_device *device, int argc, char **argv, return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->smpio); STAILQ_INIT(&devlist.dev_queue); rgrequest = malloc(sizeof(*rgrequest)); @@ -9448,9 +9408,6 @@ scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, goto bailout; } - /* cam_getccb cleans up the header, caller has to zero the payload */ - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - if (opcode_set != 0) { options |= RSO_OPTIONS_OC; num_opcodes = 1; @@ -9888,8 +9845,6 @@ reprobe(struct cam_device *device) return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(ccb); - ccb->ccb_h.func_code = XPT_REPROBE_LUN; if (cam_send_ccb(device, ccb) < 0) { diff --git a/sbin/camcontrol/epc.c b/sbin/camcontrol/epc.c index 8b42f63c7523..f96ca6e68ba9 100644 --- a/sbin/camcontrol/epc.c +++ b/sbin/camcontrol/epc.c @@ -633,8 +633,6 @@ epc(struct cam_device *device, int argc, char **argv, char *combinedopt, goto bailout; } - CCB_CLEAR_ALL_EXCEPT_HDR(ccb); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'c': { diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c index 87aef6d3c240..dc97b3a221db 100644 --- a/sbin/camcontrol/fwdownload.c +++ b/sbin/camcontrol/fwdownload.c @@ -465,9 +465,6 @@ fw_validate_ibm(struct cam_device *dev, int retry_count, int timeout, int fd, goto bailout; } - /* cam_getccb cleans up the header, caller has to zero the payload */ - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - bzero(&vpd_page, sizeof(vpd_page)); scsi_inquiry(&ccb->csio, @@ -671,8 +668,6 @@ fw_check_device_ready(struct cam_device *dev, camcontrol_devtype devtype, goto bailout; } - CCB_CLEAR_ALL_EXCEPT_HDR(ccb); - if (devtype != CC_DT_SCSI) { dxfer_len = sizeof(struct ata_params); @@ -802,8 +797,6 @@ fw_download_img(struct cam_device *cam_dev, struct fw_vendor *vp, goto bailout; } - CCB_CLEAR_ALL_EXCEPT_HDR(ccb); - max_pkt_size = vp->max_pkt_size; if (max_pkt_size == 0) max_pkt_size = UNKNOWN_MAX_PKT_SIZE; diff --git a/sbin/camcontrol/persist.c b/sbin/camcontrol/persist.c index ce4de9f8feb1..f7ef30e06ede 100644 --- a/sbin/camcontrol/persist.c +++ b/sbin/camcontrol/persist.c @@ -453,8 +453,6 @@ scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt, goto bailout; } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'a': diff --git a/sbin/camcontrol/zone.c b/sbin/camcontrol/zone.c index 130f53226f57..3f7dfcec4f35 100644 --- a/sbin/camcontrol/zone.c +++ b/sbin/camcontrol/zone.c @@ -347,8 +347,6 @@ zone(struct cam_device *device, int argc, char **argv, char *combinedopt, goto bailout; } - CCB_CLEAR_ALL_EXCEPT_HDR(ccb); - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'a': From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18: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 6F7F656CA7F; Thu, 25 Feb 2021 18: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 4Dmhp42lC6z3Dy4; Thu, 25 Feb 2021 18: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 513D21CB15; Thu, 25 Feb 2021 18: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 11PIuCsw020720; Thu, 25 Feb 2021 18: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 11PIuCl7020719; Thu, 25 Feb 2021 18:56:12 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:56:12 GMT Message-Id: <202102251856.11PIuCl7020719@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: cf9829d98dc7 - stable/13 - automount(8): fix absolute path when creating a mountpoint 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: cf9829d98dc771f9ca0696e493dc3bb635999536 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:56:12 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=cf9829d98dc771f9ca0696e493dc3bb635999536 commit cf9829d98dc771f9ca0696e493dc3bb635999536 Author: Robert Wing AuthorDate: 2021-02-17 09:22:23 +0000 Commit: Robert Wing CommitDate: 2021-02-25 18:53:02 +0000 automount(8): fix absolute path when creating a mountpoint When executing automount(8), it will attempt to create the directory where an autofs filesystem is to be mounted. Explicity set the root path for this directory to "/". This fixes the issue where the directory being created was being treated as a relative path instead of an absolute path (as expected). PR: 224601 Reported by: kusumi.tomohiro@gmail.com Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D27832 (cherry picked from commit 63640b2f552c0476f50484635eb9888eafcd22dc) --- usr.sbin/autofs/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c index a6ed90909ec9..7c8df4205a86 100644 --- a/usr.sbin/autofs/common.c +++ b/usr.sbin/autofs/common.c @@ -140,7 +140,7 @@ create_directory(const char *path) */ copy = tofree = checked_strdup(path + 1); - partial = checked_strdup(""); + partial = checked_strdup("/"); for (;;) { component = strsep(©, "/"); if (component == NULL) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:56: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 DDDF056D110; Thu, 25 Feb 2021 18:56: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 4Dmhpz60s0z3FTF; Thu, 25 Feb 2021 18:56: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 C18A01CC13; Thu, 25 Feb 2021 18:56: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 11PIuxW5020949; Thu, 25 Feb 2021 18:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIuxwF020948; Thu, 25 Feb 2021 18:56:59 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:56:59 GMT Message-Id: <202102251856.11PIuxwF020948@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: e7a5b3bd0589 - main - Modify lock_delay() to increase the delay time after spinning 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: e7a5b3bd058975ff3ffa346664690e54c641fc0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:56:59 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=e7a5b3bd058975ff3ffa346664690e54c641fc0f commit e7a5b3bd058975ff3ffa346664690e54c641fc0f Author: Edward Tomasz Napierala AuthorDate: 2021-02-25 18:48:50 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-25 18:55:26 +0000 Modify lock_delay() to increase the delay time after spinning Modify lock_delay() to increase the delay time after spinning, not before. Previously we would spin at least twice instead of once. In NetApp's benchmarks this fixes a performance regression compared to FreeBSD 10, which called cpu_spinwait() directly. Reviewed By: mjg Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27331 --- sys/kern/subr_lock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c index a74f7e62db4a..8b08c61715b3 100644 --- a/sys/kern/subr_lock.c +++ b/sys/kern/subr_lock.c @@ -128,10 +128,6 @@ lock_delay(struct lock_delay_arg *la) struct lock_delay_config *lc = la->config; u_short i; - la->delay <<= 1; - if (__predict_false(la->delay > lc->max)) - la->delay = lc->max; - for (i = la->delay; i > 0; i--) cpu_spinwait(); @@ -141,6 +137,10 @@ lock_delay(struct lock_delay_arg *la) if (restrict_starvation) la->delay = lc->base; } + + la->delay <<= 1; + if (__predict_false(la->delay > lc->max)) + la->delay = lc->max; } static u_int From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:58: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 83C6D56CECF; Thu, 25 Feb 2021 18:58: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 4Dmhrx3JqDz3FZR; Thu, 25 Feb 2021 18:58: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 647421CD17; Thu, 25 Feb 2021 18:58: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 11PIwfRo021334; Thu, 25 Feb 2021 18:58:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIwfOY021333; Thu, 25 Feb 2021 18:58:41 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:58:41 GMT Message-Id: <202102251858.11PIwfOY021333@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: d9e70f5d97c6 - stable/12 - automount(8): fix absolute path when creating a mountpoint 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: d9e70f5d97c63ae5dba93e9b026d1cfa1b1a4759 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:58:41 -0000 The branch stable/12 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=d9e70f5d97c63ae5dba93e9b026d1cfa1b1a4759 commit d9e70f5d97c63ae5dba93e9b026d1cfa1b1a4759 Author: Robert Wing AuthorDate: 2021-02-17 09:22:23 +0000 Commit: Robert Wing CommitDate: 2021-02-25 18:57:37 +0000 automount(8): fix absolute path when creating a mountpoint When executing automount(8), it will attempt to create the directory where an autofs filesystem is to be mounted. Explicity set the root path for this directory to "/". This fixes the issue where the directory being created was being treated as a relative path instead of an absolute path (as expected). PR: 224601 Reported by: kusumi.tomohiro@gmail.com Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D27832 (cherry picked from commit 63640b2f552c0476f50484635eb9888eafcd22dc) --- usr.sbin/autofs/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c index 65b8737bcff4..b99583652d95 100644 --- a/usr.sbin/autofs/common.c +++ b/usr.sbin/autofs/common.c @@ -141,7 +141,7 @@ create_directory(const char *path) */ copy = tofree = checked_strdup(path + 1); - partial = checked_strdup(""); + partial = checked_strdup("/"); for (;;) { component = strsep(©, "/"); if (component == NULL) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 18:58: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 6B81056D1A1; Thu, 25 Feb 2021 18:58: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 4Dmhs072Lfz3Fvt; Thu, 25 Feb 2021 18:58: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 E0CC01CB17; Thu, 25 Feb 2021 18:58: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 11PIwi0l021453; Thu, 25 Feb 2021 18:58:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PIwiP5021452; Thu, 25 Feb 2021 18:58:44 GMT (envelope-from git) Date: Thu, 25 Feb 2021 18:58:44 GMT Message-Id: <202102251858.11PIwiP5021452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: b7109c3cfd28 - main - libifconfig: Add missing symbols to map MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7109c3cfd28559dbb280d640c47ceba192108cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 18:58:45 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=b7109c3cfd28559dbb280d640c47ceba192108cc commit b7109c3cfd28559dbb280d640c47ceba192108cc Author: Ryan Moeller AuthorDate: 2021-02-25 18:54:16 +0000 Commit: Ryan Moeller CommitDate: 2021-02-25 18:58:33 +0000 libifconfig: Add missing symbols to map Regenerate the list of generated symbols for libifconfig: ``` grep -hr ^ifconfig_sfp_ /usr/obj/usr/src/amd64.amd64/lib/libifconfig \ | sed 's/(.*/;/' | sort -u ``` Spotted by build failures caused by a missing symbol while working on upgrading libifconfig from internal to private. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D28927 --- lib/libifconfig/Symbol.map | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/libifconfig/Symbol.map b/lib/libifconfig/Symbol.map index fd147554f085..4f82c8185d0b 100644 --- a/lib/libifconfig/Symbol.map +++ b/lib/libifconfig/Symbol.map @@ -59,16 +59,24 @@ FBSD_1.6 { ifconfig_sfp_cab_tech_symbol; ifconfig_sfp_conn_description; ifconfig_sfp_conn_symbol; - ifconfig_sfp_eth_10g_description; - ifconfig_sfp_eth_10g_symbol; ifconfig_sfp_eth_1040g_description; ifconfig_sfp_eth_1040g_symbol; + ifconfig_sfp_eth_10g_description; + ifconfig_sfp_eth_10g_symbol; ifconfig_sfp_eth_description; - ifconfig_sfp_eth_symbol; ifconfig_sfp_eth_ext_description; ifconfig_sfp_eth_ext_symbol; + ifconfig_sfp_eth_symbol; + ifconfig_sfp_fc_len_description; + ifconfig_sfp_fc_len_symbol; + ifconfig_sfp_fc_media_description; + ifconfig_sfp_fc_media_symbol; ifconfig_sfp_fc_speed_description; ifconfig_sfp_fc_speed_symbol; + ifconfig_sfp_id_description; + ifconfig_sfp_id_display; + ifconfig_sfp_id_is_qsfp; + ifconfig_sfp_id_symbol; ifconfig_sfp_rev_description; ifconfig_sfp_rev_symbol; }; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 19:19: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 4960056DB9C; Thu, 25 Feb 2021 19:19: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 4DmjJV1hY8z3HJ8; Thu, 25 Feb 2021 19:19: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 2CB531C87E; Thu, 25 Feb 2021 19:19: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 11PJJ6Z0048723; Thu, 25 Feb 2021 19:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PJJ6Ru048722; Thu, 25 Feb 2021 19:19:06 GMT (envelope-from git) Date: Thu, 25 Feb 2021 19:19:06 GMT Message-Id: <202102251919.11PJJ6Ru048722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: 2ae79aa362e7 - main - Install links for zpool feature compat aliases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ae79aa362e7a2ee72657b39be64f1390158aaf6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 19:19:06 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=2ae79aa362e7a2ee72657b39be64f1390158aaf6 commit 2ae79aa362e7a2ee72657b39be64f1390158aaf6 Author: Ryan Moeller AuthorDate: 2021-02-25 19:16:09 +0000 Commit: Ryan Moeller CommitDate: 2021-02-25 19:16:09 +0000 Install links for zpool feature compat aliases The alias links were missed when this feature was introduced to the FreeBSD build system in 10f57cb98fd61b2669640a84aa73ad118601f281. Reviewed by: mm MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D28925 --- cddl/share/zfs/compatibility.d/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cddl/share/zfs/compatibility.d/Makefile b/cddl/share/zfs/compatibility.d/Makefile index 6531430ef050..8bc18bcd6391 100644 --- a/cddl/share/zfs/compatibility.d/Makefile +++ b/cddl/share/zfs/compatibility.d/Makefile @@ -25,4 +25,25 @@ FILES= \ 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 From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:07: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 E0EA856E8DD; Thu, 25 Feb 2021 20:07: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 4DmkNM63jrz3Kdr; Thu, 25 Feb 2021 20:07: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 C2F5A1DA2A; Thu, 25 Feb 2021 20:07: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 11PK7VjZ014318; Thu, 25 Feb 2021 20:07:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PK7Vld014317; Thu, 25 Feb 2021 20:07:31 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:07:31 GMT Message-Id: <202102252007.11PK7Vld014317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: f1ab799927c8 - main - rc: fix rc script parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1ab799927c8e93e8f58e5039f287a2ca45675ec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:07:31 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f1ab799927c8e93e8f58e5039f287a2ca45675ec commit f1ab799927c8e93e8f58e5039f287a2ca45675ec Author: Cy Schubert AuthorDate: 2021-02-25 19:04:50 +0000 Commit: Cy Schubert CommitDate: 2021-02-25 19:47:56 +0000 rc: fix rc script parsing 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 introduced a bug whereby rc scripts in etc/rc.d and $local_startup failed to parse output from called commands because IFS was set to " " instead of the default " \t\n". This caused parsing of output that contains any whitespace character, such as tabs and newlines, not matching just a space to fail. PR: 249192 MFC after: 3 weeks X-MFC with: 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 --- libexec/rc/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index b5bc188fc7c0..92eb5c48aab7 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -105,7 +105,7 @@ files=`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/* 2>/dev/null _rc_elem_done=' ' IFS=$'\n' for _rc_group in ${files}; do - IFS=$' ' + unset IFS for _rc_elem in ${_rc_group}; do run_rc_script ${_rc_elem} ${_boot} & _rc_elem_done="${_rc_elem_done}${_rc_elem} " @@ -138,7 +138,7 @@ fi files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_rc_parallel} 2>/dev/null` IFS=$'\n' for _rc_group in ${files}; do - IFS=$' ' + unset IFS for _rc_elem in ${_rc_group}; do case "$_rc_elem_done" in *" $_rc_elem "*) continue ;; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:28: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 B376156F093; Thu, 25 Feb 2021 20:28: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 4Dmks54kMwz3Ly4; Thu, 25 Feb 2021 20:28: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 950E71DED7; Thu, 25 Feb 2021 20:28: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 11PKSveG040952; Thu, 25 Feb 2021 20:28:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKSvQL040951; Thu, 25 Feb 2021 20:28:57 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:28:57 GMT Message-Id: <202102252028.11PKSvQL040951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: d7671ad8d6eb - main - Close races in vm object chain traversal for unlock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7671ad8d6ebe205933628466dc0a52d32eea2e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:28:57 -0000 The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=d7671ad8d6ebe205933628466dc0a52d32eea2e8 commit d7671ad8d6ebe205933628466dc0a52d32eea2e8 Author: Ryan Libby AuthorDate: 2021-02-25 20:11:19 +0000 Commit: Ryan Libby CommitDate: 2021-02-25 20:11:19 +0000 Close races in vm object chain traversal for unlock We were unlocking the vm object before reading the backing_object field. In the meantime, the object could be freed and reused. This could cause us to go off the rails in the object chain traversal, failing to unlock the rest of the objects in the original chain and corrupting the lock state of the victim chain. Reviewed by: bdrewery, kib, markj, vangyzen MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28926 --- sys/fs/procfs/procfs_map.c | 5 +++-- sys/kern/kern_proc.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index a9893e5e10f0..e4969d795dcc 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -84,7 +84,7 @@ procfs_doprocmap(PFS_FILL_ARGS) struct vnode *vp; char *fullpath, *freepath, *type; struct ucred *cred; - vm_object_t obj, tobj, lobj; + vm_object_t lobj, nobj, obj, tobj; int error, privateresident, ref_count, resident, shadow_count, flags; vm_offset_t e_start, e_end; vm_eflags_t e_eflags; @@ -144,7 +144,8 @@ procfs_doprocmap(PFS_FILL_ARGS) } if (obj != NULL) kern_proc_vmmap_resident(map, entry, &resident, &super); - for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + for (tobj = obj; tobj != NULL; tobj = nobj) { + nobj = tobj->backing_object; if (tobj != obj && tobj != lobj) VM_OBJECT_RUNLOCK(tobj); } diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index f8fed2573712..817cb9766bbf 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2505,7 +2505,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) vm_map_entry_t entry, tmp_entry; struct vattr va; vm_map_t map; - vm_object_t obj, tobj, lobj; + vm_object_t lobj, nobj, obj, tobj; char *fullpath, *freepath; struct kinfo_vmentry *kve; struct ucred *cred; @@ -2551,8 +2551,8 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) &kve->kve_resident, &super); if (super) kve->kve_flags |= KVME_FLAG_SUPER; - for (tobj = obj; tobj != NULL; - tobj = tobj->backing_object) { + for (tobj = obj; tobj != NULL; tobj = nobj) { + nobj = tobj->backing_object; if (tobj != obj && tobj != lobj) VM_OBJECT_RUNLOCK(tobj); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:41: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 D7F7256F1D3; Thu, 25 Feb 2021 20:41: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 4Dml7V58QMz3Mdj; Thu, 25 Feb 2021 20:41: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 A444D1DCED; Thu, 25 Feb 2021 20:41: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 11PKfQSS064979; Thu, 25 Feb 2021 20:41:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKfQ2O064978; Thu, 25 Feb 2021 20:41:26 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:41:26 GMT Message-Id: <202102252041.11PKfQ2O064978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: 1eb60112b22e - releng/13.0 - Use iflib_if_init_locked() during media change instead of iflib_init_locked(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 1eb60112b22ea0d61f0d1ba4ac0cca56a0c034c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:41:27 -0000 The branch releng/13.0 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=1eb60112b22ea0d61f0d1ba4ac0cca56a0c034c8 commit 1eb60112b22ea0d61f0d1ba4ac0cca56a0c034c8 Author: Allan Jude AuthorDate: 2021-02-14 18:39:09 +0000 Commit: Allan Jude CommitDate: 2021-02-25 20:41:10 +0000 Use iflib_if_init_locked() during media change instead of iflib_init_locked(). iflib_init_locked() assumes that iflib_stop() has been called, however, it is not called for media changes. iflib_if_init_locked() calls stop then init, so fixes the problem. PR: 253473 Sponsored by: Juniper Networks, Inc., Klara, Inc. Approved by: re (gjb) (cherry picked from commit 922cf8ac43adc9983f9a9e05cfd838306c1ef483) --- sys/net/iflib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index d10c11f865fe..506861b65570 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2503,7 +2503,7 @@ iflib_media_change(if_t ifp) CTX_LOCK(ctx); if ((err = IFDI_MEDIA_CHANGE(ctx)) == 0) - iflib_init_locked(ctx); + iflib_if_init_locked(ctx); CTX_UNLOCK(ctx); return (err); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:51: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 6292156FD4A; Thu, 25 Feb 2021 20:51: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 4DmlM72KKHz3Nrh; Thu, 25 Feb 2021 20:51: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 42A4A1E596; Thu, 25 Feb 2021 20:51: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 11PKpVdX074725; Thu, 25 Feb 2021 20:51:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKpVFQ074724; Thu, 25 Feb 2021 20:51:31 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:51:31 GMT Message-Id: <202102252051.11PKpVFQ074724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: 5001c579baff - main - [PowerPC64LE] pseries: Fix input buffering logic. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5001c579baff78719919d79ec054207aa2938dbd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:51:31 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=5001c579baff78719919d79ec054207aa2938dbd commit 5001c579baff78719919d79ec054207aa2938dbd Author: Brandon Bergren AuthorDate: 2021-02-25 18:55:58 +0000 Commit: Brandon Bergren CommitDate: 2021-02-25 20:50:13 +0000 [PowerPC64LE] pseries: Fix input buffering logic. In uart_phyp_get(), when the internal buffer is empty, we make a hypercall to retrieve up to 16 bytes of input data from the hypervisor. As this is specified to be returned in BE format, we need to do a 64-bit byte swap on the first and second half of the data. If the buffer being passed in was insufficient to return the fetched data, we store the remainder in the internal buffer and use it to satisfy the following calls to uart_phyp_get() until it is drained. However, in this case, we were accidentally byteswapping the internal buffer again. Move the byteswapping code to just after the hypercall so it only gets swapped when we're filling the buffer. Fixes arrow keys in qemu on pseries, among other console oddities. Sponsored by: Tag1 Consulting, Inc. MFC after: 3 days --- sys/powerpc/pseries/phyp_console.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/powerpc/pseries/phyp_console.c b/sys/powerpc/pseries/phyp_console.c index 84ab292dae94..484952177d51 100644 --- a/sys/powerpc/pseries/phyp_console.c +++ b/sys/powerpc/pseries/phyp_console.c @@ -295,6 +295,10 @@ uart_phyp_get(struct uart_phyp_softc *sc, void *buffer, size_t bufsize) err = phyp_pft_hcall(H_GET_TERM_CHAR, sc->vtermid, 0, 0, 0, &sc->inbuflen, &sc->phyp_inbuf.u64[0], &sc->phyp_inbuf.u64[1]); +#if BYTE_ORDER == LITTLE_ENDIAN + sc->phyp_inbuf.u64[0] = be64toh(sc->phyp_inbuf.u64[0]); + sc->phyp_inbuf.u64[1] = be64toh(sc->phyp_inbuf.u64[1]); +#endif if (err != H_SUCCESS) { uart_unlock(&sc->sc_mtx); return (-1); @@ -307,11 +311,6 @@ uart_phyp_get(struct uart_phyp_softc *sc, void *buffer, size_t bufsize) return (0); } -#if BYTE_ORDER == LITTLE_ENDIAN - sc->phyp_inbuf.u64[0] = be64toh(sc->phyp_inbuf.u64[0]); - sc->phyp_inbuf.u64[1] = be64toh(sc->phyp_inbuf.u64[1]); -#endif - if ((sc->protocol == HVTERMPROT) && (hdr == 1)) { sc->inbuflen = sc->inbuflen - 4; /* The VTERM protocol has a 4 byte header, skip it here. */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20: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 6C39956FA5B; Thu, 25 Feb 2021 20:52: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 4DmlMq2d82z3NbY; Thu, 25 Feb 2021 20:52: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 4CBDD1E7C8; Thu, 25 Feb 2021 20:52: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 11PKq7de076677; Thu, 25 Feb 2021 20:52:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKq78d076676; Thu, 25 Feb 2021 20:52:07 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:07 GMT Message-Id: <202102252052.11PKq78d076676@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: 041d9a1e057e - releng/13.0 - buf SU hooks: track buf_start() calls with B_IOSTARTED flag 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 041d9a1e057e5e16a29070ee149357dde2c77c2c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:07 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=041d9a1e057e5e16a29070ee149357dde2c77c2c commit 041d9a1e057e5e16a29070ee149357dde2c77c2c Author: Konstantin Belousov AuthorDate: 2021-01-30 02:10:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:47:01 +0000 buf SU hooks: track buf_start() calls with B_IOSTARTED flag Approved by: re (delphij, gjb) (cherry picked from commit bf0db19339e770a82236b74f523be4b572bde15d) --- sys/kern/vfs_bio.c | 14 ++++++++++++++ sys/sys/buf.h | 16 +++++++++++----- sys/ufs/ffs/ffs_vfsops.c | 4 ++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 2f18221e9270..9264388e9a3e 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2639,6 +2639,13 @@ brelse(struct buf *bp) return; } + if (LIST_EMPTY(&bp->b_dep)) { + bp->b_flags &= ~B_IOSTARTED; + } else { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("brelse: SU io not finished bp %p", bp)); + } + if ((bp->b_vflags & (BV_BKGRDINPROG | BV_BKGRDERR)) == BV_BKGRDERR) { BO_LOCK(bp->b_bufobj); bp->b_vflags &= ~BV_BKGRDERR; @@ -2826,6 +2833,13 @@ bqrelse(struct buf *bp) bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF); bp->b_xflags &= ~(BX_CVTENXIO); + if (LIST_EMPTY(&bp->b_dep)) { + bp->b_flags &= ~B_IOSTARTED; + } else { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("bqrelse: SU io not finished bp %p", bp)); + } + if (bp->b_flags & B_MANAGED) { if (bp->b_flags & B_REMFREE) bremfreef(bp); diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 50fa0f35491e..2997560b9ab3 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -232,7 +232,7 @@ struct buf { #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ #define B_INVALONERR 0x00040000 /* Invalidate on write error. */ -#define B_00080000 0x00080000 /* Available flag. */ +#define B_IOSTARTED 0x00080000 /* buf_start() called */ #define B_00100000 0x00100000 /* Available flag. */ #define B_MAXPHYS 0x00200000 /* nitems(b_pages[]) = atop(MAXPHYS). */ #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ @@ -248,8 +248,8 @@ struct buf { #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26maxphys\25b20" \ - "\24b19\23invalonerr\22clusterok\21malloc\20nocache\17b14\16inval" \ - "\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ + "\24iostarted\23invalonerr\22clusterok\21malloc\20nocache\17b14" \ + "\16inval\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" /* @@ -434,6 +434,9 @@ bstrategy(struct buf *bp) static __inline void buf_start(struct buf *bp) { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("recursed buf_start %p", bp)); + bp->b_flags |= B_IOSTARTED; if (bioops.io_start) (*bioops.io_start)(bp); } @@ -441,8 +444,11 @@ buf_start(struct buf *bp) static __inline void buf_complete(struct buf *bp) { - if (bioops.io_complete) - (*bioops.io_complete)(bp); + if ((bp->b_flags & B_IOSTARTED) != 0) { + bp->b_flags &= ~B_IOSTARTED; + if (bioops.io_complete) + (*bioops.io_complete)(bp); + } } static __inline void diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 60d4dad57d03..04afbfd4d6e4 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2393,10 +2393,10 @@ ffs_backgroundwritedone(struct buf *bp) #endif /* * This buffer is marked B_NOCACHE so when it is released - * by biodone it will be tossed. + * by biodone it will be tossed. Clear B_IOSTARTED in case of error. */ bp->b_flags |= B_NOCACHE; - bp->b_flags &= ~B_CACHE; + bp->b_flags &= ~(B_CACHE | B_IOSTARTED); pbrelvp(bp); /* From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 9D77656FC9F; Thu, 25 Feb 2021 20:52: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 4DmlMr41Cqz3NdV; Thu, 25 Feb 2021 20:52: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 723D51E618; Thu, 25 Feb 2021 20:52: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 11PKq8Gr076715; Thu, 25 Feb 2021 20:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKq8Bn076707; Thu, 25 Feb 2021 20:52:08 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:08 GMT Message-Id: <202102252052.11PKq8Bn076707@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: b95a45365676 - releng/13.0 - ffs: call ufsdirhash_dirtrunc() right after setting directory size 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b95a45365676204c7bfad1a28bfdbd1831a86e6c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:08 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b95a45365676204c7bfad1a28bfdbd1831a86e6c commit b95a45365676204c7bfad1a28bfdbd1831a86e6c Author: Konstantin Belousov AuthorDate: 2021-01-28 18:33:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:47:36 +0000 ffs: call ufsdirhash_dirtrunc() right after setting directory size Approved by: re (delphij, gjb) (cherry picked from commit e94f2f1be32294cb6d519b6631f7522466fbbb3b) --- sys/ufs/ffs/ffs_inode.c | 13 +++++++++++++ sys/ufs/ufs/ufs_lookup.c | 4 ---- sys/ufs/ufs/ufs_vnops.c | 2 -- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 0b4172b34300..3df7bf8e8596 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ufs.h" #include "opt_quota.h" #include @@ -59,6 +60,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef UFS_DIRHASH +#include +#endif #include #include @@ -456,6 +461,10 @@ ffs_truncate(vp, length, flags, cred) ip->i_size = length; DIP_SET(ip, i_size, length); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); +#ifdef UFS_DIRHASH + if (vp->v_type == VDIR && ip->i_dirhash != NULL) + ufsdirhash_dirtrunc(ip, length); +#endif } else { lbn = lblkno(fs, length); flags |= BA_CLRBUF; @@ -482,6 +491,10 @@ ffs_truncate(vp, length, flags, cred) return (error); ip->i_size = length; DIP_SET(ip, i_size, length); +#ifdef UFS_DIRHASH + if (vp->v_type == VDIR && ip->i_dirhash != NULL) + ufsdirhash_dirtrunc(ip, length); +#endif size = blksize(fs, ip, lbn); if (vp->v_type != VDIR && offset != 0) bzero((char *)bp->b_data + offset, diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 7dbd58f795cc..2f5fbf3d8001 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1131,10 +1131,6 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) vn_printf(dvp, "ufs_direnter: failed to truncate, error %d\n", error); -#ifdef UFS_DIRHASH - if (error == 0 && dp->i_dirhash != NULL) - ufsdirhash_dirtrunc(dp, I_ENDOFF(dp)); -#endif error = 0; if (tvp != NULL) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 0e7ec7ae5453..70b5a44ca21d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1694,8 +1694,6 @@ unlockout: #ifdef UFS_DIRHASH if (error != 0) ufsdirhash_free(tdp); - else if (tdp->i_dirhash != NULL) - ufsdirhash_dirtrunc(tdp, endoff); #endif /* * Even if the directory compaction failed, rename was From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 3A98A56FDF1; Thu, 25 Feb 2021 20:52: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 4DmlMs67NJz3NhG; Thu, 25 Feb 2021 20:52: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 8560E1E53F; Thu, 25 Feb 2021 20:52: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 11PKq9B6078147; Thu, 25 Feb 2021 20:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKq96B078132; Thu, 25 Feb 2021 20:52:09 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:09 GMT Message-Id: <202102252052.11PKq96B078132@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: 8ecc621480bb - releng/13.0 - ffs: Add FFSV_REPLACE_DOOMED flag to ffs_vgetf() 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 8ecc621480bb2e3676c940a63acc3a8ad61a75f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:10 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ecc621480bb2e3676c940a63acc3a8ad61a75f5 commit 8ecc621480bb2e3676c940a63acc3a8ad61a75f5 Author: Konstantin Belousov AuthorDate: 2021-01-26 11:35:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:47:42 +0000 ffs: Add FFSV_REPLACE_DOOMED flag to ffs_vgetf() Approved by: re (delphij, gjb) (cherry picked from commit f16c26b1c009fd0d87d07d3b1cf0d5078ad7f511) --- sys/ufs/ffs/ffs_extern.h | 5 +++-- sys/ufs/ffs/ffs_vfsops.c | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index d54df1deced9..bdb3f533e1ad 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -122,8 +122,9 @@ int ffs_breadz(struct ufsmount *, struct vnode *, daddr_t, daddr_t, int, /* * Flags to ffs_vgetf */ -#define FFSV_FORCEINSMQ 0x0001 -#define FFSV_REPLACE 0x0002 +#define FFSV_FORCEINSMQ 0x0001 +#define FFSV_REPLACE 0x0002 +#define FFSV_REPLACE_DOOMED 0x0004 /* * Flags to ffs_reload diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 04afbfd4d6e4..91b8c30f0919 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1954,13 +1954,16 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) daddr_t dbn; int error; - MPASS((ffs_flags & FFSV_REPLACE) == 0 || (flags & LK_EXCLUSIVE) != 0); + MPASS((ffs_flags & (FFSV_REPLACE | FFSV_REPLACE_DOOMED)) == 0 || + (flags & LK_EXCLUSIVE) != 0); error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL); if (error != 0) return (error); if (*vpp != NULL) { - if ((ffs_flags & FFSV_REPLACE) == 0) + if ((ffs_flags & FFSV_REPLACE) == 0 || + ((ffs_flags & FFSV_REPLACE_DOOMED) == 0 || + !VN_IS_DOOMED(*vpp))) return (0); vgone(*vpp); vput(*vpp); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 07C0356FD5F; Thu, 25 Feb 2021 20:52: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 4DmlMy07jwz3NhX; Thu, 25 Feb 2021 20: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 BA99A1E5A5; Thu, 25 Feb 2021 20:52: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 11PKqBac079110; Thu, 25 Feb 2021 20:52:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqBXZ079109; Thu, 25 Feb 2021 20:52:11 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:11 GMT Message-Id: <202102252052.11PKqBXZ079109@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: 6a61e5e0a1ed - releng/13.0 - Merge ufs_fhtovp() into ffs_inotovp(). 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 6a61e5e0a1ed058515860b4806d17196cc51195e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:16 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a61e5e0a1ed058515860b4806d17196cc51195e commit 6a61e5e0a1ed058515860b4806d17196cc51195e Author: Konstantin Belousov AuthorDate: 2021-01-28 12:20:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:13 +0000 Merge ufs_fhtovp() into ffs_inotovp(). Approved by: re (delphij, gjb) (cherry picked from commit 89fd61d955ada4fdb20030253206201bc279cdf0) --- sys/ufs/ffs/ffs_vfsops.c | 21 +++++++++++++++++---- sys/ufs/ufs/ufs_extern.h | 1 - sys/ufs/ufs/ufs_vfsops.c | 25 ------------------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 596e2f4b4b5f..540dd02c9631 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2170,6 +2170,7 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) { struct ufsmount *ump; struct vnode *nvp; + struct inode *ip; struct fs *fs; struct cg *cgp; struct buf *bp; @@ -2178,6 +2179,8 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) ump = VFSTOUFS(mp); fs = ump->um_fs; + *vpp = NULL; + if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) return (ESTALE); @@ -2198,10 +2201,20 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) } error = ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags); - if (error == 0) - error = ufs_fhtovp(mp, nvp, gen); - *vpp = error == 0 ? nvp : NULLVP; - return (error); + if (error != 0) + return (error); + + ip = VTOI(nvp); + if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { + if (ip->i_mode == 0) + vgone(nvp); + vput(nvp); + return (ESTALE); + } + + vnode_create_vobject(nvp, DIP(ip, i_size), curthread); + *vpp = nvp; + return (0); } /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index ab26750455e8..1697f2c0ba61 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -59,7 +59,6 @@ int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); int ufs_bmap_seekdata(struct vnode *, off_t *); -int ufs_fhtovp(struct mount *, struct vnode *, u_int64_t); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); int ufs_dirbadentry(struct vnode *, struct direct *, int); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 1a63e92b3e2c..0f45baed634f 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -214,28 +214,3 @@ ufs_uninit(vfsp) #endif return (0); } - -/* - * This is the generic part of fhtovp called after the underlying - * filesystem has validated the file handle. - * - * Call the VFS_CHECKEXP beforehand to verify access. - */ -int -ufs_fhtovp(mp, nvp, gen) - struct mount *mp; - struct vnode *nvp; - u_int64_t gen; -{ - struct inode *ip; - - ip = VTOI(nvp); - if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { - if (ip->i_mode == 0) - vgone(nvp); - vput(nvp); - return (ESTALE); - } - vnode_create_vobject(nvp, DIP(ip, i_size), curthread); - return (0); -} From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 4AEA656FE0E; Thu, 25 Feb 2021 20:52: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 4DmlMz69Zkz3P8Z; Thu, 25 Feb 2021 20:52: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 E08451E542; Thu, 25 Feb 2021 20: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 11PKqCA7079132; Thu, 25 Feb 2021 20: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 11PKqC6e079131; Thu, 25 Feb 2021 20:52:12 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:12 GMT Message-Id: <202102252052.11PKqC6e079131@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: 57582311c3e0 - releng/13.0 - ffs_syncvnode: only clear IN_NEEDSYNC after successfull sync 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 57582311c3e099d91bd213c0c6f3af1f3119bc01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:17 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=57582311c3e099d91bd213c0c6f3af1f3119bc01 commit 57582311c3e099d91bd213c0c6f3af1f3119bc01 Author: Konstantin Belousov AuthorDate: 2021-01-23 21:50:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:18 +0000 ffs_syncvnode: only clear IN_NEEDSYNC after successfull sync Approved by: re (delphij, gjb) (cherry picked from commit 1de1e2bfbf3c089418bbe67c096d60315c8ca5dd) --- sys/ufs/ffs/ffs_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 68985d8715f3..be2653e32adc 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -257,7 +257,6 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) bool still_dirty, unlocked, wait; ip = VTOI(vp); - ip->i_flag &= ~IN_NEEDSYNC; bo = &vp->v_bufobj; ump = VFSTOUFS(vp->v_mount); @@ -445,6 +444,8 @@ next: } if (error == 0 && unlocked) error = ERELOOKUP; + if (error == 0) + ip->i_flag &= ~IN_NEEDSYNC; return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 29A5A56FC77; Thu, 25 Feb 2021 20:52: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 4DmlMv4ntdz3NhM; Thu, 25 Feb 2021 20:52: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 B9D8B1E540; Thu, 25 Feb 2021 20:52: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 11PKqAWV079092; Thu, 25 Feb 2021 20:52:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqACx079091; Thu, 25 Feb 2021 20:52:10 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:10 GMT Message-Id: <202102252052.11PKqACx079091@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: fc54784b47b6 - releng/13.0 - ffs_inotovp(): interface to convert (ino, gen) into alive 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: fc54784b47b6876e03527fbfff317fcc4764c1b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:12 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fc54784b47b6876e03527fbfff317fcc4764c1b1 commit fc54784b47b6876e03527fbfff317fcc4764c1b1 Author: Konstantin Belousov AuthorDate: 2021-01-26 11:52:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:47:47 +0000 ffs_inotovp(): interface to convert (ino, gen) into alive vnode Approved by: re (delphij, gjb) (cherry picked from commit 5952c86c78b177b5e904bf139e6b56519897c7e0) --- sys/ufs/ffs/ffs_extern.h | 2 ++ sys/ufs/ffs/ffs_vfsops.c | 44 ++++++++++++++++++++++++++++++++------------ sys/ufs/ufs/ufs_extern.h | 2 +- sys/ufs/ufs/ufs_vfsops.c | 21 +++++---------------- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index bdb3f533e1ad..9694489266b6 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -80,6 +80,8 @@ int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t, void ffs_fserr(struct fs *, ino_t, char *); int ffs_getcg(struct fs *, struct vnode *, u_int, int, struct buf **, struct cg **); +int ffs_inotovp(struct mount *, ino_t, u_int64_t, int, struct vnode **, + int); int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 91b8c30f0919..596e2f4b4b5f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2153,35 +2153,55 @@ ffs_fhtovp(mp, fhp, flags, vpp) struct vnode **vpp; { struct ufid *ufhp; + + ufhp = (struct ufid *)fhp; + return (ffs_inotovp(mp, ufhp->ufid_ino, ufhp->ufid_gen, flags, + vpp, 0)); +} + +int +ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) + struct mount *mp; + ino_t ino; + u_int64_t gen; + int lflags; + struct vnode **vpp; + int ffs_flags; +{ struct ufsmount *ump; + struct vnode *nvp; struct fs *fs; struct cg *cgp; struct buf *bp; - ino_t ino; u_int cg; int error; - ufhp = (struct ufid *)fhp; - ino = ufhp->ufid_ino; ump = VFSTOUFS(mp); fs = ump->um_fs; if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) return (ESTALE); + /* * Need to check if inode is initialized because UFS2 does lazy * initialization and nfs_fhtovp can offer arbitrary inode numbers. */ - if (fs->fs_magic != FS_UFS2_MAGIC) - return (ufs_fhtovp(mp, ufhp, flags, vpp)); - cg = ino_to_cg(fs, ino); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) - return (error); - if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { + if (fs->fs_magic == FS_UFS2_MAGIC) { + cg = ino_to_cg(fs, ino); + error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp); + if (error != 0) + return (error); + if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { + brelse(bp); + return (ESTALE); + } brelse(bp); - return (ESTALE); } - brelse(bp); - return (ufs_fhtovp(mp, ufhp, flags, vpp)); + + error = ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags); + if (error == 0) + error = ufs_fhtovp(mp, nvp, gen); + *vpp = error == 0 ? nvp : NULLVP; + return (error); } /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index a28fcffabd2e..ab26750455e8 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -59,7 +59,7 @@ int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); int ufs_bmap_seekdata(struct vnode *, off_t *); -int ufs_fhtovp(struct mount *, struct ufid *, int, struct vnode **); +int ufs_fhtovp(struct mount *, struct vnode *, u_int64_t); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); int ufs_dirbadentry(struct vnode *, struct direct *, int); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 4813ac7db763..1a63e92b3e2c 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -222,31 +222,20 @@ ufs_uninit(vfsp) * Call the VFS_CHECKEXP beforehand to verify access. */ int -ufs_fhtovp(mp, ufhp, flags, vpp) +ufs_fhtovp(mp, nvp, gen) struct mount *mp; - struct ufid *ufhp; - int flags; - struct vnode **vpp; + struct vnode *nvp; + u_int64_t gen; { struct inode *ip; - struct vnode *nvp; - int error; - error = VFS_VGET(mp, ufhp->ufid_ino, flags, &nvp); - if (error) { - *vpp = NULLVP; - return (error); - } ip = VTOI(nvp); - if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen || - ip->i_effnlink <= 0) { + if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { if (ip->i_mode == 0) vgone(nvp); vput(nvp); - *vpp = NULLVP; return (ESTALE); } - *vpp = nvp; - vnode_create_vobject(*vpp, DIP(ip, i_size), curthread); + vnode_create_vobject(nvp, DIP(ip, i_size), curthread); return (0); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20: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 BC2EB56FA72; Thu, 25 Feb 2021 20:52: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 4DmlN70mwrz3P2Z; Thu, 25 Feb 2021 20:52: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 8BA8D1E548; Thu, 25 Feb 2021 20:52: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 11PKqJSq079256; Thu, 25 Feb 2021 20:52:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqJXO079255; Thu, 25 Feb 2021 20:52:19 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:19 GMT Message-Id: <202102252052.11PKqJXO079255@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: 56119250bbfe - releng/13.0 - ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 56119250bbfecee2121b309ecf7a61952c0c1998 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:25 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56119250bbfecee2121b309ecf7a61952c0c1998 commit 56119250bbfecee2121b309ecf7a61952c0c1998 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:56:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:47 +0000 ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. Approved by: re (delphij, gjb) (cherry picked from commit be44e986377780f533f961fe7c009b93379b4710) --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 32dc47653d18..b5daec14decf 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -296,16 +296,21 @@ restart: goto restart; } error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vat); - VOP_UNLOCK(nd.ni_dvp); if (error) { + VOP_VPUT_PAIR(nd.ni_dvp, NULL, true); NDFREE(&nd, NDF_ONLY_PNBUF); vn_finished_write(wrtmp); - vrele(nd.ni_dvp); if (error == ERELOOKUP) goto restart; return (error); } vp = nd.ni_vp; + vref(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, false); + if (VN_IS_DOOMED(vp)) { + error = EBADF; + goto out; + } vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 BC1EA56FD6F; Thu, 25 Feb 2021 20:52: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 4DmlN3195Lz3Nwk; Thu, 25 Feb 2021 20:52: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 353441E545; Thu, 25 Feb 2021 20:52: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 11PKqGS5079194; Thu, 25 Feb 2021 20:52:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqGrW079193; Thu, 25 Feb 2021 20:52:16 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:16 GMT Message-Id: <202102252052.11PKqGrW079193@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: 984c11f5aaa0 - releng/13.0 - Add VOP_VPUT_PAIR() with trivial default implementation. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 984c11f5aaa02883d1afbbca31b419194005ac4c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:21 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=984c11f5aaa02883d1afbbca31b419194005ac4c commit 984c11f5aaa02883d1afbbca31b419194005ac4c Author: Konstantin Belousov AuthorDate: 2021-01-28 22:30:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:32 +0000 Add VOP_VPUT_PAIR() with trivial default implementation. Approved by: re (delphij, gjb) (cherry picked from commit 49c117c193768b10f5fb1c5e4d6b88300cfbcdd6) --- sys/kern/vfs_default.c | 15 +++++++++++++++ sys/kern/vnode_if.src | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 4b96d9522ce3..382fbb2d9ace 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -92,6 +92,7 @@ static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); static int vop_stdread_pgcache(struct vop_read_pgcache_args *ap); static int vop_stdstat(struct vop_stat_args *ap); +static int vop_stdvput_pair(struct vop_vput_pair_args *ap); /* * This vnode table stores what we want to do if the filesystem doesn't @@ -151,6 +152,7 @@ struct vop_vector default_vnodeops = { .vop_unset_text = vop_stdunset_text, .vop_add_writecount = vop_stdadd_writecount, .vop_copy_file_range = vop_stdcopy_file_range, + .vop_vput_pair = vop_stdvput_pair, }; VFS_VOP_VECTOR_REGISTER(default_vnodeops); @@ -1592,3 +1594,16 @@ vop_stdread_pgcache(struct vop_read_pgcache_args *ap __unused) { return (EJUSTRETURN); } + +static int +vop_stdvput_pair(struct vop_vput_pair_args *ap) +{ + struct vnode *dvp, *vp, **vpp; + + dvp = ap->a_dvp; + vpp = ap->a_vpp; + vput(dvp); + if (vpp != NULL && ap->a_unlock_vp && (vp = *vpp) != NULL) + vput(vp); + return (0); +} diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 5d15d4a0c863..b506237f385d 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -792,6 +792,15 @@ vop_copy_file_range { }; +%% vput_pair dvp E - - + +vop_vput_pair { + IN struct vnode *dvp; + INOUT struct vnode **vpp; + IN bool unlock_vp; +}; + + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 AA87654801A; Thu, 25 Feb 2021 20:52: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 4DmlNG5Ymtz3P7n; Thu, 25 Feb 2021 20:52: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 7CBA51E7CD; Thu, 25 Feb 2021 20:52: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 11PKqQVf079382; Thu, 25 Feb 2021 20:52:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqQO9079381; Thu, 25 Feb 2021 20:52:26 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:26 GMT Message-Id: <202102252052.11PKqQO9079381@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: bccb8dda0ee2 - releng/13.0 - ufs_direnter: directory truncation does not need special case for rename 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: bccb8dda0ee259cc35561d87836db477be7d20ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:32 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bccb8dda0ee259cc35561d87836db477be7d20ea commit bccb8dda0ee259cc35561d87836db477be7d20ea Author: Konstantin Belousov AuthorDate: 2021-01-29 12:31:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:49:29 +0000 ufs_direnter: directory truncation does not need special case for rename Approved by: re (delphij, gjb) (cherry picked from commit 06f2918ab8a2621c6e6bc5729ed9ab982741aaf2) --- sys/ufs/ffs/ffs_vnops.c | 25 ++++++++++++------------- sys/ufs/ufs/ufs_extern.h | 2 +- sys/ufs/ufs/ufs_lookup.c | 12 +++++------- sys/ufs/ufs/ufs_vnops.c | 10 +++++----- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index dd0f1ba6b81d..38511647c502 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1968,22 +1968,21 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) * now that other locks are no longer held. */ if ((dp->i_flag & IN_ENDOFF) != 0) { + VNASSERT(I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size, dvp, + ("IN_ENDOFF set but I_ENDOFF() is not")); dp->i_flag &= ~IN_ENDOFF; - if (I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { - old_size = dp->i_size; - error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), - IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), - curthread->td_ucred); - if (error != 0 && error != ERELOOKUP) { - if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { - vn_printf(dvp, - "IN_ENDOFF: failed to truncate, " - "error %d\n", error); - } + old_size = dp->i_size; + error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), IO_NORMAL | + (DOINGASYNC(dvp) ? 0 : IO_SYNC), curthread->td_ucred); + if (error != 0 && error != ERELOOKUP) { + if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { + vn_printf(dvp, + "IN_ENDOFF: failed to truncate, " + "error %d\n", error); + } #ifdef UFS_DIRHASH - ufsdirhash_free(dp); + ufsdirhash_free(dp); #endif - } } SET_I_ENDOFF(dp, 0); } diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index 1697f2c0ba61..3ac631e6ab0b 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -68,7 +68,7 @@ int ufs_extwrite(struct vop_write_args *); void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); int ufs_direnter(struct vnode *, struct vnode *, struct direct *, - struct componentname *, struct buf *, int); + struct componentname *, struct buf *); int ufs_dirremove(struct vnode *, struct inode *, int, int); int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 3036bce81caf..0509185c4663 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -876,13 +876,12 @@ ufs_makedirentry(ip, cnp, newdirp) * soft dependency code). */ int -ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) +ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) struct vnode *dvp; struct vnode *tvp; struct direct *dirp; struct componentname *cnp; struct buf *newdirbp; - int isrename; { struct ucred *cr; struct thread *td; @@ -1111,14 +1110,13 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) error = bwrite(bp); } } - UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE); /* - * If all went well, and the directory can be shortened, mark directory inode - * with the truncation request right before unlock. + * If all went well, and the directory can be shortened, + * mark directory inode with the truncation request. */ - if (isrename == 0 && error == 0) - UFS_INODE_SET_FLAG(dp, IN_ENDOFF); + UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE | (error == 0 && + I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size ? IN_ENDOFF : 0)); return (error); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index c101e699bad6..22199a390dd4 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1111,7 +1111,7 @@ ufs_link(ap) error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp) && !DOINGASYNC(vp)); if (!error) { ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL, 0); + error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL); } if (error) { @@ -1171,7 +1171,7 @@ ufs_whiteout(ap) newdir.d_namlen = cnp->cn_namelen; bcopy(cnp->cn_nameptr, newdir.d_name, (unsigned)cnp->cn_namelen + 1); newdir.d_type = DT_WHT; - error = ufs_direnter(dvp, NULL, &newdir, cnp, NULL, 0); + error = ufs_direnter(dvp, NULL, &newdir, cnp, NULL); break; case DELETE: @@ -1511,7 +1511,7 @@ relock: } } ufs_makedirentry(fip, tcnp, &newdir); - error = ufs_direnter(tdvp, NULL, &newdir, tcnp, NULL, 1); + error = ufs_direnter(tdvp, NULL, &newdir, tcnp, NULL); if (error) goto bad; /* Setup tdvp for directory compaction if needed. */ @@ -2132,7 +2132,7 @@ ufs_mkdir(ap) else if (!DOINGSOFTDEP(dvp) && ((error = bwrite(bp)))) goto bad; ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(dvp, tvp, &newdir, cnp, bp, 0); + error = ufs_direnter(dvp, tvp, &newdir, cnp, bp); bad: if (error == 0) { @@ -2865,7 +2865,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) } #endif /* !UFS_ACL */ ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(dvp, tvp, &newdir, cnp, NULL, 0); + error = ufs_direnter(dvp, tvp, &newdir, cnp, NULL); if (error) goto bad; vn_seqc_write_end(tvp); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 38CD256FE0D; Thu, 25 Feb 2021 20:52: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 4DmlMz2CVxz3P8W; Thu, 25 Feb 2021 20:52: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 0EB441E452; Thu, 25 Feb 2021 20:52: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 11PKqDRT079154; Thu, 25 Feb 2021 20:52:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqDK1079153; Thu, 25 Feb 2021 20:52:13 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:13 GMT Message-Id: <202102252052.11PKqDK1079153@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: 9ab31d3d60ad - releng/13.0 - ufs_direnter/SU: unconditionally UFS_UPDATE inode when extending directory 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9ab31d3d60adc11e3050e0730b6f3dd517084172 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:18 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9ab31d3d60adc11e3050e0730b6f3dd517084172 commit 9ab31d3d60adc11e3050e0730b6f3dd517084172 Author: Konstantin Belousov AuthorDate: 2021-01-23 21:52:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:23 +0000 ufs_direnter/SU: unconditionally UFS_UPDATE inode when extending directory Approved by: re (delphij, gjb) (cherry picked from commit 08c2dc2841214187a162d5e4475aa1b94d03fd77) --- sys/ufs/ufs/ufs_lookup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 2f5fbf3d8001..e614f189a623 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -964,9 +964,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) if (newdirbp) bdwrite(newdirbp); bdwrite(bp); - if ((dp->i_flag & IN_NEEDSYNC) == 0) - return (UFS_UPDATE(dvp, 0)); - return (0); + return (UFS_UPDATE(dvp, 0)); } if (DOINGASYNC(dvp)) { bdwrite(bp); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB41F56FB73; Thu, 25 Feb 2021 20:52:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmlNL0wXwz3PTr; Thu, 25 Feb 2021 20:52: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 D3D911E3E9; Thu, 25 Feb 2021 20:52: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 11PKqT39079446; Thu, 25 Feb 2021 20:52:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqTaj079445; Thu, 25 Feb 2021 20:52:29 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:29 GMT Message-Id: <202102252052.11PKqTaj079445@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: 2e4940262c71 - releng/13.0 - Stop ignoring ERELOOKUP from VOP_INACTIVE() 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 2e4940262c719672763181a6a735b17a6fb50b64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:36 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2e4940262c719672763181a6a735b17a6fb50b64 commit 2e4940262c719672763181a6a735b17a6fb50b64 Author: Konstantin Belousov AuthorDate: 2021-01-30 19:17:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:49:49 +0000 Stop ignoring ERELOOKUP from VOP_INACTIVE() Approved by: re (delphij, gjb) (cherry picked from commit b59a8e63d6bf9092419b7a421c655d0ae2099662) --- sys/kern/vfs_subr.c | 47 ++++++++++++++++++++++++++++++++-------------- sys/sys/vnode.h | 3 ++- sys/ufs/ffs/ffs_snapshot.c | 8 +++++++- 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 047e4c54f0c5..04cd0e0175f9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3159,9 +3159,21 @@ vput_final(struct vnode *vp, enum vput_op func) break; } if (error == 0) { - vinactive(vp); - if (want_unlock) - VOP_UNLOCK(vp); + if (func == VUNREF) { + VNASSERT((vp->v_vflag & VV_UNREF) == 0, vp, + ("recursive vunref")); + vp->v_vflag |= VV_UNREF; + } + for (;;) { + error = vinactive(vp); + if (want_unlock) + VOP_UNLOCK(vp); + if (error != ERELOOKUP || !want_unlock) + break; + VOP_LOCK(vp, LK_EXCLUSIVE); + } + if (func == VUNREF) + vp->v_vflag &= ~VV_UNREF; vdropl(vp); } else { vdefer_inactive(vp); @@ -3546,10 +3558,11 @@ vdropl(struct vnode *vp) * Call VOP_INACTIVE on the vnode and manage the DOINGINACT and OWEINACT * flags. DOINGINACT prevents us from recursing in calls to vinactive. */ -static void +static int vinactivef(struct vnode *vp) { struct vm_object *obj; + int error; ASSERT_VOP_ELOCKED(vp, "vinactive"); ASSERT_VI_LOCKED(vp, "vinactive"); @@ -3575,14 +3588,15 @@ vinactivef(struct vnode *vp) vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); } - VOP_INACTIVE(vp); + error = VOP_INACTIVE(vp); VI_LOCK(vp); VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, ("vinactive: lost VI_DOINGINACT")); vp->v_iflag &= ~VI_DOINGINACT; + return (error); } -void +int vinactive(struct vnode *vp) { @@ -3591,14 +3605,14 @@ vinactive(struct vnode *vp) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if ((vp->v_iflag & VI_OWEINACT) == 0) - return; + return (0); if (vp->v_iflag & VI_DOINGINACT) - return; + return (0); if (vp->v_usecount > 0) { vp->v_iflag &= ~VI_OWEINACT; - return; + return (0); } - vinactivef(vp); + return (vinactivef(vp)); } /* @@ -3911,10 +3925,15 @@ vgonel(struct vnode *vp) */ if (active) VOP_CLOSE(vp, FNONBLOCK, NOCRED, td); - if ((oweinact || active) && !doinginact) { - VI_LOCK(vp); - vinactivef(vp); - VI_UNLOCK(vp); + if (!doinginact) { + do { + if (oweinact || active) { + VI_LOCK(vp); + vinactivef(vp); + oweinact = (vp->v_iflag & VI_OWEINACT) != 0; + VI_UNLOCK(vp); + } + } while (oweinact); } if (vp->v_type == VSOCK) vfs_unp_reclaim(vp); diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 78fbec1bd0ba..639a16881e09 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -269,6 +269,7 @@ struct xvnode { #define VV_MD 0x0800 /* vnode backs the md device */ #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ #define VV_READLINK 0x2000 /* fdescfs linux vnode */ +#define VV_UNREF 0x4000 /* vunref, do not drop lock in inactive() */ #define VMP_LAZYLIST 0x0001 /* Vnode is on mnt's lazy list */ @@ -710,7 +711,7 @@ void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdnz(struct vnode *); bool vhold_smr(struct vnode *); -void vinactive(struct vnode *vp); +int vinactive(struct vnode *vp); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, off_t length, int blksize); void v_inval_buf_range(struct vnode *vp, daddr_t startlbn, daddr_t endlbn, diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index b5daec14decf..72c8061917d8 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -2595,6 +2595,7 @@ process_deferred_inactive(struct mount *mp) continue; } vholdl(vp); +retry_vnode: error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK); if (error != 0) { vdrop(vp); @@ -2609,7 +2610,12 @@ process_deferred_inactive(struct mount *mp) UFS_INODE_SET_FLAG(ip, IN_MODIFIED); } VI_LOCK(vp); - vinactive(vp); + error = vinactive(vp); + if (error == ERELOOKUP && vp->v_usecount == 0) { + VI_UNLOCK(vp); + VOP_UNLOCK(vp); + goto retry_vnode; + } VI_UNLOCK(vp); VOP_UNLOCK(vp); vdrop(vp); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 D2E9656FB74; Thu, 25 Feb 2021 20:52:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmlNM0H0Yz3PXV; Thu, 25 Feb 2021 20:52: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 219F81E624; Thu, 25 Feb 2021 20:52: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 11PKqW2Z079488; Thu, 25 Feb 2021 20:52:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqWPM079487; Thu, 25 Feb 2021 20:52:32 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:32 GMT Message-Id: <202102252052.11PKqWPM079487@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: 28d0541398bf - releng/13.0 - softdep_request_cleanup: wait for softdep_request_clean_flush() to pass 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 28d0541398bffc9930fd027613fb1bdc43a61704 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:36 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=28d0541398bffc9930fd027613fb1bdc43a61704 commit 28d0541398bffc9930fd027613fb1bdc43a61704 Author: Konstantin Belousov AuthorDate: 2021-02-03 23:58:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:12 +0000 softdep_request_cleanup: wait for softdep_request_clean_flush() to pass Approved by: re (delphij, gjb) (cherry picked from commit 2011b44fa3f2b2bd5a24be01094420cce9144b2d) --- sys/ufs/ffs/ffs_softdep.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8c3ae9dd95fc..8c52139687f9 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -13847,6 +13847,7 @@ retry: failed_vnode = softdep_request_cleanup_flush(mp, ump); ACQUIRE_LOCK(ump); ump->um_softdep->sd_flags &= ~FLUSH_RC_ACTIVE; + wakeup(&ump->um_softdep->sd_flags); FREE_LOCK(ump); if (ump->softdep_on_worklist > 0) { stat_cleanup_retries += 1; @@ -13854,6 +13855,11 @@ retry: goto retry; } } else { + while ((ump->um_softdep->sd_flags & + FLUSH_RC_ACTIVE) != 0) { + msleep(&ump->um_softdep->sd_flags, + LOCK_PTR(ump), PVM, "ffsrca", hz); + } FREE_LOCK(ump); error = 0; } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 A6A4056FE4E; Thu, 25 Feb 2021 20:52: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 4DmlNQ0sY4z3PDr; Thu, 25 Feb 2021 20:52: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 6D9531E626; Thu, 25 Feb 2021 20:52: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 11PKqYC0079528; Thu, 25 Feb 2021 20:52:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqYAm079527; Thu, 25 Feb 2021 20:52:34 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:34 GMT Message-Id: <202102252052.11PKqYAm079527@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: eed0fd5903e5 - releng/13.0 - ffs_unlock: assert that IN_ENDOFF is not leaked past locked scope 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: eed0fd5903e5629af1062d6047d090a1aca74bdd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:39 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eed0fd5903e5629af1062d6047d090a1aca74bdd commit eed0fd5903e5629af1062d6047d090a1aca74bdd Author: Konstantin Belousov AuthorDate: 2021-01-31 19:01:17 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:27 +0000 ffs_unlock: assert that IN_ENDOFF is not leaked past locked scope Approved by: re (delphij, gjb) (cherry picked from commit 26af9f72f7cb162abeced8b7e444800b601e5017) --- sys/ufs/ffs/ffs_vnops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 38511647c502..1dfdf5182a42 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -591,6 +591,9 @@ ffs_unlock_debug(struct vop_unlock_args *ap) VI_UNLOCK(vp); } } + KASSERT(vp->v_type != VDIR || vp->v_vnlock->lk_recurse != 0 || + (ip->i_flag & IN_ENDOFF) == 0, + ("ufs dir vp %p ip %p flags %#x", vp, ip, ip->i_flag)); #ifdef DIAGNOSTIC if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE && ip != NULL && vp->v_vnlock->lk_recurse == 0) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 A4F5156FA6F; Thu, 25 Feb 2021 20:52: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 4DmlN23LDrz3P28; Thu, 25 Feb 2021 20:52: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 381FA1E5A6; Thu, 25 Feb 2021 20:52: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 11PKqEgI079172; Thu, 25 Feb 2021 20:52:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqEql079171; Thu, 25 Feb 2021 20:52:14 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:14 GMT Message-Id: <202102252052.11PKqEql079171@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: c2007457027d - releng/13.0 - vn_open(): If the vnode is reclaimed during open(2), do not return error. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: c2007457027d54f60d4558b4e8f90673596357a2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:21 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c2007457027d54f60d4558b4e8f90673596357a2 commit c2007457027d54f60d4558b4e8f90673596357a2 Author: Konstantin Belousov AuthorDate: 2021-02-03 11:02:18 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:28 +0000 vn_open(): If the vnode is reclaimed during open(2), do not return error. Approved by: re (delphij, gjb) (cherry picked from commit ee965dfa64929227ced8adb68900c35f877480e7) --- sys/fs/deadfs/dead_vnops.c | 11 +++++++++-- sys/kern/vfs_vnops.c | 2 -- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index 09c3c996ee0e..324bbafd7caf 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -45,6 +45,7 @@ */ static vop_lookup_t dead_lookup; static vop_open_t dead_open; +static vop_close_t dead_close; static vop_getwritemount_t dead_getwritemount; static vop_rename_t dead_rename; static vop_unset_text_t dead_unset_text; @@ -55,6 +56,7 @@ struct vop_vector dead_vnodeops = { .vop_access = VOP_EBADF, .vop_advlock = VOP_EBADF, .vop_bmap = VOP_EBADF, + .vop_close = dead_close, .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, .vop_getwritemount = dead_getwritemount, @@ -104,13 +106,18 @@ dead_lookup(struct vop_lookup_args *ap) } /* - * Open always fails as if device did not exist. + * Silently succeed open and close. */ static int dead_open(struct vop_open_args *ap) { + return (0); +} - return (ENXIO); +static int +dead_close(struct vop_close_args *ap) +{ + return (0); } int diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 1e52a797a1f7..3ec2662dfcd8 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -356,8 +356,6 @@ vn_open_vnode_advlock(struct vnode *vp, int fmode, struct file *fp) fp->f_flag |= FHASLOCK; vn_lock(vp, lock_flags | LK_RETRY); - if (error == 0 && VN_IS_DOOMED(vp)) - error = ENOENT; return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 923BD56FF88; Thu, 25 Feb 2021 20:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmlNK1VLfz3PRp; Thu, 25 Feb 2021 20:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4C541E5AD; Thu, 25 Feb 2021 20:52: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 11PKqSPQ079426; Thu, 25 Feb 2021 20:52:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqSEu079425; Thu, 25 Feb 2021 20:52:28 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:28 GMT Message-Id: <202102252052.11PKqSEu079425@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: 8ef69a7e8fdf - releng/13.0 - ufs vnops: brace softdep_prelink() with DOINGSUJ instead of DOINGSOFTDEP 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 8ef69a7e8fdfdc9968592c5d7eec73d846af2961 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:33 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ef69a7e8fdfdc9968592c5d7eec73d846af2961 commit 8ef69a7e8fdfdc9968592c5d7eec73d846af2961 Author: Konstantin Belousov AuthorDate: 2021-01-23 23:12:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:49:41 +0000 ufs vnops: brace softdep_prelink() with DOINGSUJ instead of DOINGSOFTDEP Approved by: re (delphij, gjb) (cherry picked from commit 6aed2435c8bf1fa55891c7d30186c9ad91064da8) --- sys/ufs/ufs/ufs_vnops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index b035a8b1c34d..e6a78c3655cc 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1006,7 +1006,7 @@ ufs_remove(ap) if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (VTOI(dvp)->i_flags & APPEND)) return (EPERM); - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -1071,7 +1071,7 @@ ufs_link(ap) panic("ufs_link: no name"); #endif - if (DOINGSOFTDEP(tdvp)) { + if (DOINGSUJ(tdvp)) { error = softdep_prelink(tdvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -1142,7 +1142,7 @@ ufs_whiteout(ap) struct direct newdir; int error = 0; - if (DOINGSOFTDEP(dvp) && (ap->a_flags == CREATE || + if (DOINGSUJ(dvp) && (ap->a_flags == CREATE || ap->a_flags == DELETE)) { error = softdep_prelink(dvp, NULL); if (error != 0) { @@ -1945,7 +1945,7 @@ ufs_mkdir(ap) goto out; } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); @@ -2209,7 +2209,7 @@ ufs_rmdir(ap) error = EINVAL; goto out; } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -2736,7 +2736,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) print_bad_link_count(callfunc, dvp); return (EINVAL); } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 7A34356FCC9; Thu, 25 Feb 2021 20:52: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 4DmlNQ3GpSz3PPc; Thu, 25 Feb 2021 20:52: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 48ED11E625; Thu, 25 Feb 2021 20:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PKqXLn079510; Thu, 25 Feb 2021 20:52:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqX7j079509; Thu, 25 Feb 2021 20:52:33 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:33 GMT Message-Id: <202102252052.11PKqX7j079509@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: eadca59970c1 - releng/13.0 - ffs softdep: Force processing of VI_OWEINACT vnodes when there is inode shortage 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: eadca59970c1ad89d79991423488adc3cd113f1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:39 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eadca59970c1ad89d79991423488adc3cd113f1f commit eadca59970c1ad89d79991423488adc3cd113f1f Author: Konstantin Belousov AuthorDate: 2021-01-31 18:39:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:22 +0000 ffs softdep: Force processing of VI_OWEINACT vnodes when there is inode shortage Approved by: re (delphij, gjb) (cherry picked from commit 28703d27130c9cb7e7830ff53155c379a502c248) --- sys/ufs/ffs/ffs_softdep.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++ sys/ufs/ffs/softdep.h | 2 ++ 2 files changed, 63 insertions(+) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8c52139687f9..786fb43c7d81 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1311,6 +1311,7 @@ static int softdep_flushcache = 0; /* Should we do BIO_FLUSH? */ */ static int stat_flush_threads; /* number of softdep flushing threads */ static int stat_worklist_push; /* number of worklist cleanups */ +static int stat_delayed_inact; /* number of delayed inactivation cleanups */ static int stat_blk_limit_push; /* number of times block limit neared */ static int stat_ino_limit_push; /* number of times inode limit neared */ static int stat_blk_limit_hit; /* number of times block slowdown imposed */ @@ -1344,6 +1345,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, flush_threads, CTLFLAG_RD, &stat_flush_threads, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, CTLFLAG_RW | CTLFLAG_STATS, &stat_worklist_push, 0,""); +SYSCTL_INT(_debug_softdep, OID_AUTO, delayed_inactivations, CTLFLAG_RD, + &stat_delayed_inact, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, CTLFLAG_RW | CTLFLAG_STATS, &stat_blk_limit_push, 0,""); SYSCTL_INT(_debug_softdep, OID_AUTO, ino_limit_push, @@ -13707,6 +13710,37 @@ softdep_slowdown(vp) return (1); } +static int +softdep_request_cleanup_filter(struct vnode *vp, void *arg __unused) +{ + return ((vp->v_iflag & VI_OWEINACT) != 0 && vp->v_usecount == 0 && + ((vp->v_vflag & VV_NOSYNC) != 0 || VTOI(vp)->i_effnlink == 0)); +} + +static void +softdep_request_cleanup_inactivate(struct mount *mp) +{ + struct vnode *vp, *mvp; + int error; + + MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, softdep_request_cleanup_filter, + NULL) { + vholdl(vp); + vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY); + VI_LOCK(vp); + if (vp->v_data != NULL && vp->v_usecount == 0) { + while ((vp->v_iflag & VI_OWEINACT) != 0) { + error = vinactive(vp); + if (error != 0 && error != ERELOOKUP) + break; + } + atomic_add_int(&stat_delayed_inact, 1); + } + VOP_UNLOCK(vp); + vdropl(vp); + } +} + /* * Called by the allocation routines when they are about to fail * in the hope that we can free up the requested resource (inodes @@ -13819,6 +13853,33 @@ retry: stat_worklist_push += 1; FREE_LOCK(ump); } + + /* + * Check that there are vnodes pending inactivation. As they + * have been unlinked, inactivating them will free up their + * inodes. + */ + ACQUIRE_LOCK(ump); + if (resource == FLUSH_INODES_WAIT && + fs->fs_cstotal.cs_nifree <= needed && + fs->fs_pendinginodes <= needed) { + if ((ump->um_softdep->sd_flags & FLUSH_DI_ACTIVE) == 0) { + ump->um_softdep->sd_flags |= FLUSH_DI_ACTIVE; + FREE_LOCK(ump); + softdep_request_cleanup_inactivate(mp); + ACQUIRE_LOCK(ump); + ump->um_softdep->sd_flags &= ~FLUSH_DI_ACTIVE; + wakeup(&ump->um_softdep->sd_flags); + } else { + while ((ump->um_softdep->sd_flags & + FLUSH_DI_ACTIVE) != 0) { + msleep(&ump->um_softdep->sd_flags, + LOCK_PTR(ump), PVM, "ffsvina", hz); + } + } + } + FREE_LOCK(ump); + /* * If we still need resources and there are no more worklist * entries to process to obtain them, we have to start flushing diff --git a/sys/ufs/ffs/softdep.h b/sys/ufs/ffs/softdep.h index 868ada00f2dc..3493aadafc98 100644 --- a/sys/ufs/ffs/softdep.h +++ b/sys/ufs/ffs/softdep.h @@ -1086,6 +1086,8 @@ struct mount_softdeps { #define FLUSH_CLEANUP 0x0002 /* need to clear out softdep structures */ #define FLUSH_STARTING 0x0004 /* flush thread not yet started */ #define FLUSH_RC_ACTIVE 0x0008 /* a thread is flushing the mount point */ +#define FLUSH_DI_ACTIVE 0x0010 /* a thread is processing delayed + inactivations */ /* * Keep the old names from when these were in the ufsmount structure. From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 B00E356FEAD; Thu, 25 Feb 2021 20:52: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 4DmlNS0L3Bz3PZr; Thu, 25 Feb 2021 20:52: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 9AE8E1E627; Thu, 25 Feb 2021 20:52: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 11PKqZZv079550; Thu, 25 Feb 2021 20:52:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqZtc079549; Thu, 25 Feb 2021 20:52:35 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:35 GMT Message-Id: <202102252052.11PKqZtc079549@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: d1015ac54429 - releng/13.0 - fifo: minor comment and assert improvements. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: d1015ac5442990b1e916b7d0c4886f63b7079468 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:41 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d1015ac5442990b1e916b7d0c4886f63b7079468 commit d1015ac5442990b1e916b7d0c4886f63b7079468 Author: Konstantin Belousov AuthorDate: 2021-02-01 10:43:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:32 +0000 fifo: minor comment and assert improvements. Approved by: re (delphij, gjb) (cherry picked from commit adf28ab45670329459aed8afeec2dbe91c9b3713) --- sys/kern/vfs_syscalls.c | 3 ++- sys/ufs/ufs/ufs_vnops.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index aba3d62936bb..a51d693446e3 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1183,7 +1183,8 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, * vnode operations here. */ if (fp->f_ops == &badfileops) { - KASSERT(vp->v_type != VFIFO, ("Unexpected fifo.")); + KASSERT(vp->v_type != VFIFO, + ("Unexpected fifo fp %p vp %p", fp, vp)); finit_vnode(fp, flags, NULL, &vnops); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index e6a78c3655cc..301c583291d1 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -252,9 +252,10 @@ ufs_mknod(ap) DIP_SET(ip, i_rdev, vap->va_rdev); } /* - * Remove inode, then reload it through VFS_VGET so it is - * checked to see if it is an alias of an existing entry in - * the inode cache. XXX I don't believe this is necessary now. + * Remove inode, then reload it through VFS_VGET(). This is + * needed to do further inode initialization, for instance + * fifo, which was too early for VFS_VGET() done as part of + * UFS_VALLOC(). */ (*vpp)->v_type = VNON; ino = ip->i_number; /* Save this before vgone() invalidates ip. */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20: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 EB4DE56FF26; Thu, 25 Feb 2021 20: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 4DmlNT5CRkz3PF5; Thu, 25 Feb 2021 20:52: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 DE53D1E3EB; Thu, 25 Feb 2021 20:52: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 11PKqbeS079592; Thu, 25 Feb 2021 20:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqbb6079591; Thu, 25 Feb 2021 20:52:37 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:37 GMT Message-Id: <202102252052.11PKqbb6079591@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: 9bef28f29446 - releng/13.0 - ffs: do not call softdep_prealloc() from UFS_BALLOC() 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9bef28f2944696906c7fa68223faaf12b17695dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:44 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9bef28f2944696906c7fa68223faaf12b17695dd commit 9bef28f2944696906c7fa68223faaf12b17695dd Author: Konstantin Belousov AuthorDate: 2021-02-18 14:51:50 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:42 +0000 ffs: do not call softdep_prealloc() from UFS_BALLOC() Approved by: re (delphij, gjb) (cherry picked from commit 49831462794690155ce8dbe02679e6d9390f3d7d) --- sys/ufs/ffs/ffs_balloc.c | 5 ----- sys/ufs/ffs/ffs_vnops.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index daa897dfe032..1b53a90a48c4 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -128,8 +128,6 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size, return (EFBIG); gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; - if (DOINGSOFTDEP(vp)) - softdep_prealloc(vp, MNT_WAIT); /* * If the next write will extend the file into a new block, * and the file is currently composed of a fragment @@ -621,9 +619,6 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size, return (EFBIG); gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0; - if (DOINGSOFTDEP(vp)) - softdep_prealloc(vp, MNT_WAIT); - /* * Check for allocating external data. */ diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 1dfdf5182a42..c00469c4c7e3 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -834,6 +834,11 @@ ffs_write(ap) int blkoffset, error, flags, ioflag, size, xfersize; vp = ap->a_vp; + if (DOINGSUJ(vp)) + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + uio = ap->a_uio; ioflag = ap->a_ioflag; if (ap->a_ioflag & IO_EXT) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 B9A2B56FB50; Thu, 25 Feb 2021 20:52: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 4DmlN836PKz3PH1; Thu, 25 Feb 2021 20:52: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 C92D91E3E5; Thu, 25 Feb 2021 20:52: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 11PKqLTx079300; Thu, 25 Feb 2021 20:52:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqLuB079299; Thu, 25 Feb 2021 20:52:21 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:21 GMT Message-Id: <202102252052.11PKqLuB079299@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: b3162f7d998b - releng/13.0 - FFS: implement special VOP_VPUT_PAIR(). 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b3162f7d998bfb568819ce55046c3ae990512b61 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:25 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b3162f7d998bfb568819ce55046c3ae990512b61 commit b3162f7d998bfb568819ce55046c3ae990512b61 Author: Konstantin Belousov AuthorDate: 2021-01-27 18:09:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:58 +0000 FFS: implement special VOP_VPUT_PAIR(). Approved by: re (delphij, gjb) (cherry picked from commit f2c9d038bdee547be07c8b0404547617b71f2232) --- sys/ufs/ffs/ffs_vnops.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index be2653e32adc..623b13790ce0 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -130,6 +130,7 @@ static vop_listextattr_t ffs_listextattr; static vop_openextattr_t ffs_openextattr; static vop_setextattr_t ffs_setextattr; static vop_vptofh_t ffs_vptofh; +static vop_vput_pair_t ffs_vput_pair; /* Global vfs data structures for ufs. */ struct vop_vector ffs_vnodeops1 = { @@ -146,6 +147,7 @@ struct vop_vector ffs_vnodeops1 = { .vop_reallocblks = ffs_reallocblks, .vop_write = ffs_write, .vop_vptofh = ffs_vptofh, + .vop_vput_pair = ffs_vput_pair, }; VFS_VOP_VECTOR_REGISTER(ffs_vnodeops1); @@ -182,6 +184,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_openextattr = ffs_openextattr, .vop_setextattr = ffs_setextattr, .vop_vptofh = ffs_vptofh, + .vop_vput_pair = ffs_vput_pair, }; VFS_VOP_VECTOR_REGISTER(ffs_vnodeops2); @@ -1917,3 +1920,55 @@ ffs_getpages_async(struct vop_getpages_async_args *ap) return (error); } + +static int +ffs_vput_pair(struct vop_vput_pair_args *ap) +{ + struct vnode *dvp, *vp, **vpp; + struct inode *dp; + int error, vp_locked; + + dvp = ap->a_dvp; + dp = VTOI(dvp); + vpp = ap->a_vpp; + vp = vpp != NULL ? *vpp : NULL; + + if ((dp->i_flag & IN_NEEDSYNC) == 0) { + vput(dvp); + if (vp != NULL && ap->a_unlock_vp) + vput(vp); + return (0); + } + + if (vp != NULL) { + if (ap->a_unlock_vp) { + vput(vp); + } else { + MPASS(vp->v_type != VNON); + vp_locked = VOP_ISLOCKED(vp); + VOP_UNLOCK(vp); + } + } + + do { + error = ffs_syncvnode(dvp, MNT_WAIT, 0); + } while (error == ERELOOKUP); + vput(dvp); + + if (vp == NULL || ap->a_unlock_vp) + return (0); + + /* + * It is possible that vp is reclaimed at this point. Only + * routines that call us with a_unlock_vp == false can find + * that their vp has been reclaimed. There are three areas + * that are affected: + * 1) vn_open_cred() - later VOPs could fail, but + * dead_open() returns 0 to simulate successful open. + * 2) ffs_snapshot() - creation of snapshot fails with EBADF. + * 3) NFS server (several places) - code is prepared to detect + * and respond to dead vnodes by returning ESTALE. + */ + VOP_LOCK(vp, vp_locked | LK_RETRY); + return (0); +} From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 B72E056FD78; Thu, 25 Feb 2021 20:52: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 4DmlN443Ynz3P2N; Thu, 25 Feb 2021 20:52: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 684621E68B; Thu, 25 Feb 2021 20:52: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 11PKqHfB079216; Thu, 25 Feb 2021 20:52:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqHDE079215; Thu, 25 Feb 2021 20:52:17 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:17 GMT Message-Id: <202102252052.11PKqHDE079215@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: b4cc32336d31 - releng/13.0 - nullfs: provide special bypass for VOP_VPUT_PAIR 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b4cc32336d31c8d81feaae2aab4d1d2fd9f306a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:25 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b4cc32336d31c8d81feaae2aab4d1d2fd9f306a5 commit b4cc32336d31c8d81feaae2aab4d1d2fd9f306a5 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:22:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:37 +0000 nullfs: provide special bypass for VOP_VPUT_PAIR Approved by: re (delphij, gjb) (cherry picked from commit e4aaf35ab54958f74409790fa2b7df8c2d230cee) --- sys/fs/nullfs/null_vnops.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 1de0cdfca9ac..45065e0be7b5 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -967,6 +967,54 @@ null_read_pgcache(struct vop_read_pgcache_args *ap) return (error); } +/* + * Avoid standard bypass, since lower dvp and vp could be no longer + * valid after vput(). + */ +static int +null_vput_pair(struct vop_vput_pair_args *ap) +{ + struct mount *mp; + struct vnode *dvp, *ldvp, *lvp, *vp, *vp1, **vpp; + int error, res; + + dvp = ap->a_dvp; + ldvp = NULLVPTOLOWERVP(dvp); + vref(ldvp); + + vpp = ap->a_vpp; + vp = NULL; + lvp = NULL; + if (vpp != NULL) { + vp = *vpp; + if (vp != NULL) { + vhold(vp); + mp = vp->v_mount; + lvp = NULLVPTOLOWERVP(vp); + if (ap->a_unlock_vp) + vref(lvp); + } + } + + res = VOP_VPUT_PAIR(ldvp, &lvp, ap->a_unlock_vp); + + /* lvp might have been unlocked and vp reclaimed */ + if (vp != NULL) { + if (!ap->a_unlock_vp && vp->v_vnlock != lvp->v_vnlock) { + error = null_nodeget(mp, lvp, &vp1); + if (error == 0) { + vput(vp); + *vpp = vp1; + } + } + if (ap->a_unlock_vp) + vrele(vp); + vdrop(vp); + } + vrele(dvp); + return (res); +} + /* * Global vfs data structures */ @@ -997,5 +1045,6 @@ struct vop_vector null_vnodeops = { .vop_vptocnp = null_vptocnp, .vop_vptofh = null_vptofh, .vop_add_writecount = null_add_writecount, + .vop_vput_pair = null_vput_pair, }; VFS_VOP_VECTOR_REGISTER(null_vnodeops); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20: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 CAA7F56FE54; Thu, 25 Feb 2021 20: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 4DmlNX23J5z3PSb; Thu, 25 Feb 2021 20: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 226211E551; Thu, 25 Feb 2021 20:52: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 11PKqeNV079634; Thu, 25 Feb 2021 20:52:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqeD6079633; Thu, 25 Feb 2021 20:52:40 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:40 GMT Message-Id: <202102252052.11PKqeD6079633@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: b287d46c385b - releng/13.0 - ffs_close_ea: do not relock vnode under lock_ea 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b287d46c385be71440693d3c0d8f4e098dee1207 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:47 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b287d46c385be71440693d3c0d8f4e098dee1207 commit b287d46c385be71440693d3c0d8f4e098dee1207 Author: Konstantin Belousov AuthorDate: 2021-02-21 10:10:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:52 +0000 ffs_close_ea: do not relock vnode under lock_ea Approved by: re (delphij, gjb) (cherry picked from commit 5e198e7646a27412c0541719f7bf1bbc0bd89223) --- sys/ufs/ffs/ffs_vnops.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index f9a6a36d178a..64c72f3d3cc4 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1422,9 +1422,10 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td { struct inode *ip; struct uio luio; - struct iovec liovec; + struct iovec *liovec; struct ufs2_dinode *dp; - int error; + size_t ea_len, tlen; + int error, i, lcnt; ip = VTOI(vp); @@ -1439,18 +1440,31 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td ASSERT_VOP_ELOCKED(vp, "ffs_close_ea commit"); if (cred == NOCRED) cred = vp->v_mount->mnt_cred; - liovec.iov_base = ip->i_ea_area; - liovec.iov_len = ip->i_ea_len; - luio.uio_iov = &liovec; - luio.uio_iovcnt = 1; + + ea_len = MAX(ip->i_ea_len, dp->di_extsize); + for (lcnt = 1, tlen = ea_len - ip->i_ea_len; tlen > 0;) { + tlen -= MIN(ZERO_REGION_SIZE, tlen); + lcnt++; + } + + liovec = __builtin_alloca(lcnt * sizeof(struct iovec)); + luio.uio_iovcnt = lcnt; + + liovec[0].iov_base = ip->i_ea_area; + liovec[0].iov_len = ip->i_ea_len; + for (i = 1, tlen = ea_len; i < lcnt; i++) { + liovec[i].iov_base = __DECONST(void *, zero_region); + liovec[i].iov_len = MIN(ZERO_REGION_SIZE, tlen); + tlen -= liovec[i].iov_len; + } + MPASS(tlen == ip->i_ea_len); + + luio.uio_iov = liovec; luio.uio_offset = 0; - luio.uio_resid = ip->i_ea_len; + luio.uio_resid = ea_len; luio.uio_segflg = UIO_SYSSPACE; luio.uio_rw = UIO_WRITE; luio.uio_td = td; - /* XXX: I'm not happy about truncating to zero size */ - if (ip->i_ea_len < dp->di_extsize) - error = ffs_truncate(vp, 0, IO_EXT, cred); error = ffs_extwrite(vp, &luio, IO_EXT | IO_SYNC, cred); } if (--ip->i_ea_refs == 0) { @@ -1460,6 +1474,9 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td ip->i_ea_error = 0; } ffs_unlock_ea(vp); + + if (commit && error == 0 && ip->i_ea_len == 0) + ffs_truncate(vp, 0, IO_EXT, cred); return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20: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 2745356FF20; Thu, 25 Feb 2021 20: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 4DmlNS6XTBz3PKD; Thu, 25 Feb 2021 20:52: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 0213E1E691; Thu, 25 Feb 2021 20:52: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 11PKqcWr079612; Thu, 25 Feb 2021 20:52:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqcBb079611; Thu, 25 Feb 2021 20:52:38 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:38 GMT Message-Id: <202102252052.11PKqcBb079611@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: 16961e5e3fa4 - releng/13.0 - ffs_vnops.c: style 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 16961e5e3fa47563743b7e4dd8892d017000477a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:43 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=16961e5e3fa47563743b7e4dd8892d017000477a commit 16961e5e3fa47563743b7e4dd8892d017000477a Author: Konstantin Belousov AuthorDate: 2021-02-20 17:01:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:47 +0000 ffs_vnops.c: style Approved by: re (delphij, gjb) (cherry picked from commit c6d68ca842a3f5b6814cdd5c87e406bad579b792) --- sys/ufs/ffs/ffs_vnops.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index c00469c4c7e3..f9a6a36d178a 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1423,8 +1423,8 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td struct inode *ip; struct uio luio; struct iovec liovec; - int error; struct ufs2_dinode *dp; + int error; ip = VTOI(vp); @@ -1527,14 +1527,15 @@ struct vop_closeextattr_args { }; */ { + struct vnode *vp; - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + vp = ap->a_vp; + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - - if (ap->a_commit && (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)) + if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); - return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred, ap->a_td)); + return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } /* @@ -1552,6 +1553,7 @@ vop_deleteextattr { }; */ { + struct vnode *vp; struct inode *ip; struct extattr *eap; uint32_t ul; @@ -1559,18 +1561,17 @@ vop_deleteextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); - - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1582,7 +1583,7 @@ vop_deleteextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1596,7 +1597,7 @@ vop_deleteextattr { if (olen == -1) { /* delete but nonexistent */ free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); return (ENOATTR); } ul = eap->ea_length; @@ -1608,7 +1609,7 @@ vop_deleteextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); } @@ -1741,6 +1742,7 @@ vop_setextattr { }; */ { + struct vnode *vp; struct inode *ip; struct fs *fs; struct extattr *eap; @@ -1750,12 +1752,12 @@ vop_setextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); fs = ITOFS(ip); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); @@ -1763,14 +1765,14 @@ vop_setextattr { if (ap->a_uio == NULL) return (EOPNOTSUPP); - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); ealen = ap->a_uio->uio_resid; if (ealen < 0 || ealen > lblktosize(fs, UFS_NXADDR)) return (EINVAL); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1782,7 +1784,7 @@ vop_setextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1819,7 +1821,7 @@ vop_setextattr { } if (easize > lblktosize(fs, UFS_NXADDR)) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = ENOSPC; return (ENOSPC); @@ -1833,7 +1835,7 @@ vop_setextattr { error = uiomove(EXTATTR_CONTENT(eap), ealen, ap->a_uio); if (error) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = error; return (error); @@ -1844,7 +1846,7 @@ vop_setextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 63DEC56FADD; Thu, 25 Feb 2021 20:52: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 4DmlN95Q9xz3P0W; Thu, 25 Feb 2021 20:52: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 EFB551E54B; Thu, 25 Feb 2021 20:52: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 11PKqMni079320; Thu, 25 Feb 2021 20:52:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqMV5079319; Thu, 25 Feb 2021 20:52:22 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:22 GMT Message-Id: <202102252052.11PKqMV5079319@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: 0c3cdbf4293a - releng/13.0 - ffs_vput_pair(): try harder to recover from the vnode reclaim 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 0c3cdbf4293afa1f6faa50e368e47327957ceb85 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:28 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0c3cdbf4293afa1f6faa50e368e47327957ceb85 commit 0c3cdbf4293afa1f6faa50e368e47327957ceb85 Author: Konstantin Belousov AuthorDate: 2021-01-27 18:10:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:49:04 +0000 ffs_vput_pair(): try harder to recover from the vnode reclaim Approved by: re (delphij, gjb) (cherry picked from commit 30bfb2fa0fad8e5bbcce369df46dcaa2e08324f3) --- sys/ufs/ffs/ffs_vnops.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 623b13790ce0..2ac67adad5f2 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1924,8 +1924,11 @@ ffs_getpages_async(struct vop_getpages_async_args *ap) static int ffs_vput_pair(struct vop_vput_pair_args *ap) { - struct vnode *dvp, *vp, **vpp; - struct inode *dp; + struct mount *mp; + struct vnode *dvp, *vp, *vp1, **vpp; + struct inode *dp, *ip; + ino_t ip_ino; + u_int64_t ip_gen; int error, vp_locked; dvp = ap->a_dvp; @@ -1940,12 +1943,17 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) return (0); } + mp = NULL; if (vp != NULL) { if (ap->a_unlock_vp) { vput(vp); } else { MPASS(vp->v_type != VNON); vp_locked = VOP_ISLOCKED(vp); + ip = VTOI(vp); + ip_ino = ip->i_number; + ip_gen = ip->i_gen; + mp = vp->v_mount; VOP_UNLOCK(vp); } } @@ -1957,6 +1965,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) if (vp == NULL || ap->a_unlock_vp) return (0); + MPASS(mp != NULL); /* * It is possible that vp is reclaimed at this point. Only @@ -1970,5 +1979,29 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) * and respond to dead vnodes by returning ESTALE. */ VOP_LOCK(vp, vp_locked | LK_RETRY); - return (0); + if (!VN_IS_DOOMED(vp)) + return (0); + + /* + * Try harder to recover from reclaimed vp if reclaim was not + * because underlying inode was cleared. We saved inode + * number and inode generation, so we can try to reinstantiate + * exactly same version of inode. If this fails, return + * original doomed vnode and let caller to handle + * consequences. + * + * Note that callers must keep write started around + * VOP_VPUT_PAIR() calls, so it is safe to use mp without + * busying it. + */ + VOP_UNLOCK(vp); + error = ffs_inotovp(mp, ip_ino, ip_gen, LK_EXCLUSIVE, &vp1, + FFSV_REPLACE_DOOMED); + if (error != 0) { + VOP_LOCK(vp, vp_locked | LK_RETRY); + } else { + vrele(vp); + *vpp = vp1; + } + return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 9D79D56FAE5; Thu, 25 Feb 2021 20:52: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 4DmlNF5HfSz3PMw; Thu, 25 Feb 2021 20:52: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 9B7701E54F; Thu, 25 Feb 2021 20:52: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 11PKqRNg079404; Thu, 25 Feb 2021 20:52:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqR5k079403; Thu, 25 Feb 2021 20:52:27 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:27 GMT Message-Id: <202102252052.11PKqR5k079403@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: f889959e0a35 - releng/13.0 - ffs softdep: remove will_direnter argument of softdep_prelink() 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f889959e0a35ae47205105d3074860272c639c04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:32 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f889959e0a35ae47205105d3074860272c639c04 commit f889959e0a35ae47205105d3074860272c639c04 Author: Konstantin Belousov AuthorDate: 2021-01-23 22:40:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:49:35 +0000 ffs softdep: remove will_direnter argument of softdep_prelink() Approved by: re (delphij, gjb) (cherry picked from commit ede40b0675155b5cc862652f2fee11c738a46bcd) --- sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_softdep.c | 46 ++++++++-------------------------------------- sys/ufs/ufs/ufs_vnops.c | 12 ++++++------ 3 files changed, 15 insertions(+), 45 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 9694489266b6..544012089046 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -178,7 +178,7 @@ int softdep_request_cleanup(struct fs *, struct vnode *, struct ucred *, int); int softdep_prerename(struct vnode *, struct vnode *, struct vnode *, struct vnode *); -int softdep_prelink(struct vnode *, struct vnode *, int); +int softdep_prelink(struct vnode *, struct vnode *); void softdep_setup_freeblocks(struct inode *, off_t, int); void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int); void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t, diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index e90593b20e40..3cc76f9142c3 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -621,10 +621,9 @@ softdep_prerename(fdvp, fvp, tdvp, tvp) } int -softdep_prelink(dvp, vp, will_direnter) +softdep_prelink(dvp, vp) struct vnode *dvp; struct vnode *vp; - int will_direnter; { panic("softdep_prelink called"); @@ -3358,13 +3357,11 @@ softdep_prerename(fdvp, fvp, tdvp, tvp) * syscall must be restarted at top level from the lookup. */ int -softdep_prelink(dvp, vp, will_direnter) +softdep_prelink(dvp, vp) struct vnode *dvp; struct vnode *vp; - int will_direnter; { struct ufsmount *ump; - int error, error1; ASSERT_VOP_ELOCKED(dvp, "prelink dvp"); if (vp != NULL) @@ -3372,40 +3369,13 @@ softdep_prelink(dvp, vp, will_direnter) ump = VFSTOUFS(dvp->v_mount); /* - * Nothing to do if we have sufficient journal space. - * If we currently hold the snapshot lock, we must avoid - * handling other resources that could cause deadlock. - * - * will_direnter == 1: In case allocated a directory block in - * an indirect block, we must prevent holes in the directory - * created if directory entries are written out of order. To - * accomplish this we fsync when we extend a directory into - * indirects. During rename it's not safe to drop the tvp - * lock so sync must be delayed until it is. - * - * This synchronous step could be removed if fsck and the - * kernel were taught to fill in sparse directories rather - * than panic. + * Nothing to do if we have sufficient journal space. We skip + * flushing when vp is a snapshot to avoid deadlock where + * another thread is trying to update the inodeblock for dvp + * and is waiting on snaplk that vp holds. */ - if (journal_space(ump, 0) || (vp != NULL && IS_SNAPSHOT(VTOI(vp)))) { - error = 0; - if (will_direnter && (vp == NULL || !IS_SNAPSHOT(VTOI(vp)))) { - if (vp != NULL) - VOP_UNLOCK(vp); - error = ffs_syncvnode(dvp, MNT_WAIT, 0); - if (vp != NULL) { - error1 = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); - if (error1 != 0) { - vn_lock_pair(dvp, true, vp, false); - if (error == 0) - error = ERELOOKUP; - } else if (vp->v_data == NULL) { - error = ERELOOKUP; - } - } - } - return (error); - } + if (journal_space(ump, 0) || (vp != NULL && IS_SNAPSHOT(VTOI(vp)))) + return (0); stat_journal_low++; if (vp != NULL) { diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 22199a390dd4..b035a8b1c34d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1007,7 +1007,7 @@ ufs_remove(ap) (VTOI(dvp)->i_flags & APPEND)) return (EPERM); if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, vp, true); + error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1072,7 +1072,7 @@ ufs_link(ap) #endif if (DOINGSOFTDEP(tdvp)) { - error = softdep_prelink(tdvp, vp, true); + error = softdep_prelink(tdvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1144,7 +1144,7 @@ ufs_whiteout(ap) if (DOINGSOFTDEP(dvp) && (ap->a_flags == CREATE || ap->a_flags == DELETE)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1946,7 +1946,7 @@ ufs_mkdir(ap) } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -2210,7 +2210,7 @@ ufs_rmdir(ap) goto out; } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, vp, false); + error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -2737,7 +2737,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) return (EINVAL); } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 855BD56FD77; Thu, 25 Feb 2021 20:52: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 4DmlN60w0zz3P5P; Thu, 25 Feb 2021 20:52: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 6C1E61E547; Thu, 25 Feb 2021 20:52: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 11PKqICP079234; Thu, 25 Feb 2021 20:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqIRQ079233; Thu, 25 Feb 2021 20:52:18 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:18 GMT Message-Id: <202102252052.11PKqIRQ079233@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: 02c163e49b03 - releng/13.0 - Use VOP_VPUT_PAIR() for eligible VFS syscalls. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 02c163e49b03e6e6121f9e0d14a2f15c90b73bbd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:24 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=02c163e49b03e6e6121f9e0d14a2f15c90b73bbd commit 02c163e49b03e6e6121f9e0d14a2f15c90b73bbd Author: Konstantin Belousov AuthorDate: 2021-01-28 22:31:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:42 +0000 Use VOP_VPUT_PAIR() for eligible VFS syscalls. Approved by: re (delphij, gjb) (cherry picked from commit 3b2aa36024abcb2d8fdbf3a6ecc7438b073b04e4) --- sys/kern/uipc_usrreq.c | 5 +++-- sys/kern/vfs_syscalls.c | 29 ++++++++++++----------------- sys/kern/vfs_vnops.c | 5 +++-- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0809f5180cc1..ca23ccbdb05e 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -669,8 +669,8 @@ restart: if (error == 0) error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); if (error) { + VOP_VPUT_PAIR(nd.ni_dvp, NULL, true); vn_finished_write(mp); if (error == ERELOOKUP) goto restart; @@ -686,7 +686,8 @@ restart: unp->unp_addr = soun; unp->unp_flags &= ~UNP_BINDING; UNP_PCB_UNLOCK(unp); - VOP_UNLOCK(vp); + vref(vp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, true); vn_finished_write(mp); free(buf, M_TEMP); return (0); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 35a56510e9ef..aba3d62936bb 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1370,13 +1370,12 @@ restart: else { error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); - if (error == 0) - vput(nd.ni_vp); } } - NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 && !whiteout ? &nd.ni_vp : NULL, + true); vn_finished_write(mp); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) goto restart; return (error); @@ -1457,12 +1456,10 @@ restart: goto out; #endif error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); - if (error == 0) - vput(nd.ni_vp); #ifdef MAC out: #endif - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) @@ -1629,10 +1626,10 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, return (EAGAIN); } error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); - VOP_UNLOCK(vp); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, true); vn_finished_write(mp); NDFREE(&nd, NDF_ONLY_PNBUF); + vp = NULL; } else { vput(nd.ni_dvp); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1640,7 +1637,8 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, return (EAGAIN); } } - vrele(vp); + if (vp != NULL) + vrele(vp); return (error); } @@ -1710,6 +1708,7 @@ restart: else vput(nd.ni_dvp); vrele(nd.ni_vp); + nd.ni_vp = NULL; error = EEXIST; goto out; } @@ -1730,14 +1729,12 @@ restart: goto out2; #endif error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, syspath); - if (error == 0) - vput(nd.ni_vp); #ifdef MAC out2: #endif - NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) goto restart; out: @@ -3794,9 +3791,7 @@ restart: out: #endif NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); - if (error == 0) - vput(nd.ni_vp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); if (error == ERELOOKUP) goto restart; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 3ec2662dfcd8..71dd379558cb 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -274,8 +274,9 @@ restart: if (error == 0) #endif error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, - &ndp->ni_cnd, vap); - vput(ndp->ni_dvp); + &ndp->ni_cnd, vap); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); vn_finished_write(mp); if (error) { NDFREE(ndp, NDF_ONLY_PNBUF); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 1A1CA56FB51; Thu, 25 Feb 2021 20:52: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 4DmlN72ft7z3P0Q; Thu, 25 Feb 2021 20:52: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 A89001E61E; Thu, 25 Feb 2021 20:52: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 11PKqKXF079280; Thu, 25 Feb 2021 20:52:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqKSk079279; Thu, 25 Feb 2021 20:52:20 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:20 GMT Message-Id: <202102252052.11PKqKSk079279@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: 2b2c2c7128ea - releng/13.0 - nfsserver: use VOP_VPUT_PAIR(). 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 2b2c2c7128ea1ee9ed049e9bca939772ed8d6ce1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:26 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2b2c2c7128ea1ee9ed049e9bca939772ed8d6ce1 commit 2b2c2c7128ea1ee9ed049e9bca939772ed8d6ce1 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:02:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:52 +0000 nfsserver: use VOP_VPUT_PAIR(). Approved by: re (delphij, gjb) (cherry picked from commit 4a21bcb24174438e0944d6e4d6633290a067b7a8) --- sys/fs/nfsserver/nfs_nfsdport.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index b781503a6815..4d19c73dfa06 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1105,7 +1105,8 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred, p); } - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); nfsvno_relpathbuf(ndp); if (!error) { if (*exclusive_flagp) { @@ -1140,7 +1141,8 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, nvap->na_rdev = rdev; error = VOP_MKNOD(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); nfsvno_relpathbuf(ndp); vrele(ndp->ni_startdir); if (error) @@ -1221,7 +1223,8 @@ nfsvno_mknod(struct nameidata *ndp, struct nfsvattr *nvap, struct ucred *cred, vrele(ndp->ni_startdir); error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, + false); nfsvno_relpathbuf(ndp); } else { if (nvap->na_type != VFIFO && @@ -1233,7 +1236,8 @@ nfsvno_mknod(struct nameidata *ndp, struct nfsvattr *nvap, struct ucred *cred, } error = VOP_MKNOD(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, + false); nfsvno_relpathbuf(ndp); vrele(ndp->ni_startdir); /* @@ -1268,7 +1272,7 @@ nfsvno_mkdir(struct nameidata *ndp, struct nfsvattr *nvap, uid_t saved_uid, } error = VOP_MKDIR(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, false); nfsvno_relpathbuf(ndp); out: @@ -1300,17 +1304,15 @@ nfsvno_symlink(struct nameidata *ndp, struct nfsvattr *nvap, char *pathcp, error = VOP_SYMLINK(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr, pathcp); - vput(ndp->ni_dvp); - vrele(ndp->ni_startdir); - nfsvno_relpathbuf(ndp); /* * Although FreeBSD still had the lookup code in * it for 7/current, there doesn't seem to be any * point, since VOP_SYMLINK() returns the ni_vp. * Just vput it for v2. */ - if (!not_v2 && !error) - vput(ndp->ni_vp); + VOP_VPUT_PAIR(ndp->ni_dvp, &ndp->ni_vp, !not_v2 && error == 0); + vrele(ndp->ni_startdir); + nfsvno_relpathbuf(ndp); out: NFSEXITCODE(error); @@ -1595,11 +1597,13 @@ nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); else error = EPERM; - if (ndp->ni_dvp == vp) + if (ndp->ni_dvp == vp) { vrele(ndp->ni_dvp); - else - vput(ndp->ni_dvp); - NFSVOPUNLOCK(vp); + NFSVOPUNLOCK(vp); + } else { + vref(vp); + VOP_VPUT_PAIR(ndp->ni_dvp, &vp, true); + } } else { if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); @@ -1793,7 +1797,8 @@ nfsvno_open(struct nfsrv_descript *nd, struct nameidata *ndp, nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, cred, p); } - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, nd->nd_repstat == 0 ? + &ndp->ni_vp : NULL, false); nfsvno_relpathbuf(ndp); if (!nd->nd_repstat) { if (*exclusive_flagp) { @@ -4106,7 +4111,8 @@ nfsrv_dscreate(struct vnode *dvp, struct vattr *vap, struct vattr *nvap, error = NFSVOPLOCK(dvp, LK_EXCLUSIVE); if (error == 0) { error = VOP_CREATE(dvp, &nvp, &named.ni_cnd, vap); - NFSVOPUNLOCK(dvp); + vref(dvp); + VOP_VPUT_PAIR(dvp, error == 0 ? &nvp : NULL, false); if (error == 0) { /* Set the ownership of the file. */ error = VOP_SETATTR(nvp, nvap, tcred); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 EA03556FB52; Thu, 25 Feb 2021 20:52: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 4DmlND0Kd2z3PCy; Thu, 25 Feb 2021 20:52: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 38FF81E5A9; Thu, 25 Feb 2021 20:52: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 11PKqOa3079342; Thu, 25 Feb 2021 20:52:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqOsa079341; Thu, 25 Feb 2021 20:52:24 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:24 GMT Message-Id: <202102252052.11PKqOsa079341@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: b62d17802dcf - releng/13.0 - ufs_direnter: move directory truncation to ffs_vput_pair(). 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b62d17802dcf9b589b6572a010e1a65820117155 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:29 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b62d17802dcf9b589b6572a010e1a65820117155 commit b62d17802dcf9b589b6572a010e1a65820117155 Author: Konstantin Belousov AuthorDate: 2021-01-27 20:34:14 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:49:09 +0000 ufs_direnter: move directory truncation to ffs_vput_pair(). Approved by: re (delphij, gjb) (cherry picked from commit 74a3652f832f4ed0f1ad9f7eb60d70013b478e1a) --- sys/ufs/ffs/ffs_vnops.c | 44 ++++++++++++++++++++++++++++++++++++++------ sys/ufs/ufs/inode.h | 2 ++ sys/ufs/ufs/ufs_lookup.c | 25 ++++++------------------- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 2ac67adad5f2..dd0f1ba6b81d 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "opt_directio.h" #include "opt_ffs.h" +#include "opt_ufs.h" #include #include @@ -99,6 +100,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef UFS_DIRHASH +#include +#endif #include #include @@ -1929,6 +1934,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) struct inode *dp, *ip; ino_t ip_ino; u_int64_t ip_gen; + off_t old_size; int error, vp_locked; dvp = ap->a_dvp; @@ -1936,14 +1942,14 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) vpp = ap->a_vpp; vp = vpp != NULL ? *vpp : NULL; - if ((dp->i_flag & IN_NEEDSYNC) == 0) { + if ((dp->i_flag & (IN_NEEDSYNC | IN_ENDOFF)) == 0) { vput(dvp); if (vp != NULL && ap->a_unlock_vp) vput(vp); return (0); } - mp = NULL; + mp = dvp->v_mount; if (vp != NULL) { if (ap->a_unlock_vp) { vput(vp); @@ -1953,14 +1959,40 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) ip = VTOI(vp); ip_ino = ip->i_number; ip_gen = ip->i_gen; - mp = vp->v_mount; VOP_UNLOCK(vp); } } - do { - error = ffs_syncvnode(dvp, MNT_WAIT, 0); - } while (error == ERELOOKUP); + /* + * If compaction or fsync was requested do it in ffs_vput_pair() + * now that other locks are no longer held. + */ + if ((dp->i_flag & IN_ENDOFF) != 0) { + dp->i_flag &= ~IN_ENDOFF; + if (I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { + old_size = dp->i_size; + error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), + IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), + curthread->td_ucred); + if (error != 0 && error != ERELOOKUP) { + if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { + vn_printf(dvp, + "IN_ENDOFF: failed to truncate, " + "error %d\n", error); + } +#ifdef UFS_DIRHASH + ufsdirhash_free(dp); +#endif + } + } + SET_I_ENDOFF(dp, 0); + } + if ((dp->i_flag & IN_NEEDSYNC) != 0) { + do { + error = ffs_syncvnode(dvp, MNT_WAIT, 0); + } while (error == ERELOOKUP); + } + vput(dvp); if (vp == NULL || ap->a_unlock_vp) diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 16db8d6d5cea..4515dcbed401 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -152,6 +152,8 @@ struct inode { #define IN_IBLKDATA 0x0800 /* datasync requires inode block update */ #define IN_SIZEMOD 0x1000 /* Inode size has been modified */ +#define IN_ENDOFF 0x2000 /* Free space at the end of directory, + try to truncate when possible */ #define PRINT_INODE_FLAGS "\20\20b16\17b15\16b14\15sizemod" \ "\14iblkdata\13is_ufs2\12truncated\11ea_lockwait\10ea_locked" \ diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index e614f189a623..3036bce81caf 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1112,27 +1112,14 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) } } UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE); + /* - * If all went well, and the directory can be shortened, proceed - * with the truncation. Note that we have to unlock the inode for - * the entry that we just entered, as the truncation may need to - * lock other inodes which can lead to deadlock if we also hold a - * lock on the newly entered node. + * If all went well, and the directory can be shortened, mark directory inode + * with the truncation request right before unlock. */ - if (isrename == 0 && error == 0 && - I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { - if (tvp != NULL) - VOP_UNLOCK(tvp); - error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), - IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); - if (error != 0) - vn_printf(dvp, - "ufs_direnter: failed to truncate, error %d\n", - error); - error = 0; - if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); - } + if (isrename == 0 && error == 0) + UFS_INODE_SET_FLAG(dp, IN_ENDOFF); + return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 53DD7548002; Thu, 25 Feb 2021 20:52: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 4DmlND5npwz3P7M; Thu, 25 Feb 2021 20:52: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 501CF1E349; Thu, 25 Feb 2021 20:52: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 11PKqPd6079364; Thu, 25 Feb 2021 20:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqPw3079363; Thu, 25 Feb 2021 20:52:25 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:25 GMT Message-Id: <202102252052.11PKqPw3079363@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: 9fc9a50119fa - releng/13.0 - ufs_rename: use VOP_VPUT_PAIR and rely on directory sync/truncation there 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9fc9a50119fa65bce6612a634f161d9e7dbf9478 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:30 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9fc9a50119fa65bce6612a634f161d9e7dbf9478 commit 9fc9a50119fa65bce6612a634f161d9e7dbf9478 Author: Konstantin Belousov AuthorDate: 2021-01-28 13:34:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:49:24 +0000 ufs_rename: use VOP_VPUT_PAIR and rely on directory sync/truncation there Approved by: re (delphij, gjb) (cherry picked from commit 038fe6e089f03ca864c1dd5ac0c76404a13bbe79) --- sys/ufs/ufs/ufs_vnops.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 70b5a44ca21d..c101e699bad6 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1676,38 +1676,16 @@ unlockout: vput(fdvp); vput(fvp); - if (tvp) - vput(tvp); + /* - * If compaction or fsync was requested do it now that other locks - * are no longer needed. + * If compaction or fsync was requested do it in + * ffs_vput_pair() now that other locks are no longer needed. */ if (error == 0 && endoff != 0) { - do { - error = UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | - (DOINGASYNC(tdvp) ? 0 : IO_SYNC), tcnp->cn_cred); - } while (error == ERELOOKUP); - if (error != 0 && !ffs_fsfail_cleanup(VFSTOUFS(mp), error)) - vn_printf(tdvp, - "ufs_rename: failed to truncate, error %d\n", - error); -#ifdef UFS_DIRHASH - if (error != 0) - ufsdirhash_free(tdp); -#endif - /* - * Even if the directory compaction failed, rename was - * succesful. Do not propagate a UFS_TRUNCATE() error - * to the caller. - */ - error = 0; - } - if (error == 0 && tdp->i_flag & IN_NEEDSYNC) { - do { - error = VOP_FSYNC(tdvp, MNT_WAIT, td); - } while (error == ERELOOKUP); + UFS_INODE_SET_FLAG(tdp, IN_ENDOFF); + SET_I_ENDOFF(tdp, endoff); } - vput(tdvp); + VOP_VPUT_PAIR(tdvp, &tvp, true); return (error); bad: From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FDF856FE39; Thu, 25 Feb 2021 20:52:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmlNL2pWhz3PTv; Thu, 25 Feb 2021 20:52: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 1F2161E3EA; Thu, 25 Feb 2021 20:52: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 11PKqUVh079466; Thu, 25 Feb 2021 20:52:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqUU8079465; Thu, 25 Feb 2021 20:52:30 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:30 GMT Message-Id: <202102252052.11PKqUU8079465@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: f8272ff1d26b - releng/13.0 - ufs_inactive(): stop hiding ERELOOKUP from ffs_truncate(), return it. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f8272ff1d26b2fa6936a2ef294e494e43429f973 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:36 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f8272ff1d26b2fa6936a2ef294e494e43429f973 commit f8272ff1d26b2fa6936a2ef294e494e43429f973 Author: Konstantin Belousov AuthorDate: 2021-01-30 19:18:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:00 +0000 ufs_inactive(): stop hiding ERELOOKUP from ffs_truncate(), return it. Approved by: re (delphij, gjb) (cherry picked from commit 013168db8cea926c3dde1247d400d6bedf9a889d) --- sys/ufs/ffs/ffs_softdep.c | 9 +++++---- sys/ufs/ufs/ufs_inode.c | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 3cc76f9142c3..8c3ae9dd95fc 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1493,13 +1493,14 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_t inum, struct buf *bp, } /* - * Do not drop vnode lock while inactivating. This - * would result in leaks of the VI flags and - * reclaiming of non-truncated vnode. Instead, + * Do not drop vnode lock while inactivating during + * vunref. This would result in leaks of the VI flags + * and reclaiming of non-truncated vnode. Instead, * re-schedule inactivation hoping that we would be * able to sync inode later. */ - if ((vp->v_iflag & VI_DOINGINACT) != 0) { + if ((vp->v_iflag & VI_DOINGINACT) != 0 && + (vp->v_vflag & VV_UNREF) != 0) { VI_LOCK(vp); vp->v_iflag |= VI_OWEINACT; VI_UNLOCK(vp); diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index 15bd8be448a9..46e4f8e54e41 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -212,8 +212,6 @@ out: vrecycle(vp); if (mp != NULL) vn_finished_secondary_write(mp); - if (error == ERELOOKUP) - error = 0; return (error); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20: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 26F1856FF1F; Thu, 25 Feb 2021 20: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 4DmlNS4yfbz3PVF; Thu, 25 Feb 2021 20:52: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 DD27C1E550; Thu, 25 Feb 2021 20:52: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 11PKqahw079572; Thu, 25 Feb 2021 20:52:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqaU2079571; Thu, 25 Feb 2021 20:52:36 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:36 GMT Message-Id: <202102252052.11PKqaU2079571@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: 298fde182f38 - releng/13.0 - ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ() 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 298fde182f389b48eecd0f6f84c6479e743b70a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:43 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=298fde182f389b48eecd0f6f84c6479e743b70a8 commit 298fde182f389b48eecd0f6f84c6479e743b70a8 Author: Konstantin Belousov AuthorDate: 2021-02-19 12:37:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:37 +0000 ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ() Approved by: re (delphij, gjb) (cherry picked from commit cc9958bf22f1426faf4be8bf492ce69587a9008f) --- sys/ufs/ffs/ffs_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 3b652ea14303..c7a1e2dec15e 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -543,7 +543,7 @@ ffs_reallocblks(ap) * here. Instead we simply fail to reallocate blocks if this * rare condition arises. */ - if (DOINGSOFTDEP(ap->a_vp)) + if (DOINGSUJ(ap->a_vp)) if (softdep_prealloc(ap->a_vp, MNT_NOWAIT) != 0) return (ENOSPC); if (ump->um_fstype == UFS1) From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20: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 7A21356FEB5; Thu, 25 Feb 2021 20: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 4DmlNX4QPBz3PNf; Thu, 25 Feb 2021 20: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 35ED31E629; Thu, 25 Feb 2021 20:52: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 11PKqf60079656; Thu, 25 Feb 2021 20:52:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqf1T079655; Thu, 25 Feb 2021 20:52:41 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:41 GMT Message-Id: <202102252052.11PKqf1T079655@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: 6e3f19537ae6 - releng/13.0 - Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 6e3f19537ae6e91560fe7130a13cd47e63399146 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:48 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6e3f19537ae6e91560fe7130a13cd47e63399146 commit 6e3f19537ae6e91560fe7130a13cd47e63399146 Author: Konstantin Belousov AuthorDate: 2021-02-21 10:11:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:57 +0000 Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing Approved by: re (delphij, gjb) (cherry picked from commit 6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba) --- sys/ufs/ffs/ffs_vnops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 64c72f3d3cc4..af03b369a280 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1552,6 +1552,12 @@ struct vop_closeextattr_args { if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); + if (ap->a_commit && DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_closeextattr commit"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } @@ -1600,6 +1606,13 @@ vop_deleteextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1801,6 +1814,13 @@ vop_setextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52: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 10CD956FAFD; Thu, 25 Feb 2021 20:52: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 4DmlNY049pz3PVW; Thu, 25 Feb 2021 20: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 749BD1E5B1; Thu, 25 Feb 2021 20:52: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 11PKqgZc079674; Thu, 25 Feb 2021 20: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 11PKqgvh079673; Thu, 25 Feb 2021 20:52:42 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:42 GMT Message-Id: <202102252052.11PKqgvh079673@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: f3a1daebaff5 - releng/13.0 - Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f3a1daebaff5181c69ba1086d63de694bf298c64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 20:52:48 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f3a1daebaff5181c69ba1086d63de694bf298c64 commit f3a1daebaff5181c69ba1086d63de694bf298c64 Author: Kirk McKusick AuthorDate: 2021-02-12 05:31:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:51:10 +0000 Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash PR: 253158 Approved by: re (delphij, gjb) (cherry picked from commit 8563de2f2799b2cb6f2f06e3c9dddd48dca2a986) (cherry picked from commit c31480a1f66537e59b02e935a547bcfc76715278) --- sys/ufs/ffs/ffs_snapshot.c | 141 ++++++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 67 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 72c8061917d8..6da84fb46bb0 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -316,21 +319,21 @@ restart: ip = VTOI(vp); devvp = ITODEVVP(ip); /* - * Allocate and copy the last block contents so as to be able - * to set size to that of the filesystem. + * Calculate the size of the filesystem then allocate the block + * immediately following the last block of the filesystem that + * will contain the snapshot list. This operation allows us to + * set the size of the snapshot. */ numblks = howmany(fs->fs_size, fs->fs_frag); - error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(numblks - 1)), + error = UFS_BALLOC(vp, lblktosize(fs, (off_t)numblks), fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); if (error) goto out; - ip->i_size = lblktosize(fs, (off_t)numblks); + bawrite(bp); + ip->i_size = lblktosize(fs, (off_t)(numblks + 1)); + vnode_pager_setsize(vp, ip->i_size); DIP_SET(ip, i_size, ip->i_size); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); - error = readblock(vp, bp, numblks - 1); - bawrite(bp); - if (error != 0) - goto out; /* * Preallocate critical data structures so that we can copy * them in without further allocation after we suspend all @@ -452,23 +455,13 @@ restart: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (ip->i_effnlink == 0) { error = ENOENT; /* Snapshot file unlinked */ - goto out1; + goto resumefs; } #ifdef DIAGNOSTIC if (collectsnapstats) nanotime(&starttime); #endif - /* The last block might have changed. Copy it again to be sure. */ - error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(numblks - 1)), - fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); - if (error != 0) - goto out1; - error = readblock(vp, bp, numblks - 1); - bp->b_flags |= B_VALIDSUSPWRT; - bawrite(bp); - if (error != 0) - goto out1; /* * First, copy all the cylinder group maps that have changed. */ @@ -479,11 +472,11 @@ restart: error = UFS_BALLOC(vp, lfragtosize(fs, cgtod(fs, cg)), fs->fs_bsize, KERNCRED, 0, &nbp); if (error) - goto out1; + goto resumefs; error = cgaccount(cg, vp, nbp, 2); bawrite(nbp); if (error) - goto out1; + goto resumefs; } /* * Grab a copy of the superblock and its summary information. @@ -513,11 +506,7 @@ restart: if ((error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + loc), len, KERNCRED, &bp)) != 0) { brelse(bp); - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; - goto out1; + goto resumefs; } bcopy(bp->b_data, space, (u_int)len); space = (char *)space + len; @@ -539,10 +528,27 @@ restart: * Note that we skip unlinked snapshot files as they will * be handled separately below. * - * We also calculate the needed size for the snapshot list. + * We also calculate the size needed for the snapshot list. + * Initial number of entries is composed of: + * - one for each cylinder group map + * - one for each block used by superblock summary table + * - one for each snapshot inode block + * - one for the superblock + * - one for the snapshot list + * The direct block entries in the snapshot are always + * copied (see reason below). Note that the superblock and + * the first cylinder group will almost always be allocated + * in the direct blocks, but we add the slop for them in case + * they do not end up there. The snapshot list size may get + * expanded by one because of an update of an inode block for + * an unlinked but still open file when it is expunged. + * + * Because the direct block pointers are always copied, they + * are not added to the list. Instead ffs_copyonwrite() + * explicitly checks for them before checking the snapshot list. */ snaplistsize = fs->fs_ncg + howmany(fs->fs_cssize, fs->fs_bsize) + - FSMAXSNAP + 1 /* superblock */ + 1 /* last block */ + 1 /* size */; + FSMAXSNAP + /* superblock */ 1 + /* snaplist */ 1; MNT_ILOCK(mp); mp->mnt_kern_flag &= ~MNTK_SUSPENDED; MNT_IUNLOCK(mp); @@ -624,12 +630,8 @@ loop: VOP_UNLOCK(xvp); vdrop(xvp); if (error) { - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); - goto out1; + goto resumefs; } } /* @@ -637,13 +639,8 @@ loop: */ if (fs->fs_flags & FS_SUJ) { error = softdep_journal_lookup(mp, &xvp); - if (error) { - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; - goto out1; - } + if (error) + goto resumefs; xp = VTOI(xvp); if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1, @@ -694,6 +691,27 @@ loop: sn->sn_listsize = blkp - snapblklist; VI_UNLOCK(devvp); } + /* + * Preallocate all the direct blocks in the snapshot inode so + * that we never have to write the inode itself to commit an + * update to the contents of the snapshot. Note that once + * created, the size of the snapshot will never change, so + * there will never be a need to write the inode except to + * update the non-integrity-critical time fields and + * allocated-block count. + */ + for (blockno = 0; blockno < UFS_NDADDR; blockno++) { + if (DIP(ip, i_db[blockno]) != 0) + continue; + error = UFS_BALLOC(vp, lblktosize(fs, blockno), + fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); + if (error) + goto resumefs; + error = readblock(vp, bp, blockno); + bawrite(bp); + if (error != 0) + goto resumefs; + } /* * Record snapshot inode. Since this is the newest snapshot, * it must be placed at the end of the list. @@ -706,11 +724,16 @@ loop: TAILQ_INSERT_TAIL(&sn->sn_head, ip, i_nextsnap); devvp->v_vflag |= VV_COPYONWRITE; VI_UNLOCK(devvp); +resumefs: ASSERT_VOP_LOCKED(vp, "ffs_snapshot vp"); -out1: - KASSERT((sn != NULL && copy_fs != NULL && error == 0) || - (sn == NULL && copy_fs == NULL && error != 0), - ("email phk@ and mckusick@")); + if (error != 0 && copy_fs != NULL) { + free(copy_fs->fs_csp, M_UFSMNT); + free(copy_fs->fs_si, M_UFSMNT); + free(copy_fs, M_UFSMNT); + copy_fs = NULL; + } + KASSERT(error != 0 || (sn != NULL && copy_fs != NULL), + ("missing snapshot setup parameters")); /* * Resume operation on filesystem. */ @@ -786,7 +809,7 @@ out1: aiov.iov_base = (void *)snapblklist; aiov.iov_len = snaplistsize * sizeof(daddr_t); auio.uio_resid = aiov.iov_len; - auio.uio_offset = ip->i_size; + auio.uio_offset = lblktosize(fs, (off_t)numblks); auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; auio.uio_td = td; @@ -835,27 +858,6 @@ out1: VI_UNLOCK(devvp); if (space != NULL) free(space, M_UFSMNT); - /* - * Preallocate all the direct blocks in the snapshot inode so - * that we never have to write the inode itself to commit an - * update to the contents of the snapshot. Note that once - * created, the size of the snapshot will never change, so - * there will never be a need to write the inode except to - * update the non-integrity-critical time fields and - * allocated-block count. - */ - for (blockno = 0; blockno < UFS_NDADDR; blockno++) { - if (DIP(ip, i_db[blockno]) != 0) - continue; - error = UFS_BALLOC(vp, lblktosize(fs, blockno), - fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); - if (error) - break; - error = readblock(vp, bp, blockno); - bawrite(bp); - if (error != 0) - break; - } done: free(copy_fs->fs_csp, M_UFSMNT); free(copy_fs->fs_si, M_UFSMNT); @@ -1573,7 +1575,8 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype) blkno = *oldblkp; if (blkno == 0 || blkno == BLK_NOCOPY) continue; - if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP) + if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP && + lblkno >= UFS_NDADDR) *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); @@ -2320,6 +2323,10 @@ ffs_copyonwrite(devvp, bp) ip = TAILQ_FIRST(&sn->sn_head); fs = ITOFS(ip); lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno)); + if (lbn < UFS_NDADDR) { + VI_UNLOCK(devvp); + return (0); /* Direct blocks are always copied */ + } snapblklist = sn->sn_blklist; upper = sn->sn_listsize - 1; lower = 1; From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:15: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 EE9A5549E09; Thu, 25 Feb 2021 21:15: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 4DmltJ64HLz3lRR; Thu, 25 Feb 2021 21:15: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 C34F01E6CE; Thu, 25 Feb 2021 21:15: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 11PLF4v7007619; Thu, 25 Feb 2021 21:15:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLF47Q007618; Thu, 25 Feb 2021 21:15:04 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:15:04 GMT Message-Id: <202102252115.11PLF47Q007618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 547739cc003a - main - [ar71xx] Fix routerstation / routerstation pro redboot FIS probing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 547739cc003a68f43a13981e5de1143861eca08c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:15:05 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=547739cc003a68f43a13981e5de1143861eca08c commit 547739cc003a68f43a13981e5de1143861eca08c Author: Adrian Chadd AuthorDate: 2021-02-25 21:06:03 +0000 Commit: Adrian Chadd CommitDate: 2021-02-25 21:14:55 +0000 [ar71xx] Fix routerstation / routerstation pro redboot FIS probing Some changes back in ye olde times somewhere has changed the default block size the flash device exposes. So, the default geom redboot FIS probing (to find the partition table structure in flash!) is no longer finding it. So, force it to probe at the last 64k of flash regardless of the underlying flash block size. Tested: * Ubiquiti Routerstation pro, boots -HEAD MIPS --- sys/mips/conf/ROUTERSTATION.hints | 4 ++++ sys/mips/conf/RSPRO.hints | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sys/mips/conf/ROUTERSTATION.hints b/sys/mips/conf/ROUTERSTATION.hints index 7b35b229af30..c5740c035d8f 100644 --- a/sys/mips/conf/ROUTERSTATION.hints +++ b/sys/mips/conf/ROUTERSTATION.hints @@ -46,3 +46,7 @@ hint.gpioled.0.at="gpiobus0" hint.gpioled.0.name="rf" # pin 2 hint.gpioled.0.pins=0x0004 + +# Override this to ensure we definitely point to the last 64K of the +# 16MiB flash chip in case underlying block size of the flash driver changes. +hint.redboot.0.fisoffset="0xff0000" diff --git a/sys/mips/conf/RSPRO.hints b/sys/mips/conf/RSPRO.hints index a802328db3b5..6ed26ec0b9e6 100644 --- a/sys/mips/conf/RSPRO.hints +++ b/sys/mips/conf/RSPRO.hints @@ -47,3 +47,7 @@ hint.gpioled.0.at="gpiobus0" hint.gpioled.0.name="rf" # pin 2 hint.gpioled.0.pins=0x0004 + +# Override this to ensure we definitely point to the last 64K of the +# 16MiB flash chip in case underlying block size of the flash driver changes. +hint.redboot.0.fisoffset="0xff0000" From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:32: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 11FBE54A323; Thu, 25 Feb 2021 21:32: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 4DmmG673G5z3msj; Thu, 25 Feb 2021 21:32: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 E4D261EEA4; Thu, 25 Feb 2021 21:32: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 11PLWEdQ033493; Thu, 25 Feb 2021 21:32:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLWECa033491; Thu, 25 Feb 2021 21:32:14 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:32:14 GMT Message-Id: <202102252132.11PLWECa033491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ce9bc83f9146 - releng/13.0 - arm64: validate breakpoint registers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: ce9bc83f914623a2f2309b10786bafc0d481054c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:32:15 -0000 The branch releng/13.0 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ce9bc83f914623a2f2309b10786bafc0d481054c commit ce9bc83f914623a2f2309b10786bafc0d481054c Author: Mitchell Horne AuthorDate: 2021-02-09 18:29:38 +0000 Commit: Mitchell Horne CommitDate: 2021-02-25 21:30:45 +0000 arm64: validate breakpoint registers In particular, we want to disallow setting breakpoints on kernel addresses from userspace. The control register fields are validated or ignored as appropriate. Reviewed by: markj Sponsored by: The FreeBSD Foundation Approved by: re (gjb) (cherry picked from commit de2b9422807586d376ec7ffa7b660cd492464bdf) (cherry picked from commit 8837e9c54072679b69ae0c0345e7ef7d241255aa) --- sys/arm64/arm64/machdep.c | 37 +++++++++++++++++++++++++++++++++---- sys/arm64/include/armreg.h | 17 +++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 90fc19d57415..bf44dba19482 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -357,6 +357,8 @@ int set_dbregs(struct thread *td, struct dbreg *regs) { struct debug_monitor_state *monitor; + uint64_t addr; + uint32_t ctrl; int count; int i; @@ -364,11 +366,38 @@ set_dbregs(struct thread *td, struct dbreg *regs) count = 0; monitor->dbg_enable_count = 0; for (i = 0; i < DBG_BRP_MAX; i++) { - /* TODO: Check these values */ - monitor->dbg_bvr[i] = regs->db_regs[i].dbr_addr; - monitor->dbg_bcr[i] = regs->db_regs[i].dbr_ctrl; - if ((monitor->dbg_bcr[i] & 1) != 0) + addr = regs->db_regs[i].dbr_addr; + ctrl = regs->db_regs[i].dbr_ctrl; + + /* Don't let the user set a breakpoint on a kernel address. */ + if (addr >= VM_MAXUSER_ADDRESS) + return (EINVAL); + + /* + * The lowest 2 bits are ignored, so record the effective + * address. + */ + addr = rounddown2(addr, 4); + + /* + * Some control fields are ignored, and other bits reserved. + * Only unlinked, address-matching breakpoints are supported. + * + * XXX: fields that appear unvalidated, such as BAS, have + * constrained undefined behaviour. If the user mis-programs + * these, there is no risk to the system. + */ + ctrl &= DBG_BCR_EN | DBG_BCR_PMC | DBG_BCR_BAS; + if ((ctrl & DBG_BCR_EN) != 0) { + /* Only target EL0. */ + if ((ctrl & DBG_BCR_PMC) != DBG_BCR_PMC_EL0) + return (EINVAL); + monitor->dbg_enable_count++; + } + + monitor->dbg_bvr[i] = addr; + monitor->dbg_bcr[i] = ctrl; } if (monitor->dbg_enable_count > 0) monitor->dbg_flags |= DBGMON_ENABLED; diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 201d7559320b..73d1010057b9 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -943,6 +943,23 @@ #define DBG_MDSCR_KDE (0x1 << 13) #define DBG_MDSCR_MDE (0x1 << 15) +/* Debug Breakpoint Control Registers */ +#define DBG_BCR_EN 0x1 +#define DBG_BCR_PMC_SHIFT 1 +#define DBG_BCR_PMC (0x3 << DBG_BCR_PMC_SHIFT) +#define DBG_BCR_PMC_EL1 (0x1 << DBG_BCR_PMC_SHIFT) +#define DBG_BCR_PMC_EL0 (0x2 << DBG_BCR_PMC_SHIFT) +#define DBG_BCR_BAS_SHIFT 5 +#define DBG_BCR_BAS (0xf << DBG_BCR_BAS_SHIFT) +#define DBG_BCR_HMC_SHIFT 13 +#define DBG_BCR_HMC (0x1 << DBG_BCR_HMC_SHIFT) +#define DBG_BCR_SSC_SHIFT 14 +#define DBG_BCR_SSC (0x3 << DBG_BCR_SSC_SHIFT) +#define DBG_BCR_LBN_SHIFT 16 +#define DBG_BCR_LBN (0xf << DBG_BCR_LBN_SHIFT) +#define DBG_BCR_BT_SHIFT 20 +#define DBG_BCR_BT (0xf << DBG_BCR_BT_SHIFT) + /* Perfomance Monitoring Counters */ #define PMCR_E (1 << 0) /* Enable all counters */ #define PMCR_P (1 << 1) /* Reset all counters */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:32: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 1960454A329; Thu, 25 Feb 2021 21:32: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 4DmmG80G7Lz3mWL; Thu, 25 Feb 2021 21:32: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 EE43D1EDAE; Thu, 25 Feb 2021 21:32: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 11PLWFm0033512; Thu, 25 Feb 2021 21:32:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLWFPl033511; Thu, 25 Feb 2021 21:32:15 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:32:15 GMT Message-Id: <202102252132.11PLWFPl033511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 8f686c0f29f0 - releng/13.0 - arm64: handle watchpoint exceptions from EL0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 8f686c0f29f094eba305d7911195bd629c3954bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:32:16 -0000 The branch releng/13.0 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8f686c0f29f094eba305d7911195bd629c3954bb commit 8f686c0f29f094eba305d7911195bd629c3954bb Author: Mitchell Horne AuthorDate: 2021-02-05 21:46:48 +0000 Commit: Mitchell Horne CommitDate: 2021-02-25 21:31:17 +0000 arm64: handle watchpoint exceptions from EL0 This is a prerequisite to allowing the use of hardware watchpoints for userspace debuggers. This is also a slight departure from the x86 behaviour, since `si_addr` returns the data address that triggered the watchpoint, not the address of the instruction that was executed. Otherwise, there is no straightforward way for the application to determine which watchpoint was triggered. Make a note of this in the siginfo(3) man page. Reviewed by: jhb, markj (earlier version) Tested by: Michał Górny (mgorny@gentoo.org) Sponsored by: The FreeBSD Foundation Approved by: re (gjb) (cherry picked from commit bd012c71592323d957b409bb5e0cf7940729650e) (cherry picked from commit 9372df63ad5b814440732d171c8f04f0e1c26b87) --- share/man/man3/siginfo.3 | 7 ++++++- sys/arm64/arm64/trap.c | 6 ++++++ sys/arm64/include/armreg.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/share/man/man3/siginfo.3 b/share/man/man3/siginfo.3 index fc4ea2ba1df7..acc8785b2f0d 100644 --- a/share/man/man3/siginfo.3 +++ b/share/man/man3/siginfo.3 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2020 +.Dd February 17, 2021 .Dt SIGINFO 3 .Os .Sh NAME @@ -218,6 +218,11 @@ and may report the address of the faulting memory access (if available) in .Va si_addr instead. +Additionally +.Dv SIGTRAP +raised by a hardware watchpoint exception may report the data address that +triggered the watchpoint in +.Va si_addr . .Pp Sychronous signals set .Va si_trapno diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 0b2d4760cea3..cb3a05ad0163 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -474,6 +474,7 @@ do_el0_sync(struct thread *td, struct trapframe *frame) case EXCP_UNKNOWN: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: + case EXCP_WATCHPT_EL0: far = READ_SPECIALREG(far_el1); break; } @@ -534,6 +535,11 @@ do_el0_sync(struct thread *td, struct trapframe *frame) exception); userret(td, frame); break; + case EXCP_WATCHPT_EL0: + call_trapsignal(td, SIGTRAP, TRAP_TRACE, (void *)far, + exception); + userret(td, frame); + break; case EXCP_MSR: /* * The CPU can raise EXCP_MSR when userspace executes an mrs diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 73d1010057b9..66cd8591c7ab 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -230,6 +230,7 @@ #define EXCP_BRKPT_EL0 0x30 /* Hardware breakpoint, from same EL */ #define EXCP_SOFTSTP_EL0 0x32 /* Software Step, from lower EL */ #define EXCP_SOFTSTP_EL1 0x33 /* Software Step, from same EL */ +#define EXCP_WATCHPT_EL0 0x34 /* Watchpoint, from lower EL */ #define EXCP_WATCHPT_EL1 0x35 /* Watchpoint, from same EL */ #define EXCP_BRK 0x3c /* Breakpoint */ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:32: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 97B2554A32E; Thu, 25 Feb 2021 21:32: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 4DmmG91fMKz3mf6; Thu, 25 Feb 2021 21:32: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 20C2C1EE2B; Thu, 25 Feb 2021 21:32: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 11PLWH2f033530; Thu, 25 Feb 2021 21:32:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLWHKU033529; Thu, 25 Feb 2021 21:32:17 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:32:17 GMT Message-Id: <202102252132.11PLWHKU033529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: f1847ed16ebd - releng/13.0 - arm64: extend struct db_reg to include watchpoint registers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: f1847ed16ebd16d91766934ff7c28e887fbd2846 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:32:18 -0000 The branch releng/13.0 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=f1847ed16ebd16d91766934ff7c28e887fbd2846 commit f1847ed16ebd16d91766934ff7c28e887fbd2846 Author: Mitchell Horne AuthorDate: 2021-01-28 17:49:47 +0000 Commit: Mitchell Horne CommitDate: 2021-02-25 21:31:31 +0000 arm64: extend struct db_reg to include watchpoint registers The motivation is to provide access to these registers from userspace via ptrace(2) requests PT_GETDBREGS and PT_SETDBREGS. This change breaks the ABI of these particular requests, but is justified by the fact that the intended consumers (debuggers) have not been taught to use them yet. Making this change now enables active upstream work on lldb to begin using this interface, and take advantage of the hardware debugging registers available on the platform. PR: 252860 Reported by: Michał Górny (mgorny@gentoo.org) Reviewed by: andrew, markj (earlier version) Tested by: Michał Górny (mgorny@gentoo.org) Sponsored by: The FreeBSD Foundation Approved by: re (gjb) (cherry picked from commit f2583be110ca3a5b32f0993f1464a5c69151c62f) (cherry picked from commit 4786c8582c569a7245dadbdbb4638d1667c10d62) --- sys/arm64/arm64/identcpu.c | 2 +- sys/arm64/arm64/machdep.c | 71 ++++++++++++++++++++++++++++++++++++++-------- sys/arm64/include/armreg.h | 22 ++++++++++++++ sys/arm64/include/reg.h | 13 +++++++-- 4 files changed, 92 insertions(+), 16 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index bfbaad7a6483..c3544e9de9aa 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -350,7 +350,7 @@ static struct mrs_field id_aa64dfr0_fields[] = { MRS_FIELD(ID_AA64DFR0, PMSVer, false, MRS_EXACT, id_aa64dfr0_pmsver), MRS_FIELD(ID_AA64DFR0, CTX_CMPs, false, MRS_EXACT, id_aa64dfr0_ctx_cmps), - MRS_FIELD(ID_AA64DFR0, WRPs, false, MRS_EXACT, id_aa64dfr0_wrps), + MRS_FIELD(ID_AA64DFR0, WRPs, false, MRS_LOWER, id_aa64dfr0_wrps), MRS_FIELD(ID_AA64DFR0, BRPs, false, MRS_LOWER, id_aa64dfr0_brps), MRS_FIELD(ID_AA64DFR0, PMUVer, false, MRS_EXACT, id_aa64dfr0_pmuver), MRS_FIELD(ID_AA64DFR0, TraceVer, false, MRS_EXACT, diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index bf44dba19482..73b06beeba7e 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -321,8 +321,8 @@ int fill_dbregs(struct thread *td, struct dbreg *regs) { struct debug_monitor_state *monitor; - int count, i; - uint8_t debug_ver, nbkpts; + int i; + uint8_t debug_ver, nbkpts, nwtpts; memset(regs, 0, sizeof(*regs)); @@ -330,23 +330,30 @@ fill_dbregs(struct thread *td, struct dbreg *regs) &debug_ver); extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_BRPs_SHIFT, &nbkpts); + extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_WRPs_SHIFT, + &nwtpts); /* * The BRPs field contains the number of breakpoints - 1. Armv8-A * allows the hardware to provide 2-16 breakpoints so this won't - * overflow an 8 bit value. + * overflow an 8 bit value. The same applies to the WRPs field. */ - count = nbkpts + 1; + nbkpts++; + nwtpts++; - regs->db_info = debug_ver; - regs->db_info <<= 8; - regs->db_info |= count; + regs->db_debug_ver = debug_ver; + regs->db_nbkpts = nbkpts; + regs->db_nwtpts = nwtpts; monitor = &td->td_pcb->pcb_dbg_regs; if ((monitor->dbg_flags & DBGMON_ENABLED) != 0) { - for (i = 0; i < count; i++) { - regs->db_regs[i].dbr_addr = monitor->dbg_bvr[i]; - regs->db_regs[i].dbr_ctrl = monitor->dbg_bcr[i]; + for (i = 0; i < nbkpts; i++) { + regs->db_breakregs[i].dbr_addr = monitor->dbg_bvr[i]; + regs->db_breakregs[i].dbr_ctrl = monitor->dbg_bcr[i]; + } + for (i = 0; i < nwtpts; i++) { + regs->db_watchregs[i].dbw_addr = monitor->dbg_wvr[i]; + regs->db_watchregs[i].dbw_ctrl = monitor->dbg_wcr[i]; } } @@ -365,9 +372,10 @@ set_dbregs(struct thread *td, struct dbreg *regs) monitor = &td->td_pcb->pcb_dbg_regs; count = 0; monitor->dbg_enable_count = 0; + for (i = 0; i < DBG_BRP_MAX; i++) { - addr = regs->db_regs[i].dbr_addr; - ctrl = regs->db_regs[i].dbr_ctrl; + addr = regs->db_breakregs[i].dbr_addr; + ctrl = regs->db_breakregs[i].dbr_ctrl; /* Don't let the user set a breakpoint on a kernel address. */ if (addr >= VM_MAXUSER_ADDRESS) @@ -399,6 +407,45 @@ set_dbregs(struct thread *td, struct dbreg *regs) monitor->dbg_bvr[i] = addr; monitor->dbg_bcr[i] = ctrl; } + + for (i = 0; i < DBG_WRP_MAX; i++) { + addr = regs->db_watchregs[i].dbw_addr; + ctrl = regs->db_watchregs[i].dbw_ctrl; + + /* Don't let the user set a watchpoint on a kernel address. */ + if (addr >= VM_MAXUSER_ADDRESS) + return (EINVAL); + + /* + * Some control fields are ignored, and other bits reserved. + * Only unlinked watchpoints are supported. + */ + ctrl &= DBG_WCR_EN | DBG_WCR_PAC | DBG_WCR_LSC | DBG_WCR_BAS | + DBG_WCR_MASK; + + if ((ctrl & DBG_WCR_EN) != 0) { + /* Only target EL0. */ + if ((ctrl & DBG_WCR_PAC) != DBG_WCR_PAC_EL0) + return (EINVAL); + + /* Must set at least one of the load/store bits. */ + if ((ctrl & DBG_WCR_LSC) == 0) + return (EINVAL); + + /* + * When specifying the address range with BAS, the MASK + * field must be zero. + */ + if ((ctrl & DBG_WCR_BAS) != DBG_WCR_BAS_MASK && + (ctrl & DBG_WCR_MASK) != 0) + return (EINVAL); + + monitor->dbg_enable_count++; + } + monitor->dbg_wvr[i] = addr; + monitor->dbg_wcr[i] = ctrl; + } + if (monitor->dbg_enable_count > 0) monitor->dbg_flags |= DBGMON_ENABLED; diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 66cd8591c7ab..81cea5431017 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -961,6 +961,28 @@ #define DBG_BCR_BT_SHIFT 20 #define DBG_BCR_BT (0xf << DBG_BCR_BT_SHIFT) +/* Debug Watchpoint Control Registers */ +#define DBG_WCR_EN 0x1 +#define DBG_WCR_PAC_SHIFT 1 +#define DBG_WCR_PAC (0x3 << DBG_WCR_PAC_SHIFT) +#define DBG_WCR_PAC_EL1 (0x1 << DBG_WCR_PAC_SHIFT) +#define DBG_WCR_PAC_EL0 (0x2 << DBG_WCR_PAC_SHIFT) +#define DBG_WCR_LSC_SHIFT 3 +#define DBG_WCR_LSC (0x3 << DBG_WCR_LSC_SHIFT) +#define DBG_WCR_BAS_SHIFT 5 +#define DBG_WCR_BAS (0xff << DBG_WCR_BAS_SHIFT) +#define DBG_WCR_BAS_MASK DBG_WCR_BAS +#define DBG_WCR_HMC_SHIFT 13 +#define DBG_WCR_HMC (0x1 << DBG_WCR_HMC_SHIFT) +#define DBG_WCR_SSC_SHIFT 14 +#define DBG_WCR_SSC (0x3 << DBG_WCR_SSC_SHIFT) +#define DBG_WCR_LBN_SHIFT 16 +#define DBG_WCR_LBN (0xf << DBG_WCR_LBN_SHIFT) +#define DBG_WCR_WT_SHIFT 20 +#define DBG_WCR_WT (0x1 << DBG_WCR_WT_SHIFT) +#define DBG_WCR_MASK_SHIFT 24 +#define DBG_WCR_MASK (0x1f << DBG_WCR_MASK_SHIFT) + /* Perfomance Monitoring Counters */ #define PMCR_E (1 << 0) /* Enable all counters */ #define PMCR_P (1 << 1) /* Reset all counters */ diff --git a/sys/arm64/include/reg.h b/sys/arm64/include/reg.h index aafe02b70925..9cfc5ea1d437 100644 --- a/sys/arm64/include/reg.h +++ b/sys/arm64/include/reg.h @@ -60,14 +60,21 @@ struct fpreg32 { }; struct dbreg { - uint32_t db_info; - uint32_t db_pad; + uint8_t db_debug_ver; + uint8_t db_nbkpts; + uint8_t db_nwtpts; + uint8_t db_pad[5]; struct { uint64_t dbr_addr; uint32_t dbr_ctrl; uint32_t dbr_pad; - } db_regs[16]; + } db_breakregs[16]; + struct { + uint64_t dbw_addr; + uint32_t dbw_ctrl; + uint32_t dbw_pad; + } db_watchregs[16]; }; struct dbreg32 { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:42: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 59F0554A678; Thu, 25 Feb 2021 21:42: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 4DmmTb235vz3nPf; Thu, 25 Feb 2021 21:42: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 2F0AE1F191; Thu, 25 Feb 2021 21:42: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 11PLgBLn046600; Thu, 25 Feb 2021 21:42:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLgBUi046599; Thu, 25 Feb 2021 21:42:11 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:42:11 GMT Message-Id: <202102252142.11PLgBUi046599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Watson Subject: git: bbcdd9faca55 - stable/13 - Reimplemen FreeBSD/arm64 dtrace_gethrtime() to use the system timer. dtrace_gethrtime() is the high-resolution nanosecond timestemp used for the DTrace 'timestamp' built-in variable. The new implementation uses the EL0 cycle counter and frequency registers in ARMv8-A. This replaces a previous implementation that relied on an instrumentation-safe implementation of getnanotime(), which provided only timer resolution. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbcdd9faca55758b228b949f1c1bb41b85e90a8e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:42:11 -0000 The branch stable/13 has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=bbcdd9faca55758b228b949f1c1bb41b85e90a8e commit bbcdd9faca55758b228b949f1c1bb41b85e90a8e Author: Robert Watson AuthorDate: 2021-02-16 15:19:05 +0000 Commit: Robert Watson CommitDate: 2021-02-25 21:38:30 +0000 Reimplemen FreeBSD/arm64 dtrace_gethrtime() to use the system timer. dtrace_gethrtime() is the high-resolution nanosecond timestemp used for the DTrace 'timestamp' built-in variable. The new implementation uses the EL0 cycle counter and frequency registers in ARMv8-A. This replaces a previous implementation that relied on an instrumentation-safe implementation of getnanotime(), which provided only timer resolution. Approved by: re (gjb) Reviewed by: andrew, bsdimp (older version) Useful comments appreciated: jrtc27, emaste Differential Revision: https://reviews.freebsd.org/D28723 --- sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index 6646e51fc191..9bf9f0798bb5 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -153,23 +153,26 @@ dtrace_sync(void) } /* - * DTrace needs a high resolution time function which can - * be called from a probe context and guaranteed not to have - * instrumented with probes itself. + * DTrace needs a high resolution time function which can be called from a + * probe context and guaranteed not to have instrumented with probes itself. * - * Returns nanoseconds since boot. + * Returns nanoseconds since some arbitrary point in time (likely SoC reset?). */ uint64_t -dtrace_gethrtime() +dtrace_gethrtime(void) { - struct timespec curtime; - - dtrace_getnanouptime(&curtime); - - return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); + uint64_t count, freq; + count = READ_SPECIALREG(cntvct_el0); + freq = READ_SPECIALREG(cntfrq_el0); + return ((1000000000UL * count) / freq); } +/* + * Return a much lower resolution wallclock time based on the system clock + * updated by the timer. If needed, we could add a version interpolated from + * the system clock as is the case with dtrace_gethrtime(). + */ uint64_t dtrace_gethrestime(void) { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:44: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 E837B54AAC4; Thu, 25 Feb 2021 21:44: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 4DmmXQ61J0z3p6d; Thu, 25 Feb 2021 21:44: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 BF7CC1F1A3; Thu, 25 Feb 2021 21:44: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 11PLic7h047089; Thu, 25 Feb 2021 21:44:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLic3p047088; Thu, 25 Feb 2021 21:44:38 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:44:38 GMT Message-Id: <202102252144.11PLic3p047088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7dfdd039a358 - stable/13 - Fix crash with rtadv-originated multipath IPv6 routes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7dfdd039a3584885648d33888359032479038dc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:44:39 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7dfdd039a3584885648d33888359032479038dc1 commit 7dfdd039a3584885648d33888359032479038dc1 Author: Alexander V. Chernikov AuthorDate: 2021-02-24 16:42:48 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-25 21:43:37 +0000 Fix crash with rtadv-originated multipath IPv6 routes. PR: 253800 Reported by: Frederic Denis MFC after: immediately (cherry picked from commit cc3fa1e29fda2cc761e793a61cef3bd2522b3468) --- sys/netinet6/nd6_rtr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 51b831a956bc..2f721b4edcc3 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -699,7 +698,7 @@ defrouter_addreq(struct nd_defrouter *new) NET_EPOCH_ASSERT(); error = rib_action(fibnum, RTM_ADD, &info, &rc); if (error == 0) { - struct nhop_object *nh = nhop_select(rc.rc_nh_new, 0); + struct nhop_object *nh = nhop_select_func(rc.rc_nh_new, 0); rt_routemsg(RTM_ADD, rc.rc_rt, nh, fibnum); new->installed = 1; } @@ -739,7 +738,7 @@ defrouter_delreq(struct nd_defrouter *dr) NET_EPOCH_ENTER(et); error = rib_action(fibnum, RTM_DELETE, &info, &rc); if (error == 0) { - struct nhop_object *nh = nhop_select(rc.rc_nh_old, 0); + struct nhop_object *nh = nhop_select_func(rc.rc_nh_old, 0); rt_routemsg(RTM_DELETE, rc.rc_rt, nh, fibnum); } NET_EPOCH_EXIT(et); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:49: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 ECEC854AAE7; Thu, 25 Feb 2021 21:49: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 4DmmfF017Hz3p83; Thu, 25 Feb 2021 21:49: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 44C0C1EEF3; Thu, 25 Feb 2021 21:49: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 11PLnevq047986; Thu, 25 Feb 2021 21:49:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLneYj047985; Thu, 25 Feb 2021 21:49:40 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:49:40 GMT Message-Id: <202102252149.11PLneYj047985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: e6b813522702 - main - ncurses: fix patch date MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6b813522702811681247b9dd5fc1839c3e242f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:49:42 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e6b813522702811681247b9dd5fc1839c3e242f3 commit e6b813522702811681247b9dd5fc1839c3e242f3 Author: Baptiste Daroussin AuthorDate: 2021-02-25 21:40:07 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 21:47:44 +0000 ncurses: fix patch date Submitted by: cy --- lib/ncurses/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ncurses/config.mk b/lib/ncurses/config.mk index fc77567b2594..cd569ddf9ec8 100644 --- a/lib/ncurses/config.mk +++ b/lib/ncurses/config.mk @@ -5,7 +5,7 @@ NCURSES_DIR= ${SRCTOP}/contrib/ncurses NCURSES_MAJOR= 6 NCURSES_MINOR= 2 -NCURSES_PATCH= 20200215 +NCURSES_PATCH= 20210220 CFLAGS+= -D_XOPEN_SOURCE_EXTENDED NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:49: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 B142454AAEA; Thu, 25 Feb 2021 21:49: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 4DmmfF4Xq3z3p3Z; Thu, 25 Feb 2021 21:49: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 5CB641EEF4; Thu, 25 Feb 2021 21:49: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 11PLnfkn048008; Thu, 25 Feb 2021 21:49:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLnfr3048007; Thu, 25 Feb 2021 21:49:41 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:49:41 GMT Message-Id: <202102252149.11PLnfr3048007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d2eb5dbd7d6d - main - ncurses: fix generation of term.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2eb5dbd7d6d31e6ab85737e86c9a8bfc7f266c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:49:42 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d2eb5dbd7d6d31e6ab85737e86c9a8bfc7f266c8 commit d2eb5dbd7d6d31e6ab85737e86c9a8bfc7f266c8 Author: Baptiste Daroussin AuthorDate: 2021-02-25 21:46:24 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-25 21:49:20 +0000 ncurses: fix generation of term.h All variable were not properly expanded Submitted by: cy (initial version) --- lib/ncurses/ncurses/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 68ed3b39f458..5a1fab7003a6 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -425,7 +425,9 @@ MKterm.h.awk: MKterm.h.awk.in -e "/@HAVE_TERMIOS_H@/s%%${HAVE_TERMIOS_H}%" \ -e "/@HAVE_TERMIO_H@/s%%${HAVE_TERMIO_H}%" \ -e "/@HAVE_TCGETATTR@/s%%${HAVE_TCGETATTR}%" \ - -e "s%@cf_cv_enable_reentrant@%${ENABLE_REENTRANT}%g" + -e "s%@cf_cv_enable_reentrant@%${ENABLE_REENTRANT}%g" \ + -e "s%@NCURSES_SP_FUNCS@%1%" \ + -e "s%@NCURSES_PATCH@%${NCURSES_PATCH}%" termcap.h: termcap.h.in sed <${NCURSES_DIR}/include/termcap.h.in >$@ \ From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:56:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6B7654AD45; Thu, 25 Feb 2021 21:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dmmp95GkSz3q3G; Thu, 25 Feb 2021 21:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A30C71EDEE; Thu, 25 Feb 2021 21:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PLuX7Q060455; Thu, 25 Feb 2021 21:56:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLuX3k060454; Thu, 25 Feb 2021 21:56:33 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:56:33 GMT Message-Id: <202102252156.11PLuX3k060454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 5dde6e460a1f - releng/13.0 - Fix nd6 rib_action() handling. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 5dde6e460a1f76842f884e1f6a53df8e7648756b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:56:33 -0000 The branch releng/13.0 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5dde6e460a1f76842f884e1f6a53df8e7648756b commit 5dde6e460a1f76842f884e1f6a53df8e7648756b Author: Alexander V. Chernikov AuthorDate: 2021-02-23 22:31:07 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-25 21:55:52 +0000 Fix nd6 rib_action() handling. rib_action() guarantees valid rc filling IFF it returns without error. Check rib_action() return code instead of checking rc fields. PR: 253800 Reported by: Frederic Denis Approved by: re(gjb) (cherry picked from commit ea10694336b9a07d58d22187052291976f4906b2) --- sys/netinet6/nd6_rtr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index eca704dc2843..51b831a956bc 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -698,12 +698,11 @@ defrouter_addreq(struct nd_defrouter *new) NET_EPOCH_ASSERT(); error = rib_action(fibnum, RTM_ADD, &info, &rc); - if (rc.rc_rt != NULL) { + if (error == 0) { struct nhop_object *nh = nhop_select(rc.rc_nh_new, 0); rt_routemsg(RTM_ADD, rc.rc_rt, nh, fibnum); - } - if (error == 0) new->installed = 1; + } } /* @@ -719,6 +718,7 @@ defrouter_delreq(struct nd_defrouter *dr) struct rib_cmd_info rc; struct epoch_tracker et; unsigned int fibnum; + int error; bzero(&def, sizeof(def)); bzero(&mask, sizeof(mask)); @@ -737,8 +737,8 @@ defrouter_delreq(struct nd_defrouter *dr) info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&mask; NET_EPOCH_ENTER(et); - rib_action(fibnum, RTM_DELETE, &info, &rc); - if (rc.rc_rt != NULL) { + error = rib_action(fibnum, RTM_DELETE, &info, &rc); + if (error == 0) { struct nhop_object *nh = nhop_select(rc.rc_nh_old, 0); rt_routemsg(RTM_DELETE, rc.rc_rt, nh, fibnum); } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 21:56:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B15854ACE7; Thu, 25 Feb 2021 21:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmmpB6FR6z3pvh; Thu, 25 Feb 2021 21:56: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 C0D7C1F0DA; Thu, 25 Feb 2021 21:56: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 11PLuYw7060477; Thu, 25 Feb 2021 21:56:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PLuYvl060476; Thu, 25 Feb 2021 21:56:34 GMT (envelope-from git) Date: Thu, 25 Feb 2021 21:56:34 GMT Message-Id: <202102252156.11PLuYvl060476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 52d4c9e2fa02 - releng/13.0 - Fix crash with rtadv-originated multipath IPv6 routes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 52d4c9e2fa024c36ea75ad17c50a9e66d2dbdc8c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 21:56:35 -0000 The branch releng/13.0 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=52d4c9e2fa024c36ea75ad17c50a9e66d2dbdc8c commit 52d4c9e2fa024c36ea75ad17c50a9e66d2dbdc8c Author: Alexander V. Chernikov AuthorDate: 2021-02-24 16:42:48 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-25 21:55:58 +0000 Fix crash with rtadv-originated multipath IPv6 routes. PR: 253800 Reported by: Frederic Denis Approved by: re(gjb) (cherry picked from commit 7dfdd039a3584885648d33888359032479038dc1) --- sys/netinet6/nd6_rtr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 51b831a956bc..2f721b4edcc3 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -699,7 +698,7 @@ defrouter_addreq(struct nd_defrouter *new) NET_EPOCH_ASSERT(); error = rib_action(fibnum, RTM_ADD, &info, &rc); if (error == 0) { - struct nhop_object *nh = nhop_select(rc.rc_nh_new, 0); + struct nhop_object *nh = nhop_select_func(rc.rc_nh_new, 0); rt_routemsg(RTM_ADD, rc.rc_rt, nh, fibnum); new->installed = 1; } @@ -739,7 +738,7 @@ defrouter_delreq(struct nd_defrouter *dr) NET_EPOCH_ENTER(et); error = rib_action(fibnum, RTM_DELETE, &info, &rc); if (error == 0) { - struct nhop_object *nh = nhop_select(rc.rc_nh_old, 0); + struct nhop_object *nh = nhop_select_func(rc.rc_nh_old, 0); rt_routemsg(RTM_DELETE, rc.rc_rt, nh, fibnum); } NET_EPOCH_EXIT(et); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 22:32: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 5BD1254C127; Thu, 25 Feb 2021 22:32: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 4Dmnb8250Bz3s2N; Thu, 25 Feb 2021 22:32: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 30C211F94B; Thu, 25 Feb 2021 22:32: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 11PMW4MW010564; Thu, 25 Feb 2021 22:32:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PMW4i6010563; Thu, 25 Feb 2021 22:32:04 GMT (envelope-from git) Date: Thu, 25 Feb 2021 22:32:04 GMT Message-Id: <202102252232.11PMW4i6010563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Watson Subject: git: 97bfffafda88 - releng/13.0 - Reimplement FreeBSD/arm64 dtrace_gethrtime() to use the system timer. dtrace_gethrtime() is the high-resolution nanosecond timestemp used for the DTrace 'timestamp' built-in variable. The new implementation uses the EL0 cycle counter and frequency registers in ARMv8-A. This replaces a previous implementation that relied on an instrumentation-safe implementation of getnanotime(), which provided only timer resolution. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 97bfffafda88fde623ca732efbb089cae9eb209f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 22:32:04 -0000 The branch releng/13.0 has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=97bfffafda88fde623ca732efbb089cae9eb209f commit 97bfffafda88fde623ca732efbb089cae9eb209f Author: Robert Watson AuthorDate: 2021-02-16 15:19:05 +0000 Commit: Robert Watson CommitDate: 2021-02-25 22:31:52 +0000 Reimplement FreeBSD/arm64 dtrace_gethrtime() to use the system timer. dtrace_gethrtime() is the high-resolution nanosecond timestemp used for the DTrace 'timestamp' built-in variable. The new implementation uses the EL0 cycle counter and frequency registers in ARMv8-A. This replaces a previous implementation that relied on an instrumentation-safe implementation of getnanotime(), which provided only timer resolution. Approved by: re (gjb) Reviewed by: andrew, bsdimp (older version) Useful comments appreciated: jrtc27, emaste Differential Revision: https://reviews.freebsd.org/D28723 --- sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index 6646e51fc191..9bf9f0798bb5 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -153,23 +153,26 @@ dtrace_sync(void) } /* - * DTrace needs a high resolution time function which can - * be called from a probe context and guaranteed not to have - * instrumented with probes itself. + * DTrace needs a high resolution time function which can be called from a + * probe context and guaranteed not to have instrumented with probes itself. * - * Returns nanoseconds since boot. + * Returns nanoseconds since some arbitrary point in time (likely SoC reset?). */ uint64_t -dtrace_gethrtime() +dtrace_gethrtime(void) { - struct timespec curtime; - - dtrace_getnanouptime(&curtime); - - return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); + uint64_t count, freq; + count = READ_SPECIALREG(cntvct_el0); + freq = READ_SPECIALREG(cntfrq_el0); + return ((1000000000UL * count) / freq); } +/* + * Return a much lower resolution wallclock time based on the system clock + * updated by the timer. If needed, we could add a version interpolated from + * the system clock as is the case with dtrace_gethrtime(). + */ uint64_t dtrace_gethrestime(void) { From owner-dev-commits-src-all@freebsd.org Thu Feb 25 22:44: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 90D5554C42A; Thu, 25 Feb 2021 22:44: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 4DmnsZ3hxpz3sZX; Thu, 25 Feb 2021 22:44: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 719D61FF82; Thu, 25 Feb 2021 22:44: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 11PMiYED026969; Thu, 25 Feb 2021 22:44:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PMiYld026968; Thu, 25 Feb 2021 22:44:34 GMT (envelope-from git) Date: Thu, 25 Feb 2021 22:44:34 GMT Message-Id: <202102252244.11PMiYld026968@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: 5f1b1f184b7f - main - pf: Fix incorrect fragment handling 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: 5f1b1f184b7f12330cf4a027e3db7c6700c67640 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 22:44:34 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5f1b1f184b7f12330cf4a027e3db7c6700c67640 commit 5f1b1f184b7f12330cf4a027e3db7c6700c67640 Author: Kristof Provost AuthorDate: 2021-02-25 07:07:36 +0000 Commit: Kristof Provost CommitDate: 2021-02-25 20:51:08 +0000 pf: Fix incorrect fragment handling A sequence of overlapping IPv4 fragments could crash the kernel in pf due to an assertion. Reported by: Alexander Bluhm Obtained from: OpenBSD MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_norm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index b7a84437630b..d7310c7bccb4 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -549,6 +549,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, struct pf_frent *after, *next, *prev; struct pf_fragment *frag; uint16_t total; + int old_index, new_index; PF_FRAG_ASSERT(); @@ -660,8 +661,30 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, DPFPRINTF(("adjust overlap %d\n", aftercut)); if (aftercut < after->fe_len) { m_adj(after->fe_m, aftercut); + old_index = pf_frent_index(after); after->fe_off += aftercut; after->fe_len -= aftercut; + new_index = pf_frent_index(after); + if (old_index != new_index) { + DPFPRINTF(("frag index %d, new %d", + old_index, new_index)); + /* Fragment switched queue as fe_off changed */ + after->fe_off -= aftercut; + after->fe_len += aftercut; + /* Remove restored fragment from old queue */ + pf_frent_remove(frag, after); + after->fe_off += aftercut; + after->fe_len -= aftercut; + /* Insert into correct queue */ + if (pf_frent_insert(frag, after, prev)) { + DPFPRINTF( + ("fragment requeue limit exceeded")); + m_freem(after->fe_m); + uma_zfree(V_pf_frent_z, after); + /* There is not way to recover */ + goto bad_fragment; + } + } break; } From owner-dev-commits-src-all@freebsd.org Thu Feb 25 23:09: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 E72AB54C4BD; Thu, 25 Feb 2021 23:09: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 4DmpQk6H8Cz3tN3; Thu, 25 Feb 2021 23:09: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 C621E1FF58; Thu, 25 Feb 2021 23:09: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 11PN9oYh054379; Thu, 25 Feb 2021 23:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PN9oQU054377; Thu, 25 Feb 2021 23:09:50 GMT (envelope-from git) Date: Thu, 25 Feb 2021 23:09:50 GMT Message-Id: <202102252309.11PN9oQU054377@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: 90972f04026a - main - ktls: Use COUNTER_U64_DEFINE_EARLY for the ktls_toe_chacha20 counter. 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: 90972f04026a2248d616d7466053ff53cf8fdf9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 23:09:51 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=90972f04026a2248d616d7466053ff53cf8fdf9d commit 90972f04026a2248d616d7466053ff53cf8fdf9d Author: John Baldwin AuthorDate: 2021-02-20 00:33:46 +0000 Commit: John Baldwin CommitDate: 2021-02-25 23:00:13 +0000 ktls: Use COUNTER_U64_DEFINE_EARLY for the ktls_toe_chacha20 counter. I missed updating this counter when rebasing the changes in 9c64fc40290e08f6dc6b75aa04084b04e48a61af after the switch to COUNTER_U64_DEFINE_EARLY in 1755b2b9891bb1bfa7a58383ef5126821f7e46e3. Fixes: 9c64fc40290e Add Chacha20-Poly1305 as a KTLS cipher suite. Sponsored by: Netflix --- sys/kern/uipc_ktls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index f92314d9c607..9fc5f8b203c0 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -249,7 +249,7 @@ SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, gcm, CTLFLAG_RD, &ktls_toe_gcm, "Active number of TOE TLS sessions using AES-GCM"); -static counter_u64_t ktls_toe_chacha20; +static COUNTER_U64_DEFINE_EARLY(ktls_toe_chacha20); SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, chacha20, CTLFLAG_RD, &ktls_toe_chacha20, "Active number of TOE TLS sessions using Chacha20-Poly1305"); From owner-dev-commits-src-all@freebsd.org Thu Feb 25 23:49: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 6FF8354D9C5; Thu, 25 Feb 2021 23:49: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 4DmqK12jQwz3wXv; Thu, 25 Feb 2021 23:49: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 4B7D92093A; Thu, 25 Feb 2021 23:49: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 11PNnvWQ006584; Thu, 25 Feb 2021 23:49:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PNnvN6006583; Thu, 25 Feb 2021 23:49:57 GMT (envelope-from git) Date: Thu, 25 Feb 2021 23:49:57 GMT Message-Id: <202102252349.11PNnvN6006583@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: aac25e222525 - main - pmap: Fix largemap restart checks in the kernel_maps sysctl handler 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: aac25e222525780db8939d07a594d3e090c0a148 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 25 Feb 2021 23:49:57 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aac25e222525780db8939d07a594d3e090c0a148 commit aac25e222525780db8939d07a594d3e090c0a148 Author: Mark Johnston AuthorDate: 2021-02-25 23:49:47 +0000 Commit: Mark Johnston CommitDate: 2021-02-25 23:49:47 +0000 pmap: Fix largemap restart checks in the kernel_maps sysctl handler The purpose of these checks is to ensure that the address of the next-level page table page is valid, since nothing is synchronizing with a concurrent update of the large map and large map PTPs are freed to the system. However, if PG_PS is set, there is no next level. Reported by: rpokala Reviewed by: kib Tested by: rpokala MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28922 --- sys/amd64/amd64/pmap.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 7dddeb3ee4ea..f509c40e760a 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -11348,9 +11348,6 @@ restart: continue; } pa = pdpe & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pdpe & PG_PS) != 0) { sva = rounddown2(sva, NBPDP); sysctl_kmaps_check(sb, &range, sva, pml4e, pdpe, @@ -11359,6 +11356,15 @@ restart: sva += NBPDP; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map may be + * freed. Validate the next-level address + * before descending. + */ + goto restart; + } pd = (pd_entry_t *)PHYS_TO_DMAP(pa); for (k = pmap_pde_index(sva); k < NPDEPG; k++) { @@ -11370,9 +11376,6 @@ restart: continue; } pa = pde & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pde & PG_PS) != 0) { sva = rounddown2(sva, NBPDR); sysctl_kmaps_check(sb, &range, sva, @@ -11381,6 +11384,15 @@ restart: sva += NBPDR; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map + * may be freed. Validate the + * next-level address before descending. + */ + goto restart; + } pt = (pt_entry_t *)PHYS_TO_DMAP(pa); for (l = pmap_pte_index(sva); l < NPTEPG; l++, From owner-dev-commits-src-all@freebsd.org Fri Feb 26 00:36: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 6E20A54F9B5; Fri, 26 Feb 2021 00:36: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 4DmrLy2K4Nz4TXT; Fri, 26 Feb 2021 00:36: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 3891D2127F; Fri, 26 Feb 2021 00:36: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 11Q0aggZ072285; Fri, 26 Feb 2021 00:36:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q0agkb072284; Fri, 26 Feb 2021 00:36:42 GMT (envelope-from git) Date: Fri, 26 Feb 2021 00:36:42 GMT Message-Id: <202102260036.11Q0agkb072284@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: 63241a0764c9 - stable/13 - Handle partial data re-sending on ktls/sendfile on FreeBSD 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: 63241a0764c9414e1bcce3bcb05bfbdba8f1f487 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 00:36:42 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=63241a0764c9414e1bcce3bcb05bfbdba8f1f487 commit 63241a0764c9414e1bcce3bcb05bfbdba8f1f487 Author: Oleksandr Tymoshenko AuthorDate: 2021-02-17 22:49:30 +0000 Commit: John Baldwin CommitDate: 2021-02-25 22:45:41 +0000 Handle partial data re-sending on ktls/sendfile on FreeBSD Add a handler for EBUSY sendfile error in addition to EAGAIN. With EBUSY returned the data still can be partially sent and user code has to be notified about it, otherwise it may try to send data multiple times. PR: 251969 Obtained from: OpenSSL (dfcfd17f2818cf520ce6381aed9ec3d2fc12170d) Sponsored by: Netflix (merging to FreeBSD) (cherry picked from commit 9b2f020c14af71a2606012143432dd717c7cf90e) --- crypto/openssl/doc/man3/SSL_write.pod | 3 ++- crypto/openssl/include/internal/ktls.h | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/crypto/openssl/doc/man3/SSL_write.pod b/crypto/openssl/doc/man3/SSL_write.pod index 20c7953deb06..9b271d8e65a2 100644 --- a/crypto/openssl/doc/man3/SSL_write.pod +++ b/crypto/openssl/doc/man3/SSL_write.pod @@ -120,7 +120,8 @@ For SSL_sendfile(), the following return values can occur: =item Z<>>= 0 The write operation was successful, the return value is the number -of bytes of the file written to the TLS/SSL connection. +of bytes of the file written to the TLS/SSL connection. The return +value can be less than B for a partial write. =item E 0 diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h index 9032c0ed6174..622d7be76d1e 100644 --- a/crypto/openssl/include/internal/ktls.h +++ b/crypto/openssl/include/internal/ktls.h @@ -192,15 +192,12 @@ static ossl_inline int ktls_read_record(int fd, void *data, size_t length) static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, size_t size, int flags) { - off_t sbytes; + off_t sbytes = 0; int ret; ret = sendfile(fd, s, off, size, NULL, &sbytes, flags); - if (ret == -1) { - if (errno == EAGAIN && sbytes != 0) - return sbytes; - return -1; - } + if (ret == -1 && sbytes == 0) + return -1; return sbytes; } From owner-dev-commits-src-all@freebsd.org Fri Feb 26 00:36: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 80DA954FADD; Fri, 26 Feb 2021 00:36: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 4DmrLz30wyz4TZc; Fri, 26 Feb 2021 00:36: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 5A58621581; Fri, 26 Feb 2021 00:36: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 11Q0ahMJ072303; Fri, 26 Feb 2021 00:36:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q0ahFA072302; Fri, 26 Feb 2021 00:36:43 GMT (envelope-from git) Date: Fri, 26 Feb 2021 00:36:43 GMT Message-Id: <202102260036.11Q0ahFA072302@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: cdba1277dd26 - stable/13 - OpenSSL: Regen manual page for the previous commit 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: cdba1277dd26c8f7e54a40d86d44748f2d1a8c29 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 00:36:43 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cdba1277dd26c8f7e54a40d86d44748f2d1a8c29 commit cdba1277dd26c8f7e54a40d86d44748f2d1a8c29 Author: Jung-uk Kim AuthorDate: 2021-02-17 23:19:13 +0000 Commit: John Baldwin CommitDate: 2021-02-25 22:45:59 +0000 OpenSSL: Regen manual page for the previous commit This is regen for 9b2f020c14af71a2606012143432dd717c7cf90e. MFC after: 1 week (cherry picked from commit 351d06eeb509a420f3470c96b4a265467c87e2c2) --- secure/lib/libcrypto/man/man3/SSL_write.3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/man/man3/SSL_write.3 b/secure/lib/libcrypto/man/man3/SSL_write.3 index 99e76b5ac013..db4800fb059d 100644 --- a/secure/lib/libcrypto/man/man3/SSL_write.3 +++ b/secure/lib/libcrypto/man/man3/SSL_write.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "SSL_WRITE 3" -.TH SSL_WRITE 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH SSL_WRITE 3 "2021-02-17" "1.1.1j" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -245,7 +245,8 @@ For \fBSSL_sendfile()\fR, the following return values can occur: .IP ">= 0" 4 .IX Item ">= 0" The write operation was successful, the return value is the number -of bytes of the file written to the \s-1TLS/SSL\s0 connection. +of bytes of the file written to the \s-1TLS/SSL\s0 connection. The return +value can be less than \fBsize\fR for a partial write. .IP "< 0" 4 .IX Item "< 0" The write operation was not successful, because either the connection was From owner-dev-commits-src-all@freebsd.org Fri Feb 26 00:48: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 9EB9254FCA4; Fri, 26 Feb 2021 00:48: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 4Dmrc744Jlz4VPQ; Fri, 26 Feb 2021 00:48: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 7A70521428; Fri, 26 Feb 2021 00:48: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 11Q0m7WL085419; Fri, 26 Feb 2021 00:48:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q0m7hS085418; Fri, 26 Feb 2021 00:48:07 GMT (envelope-from git) Date: Fri, 26 Feb 2021 00:48:07 GMT Message-Id: <202102260048.11Q0m7hS085418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: a9bd22814f68 - main - Remove pointless lun->be_lun checks. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9bd22814f680ce87259d56155204f9294e684ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 00:48:07 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a9bd22814f680ce87259d56155204f9294e684ce commit a9bd22814f680ce87259d56155204f9294e684ce Author: Alexander Motin AuthorDate: 2021-02-26 00:45:59 +0000 Commit: Alexander Motin CommitDate: 2021-02-26 00:48:03 +0000 Remove pointless lun->be_lun checks. There is no such thing as LUN without backend, at least for years. MFC after: 1 week --- sys/cam/ctl/ctl.c | 13 +++++-------- sys/cam/ctl/ctl_tpc.c | 6 +++--- sys/cam/ctl/ctl_tpc_local.c | 6 +++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 9a9ae70c2173..18a82ca72d76 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -11022,16 +11022,15 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, return (CTL_ACTION_BLOCK); case CTL_SER_EXTENT: return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun && lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); + (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); case CTL_SER_EXTENTOPT: if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) != SCP_QUEUE_ALG_UNRESTRICTED) return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun && - lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); + (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); return (CTL_ACTION_PASS); case CTL_SER_EXTENTSEQ: - if (lun->be_lun && lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF) + if (lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF) return (ctl_extent_check_seq(ooa_io, pending_io)); return (CTL_ACTION_PASS); case CTL_SER_PASS: @@ -11273,8 +11272,7 @@ ctl_scsiio_lun_check(struct ctl_lun *lun, } if (entry->pattern & CTL_LUN_PAT_WRITE) { - if (lun->be_lun && - lun->be_lun->flags & CTL_LUN_FLAG_READONLY) { + if (lun->be_lun->flags & CTL_LUN_FLAG_READONLY) { ctl_set_hw_write_protected(ctsio); retval = 1; goto bailout; @@ -13303,8 +13301,7 @@ ctl_serseq_done(union ctl_io *io) { struct ctl_lun *lun = CTL_LUN(io); - if (lun->be_lun == NULL || - lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF) + if (lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF) return; mtx_lock(&lun->lun_lock); io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE; diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c index 5e6cb09760a7..de9e97b87a3e 100644 --- a/sys/cam/ctl/ctl_tpc.c +++ b/sys/cam/ctl/ctl_tpc.c @@ -759,12 +759,12 @@ tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss, { if (idx == 0xffff) { - if (ss && list->lun->be_lun) + if (ss) *ss = list->lun->be_lun->blocksize; - if (pb && list->lun->be_lun) + if (pb) *pb = list->lun->be_lun->blocksize << list->lun->be_lun->pblockexp; - if (pbo && list->lun->be_lun) + if (pbo) *pbo = list->lun->be_lun->blocksize * list->lun->be_lun->pblockoff; return (list->lun->lun); diff --git a/sys/cam/ctl/ctl_tpc_local.c b/sys/cam/ctl/ctl_tpc_local.c index 9b2c85ac8173..ba6deada86a3 100644 --- a/sys/cam/ctl/ctl_tpc_local.c +++ b/sys/cam/ctl/ctl_tpc_local.c @@ -294,12 +294,12 @@ tpcl_resolve(struct ctl_softc *softc, int init_port, lun->lun_devid->len, &cscdid->codeset, cscdid->length + 4) == 0) { lunid = lun->lun; - if (ss && lun->be_lun) + if (ss) *ss = lun->be_lun->blocksize; - if (ps && lun->be_lun) + if (ps) *ps = lun->be_lun->blocksize << lun->be_lun->pblockexp; - if (pso && lun->be_lun) + if (pso) *pso = lun->be_lun->blocksize * lun->be_lun->pblockoff; break; From owner-dev-commits-src-all@freebsd.org Fri Feb 26 01:52: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 EE7D655149D; Fri, 26 Feb 2021 01:52: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 4Dmt1r6TgSz4YJL; Fri, 26 Feb 2021 01: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 D137022527; Fri, 26 Feb 2021 01: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 11Q1q0sE075068; Fri, 26 Feb 2021 01: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 11Q1q0hV075067; Fri, 26 Feb 2021 01:52:00 GMT (envelope-from git) Date: Fri, 26 Feb 2021 01:52:00 GMT Message-Id: <202102260152.11Q1q0hV075067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 1fc928770b5d - main - Remove stale references to opt_sio.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fc928770b5db5bafb7386c7a3bd4918a0d7e876 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 01:52:01 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=1fc928770b5db5bafb7386c7a3bd4918a0d7e876 commit 1fc928770b5db5bafb7386c7a3bd4918a0d7e876 Author: Mitchell Horne AuthorDate: 2021-02-25 21:37:42 +0000 Commit: Mitchell Horne CommitDate: 2021-02-26 01:43:12 +0000 Remove stale references to opt_sio.h The sio(4) driver was removed entirely in 2019, commit 71f0077631fa. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28929 --- sys/conf/options.amd64 | 7 ------- sys/conf/options.i386 | 7 ------- 2 files changed, 14 deletions(-) diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64 index 05b295647b6b..608bcd117e2f 100644 --- a/sys/conf/options.amd64 +++ b/sys/conf/options.amd64 @@ -24,13 +24,6 @@ LINSYSFS opt_dontuse.h TIMER_FREQ opt_clock.h -# options for serial support -COM_ESP opt_sio.h -COM_MULTIPORT opt_sio.h -CONSPEED opt_sio.h -GDBSPEED opt_sio.h -COM_NO_ACPI opt_sio.h - VGA_ALT_SEQACCESS opt_vga.h VGA_DEBUG opt_vga.h VGA_NO_FONT_LOADING opt_vga.h diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 011d787ec68c..02b4db48f4c7 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -67,13 +67,6 @@ I486_CPU opt_global.h I586_CPU opt_global.h I686_CPU opt_global.h -# options for serial support -COM_ESP opt_sio.h -COM_MULTIPORT opt_sio.h -CONSPEED opt_sio.h -GDBSPEED opt_sio.h -COM_NO_ACPI opt_sio.h - VGA_ALT_SEQACCESS opt_vga.h VGA_DEBUG opt_vga.h VGA_NO_FONT_LOADING opt_vga.h From owner-dev-commits-src-all@freebsd.org Fri Feb 26 02:18: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 8DB38551D37; Fri, 26 Feb 2021 02:18: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 4DmtcL3Xm5z4ZwJ; Fri, 26 Feb 2021 02:18: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 6CA1D22758; Fri, 26 Feb 2021 02:18: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 11Q2IQZV004456; Fri, 26 Feb 2021 02:18:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q2IQ1c004455; Fri, 26 Feb 2021 02:18:26 GMT (envelope-from git) Date: Fri, 26 Feb 2021 02:18:26 GMT Message-Id: <202102260218.11Q2IQ1c004455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: e32bc2536297 - releng/13.0 - update to BETA4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: e32bc25362975db9896eeffc2933e078930a5383 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 02:18:26 -0000 The branch releng/13.0 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=e32bc25362975db9896eeffc2933e078930a5383 commit e32bc25362975db9896eeffc2933e078930a5383 Author: Glen Barber AuthorDate: 2021-02-26 02:18:11 +0000 Commit: Glen Barber CommitDate: 2021-02-26 02:18:11 +0000 update to BETA4 Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index fa48289cc39a..1056611889cf 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="BETA3-p1" +BRANCH="BETA4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-all@freebsd.org Fri Feb 26 03:54: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 730F7553D93; Fri, 26 Feb 2021 03:54: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 4Dmwkd2pr3z4hkm; Fri, 26 Feb 2021 03:54: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 53CAA23E0C; Fri, 26 Feb 2021 03:54: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 11Q3s1SV036029; Fri, 26 Feb 2021 03:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q3s1cr036028; Fri, 26 Feb 2021 03:54:01 GMT (envelope-from git) Date: Fri, 26 Feb 2021 03:54:01 GMT Message-Id: <202102260354.11Q3s1cr036028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 108a9384e9e9 - main - jail: Fix locking on an early jail_set error. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 108a9384e9e945cccba73c959f7e9cdb023cbcad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 03:54:01 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=108a9384e9e945cccba73c959f7e9cdb023cbcad commit 108a9384e9e945cccba73c959f7e9cdb023cbcad Author: Jamie Gritton AuthorDate: 2021-02-26 03:52:58 +0000 Commit: Jamie Gritton CommitDate: 2021-02-26 03:52:58 +0000 jail: Fix locking on an early jail_set error. I had locked allprison_lock without immediately setting PD_LIST_LOCKED. --- sys/kern/kern_jail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index c58751e6f5fe..c8dcf928dfaa 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -998,13 +998,13 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) jid = 0; } sx_xlock(&allprison_lock); + drflags = PD_LIST_XLOCKED; ppr = mypr; if (!prison_isalive(ppr)) { /* This jail is dying. This process will surely follow. */ error = EAGAIN; goto done_deref; } - drflags = PD_LIST_XLOCKED; if (jid != 0) { if (jid < 0) { error = EINVAL; From owner-dev-commits-src-all@freebsd.org Fri Feb 26 04:10: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 8EB5B553E4C; Fri, 26 Feb 2021 04:10:08 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.3 with cipher TLS_AES_256_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 4Dmx5D31WTz4jSk; Fri, 26 Feb 2021 04:10:08 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) (authenticated bits=0) by gritton.org (8.15.2/8.15.2) with ESMTPA id 11Q4A1Sv002533; Thu, 25 Feb 2021 20:10:01 -0800 (PST) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 25 Feb 2021 20:10:01 -0800 From: James Gritton To: Kyle Evans Cc: Alexander Richardson , src-committers , , dev-commits-src-main@freebsd.org Subject: Re: git: 811e27fa3c44 - main - jail: Add PD_KILL to remove a prison in prison_deref(). In-Reply-To: References: <202102222027.11MKRtcl033616@gitrepo.freebsd.org> User-Agent: Roundcube Webmail/1.4.1 Message-ID: <6effcf7f64ec5efec1c275d4c7798017@freebsd.org> X-Sender: jamie@freebsd.org X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Thu, 25 Feb 2021 20:10:01 -0800 (PST) X-Rspamd-Queue-Id: 4Dmx5D31WTz4jSk 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: Fri, 26 Feb 2021 04:10:08 -0000 On 2021-02-24 22:02, Kyle Evans wrote: > On Wed, Feb 24, 2021 at 11:53 PM James Gritton > wrote: >> >> On 2021-02-24 21:29, Kyle Evans wrote: >> > On Tue, Feb 23, 2021 at 7:16 AM Alexander Richardson >> > wrote: >> >> >> >> On Mon, 22 Feb 2021 at 20:28, Jamie Gritton wrote: >> >> > >> >> > The branch main has been updated by jamie: >> >> > >> >> > URL: https://cgit.FreeBSD.org/src/commit/?id=811e27fa3c445664e36071a7d08228fc7fb85676 >> >> > >> >> > commit 811e27fa3c445664e36071a7d08228fc7fb85676 >> >> > Author: Jamie Gritton >> >> > AuthorDate: 2021-02-22 20:27:44 +0000 >> >> > Commit: Jamie Gritton >> >> > CommitDate: 2021-02-22 20:27:44 +0000 >> >> > >> >> > jail: Add PD_KILL to remove a prison in prison_deref(). >> >> > >> >> > Add the PD_KILL flag that instructs prison_deref() to take steps >> >> > to actively kill a prison and its descendents, namely marking it >> >> > PRISON_STATE_DYING, clearing its PR_PERSIST flag, and killing any >> >> > attached processes. >> >> > >> >> > This replaces a similar loop in sys_jail_remove(), bringing the >> >> > operation under the same single hold on allprison_lock that it already >> >> > has. It is also used to clean up failed jail (re-)creations in >> >> > kern_jail_set(), which didn't generally take all the proper steps. >> >> > >> >> > Differential Revision: https://reviews.freebsd.org/D28473 >> >> >> >> Hi Jamie, >> >> >> >> After this commit running cd /usr/tests/lib/libc/sys && kyua test >> >> cpuset_test renders the entire system unusable: all exec calls >> >> afterwards seem to fail. In Jenkins it's triggering a kernel panic: >> >> https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17630/consoleFull >> >> Reverting this commit fixes the issue. >> >> >> > >> > Based on the backtrace and a wild stab in the dark, the last >> > prison_deref() in do_jail_attach() prior to successful return should >> > explicitly clear the PD_KILL flag from drflags. >> > >> > Thanks, >> > >> > Kyle Evans >> >> Yep, that's what's doing it. Actually, PD_KILL has no business being >> passed to do_jail_attach in the first place. Running a test on that >> right now. >> > > Ah, good point! IMHO we should KASSERT() that as well in > do_jail_attach(); it doesn't feel like we can do anything sensible > with the flag there, so we might as well raise awareness that the > caller needs to be more careful if attach failure is significant to > the lifetime of the target. That's a good point for safety, though I'm doing it slightly differently. Now do_jail_attach() explicitly only uses the lock-status-related flags. For the sake of redundancy, kern_jail_set() also only passes those flags. I've added a couple of defines in case some other function decides to take those flags: PD_OP_FLAGS for the operations that prison_deref() should do, and PD_LOCK_FLAGS for the status of the prison locks. I did add a KASSERT() in prison_deref() to detect any attempt to pass PD_KILL to prison0. A panic is a good deal better than a zombie system without processes. - Jamie From owner-dev-commits-src-all@freebsd.org Fri Feb 26 04:12: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 31838553E7B; Fri, 26 Feb 2021 04:12: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 4Dmx820zYmz4jhw; Fri, 26 Feb 2021 04:12: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 151FD242D4; Fri, 26 Feb 2021 04:12: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 11Q4CXBK063118; Fri, 26 Feb 2021 04:12:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q4CX5T063117; Fri, 26 Feb 2021 04:12:33 GMT (envelope-from git) Date: Fri, 26 Feb 2021 04:12:33 GMT Message-Id: <202102260412.11Q4CX5T063117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 589e4c1df4a6 - main - jail: Add safety around prison_deref() flags. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 589e4c1df4a6e4b1368f26fc7fef704a2e5cb42c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 04:12:34 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=589e4c1df4a6e4b1368f26fc7fef704a2e5cb42c commit 589e4c1df4a6e4b1368f26fc7fef704a2e5cb42c Author: Jamie Gritton AuthorDate: 2021-02-26 04:10:42 +0000 Commit: Jamie Gritton CommitDate: 2021-02-26 04:10:42 +0000 jail: Add safety around prison_deref() flags. do_jail_attach() now only uses the PD_XXX flags that refer to lock status, so make sure that something else like PD_KILL doesn't slip through. Add a KASSERT() in prison_deref() to catch any further PD_KILL misuse. --- sys/kern/kern_jail.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index c8dcf928dfaa..b5c8f6ebf9be 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -161,6 +161,8 @@ static void prison_racct_detach(struct prison *pr); #define PD_LOCKED 0x10 /* pr_mtx is held */ #define PD_LIST_SLOCKED 0x20 /* allprison_lock is held shared */ #define PD_LIST_XLOCKED 0x40 /* allprison_lock is held exclusive */ +#define PD_OP_FLAGS 0x07 /* Operation flags */ +#define PD_LOCK_FLAGS 0x70 /* Lock status flags */ /* * Parameter names corresponding to PR_* flag values. Size values are for kvm @@ -1836,7 +1838,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) /* Attach this process to the prison if requested. */ if (flags & JAIL_ATTACH) { error = do_jail_attach(td, pr, - prison_lock_xlock(pr, drflags & ~PD_KILL)); + prison_lock_xlock(pr, drflags & PD_LOCK_FLAGS)); drflags &= ~(PD_LOCKED | PD_LIST_XLOCKED); if (error) { vfs_opterror(opts, "attach failed"); @@ -2346,6 +2348,7 @@ do_jail_attach(struct thread *td, struct prison *pr, int drflags) mtx_assert(&pr->pr_mtx, MA_OWNED); sx_assert(&allprison_lock, SX_LOCKED); + drflags &= PD_LOCK_FLAGS; /* * XXX: Note that there is a slight race here if two threads * in the same privileged process attempt to attach to two @@ -2719,6 +2722,8 @@ prison_deref(struct prison *pr, int flags) for (;;) { if (flags & PD_KILL) { /* Kill the prison and its descendents. */ + KASSERT(pr != &prison0, + ("prison_deref trying to kill prison0")); if (!(flags & PD_DEREF)) { prison_hold(pr); flags |= PD_DEREF; @@ -2755,7 +2760,6 @@ prison_deref(struct prison *pr, int flags) } } if (flags & PD_KILL) { - flags &= ~PD_KILL; /* * Any remaining user references are probably processes * that need to be killed, either in this prison or its @@ -2763,6 +2767,8 @@ prison_deref(struct prison *pr, int flags) */ if (refcount_load(&pr->pr_uref) > 0) killpr = pr; + /* Make sure the parent prison doesn't get killed. */ + flags &= ~PD_KILL; } if (flags & PD_DEREF) { /* Drop a reference. */ From owner-dev-commits-src-all@freebsd.org Fri Feb 26 06:04: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 487A75562FB; Fri, 26 Feb 2021 06:04: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 4Dmzcd1Zrgz4pHM; Fri, 26 Feb 2021 06:04: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 28BAE2581B; Fri, 26 Feb 2021 06:04: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 11Q64113009568; Fri, 26 Feb 2021 06:04:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q641sW009567; Fri, 26 Feb 2021 06:04:01 GMT (envelope-from git) Date: Fri, 26 Feb 2021 06:04:01 GMT Message-Id: <202102260604.11Q641sW009567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 763db5893287 - main - rc: save and restore $IFS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 763db58932874bb47fc6f9322ab81cc947f80991 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 06:04:01 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=763db58932874bb47fc6f9322ab81cc947f80991 commit 763db58932874bb47fc6f9322ab81cc947f80991 Author: Cy Schubert AuthorDate: 2021-02-26 05:39:18 +0000 Commit: Cy Schubert CommitDate: 2021-02-26 06:03:38 +0000 rc: save and restore $IFS Fix another bug in 77e1ccbee3ed6c837929e4e232fd07f95bfc8294. $IFS should be fully restored for its other users. PR: 249192 Reported by: jkim MFC after: 3 weeks X-MFC with: 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 --- libexec/rc/rc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 92eb5c48aab7..2cb840e68919 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -103,9 +103,10 @@ checkyesno rc_parallel_start && _rc_parallel='-p' files=`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/* 2>/dev/null` _rc_elem_done=' ' +oldifs="$IFS" IFS=$'\n' for _rc_group in ${files}; do - unset IFS + IFS="$oldifs" for _rc_elem in ${_rc_group}; do run_rc_script ${_rc_elem} ${_boot} & _rc_elem_done="${_rc_elem_done}${_rc_elem} " @@ -119,7 +120,7 @@ for _rc_group in ${files}; do done unset files local_rc -unset IFS +IFS="$oldifs" # Now that disks are mounted, for each dir in $local_startup # search for init scripts that use the new rc.d semantics. @@ -138,7 +139,7 @@ fi files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_rc_parallel} 2>/dev/null` IFS=$'\n' for _rc_group in ${files}; do - unset IFS + IFS="$oldifs" for _rc_elem in ${_rc_group}; do case "$_rc_elem_done" in *" $_rc_elem "*) continue ;; @@ -149,7 +150,7 @@ for _rc_group in ${files}; do wait IFS=$'\n' done -unset IFS +IFS="$oldifs" # Remove the firstboot sentinel, and reboot if it was requested. # Be a bit paranoid about removing it to handle the common failure From owner-dev-commits-src-all@freebsd.org Fri Feb 26 07: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 333725591B3; Fri, 26 Feb 2021 07:48: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 4Dn1wg0shKz3C05; Fri, 26 Feb 2021 07:48: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 0C3F5265F3; Fri, 26 Feb 2021 07:48: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 11Q7m2fp042501; Fri, 26 Feb 2021 07:48:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q7m2Gc042499; Fri, 26 Feb 2021 07:48:02 GMT (envelope-from git) Date: Fri, 26 Feb 2021 07:48:02 GMT Message-Id: <202102260748.11Q7m2Gc042499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: dfff1de729bd - main - cxgbe(4): Read the rx 'c' channel for a port and make it available. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfff1de729bd73004404863b7f9e8a9bda7b0f04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 07:48:03 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=dfff1de729bd73004404863b7f9e8a9bda7b0f04 commit dfff1de729bd73004404863b7f9e8a9bda7b0f04 Author: Navdeep Parhar AuthorDate: 2021-02-26 02:10:52 +0000 Commit: Navdeep Parhar CommitDate: 2021-02-26 07:46:14 +0000 cxgbe(4): Read the rx 'c' channel for a port and make it available. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 1 + sys/dev/cxgbe/common/t4_hw.c | 18 ++++++++++++++++++ sys/dev/cxgbe/t4_main.c | 2 ++ 3 files changed, 21 insertions(+) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 5fe7b76ccb0d..ff9e4eacf112 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -306,6 +306,7 @@ struct port_info { uint8_t tx_chan; uint8_t mps_bg_map; /* rx MPS buffer group bitmap */ uint8_t rx_e_chan_map; /* rx TP e-channel bitmap */ + uint8_t rx_c_chan; /* rx TP c-channel */ struct link_config link_cfg; struct ifmedia media; diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index b3934381ba7a..bb08c55c87b2 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -6818,6 +6818,23 @@ static unsigned int t4_get_rx_e_chan_map(struct adapter *adap, int idx) return 1 << idx; } +/* + * TP RX c-channel associated with the port. + */ +static unsigned int t4_get_rx_c_chan(struct adapter *adap, int idx) +{ + u32 param, val; + int ret; + + param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_TPCHMAP)); + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val); + if (!ret) + return (val >> (8 * idx)) & 0xff; + + return 0; +} + /** * t4_get_port_type_description - return Port Type string description * @port_type: firmware Port Type enumeration @@ -9840,6 +9857,7 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id) p->tx_chan = j; p->mps_bg_map = t4_get_mps_bg_map(adap, j); p->rx_e_chan_map = t4_get_rx_e_chan_map(adap, j); + p->rx_c_chan = t4_get_rx_c_chan(adap, j); p->lport = j; if (!(adap->flags & IS_VF) || diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 3594db2ea136..c9a8b08e8d16 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7077,6 +7077,8 @@ cxgbe_sysctls(struct port_info *pi) pi->mps_bg_map, "MPS buffer group map"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_e_chan_map", CTLFLAG_RD, NULL, pi->rx_e_chan_map, "TP rx e-channel map"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_c_chan", CTLFLAG_RD, NULL, + pi->rx_c_chan, "TP rx c-channel"); if (sc->flags & IS_VF) return; From owner-dev-commits-src-all@freebsd.org Fri Feb 26 09:07: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 5191755B0D1 for ; Fri, 26 Feb 2021 09:07: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 4Dn3gz1r8mz3HBk; Fri, 26 Feb 2021 09:07: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 31DDA27A7A; Fri, 26 Feb 2021 09:07: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 11Q97B7K048079; Fri, 26 Feb 2021 09:07:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q97AwK048078; Fri, 26 Feb 2021 09:07:10 GMT (envelope-from git) Date: Fri, 26 Feb 2021 09:07:10 GMT Message-Id: <202102260907.11Q97AwK048078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Baptiste Daroussin Subject: git: 01b7bcd408fd - vendor/dialog - dialog: vendor import version 1.3-20210117 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/vendor/dialog X-Git-Reftype: branch X-Git-Commit: 01b7bcd408fd9e9dc9088b1df5761fcc0971d7e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 09:07:11 -0000 The branch vendor/dialog has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=01b7bcd408fd9e9dc9088b1df5761fcc0971d7e1 commit 01b7bcd408fd9e9dc9088b1df5761fcc0971d7e1 Author: Baptiste Daroussin AuthorDate: 2021-02-26 09:05:35 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-26 09:05:35 +0000 dialog: vendor import version 1.3-20210117 --- CHANGES | 217 +- README | 4 +- VERSION | 2 +- aclocal.m4 | 1540 ++- argv.c | 43 +- arrows.c | 16 +- buildlist.c | 45 +- buttons.c | 99 +- calendar.c | 95 +- checklist.c | 28 +- columns.c | 13 +- config.guess | 401 +- config.sub | 1627 +-- configure | 26980 +++++++++++++++++++++------------------ configure.in | 30 +- dialog-config.in | 148 +- dialog.1 | 549 +- dialog.3 | 439 +- dialog.c | 777 +- dialog.h | 80 +- dlg_colors.h | 82 +- dlg_internals.h | 47 + dlg_keys.c | 113 +- dlg_keys.h | 12 +- editbox.c | 55 +- formbox.c | 24 +- fselect.c | 121 +- guage.c | 17 +- inputbox.c | 40 +- inputstr.c | 22 +- makefile.in | 13 +- menubox.c | 59 +- mixedgauge.c | 19 +- mousewget.c | 9 +- msgbox.c | 42 +- package/debian/changelog | 108 + package/debian/compat | 2 +- package/debian/control | 9 + package/debian/copyright | 6 +- package/debian/rules | 36 +- package/dialog.map | 43 +- package/dialog.spec | 57 +- package/dialog.sym | 25 +- package/freebsd/Makefile | 2 +- pause.c | 21 +- po/ast.po | 115 + po/dialog.pot | 44 +- po/hi.po | 47 +- po/ja.po | 48 +- po/pt.po | 53 +- po/ro.po | 1 - po/sq.po | 88 +- prgbox.c | 11 +- progressbox.c | 41 +- rangebox.c | 45 +- rc.c | 305 +- headers.sh => run_test.sh | 107 +- samples/buildlist | 4 +- samples/buildlist2 | 10 +- samples/buildlist4 | 22 + samples/calendar | 6 +- samples/calendar-stdout | 6 +- samples/calendar2 | 6 +- samples/calendar2-stdout | 6 +- samples/calendar3 | 6 +- samples/calendar3-stdout | 6 +- samples/checklist | 4 +- samples/checklist-8bit | 18 +- samples/checklist-utf8 | 4 +- samples/checklist1 | 4 +- samples/checklist10 | 4 +- samples/checklist11 | 4 +- samples/checklist12 | 6 +- samples/checklist2 | 4 +- samples/checklist3 | 4 +- samples/checklist4 | 4 +- samples/checklist5 | 4 +- samples/checklist6 | 4 +- samples/checklist7 | 4 +- samples/checklist8 | 4 +- samples/checklist9 | 4 +- samples/copifuncs/copi.ifmcfg2 | 4 +- samples/copifuncs/copi.ifmcfg4 | 4 +- samples/dialog.py | 6 +- samples/dselect | 6 +- samples/editbox | 4 +- samples/editbox-utf8 | 4 +- samples/editbox2 | 4 +- samples/editbox3 | 4 +- samples/editbox4 | 4 +- samples/form1 | 16 +- samples/form1-both | 16 +- samples/form1-extra | 16 +- samples/form1-help | 16 +- samples/form1-utf8 | 16 +- samples/form2 | 8 +- samples/form3 | 8 +- samples/form4 | 8 +- samples/form5 | 8 +- samples/form6 | 8 +- samples/fselect | 6 +- samples/fselect-stdout | 6 +- samples/fselect0 | 6 +- samples/fselect1 | 8 +- samples/fselect1-stdout | 8 +- samples/fselect2 | 6 +- samples/fselect2-stdout | 6 +- samples/gauge2 | 4 +- samples/infobox | 4 +- samples/infobox1 | 4 +- samples/infobox2 | 4 +- samples/infobox3 | 4 +- samples/infobox4 | 4 +- samples/infobox5 | 4 +- samples/infobox6 | 4 +- samples/inputbox | 4 +- samples/inputbox-both | 4 +- samples/inputbox-extra | 4 +- samples/inputbox-help | 4 +- samples/inputbox1 | 4 +- samples/inputbox2 | 4 +- samples/inputbox3 | 4 +- samples/inputbox4 | 6 +- samples/inputbox5 | 4 +- samples/inputbox6-8bit | 10 +- samples/inputbox6-utf8 | 4 +- samples/inputbox7 | 6 +- samples/inputmenu | 12 +- samples/inputmenu-stdout | 12 +- samples/inputmenu1 | 12 +- samples/inputmenu2 | 12 +- samples/inputmenu3 | 14 +- samples/inputmenu4 | 12 +- samples/install/setup.c | 2 +- samples/install/setup.help | 2 +- samples/killall | 14 +- samples/menubox | 8 +- samples/menubox-8bit | 16 +- samples/menubox-utf8 | 4 +- samples/menubox1 | 8 +- samples/menubox10 | 6 +- samples/menubox11 | 6 +- samples/menubox12 | 10 +- samples/menubox2 | 12 +- samples/menubox3 | 8 +- samples/menubox4 | 8 +- samples/menubox5 | 10 +- samples/menubox6 | 8 +- samples/menubox7 | 8 +- samples/menubox8 | 12 +- samples/menubox9 | 6 +- samples/mixedform | 16 +- samples/mixedform2 | 16 +- samples/msgbox | 4 +- samples/msgbox-help | 4 +- samples/msgbox-utf8 | 4 +- samples/msgbox1 | 12 +- samples/msgbox2 | 12 +- samples/msgbox3 | 4 +- samples/msgbox4-8bit | 20 +- samples/msgbox4-utf8 | 18 +- samples/msgbox5 | 4 +- samples/msgbox6 | 4 +- samples/msgbox6a | 4 +- samples/password | 4 +- samples/password1 | 4 +- samples/password2 | 4 +- samples/passwordform1 | 16 +- samples/passwordform1-utf8 | 16 +- samples/pause | 4 +- samples/pause-both | 6 +- samples/pause-extra | 6 +- samples/pause-help | 4 +- samples/prgbox | 4 +- samples/prgbox2 | 4 +- samples/programbox | 4 +- samples/programbox2 | 4 +- samples/programbox3 | 22 + samples/progress | 4 +- samples/progress2 | 4 +- samples/radiolist | 4 +- samples/radiolist1 | 4 +- samples/radiolist10 | 4 +- samples/radiolist2 | 4 +- samples/radiolist3 | 4 +- samples/radiolist4 | 4 +- samples/rangebox | 6 +- samples/rangebox2 | 6 +- samples/rangebox3 | 6 +- samples/rangebox4 | 6 +- samples/report-button | 10 +- samples/report-edit | 10 +- samples/report-string | 18 +- samples/report-tempfile | 18 +- samples/report-yesno | 10 +- samples/rotated-data | 6 +- samples/run_test.sh | 10 +- samples/setup-vars | 29 +- samples/tailbox | 4 +- samples/tailboxbg | 4 +- samples/tailboxbg1 | 6 +- samples/tailboxbg2 | 6 +- samples/testdata-8bit | 0 samples/textbox | 6 +- samples/textbox-both | 8 +- samples/textbox-help | 8 +- samples/textbox2 | 6 +- samples/textbox3 | 8 +- samples/timebox | 6 +- samples/timebox-stdout | 6 +- samples/timebox2 | 6 +- samples/timebox2-stdout | 6 +- samples/treeview | 4 +- samples/treeview2 | 6 +- samples/treeview4 | 24 + samples/wheel | 81 +- samples/yesno | 4 +- samples/yesno-both | 4 +- samples/yesno-extra | 4 +- samples/yesno-help | 4 +- samples/yesno-utf8 | 4 +- samples/yesno2 | 4 +- samples/yesno3 | 4 +- samples/yesno4 | 4 +- tailbox.c | 40 +- textbox.c | 142 +- timebox.c | 41 +- trace.c | 32 +- treeview.c | 38 +- ttysize.c | 8 +- ui_getc.c | 67 +- util.c | 514 +- yesno.c | 36 +- 233 files changed, 20681 insertions(+), 16543 deletions(-) diff --git a/CHANGES b/CHANGES index 17c5b2735487..8e5d22e400a3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,222 @@ --- $Id: CHANGES,v 1.619 2018/06/21 09:19:45 tom Exp $ +-- $Id: CHANGES,v 1.723 2021/01/17 20:21:41 tom Exp $ -- Thomas E. Dickey This version of dialog was originally from a Debian snapshot. I've done this to it: +2021/01/17 + + updated dialog.pot + + add option --no-hot-list, to allow suppressing the hotkey feature + from lists. + + increase minimum height of inputbox to avoid input field overlapping + with the button-box (report by Victor Ananjevsky). + + modify options-parsing to permit a "no" on any boolean option and + deprecating the "no" options without a "-" , e.g., generalizing on + "--nook" equivalence to "--no-ok". + +2021/01/12 + + minor spelling fixes, per codespell + + update configure macros, for quoting/escaping fixes per shellcheck + + update config.guess, config.sub + +2020/11/26 + + modify configure script's compiler check to work around Xcode's + useless aliases for standard C. + + enable keep-tite feature for NetBSD 8 and up; earlier releases would + dump core. + > new features/fixes (Glenn Herteg) + + add option "--cursor-off-label" + + add option "--erase-on-exit" + + fix errata in manpage. + + fix logic: dlg_button_to_char() would return wrong value if no + uppercase was found + +2020/11/25 + + add DIALOG_TIMEOUT to sample scripts, and use report-button more + consistently to handle unexpected exit-status values. + +2020/11/24 + + add dlg_getenv_num() and dlg_getenv_str(). + + add DLG_EXIT_TIMEOUT to allow scripts to exit on an expired timeout + with an exit-status different from DLG_EXIT_ERROR or DLG_EXIT_ESC + (patch by Norbert Koch). + +2020/11/23 + + modify dlg_ok_label() and dlg_ok_labels() to ignore --no-ok if all + buttons would be omitted. + + add/use dlg_der_window() to account for derived windows just like + subwindows, to fix regression in dlg_getc() in fselect/dselect + widget. + + modify several widgets to make their handling of --no-ok consistent + with the majority of the widgets: editbox.c, menubox.c, msgbox.c, + rangebox.c, textbox.c, timebox.c + + add ^D as binding for new virtual key DLGK_LEAVE, which will close + the current dialog by activating the currently-selected button. + + improve manual-page description of --no-ok option (reports by + Hans Mueller, Gil Delescluse). + + modify configure script to make Solaris -R rpath feature work + +2020/11/21 + + fix regression in dlg_getc() caused by not taking into account + subwindows used for input (report by Michael Wihl). + +2020/11/20 + + add validity-checks for window pointer (report/testcase by Michael + Wihl). + + improve configure macros: + CF_CLANG_COMPILER: apply compiler-flags needed for test. + CF_WITH_SCREEN_PDCURSES: use this to reduce X11-checks. + +2020/11/17 + + amend initialization for dlg_getc to fix regression in pause widget + from 2020/03/27 changes (reports by Aidan Tessier, Norbert Koch, + Josmar Pierri). + + improve configure macros: + CF_CLANG_COMPILER: split-out check for -Qunused-arguments to ensure + that clang supports it. IBM xlclang does not. + CF_MIXEDCASE_FILENAMES: when cross-compiling to darwin (macOS), + assume the filesystem doesn't support mixed-case + +2020/09/21 + + modify init_dialog's initialization of tab_len and aspect_ratio to + avoid overwriting initialization done in process_common_options + (report/patch by Rainer Weikusat, Debian #970508). + +2020/09/13 + + fix out-of-order description for --tailbox vs --rangebox in manpage + (report by Glenn Herteg). + + updated configure-macros: compiler-warnings and shared-library + options. Changed configure --with-warnings to --enable-warnings for + consistency. + + update config.guess + +2020/04/01 + + updated sq.po from + http://translationproject.org/latest/dialog/ + +2020/03/27 + + add clarification in manual page to show when the single/double + quotes may be needed (prompted by discussion with Danilo G Baio). + + fix an extra ".exe" in makefile.in which prevented Cygwin build. + + fix most cppcheck warnings + + tailbox/tailboxbg's exit-button now works with mouse-clicks + + fix repainting while resizing for the editbox widget. + + add configure-check for curses_exit() from ncurses 6.2 + + fix a few memory leaks in fselect.c, mixedgauge.c when resizing. + + fix inconsistency in dlg_string_to_argv() which made the checklist9 + example not work. + + add empty-string check in dlg_print_listitem() to avoid indexing past + the end of the array of character-offsets. + + improve handling of KEY_RESIZE by repainting the backtitle after + clearing the screen (integrated patch by Rainer Weikusat, Debian + #954185). + + improve logic for wtimeout() calls which are used to set temporary + non-blocking reads (prompted by patch by Rainer Weikusat, Debian + #954220). + + add "make check" rule. + + updated configure-macros. + +2020/02/28 + + updated configure-macros, to work around ncurses vs xcode's c99 -W + + update config.guess + +2019/12/31 + + updated configure-macros. + + update config.guess + +2019/12/10 + + correct rc-file lookup of "default" color (report by Grady Martin, + cf: 2019/09/24). + + fix several issues in the sample scripts reported by shellcheck. + + fix a few spelling errors reported by codespell (report by Jens + Schleusener). + + correct check for return-value of isblank(), which is not necessarily + 0/1 (report/patch by Paul Cercueil, Peter Korsgaard, cf: 2018/05/31). + +2019/12/09 + + amend change for parsing command-options before calling init_dialog, + to handle --no-shadow, etc., which are initialized in init_dialog + (report by Paul Cercueil, cf: 2018/06/21). + + add dlg_trace_va_msg to manpage, symbol files. + +2019/11/10 + + improve layout of several widgets' data area when maximizing. + + modify dselect/fselect to work with autosizing (Debian #915949). + + add error messages from dlg_exiterr() to trace file. + + improve manual page description of escaping in key-bindings. + + modify inputmenu to recognize the "Cancel" button and keys bound to + that feature while editing a renamed menu item. + + revert one change, in form.c to the --last-key feature (Debian + #942025). + + correct ordering of libraries in configure-script, which appended + in a case where it should have prepended. + + update config.guess, config.sub + +2019/09/26 + + improve dialog-config script's filtering of -L options using the + linker default directories. + + improve dialog-config script, adding a -L option corresponding to + the configure --libdir option if it would be a duplicate (report by + Andrew Kosteltsev). + + build-fix for configure --disable-trace + + updated pt.po from + http://translationproject.org/latest/dialog/ + +2019/09/24 + + allow for underline- and reverse-video flags in the ".rc" file + (integrated patch by Richard Robbins). + +2019/08/08 + + amend change to --last-key feature to eliminate an unnecessary + separator (report by Gabriele Balducci). + +2019/08/06 + + extend --last-key feature to the remaining widgets which have + ok/cancel buttons, and add logic to map keys which happen to be + bound to ok/extra/cancel/help to simulate a button-press on the + corresponding button (report by "sgewrk"). + +2019/08/01 + + further fixes for dialog-config.in (report by Andrew Kosteltsev). + +2019/07/28 + + modify dialog-config.in so that setting prefix or exec-prefix to + a given value with --prefix=VALUE or --exec-prefix=VALUE has the + expected result of changing bindir, etc. + + correct substitution for $LIBS value in dialog-config.in (report by + Andrew Kosteltsev). + +2019/07/24 + + modify dlg_will_resize() and dlg_result_key() functions to reduce + the chance that dialog exits on a SIGWINCH (Debian #930775). + + make test-package for the development headers/library + + add --libs-only-L, etc., to dialog-config script (prompted by + discussion with Andrew Kosteltsev). + + fix a memory leak in gauge widget (Andrew Kosteltsev). + + minor fix for CF_GCC_WARNINGS + + update config.guess, config.sub + +2019/02/11 + + modify to work with ncurses' threaded-library, which does not allow + assignment to LINES/COLS (report by Marcus Roeckrath). + + correct clearing after text in progressbox from 2018/06/21 changes + for resizing (reports by David Boyd, Alan Somers). + + improved configure macros CF_GNU_SOURCE, CF_POSIX_C_SOURCE, + CF_XOPEN_SOURCE + + update config.guess, config.sub + +2018/11/07 + + convert ja.po to UTF-8 for consistency (suggested by Stanislav + Brabec). + + repair mis-encoded hi.po (report/analysis by Stanislav Brabec). + +2018/10/22 + + improved configure macros CF_CC_ENV_FLAGS, CF_LD_RPATH_OPT, + CF_LIBRARY_PATH, CF_SHARED_OPTS, CF_WITH_MAN2HTML, + CF_WITH_VERSIONED_SYMS from ncurses + + add ast.po, from + http://translationproject.org/latest/dialog/ + 2018/06/21 + improve file-offset computation in textbox.c (Werner Fink). + fix an overlooked case with real_auto_size() to maximize when @@ -370,7 +583,7 @@ to it: 2012/12/30 - release 1.2 + improve some older changelog entries to help with HTML'izing content. - + various fixes/improvments for scrollbar appearance. + + various fixes/improvements for scrollbar appearance. + add mappings for some equivalent options provided by whiptail; add configure option --disable-whiptail to allow suppressing these. + add configure option --disable-Xdialog2 to allow suppressing the diff --git a/README b/README index b2c9b8595dbc..1bad4311dd40 100644 --- a/README +++ b/README @@ -38,11 +38,11 @@ For the future, if any volunteer want, the way to evolve cdialog is to multithreading. 2) add an option that could permit to read commands (--options) from a file, like as in a normal programming language, but maintaining - compatiblity with older version of dialog. + compatibility with older version of dialog. I no longer could maintain cdialog... Executable and library name of cdialog are the same of dialog, for -compatiblity. +compatibility. I think that only one directive should be follow: don't use a resource like stdin, stdout when you'll write new options for cdialog; these diff --git a/VERSION b/VERSION index 12fccce09544..fc653b601c01 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -15:0:0 1.3 20180621 +15:0:0 1.3 20210117 diff --git a/aclocal.m4 b/aclocal.m4 index c33827fce67b..191ba9c373fe 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ dnl macros used for DIALOG configure script -dnl $Id: aclocal.m4,v 1.120 2018/06/21 00:30:26 tom Exp $ +dnl $Id: aclocal.m4,v 1.150 2021/01/11 09:03:36 tom Exp $ dnl --------------------------------------------------------------------------- -dnl Copyright 1999-2017,2018 -- Thomas E. Dickey +dnl Copyright 1999-2020,2021 -- Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the @@ -28,10 +28,10 @@ dnl sale, use or other dealings in this Software without prior written dnl authorization. dnl dnl see -dnl http://invisible-island.net/autoconf/ +dnl https://invisible-island.net/autoconf/ dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl AM_GNU_GETTEXT version: 14 updated: 2015/04/15 19:08:48 +dnl AM_GNU_GETTEXT version: 15 updated: 2021/01/02 09:31:20 dnl -------------- dnl Usage: Just like AM_WITH_NLS, which see. AC_DEFUN([AM_GNU_GETTEXT], @@ -76,7 +76,7 @@ strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) ("$presentlang"*) useit=yes;; esac done - if test $useit = yes; then + if test "$useit" = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done @@ -167,7 +167,7 @@ size_t iconv(); AC_SUBST(LIBICONV) ])dnl dnl --------------------------------------------------------------------------- -dnl AM_LANGINFO_CODESET version: 4 updated: 2015/04/18 08:56:57 +dnl AM_LANGINFO_CODESET version: 6 updated: 2021/01/01 16:53:59 dnl ------------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -180,17 +180,17 @@ AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], - [char* cs = nl_langinfo(CODESET);], + [char* cs = nl_langinfo(CODESET); (void)cs], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) - if test $am_cv_langinfo_codeset = yes; then + if test "$am_cv_langinfo_codeset" = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl AM_LC_MESSAGES version: 5 updated: 2015/05/10 19:52:14 +dnl AM_LC_MESSAGES version: 6 updated: 2021/01/02 09:31:20 dnl -------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -211,17 +211,17 @@ dnl dnl serial 2 dnl AC_DEFUN([AM_LC_MESSAGES], -[if test $ac_cv_header_locale_h = yes; then +[if test "$ac_cv_header_locale_h" = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then + if test "$am_cv_val_LC_MESSAGES" = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi])dnl dnl --------------------------------------------------------------------------- -dnl AM_PATH_PROG_WITH_TEST version: 9 updated: 2015/04/15 19:08:48 +dnl AM_PATH_PROG_WITH_TEST version: 10 updated: 2021/01/02 09:31:20 dnl ---------------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -257,7 +257,7 @@ AC_CACHE_VAL(ac_cv_path_$1, IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word$ac_exeext; then + if test -f "$ac_dir/$ac_word$ac_exeext" ; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exeext" break @@ -280,7 +280,7 @@ fi AC_SUBST($1)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl AM_WITH_NLS version: 29 updated: 2018/02/21 21:26:03 +dnl AM_WITH_NLS version: 31 updated: 2021/01/04 17:48:08 dnl ----------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -384,13 +384,13 @@ AC_DEFUN([AM_WITH_NLS], dnl Search for GNU msgfmt in the PATH. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + ["$ac_dir/$ac_word" --statistics /dev/null >/dev/null 2>&1], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) AC_SUBST(MSGFMT) dnl Search for GNU xgettext in the PATH. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + ["$ac_dir/$ac_word" --omit-header /dev/null >/dev/null 2>&1], :) cf_save_OPTS_1="$CPPFLAGS" if test "x$cf_save_msgfmt_path" = "x$MSGFMT" && \ @@ -466,7 +466,7 @@ AC_DEFUN([AM_WITH_NLS], if test "$nls_cv_use_gnu_gettext" != "no"; then CATOBJEXT=.gmo - if test -f $srcdir/intl/libintl.h ; then + if test -f "$srcdir/intl/libintl.h" ; then dnl Mark actions used to generate GNU NLS library. INTLOBJS="\$(GETTOBJS)" BUILD_INCLUDED_LIBINTL=yes @@ -511,10 +511,10 @@ AC_DEFUN([AM_WITH_NLS], case "$ac_file" in (*/[Mm]akefile.in) # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir="`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`" ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - ac_base=`basename $ac_file .in` + ac_dots="`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`" + ac_base="`basename $ac_file .in`" # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" @@ -561,7 +561,7 @@ AC_DEFUN([AM_WITH_NLS], AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in + case "$ac_prog_version" in ('') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; (1.2[6-9]*|1.[3-9][0-9]*|[2-9].*) changequote([,])dnl @@ -570,7 +570,7 @@ changequote([,])dnl esac AC_MSG_RESULT([$ac_prog_version]) fi - if test $ac_verc_fail = yes; then + if test "$ac_verc_fail" = yes; then INTLBISON=: fi fi @@ -638,10 +638,11 @@ define([CF_ACVERSION_COMPARE], [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40 +dnl CF_ADD_CFLAGS version: 15 updated: 2020/12/31 10:54:15 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS -dnl The second parameter if given makes this macro verbose. +dnl $1 = flags to add +dnl $2 = if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily @@ -655,19 +656,19 @@ cf_new_extra_cppflags= for cf_add_cflags in $1 do -case $cf_fix_cppflags in +case "$cf_fix_cppflags" in (no) - case $cf_add_cflags in + case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes - if test $cf_fix_cppflags = yes ; then + if test "$cf_fix_cppflags" = yes ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue elif test "${cf_tst_cflags}" = "\"'" ; then @@ -680,7 +681,7 @@ case $cf_fix_cppflags in (*$cf_add_cflags) ;; (*) - case $cf_add_cflags in + case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) @@ -698,7 +699,7 @@ case $cf_fix_cppflags in (yes) CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` + cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[[^"]]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ @@ -726,7 +727,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 15 updated: 2018/06/20 20:23:13 +dnl CF_ADD_INCDIR version: 16 updated: 2020/12/31 20:19:42 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, @@ -738,9 +739,9 @@ AC_DEFUN([CF_ADD_INCDIR], if test -n "$1" ; then for cf_add_incdir in $1 do - while test $cf_add_incdir != /usr/include + while test "$cf_add_incdir" != /usr/include do - if test -d $cf_add_incdir + if test -d "$cf_add_incdir" then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then @@ -771,7 +772,7 @@ if test -n "$1" ; then CF_VERBOSE(adding $cf_add_incdir to include-path) ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir" - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else @@ -793,7 +794,7 @@ dnl $1 = library to add, without the "-l" dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBDIR version: 10 updated: 2015/04/18 08:56:57 +dnl CF_ADD_LIBDIR version: 11 updated: 2020/12/31 20:19:42 dnl ------------- dnl Adds to the library-path dnl @@ -807,9 +808,9 @@ AC_DEFUN([CF_ADD_LIBDIR], if test -n "$1" ; then for cf_add_libdir in $1 do - if test $cf_add_libdir = /usr/lib ; then + if test "$cf_add_libdir" = /usr/lib ; then : - elif test -d $cf_add_libdir + elif test -d "$cf_add_libdir" then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then @@ -829,7 +830,7 @@ if test -n "$1" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27 +dnl CF_ADD_LIBS version: 3 updated: 2019/11/02 16:47:33 dnl ----------- dnl Add one or more libraries, used to enforce consistency. Libraries are dnl prepended to an existing list, since their dependencies are assumed to @@ -838,19 +839,19 @@ dnl dnl $1 = libraries to add, with the "-l", etc. dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIBS],[ -cf_add_libs="$1" -# Filter out duplicates - this happens with badly-designed ".pc" files... -for cf_add_1lib in [$]ifelse($2,,LIBS,[$2]) -do - for cf_add_2lib in $cf_add_libs - do - if test "x$cf_add_1lib" = "x$cf_add_2lib" - then +cf_add_libs="[$]ifelse($2,,LIBS,[$2])" +# reverse order +cf_add_0lib= +for cf_add_1lib in $1; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done +# filter duplicates +for cf_add_1lib in $cf_add_0lib; do + for cf_add_2lib in $cf_add_libs; do + if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done - test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done ifelse($2,,LIBS,[$2])="$cf_add_libs" ])dnl @@ -887,7 +888,7 @@ case "$1" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_SEARCHPATH version: 5 updated: 2009/01/11 20:40:21 +dnl CF_ADD_SEARCHPATH version: 6 updated: 2020/12/31 20:19:42 dnl ----------------- dnl Set $CPPFLAGS and $LDFLAGS with the directories given via the parameter. dnl They can be either the common root of include- and lib-directories, or the @@ -900,16 +901,16 @@ AC_DEFUN([CF_ADD_SEARCHPATH], [ AC_REQUIRE([CF_PATHSEP]) for cf_searchpath in `echo "$1" | tr $PATH_SEPARATOR ' '`; do - if test -d $cf_searchpath/include; then + if test -d "$cf_searchpath/include" ; then CF_ADD_INCDIR($cf_searchpath/include) - elif test -d $cf_searchpath/../include ; then + elif test -d "$cf_searchpath/../include" ; then CF_ADD_INCDIR($cf_searchpath/../include) ifelse([$2],,,[else $2]) fi - if test -d $cf_searchpath/lib; then + if test -d "$cf_searchpath/lib" ; then CF_ADD_LIBDIR($cf_searchpath/lib) - elif test -d $cf_searchpath ; then + elif test -d "$cf_searchpath" ; then CF_ADD_LIBDIR($cf_searchpath) ifelse([$2],,,[else $2]) @@ -917,7 +918,7 @@ $2]) done ]) dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 4 updated: 2013/10/08 17:47:05 +dnl CF_ADD_SUBDIR_PATH version: 5 updated: 2020/12/31 20:19:42 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -929,13 +930,13 @@ AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "x$4" != "x$5" && \ test -d "$4" && \ -ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]) { +ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5"; } &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" - test -d $4/$3 && $1="[$]$1 $4/$3" - test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" - test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" - test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" - test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" + test -d "$4/$3" && $1="[$]$1 $4/$3" + test -d "$4/$3/$2" && $1="[$]$1 $4/$3/$2" + test -d "$4/$3/$2/$3" && $1="[$]$1 $4/$3/$2/$3" + test -d "$4/$2/$3" && $1="[$]$1 $4/$2/$3" + test -d "$4/$2/$3/$2" && $1="[$]$1 $4/$2/$3/$2" } ])dnl dnl --------------------------------------------------------------------------- @@ -955,6 +956,12 @@ dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- +dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 +dnl ------------- +dnl Allow user to enable a normally-off option. +AC_DEFUN([CF_ARG_ENABLE], +[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl +dnl --------------------------------------------------------------------------- dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03 dnl ----------------- dnl Verbose form of AC_ARG_ENABLE: @@ -1000,7 +1007,7 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_AR_FLAGS version: 6 updated: 2015/10/10 15:25:05 +dnl CF_AR_FLAGS version: 9 updated: 2021/01/01 13:31:04 dnl ----------- dnl Check for suitable "ar" (archiver) options for updating an archive. dnl @@ -1011,39 +1018,55 @@ AC_DEFUN([CF_AR_FLAGS],[ AC_REQUIRE([CF_PROG_AR]) AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ - cf_cv_ar_flags=unknown - for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv - do + case "$cf_cv_system_name" in + (*-msvc*) + cf_cv_ar_flags='' + cat >mk_static_lib.sh <<-EOF + #!$SHELL + MSVC_BIN="[$]AR" + out="\[$]1" + shift + exec \[$]MSVC_BIN -out:"\[$]out" \[$]@ + EOF + chmod +x mk_static_lib.sh + AR=`pwd`/mk_static_lib.sh + ;; + (*) + cf_cv_ar_flags=unknown + for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv + do - # check if $ARFLAGS already contains this choice - if test "x$ARFLAGS" != "x" ; then - cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` - if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then - cf_cv_ar_flags= - break + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi fi - fi - rm -f conftest.$ac_cv_objext - rm -f conftest.a + rm -f "conftest.$ac_cv_objext" + rm -f conftest.a - cat >conftest.$ac_ext <"conftest.$ac_ext" <&AC_FD_CC - $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null - if test -f conftest.a ; then - cf_cv_ar_flags=$cf_ar_flags + if AC_TRY_EVAL(ac_compile) ; then + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC + $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&AC_FD_CC 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags="$cf_ar_flags" + break + fi + else + CF_VERBOSE(cannot compile test-program) break fi - else - CF_VERBOSE(cannot compile test-program) - break - fi - done - rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext + done + rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext" + ;; + esac ]) if test -n "$ARFLAGS" ; then @@ -1057,7 +1080,7 @@ fi AC_SUBST(ARFLAGS) ]) dnl --------------------------------------------------------------------------- -dnl CF_BUNDLED_INTL version: 19 updated: 2018/06/20 20:23:13 +dnl CF_BUNDLED_INTL version: 20 updated: 2021/01/02 09:31:20 dnl --------------- dnl Top-level macro for configuring an application with a bundled copy of dnl the intl and po directories for gettext. *** 57273 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Feb 26 09:07: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 68C8955AAF8 for ; Fri, 26 Feb 2021 09:07: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 4Dn3h02W2Bz3GsR; Fri, 26 Feb 2021 09:07: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 495A527C79; Fri, 26 Feb 2021 09:07: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 11Q97CmB048102; Fri, 26 Feb 2021 09:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q97CEu048101; Fri, 26 Feb 2021 09:07:12 GMT (envelope-from git) Date: Fri, 26 Feb 2021 09:07:12 GMT Message-Id: <202102260907.11Q97CEu048101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Baptiste Daroussin Subject: git: adade6569e32 - Create tag vendor/dialog/1.3-20210117 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/tags/vendor/dialog/1.3-20210117 X-Git-Reftype: annotated tag X-Git-Commit: adade6569e32aee0de7bd5f389fb5c19f996d472 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 09:07:12 -0000 The annotated tag vendor/dialog/1.3-20210117 has been created by bapt: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/dialog/1.3-20210117 tag vendor/dialog/1.3-20210117 Tagger: Baptiste Daroussin TaggerDate: 2021-02-26 09:06:34 +0000 dialog: tag import of version 1.3-20210117 commit 01b7bcd408fd9e9dc9088b1df5761fcc0971d7e1 Author: Baptiste Daroussin AuthorDate: 2021-02-26 09:05:35 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-26 09:05:35 +0000 dialog: vendor import version 1.3-20210117 From owner-dev-commits-src-all@freebsd.org Fri Feb 26 09:17: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 B2A9A55B2F4; Fri, 26 Feb 2021 09:17: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 4Dn3vs4jspz3Hck; Fri, 26 Feb 2021 09:17: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 90AE627F1D; Fri, 26 Feb 2021 09:17: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 11Q9HTnR061176; Fri, 26 Feb 2021 09:17:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11Q9HTfq061175; Fri, 26 Feb 2021 09:17:29 GMT (envelope-from git) Date: Fri, 26 Feb 2021 09:17:29 GMT Message-Id: <202102260917.11Q9HTfq061175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: a96ef4501919 - main - dialog: import dialog 1.3-20210117 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a96ef4501919d7ac08e94e98dc34b0bdd744802b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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, 26 Feb 2021 09:17:29 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=a96ef4501919d7ac08e94e98dc34b0bdd744802b commit a96ef4501919d7ac08e94e98dc34b0bdd744802b Merge: dfff1de729bd 01b7bcd408fd Author: Baptiste Daroussin AuthorDate: 2021-02-26 09:16:49 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-26 09:16:49 +0000 dialog: import dialog 1.3-20210117 contrib/dialog/CHANGES | 217 +- contrib/dialog/README | 4 +- contrib/dialog/VERSION | 2 +- contrib/dialog/aclocal.m4 | 1540 +- contrib/dialog/argv.c | 43 +- contrib/dialog/arrows.c | 16 +- contrib/dialog/buildlist.c | 45 +- contrib/dialog/buttons.c | 99 +- contrib/dialog/calendar.c | 95 +- contrib/dialog/checklist.c | 28 +- contrib/dialog/columns.c | 13 +- contrib/dialog/config.guess | 401 +- contrib/dialog/config.sub | 1627 +- contrib/dialog/configure | 26980 +++++++++++++----------- contrib/dialog/configure.in | 30 +- contrib/dialog/dialog-config.in | 148 +- contrib/dialog/dialog.1 | 549 +- contrib/dialog/dialog.3 | 439 +- contrib/dialog/dialog.c | 777 +- contrib/dialog/dialog.h | 80 +- contrib/dialog/dlg_colors.h | 82 +- contrib/dialog/dlg_internals.h | 47 + contrib/dialog/dlg_keys.c | 113 +- contrib/dialog/dlg_keys.h | 12 +- contrib/dialog/editbox.c | 55 +- contrib/dialog/formbox.c | 24 +- contrib/dialog/fselect.c | 121 +- contrib/dialog/guage.c | 17 +- contrib/dialog/inputbox.c | 40 +- contrib/dialog/inputstr.c | 22 +- contrib/dialog/makefile.in | 13 +- contrib/dialog/menubox.c | 59 +- contrib/dialog/mixedgauge.c | 19 +- contrib/dialog/mousewget.c | 9 +- contrib/dialog/msgbox.c | 42 +- contrib/dialog/package/debian/changelog | 108 + contrib/dialog/package/debian/compat | 2 +- contrib/dialog/package/debian/control | 9 + contrib/dialog/package/debian/copyright | 6 +- contrib/dialog/package/debian/rules | 36 +- contrib/dialog/package/dialog.map | 43 +- contrib/dialog/package/dialog.spec | 57 +- contrib/dialog/package/dialog.sym | 25 +- contrib/dialog/package/freebsd/Makefile | 2 +- contrib/dialog/pause.c | 21 +- contrib/dialog/po/ast.po | 115 + contrib/dialog/po/dialog.pot | 44 +- contrib/dialog/po/hi.po | 47 +- contrib/dialog/po/ja.po | 48 +- contrib/dialog/po/pt.po | 53 +- contrib/dialog/po/ro.po | 1 - contrib/dialog/po/sq.po | 88 +- contrib/dialog/prgbox.c | 11 +- contrib/dialog/progressbox.c | 41 +- contrib/dialog/rangebox.c | 45 +- contrib/dialog/rc.c | 305 +- contrib/dialog/{headers.sh => run_test.sh} | 107 +- contrib/dialog/samples/buildlist | 4 +- contrib/dialog/samples/buildlist2 | 10 +- contrib/dialog/samples/buildlist4 | 22 + contrib/dialog/samples/calendar | 6 +- contrib/dialog/samples/calendar-stdout | 6 +- contrib/dialog/samples/calendar2 | 6 +- contrib/dialog/samples/calendar2-stdout | 6 +- contrib/dialog/samples/calendar3 | 6 +- contrib/dialog/samples/calendar3-stdout | 6 +- contrib/dialog/samples/checklist | 4 +- contrib/dialog/samples/checklist-8bit | 18 +- contrib/dialog/samples/checklist-utf8 | 4 +- contrib/dialog/samples/checklist1 | 4 +- contrib/dialog/samples/checklist10 | 4 +- contrib/dialog/samples/checklist11 | 4 +- contrib/dialog/samples/checklist12 | 6 +- contrib/dialog/samples/checklist2 | 4 +- contrib/dialog/samples/checklist3 | 4 +- contrib/dialog/samples/checklist4 | 4 +- contrib/dialog/samples/checklist5 | 4 +- contrib/dialog/samples/checklist6 | 4 +- contrib/dialog/samples/checklist7 | 4 +- contrib/dialog/samples/checklist8 | 4 +- contrib/dialog/samples/checklist9 | 4 +- contrib/dialog/samples/copifuncs/copi.ifmcfg2 | 4 +- contrib/dialog/samples/copifuncs/copi.ifmcfg4 | 4 +- contrib/dialog/samples/dialog.py | 6 +- contrib/dialog/samples/dselect | 6 +- contrib/dialog/samples/editbox | 4 +- contrib/dialog/samples/editbox-utf8 | 4 +- contrib/dialog/samples/editbox2 | 4 +- contrib/dialog/samples/editbox3 | 4 +- contrib/dialog/samples/editbox4 | 4 +- contrib/dialog/samples/form1 | 16 +- contrib/dialog/samples/form1-both | 16 +- contrib/dialog/samples/form1-extra | 16 +- contrib/dialog/samples/form1-help | 16 +- contrib/dialog/samples/form1-utf8 | 16 +- contrib/dialog/samples/form2 | 8 +- contrib/dialog/samples/form3 | 8 +- contrib/dialog/samples/form4 | 8 +- contrib/dialog/samples/form5 | 8 +- contrib/dialog/samples/form6 | 8 +- contrib/dialog/samples/fselect | 6 +- contrib/dialog/samples/fselect-stdout | 6 +- contrib/dialog/samples/fselect0 | 6 +- contrib/dialog/samples/fselect1 | 8 +- contrib/dialog/samples/fselect1-stdout | 8 +- contrib/dialog/samples/fselect2 | 6 +- contrib/dialog/samples/fselect2-stdout | 6 +- contrib/dialog/samples/gauge2 | 4 +- contrib/dialog/samples/infobox | 4 +- contrib/dialog/samples/infobox1 | 4 +- contrib/dialog/samples/infobox2 | 4 +- contrib/dialog/samples/infobox3 | 4 +- contrib/dialog/samples/infobox4 | 4 +- contrib/dialog/samples/infobox5 | 4 +- contrib/dialog/samples/infobox6 | 4 +- contrib/dialog/samples/inputbox | 4 +- contrib/dialog/samples/inputbox-both | 4 +- contrib/dialog/samples/inputbox-extra | 4 +- contrib/dialog/samples/inputbox-help | 4 +- contrib/dialog/samples/inputbox1 | 4 +- contrib/dialog/samples/inputbox2 | 4 +- contrib/dialog/samples/inputbox3 | 4 +- contrib/dialog/samples/inputbox4 | 6 +- contrib/dialog/samples/inputbox5 | 4 +- contrib/dialog/samples/inputbox6-8bit | 10 +- contrib/dialog/samples/inputbox6-utf8 | 4 +- contrib/dialog/samples/inputbox7 | 6 +- contrib/dialog/samples/inputmenu | 12 +- contrib/dialog/samples/inputmenu-stdout | 12 +- contrib/dialog/samples/inputmenu1 | 12 +- contrib/dialog/samples/inputmenu2 | 12 +- contrib/dialog/samples/inputmenu3 | 14 +- contrib/dialog/samples/inputmenu4 | 12 +- contrib/dialog/samples/install/setup.c | 2 +- contrib/dialog/samples/install/setup.help | 2 +- contrib/dialog/samples/killall | 14 +- contrib/dialog/samples/menubox | 8 +- contrib/dialog/samples/menubox-8bit | 16 +- contrib/dialog/samples/menubox-utf8 | 4 +- contrib/dialog/samples/menubox1 | 8 +- contrib/dialog/samples/menubox10 | 6 +- contrib/dialog/samples/menubox11 | 6 +- contrib/dialog/samples/menubox12 | 10 +- contrib/dialog/samples/menubox2 | 12 +- contrib/dialog/samples/menubox3 | 8 +- contrib/dialog/samples/menubox4 | 8 +- contrib/dialog/samples/menubox5 | 10 +- contrib/dialog/samples/menubox6 | 8 +- contrib/dialog/samples/menubox7 | 8 +- contrib/dialog/samples/menubox8 | 12 +- contrib/dialog/samples/menubox9 | 6 +- contrib/dialog/samples/mixedform | 16 +- contrib/dialog/samples/mixedform2 | 16 +- contrib/dialog/samples/msgbox | 4 +- contrib/dialog/samples/msgbox-help | 4 +- contrib/dialog/samples/msgbox-utf8 | 4 +- contrib/dialog/samples/msgbox1 | 12 +- contrib/dialog/samples/msgbox2 | 12 +- contrib/dialog/samples/msgbox3 | 4 +- contrib/dialog/samples/msgbox4-8bit | 20 +- contrib/dialog/samples/msgbox4-utf8 | 18 +- contrib/dialog/samples/msgbox5 | 4 +- contrib/dialog/samples/msgbox6 | 4 +- contrib/dialog/samples/msgbox6a | 4 +- contrib/dialog/samples/password | 4 +- contrib/dialog/samples/password1 | 4 +- contrib/dialog/samples/password2 | 4 +- contrib/dialog/samples/passwordform1 | 16 +- contrib/dialog/samples/passwordform1-utf8 | 16 +- contrib/dialog/samples/pause | 4 +- contrib/dialog/samples/pause-both | 6 +- contrib/dialog/samples/pause-extra | 6 +- contrib/dialog/samples/pause-help | 4 +- contrib/dialog/samples/prgbox | 4 +- contrib/dialog/samples/prgbox2 | 4 +- contrib/dialog/samples/programbox | 4 +- contrib/dialog/samples/programbox2 | 4 +- contrib/dialog/samples/programbox3 | 22 + contrib/dialog/samples/progress | 4 +- contrib/dialog/samples/progress2 | 4 +- contrib/dialog/samples/radiolist | 4 +- contrib/dialog/samples/radiolist1 | 4 +- contrib/dialog/samples/radiolist10 | 4 +- contrib/dialog/samples/radiolist2 | 4 +- contrib/dialog/samples/radiolist3 | 4 +- contrib/dialog/samples/radiolist4 | 4 +- contrib/dialog/samples/rangebox | 6 +- contrib/dialog/samples/rangebox2 | 6 +- contrib/dialog/samples/rangebox3 | 6 +- contrib/dialog/samples/rangebox4 | 6 +- contrib/dialog/samples/report-button | 10 +- contrib/dialog/samples/report-edit | 10 +- contrib/dialog/samples/report-string | 18 +- contrib/dialog/samples/report-tempfile | 18 +- contrib/dialog/samples/report-yesno | 10 +- contrib/dialog/samples/rotated-data | 6 +- contrib/dialog/samples/run_test.sh | 10 +- contrib/dialog/samples/setup-vars | 29 +- contrib/dialog/samples/tailbox | 4 +- contrib/dialog/samples/tailboxbg | 4 +- contrib/dialog/samples/tailboxbg1 | 6 +- contrib/dialog/samples/tailboxbg2 | 6 +- contrib/dialog/samples/testdata-8bit | 0 contrib/dialog/samples/textbox | 6 +- contrib/dialog/samples/textbox-both | 8 +- contrib/dialog/samples/textbox-help | 8 +- contrib/dialog/samples/textbox2 | 6 +- contrib/dialog/samples/textbox3 | 8 +- contrib/dialog/samples/timebox | 6 +- contrib/dialog/samples/timebox-stdout | 6 +- contrib/dialog/samples/timebox2 | 6 +- contrib/dialog/samples/timebox2-stdout | 6 +- contrib/dialog/samples/treeview | 4 +- contrib/dialog/samples/treeview2 | 6 +- contrib/dialog/samples/treeview4 | 24 + contrib/dialog/samples/wheel | 81 +- contrib/dialog/samples/yesno | 4 +- contrib/dialog/samples/yesno-both | 4 +- contrib/dialog/samples/yesno-extra | 4 +- contrib/dialog/samples/yesno-help | 4 +- contrib/dialog/samples/yesno-utf8 | 4 +- contrib/dialog/samples/yesno2 | 4 +- contrib/dialog/samples/yesno3 | 4 +- contrib/dialog/samples/yesno4 | 4 +- contrib/dialog/tailbox.c | 40 +- contrib/dialog/textbox.c | 142 +- contrib/dialog/timebox.c | 41 +- contrib/dialog/trace.c | 32 +- contrib/dialog/treeview.c | 38 +- contrib/dialog/ttysize.c | 8 +- contrib/dialog/ui_getc.c | 67 +- contrib/dialog/util.c | 514 +- contrib/dialog/yesno.c | 36 +- 233 files changed, 20681 insertions(+), 16543 deletions(-) diff --cc contrib/dialog/README index b2c9b8595dbc,000000000000..1bad4311dd40 mode 100644,000000..100644 --- a/contrib/dialog/README +++ b/contrib/dialog/README @@@ -1,61 -1,0 +1,61 @@@ +-(1999-12-25)------------------------------------------------------------------- +This version of dialog, formerly known as cdialog is based on the Debian +package for dialog 0.9a (see CHANGES for recent modifications) +- T.Dickey + +-(1996-01-15)------------------------------------------------------------------- +I have uploaded cdialog-0.9a.tar.gz to sunsite. It should be moved +to pub/Linux/utils/shell, I think. + +Starting point for cdialog v.0.9a was dialog-0.6c. Many new features +like as Resolution-independence, Auto-sizing, Maximizing, more widget +on the same screen (multi-widget), etc. were added. New widget are +tailbox and tailbox-in-background. Here are the options: + + Usage: dialog + { --and-widget } + + Common options: + [--backtitle ] [--sleep ] [--beep] [--beep-after] + [--clear] [--begin ] [--aspect ] [--print-size] + [--print-maxsize] [--size-err] [--separate-output] [--cr-wrap] + [--tab-len ] [--tab-correct] [--print-version] [--no-kill] + [--title ] + + Global options: [--shadow] [--no-shadow] [--separate-widget "<str>"] + +At the moment, mouse support with libgpm can't be added because it +does't implement the wtimeout() function of ncurses. Wtimeout() is +needed to have more widgets (es.tailbox) cooperating on the same +screen... I don't know if with newer versions of libgpm it's possible. + +I have no more time to write docs for this new version...Is there +anyone, that looking at the code, can do it??? Ouch! :-) +Don't flame me! + +For the future, if any volunteer want, the way to evolve cdialog is to +1) make a daemon for a better support of multi-tasking or implementing + multithreading. +2) add an option that could permit to read commands (--options) from a + file, like as in a normal programming language, but maintaining - compatiblity with older version of dialog. ++ compatibility with older version of dialog. + +I no longer could maintain cdialog... +Executable and library name of cdialog are the same of dialog, for - compatiblity. ++compatibility. + +I think that only one directive should be follow: don't use a resource +like stdin, stdout when you'll write new options for cdialog; these +resources have to be shared from all widgets on the command line. +Guage uses stdin :-/ so that can't be mixed for example with an inputbox, +but it was made before of multi-widget. However this is not a big problem! + +THERE ARE NO *KNOWN* BUGS. If anyone has much time and can find the way +to add wtimeout() support to libgpm, also mouse could be supported. + +Please use ncurses-1.9.4 or newer. + +| __ | demarco_p@abramo.it:~$ make Linux | more > UserFriendly; +| /__) | /~~ _ _ _ _ /~\ _ / . _ | +|/ ako | (___ (_) | ) ) (-' (__/ | ) /__ | | ) (_| >< . coordinator. + diff --cc contrib/dialog/dlg_internals.h index 000000000000,4c6fb9e09615..4c6fb9e09615 mode 000000,100644..100644 --- a/contrib/dialog/dlg_internals.h +++ b/contrib/dialog/dlg_internals.h diff --cc contrib/dialog/package/freebsd/Makefile index 6f6d652eed1d,000000000000..88a6a5d48194 mode 100644,000000..100644 --- a/contrib/dialog/package/freebsd/Makefile +++ b/contrib/dialog/package/freebsd/Makefile @@@ -1,48 -1,0 +1,48 @@@ +# New ports collection makefile for: ncdialog +# Date created: 2003-01-11 +# Whom: AlanE <alane@freebsd.org> +# +# $Carpetsmoker: ports/cdialog/Makefile,v 1.4 2007/04/22 11:30:53 carpetsmoker Exp $ +# $FreeBSD$ +# + +PORTNAME= cdialog - PORTVERSION= 1.3.20180621 ++PORTVERSION= 1.3.20210117 +PORTEPOCH= 1 +CATEGORIES= devel +MASTER_SITES= ftp://ftp.invisible-island.net/${PORTNAME:S|^c||}/ +DISTNAME= ${PORTNAME:S|^c||}-${PORTVERSION:R}-${PORTVERSION:E} +EXTRACT_SUFX= .tgz + +MAINTAINER= sylvio@FreeBSD.org +COMMENT= An enhanced version of 'dialog' to work with ncurses + +LICENSE= LGPL21 + +USE_AUTOTOOLS= libtool +GNU_CONFIGURE= yes +USE_LDCONFIG= yes +CONFIGURE_ARGS= --enable-widec \ + --includedir=${PREFIX}/include/${PORTNAME} \ + --with-libtool \ + --with-ncursesw \ + --with-package=${PORTNAME} +MAKEFILE= makefile + +MAN1= cdialog.1 +MAN3= cdialog.3 +MANCOMPRESSED= no + +INSTALL_TARGET= install-strip install-man install-lib + +.if !defined(NOPORTEXAMPLES) +post-patch: + @${FIND} ${WRKSRC}/samples/ -type f -exec ${REINPLACE_CMD} -i "" "s|dialog|cdialog|g" {} \; + +post-install: + @${MKDIR} ${EXAMPLESDIR} + cd ${WRKSRC}/samples && ${FIND} . | \ + ${CPIO} -pdm -L -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR} +.endif + +.include <bsd.port.mk> diff --cc contrib/dialog/po/ast.po index 000000000000,29f8d3440297..29f8d3440297 mode 000000,100644..100644 --- a/contrib/dialog/po/ast.po +++ b/contrib/dialog/po/ast.po diff --cc contrib/dialog/samples/buildlist4 index 000000000000,6bfa98708017..6bfa98708017 mode 000000,100755..100755 --- a/contrib/dialog/samples/buildlist4 +++ b/contrib/dialog/samples/buildlist4 diff --cc contrib/dialog/samples/programbox3 index 000000000000,1dc020c3d222..1dc020c3d222 mode 000000,100755..100755 --- a/contrib/dialog/samples/programbox3 +++ b/contrib/dialog/samples/programbox3 diff --cc contrib/dialog/samples/testdata-8bit index f09021dc19db,f09021dc19db..f09021dc19db mode 100755,100644..100644 --- a/contrib/dialog/samples/testdata-8bit +++ b/contrib/dialog/samples/testdata-8bit diff --cc contrib/dialog/samples/treeview4 index 000000000000,4b1f65eef457..4b1f65eef457 mode 000000,100755..100755 --- a/contrib/dialog/samples/treeview4 +++ b/contrib/dialog/samples/treeview4 From owner-dev-commits-src-all@freebsd.org Fri Feb 26 09:17:30 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C894555B3CA; Fri, 26 Feb 2021 09: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 4Dn3vt5Ld7z3HWb; Fri, 26 Feb 2021 09: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 AA80F32; Fri, 26 Feb 2021 09: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 11Q9HU02061199; Fri, 26 Feb 2021 09: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 11Q9HUnx061198; Fri, 26 Feb 2021 09:17:30 GMT (envelope-from git) Date: Fri, 26 Feb 2021 09:17:30 GMT Message-Id: <202102260917.11Q9HUnx061198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: ec74116ace52 - main - dialog: finish update to 1.3-20210117 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec74116ace52591cf121623e2010ae5efab5524a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 09:17:30 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ec74116ace52591cf121623e2010ae5efab5524a commit ec74116ace52591cf121623e2010ae5efab5524a Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2021-02-26 09:13:13 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2021-02-26 09:17:19 +0000 dialog: finish update to 1.3-20210117 patch dialog.c which requires stddef for the usage of offsetof catchup on the config header --- contrib/dialog/dialog.c | 1 + gnu/lib/libdialog/Makefile | 2 +- gnu/lib/libdialog/dlg_config.h | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/contrib/dialog/dialog.c b/contrib/dialog/dialog.c index 510baeb97add..f59c9dc03c13 100644 --- a/contrib/dialog/dialog.c +++ b/contrib/dialog/dialog.c @@ -26,6 +26,7 @@ #include <dialog.h> +#include <stddef.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile index e4f1b62121d9..8c6b84b64f90 100644 --- a/gnu/lib/libdialog/Makefile +++ b/gnu/lib/libdialog/Makefile @@ -15,7 +15,7 @@ MAN= dialog.3 LIBADD= ncursesw m -CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DGCC_UNUSED=__unused +CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -Wno-macro-redefined .PATH: ${DIALOG} WARNS?= 1 diff --git a/gnu/lib/libdialog/dlg_config.h b/gnu/lib/libdialog/dlg_config.h index ee1d3f9ad3cb..1bd45183f509 100644 --- a/gnu/lib/libdialog/dlg_config.h +++ b/gnu/lib/libdialog/dlg_config.h @@ -6,8 +6,15 @@ */ #define CURSES_WACS_ARRAY _nc_wacs -#define DIALOG_PATCHDATE 20180621 +#define CURSES_WACS_SYMBOLS 1 +#define DIALOG_PATCHDATE 20210117 #define DIALOG_VERSION "1.3" +#define GCC_NORETURN __attribute__((noreturn)) +#define GCC_PRINTF 1 +#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) +#define GCC_SCANF 1 +#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) +#define GCC_UNUSED __attribute__((unused)) #define HAVE_ALLOCA 1 #define HAVE_BTOWC 1 #define HAVE_COLOR 1 @@ -58,6 +65,7 @@ #define HAVE_NL_TYPES_H 1 #define HAVE_PUTENV 1 #define HAVE_RC_FILE 1 +#define HAVE_RC_FILE2 1 #define HAVE_SEARCH_H 1 #define HAVE_SETENV 1 #define HAVE_SETLOCALE 1 @@ -93,11 +101,11 @@ #define HAVE_WCTOMB 1 #define HAVE_WCURSYNCUP 1 #define HAVE_WGETPARENT 1 +#define HAVE_WGET_WCH 1 #define HAVE_WHIPTAIL 1 #define HAVE_WSYNCUP 1 #define HAVE_XDIALOG 1 #define HAVE_XDIALOG2 1 -#define HAVE__NC_FREE_AND_EXIT 1 #define ICONV_CONST #define MIXEDCASE_FILENAMES 1 #define NCURSES 1 @@ -105,7 +113,8 @@ #define PACKAGE "dialog" #define RETSIGTYPE void #define STDC_HEADERS 1 -#define SYSTEM_NAME "freebsd12.0" +#define SYSTEM_NAME "FreeBSD" #define TIME_WITH_SYS_TIME 1 #define TYPE_CHTYPE_IS_SCALAR 1 #define USE_WIDE_CURSES 1 +#define WIDEC_CURSES 1 From owner-dev-commits-src-all@freebsd.org Fri Feb 26 10:14:12 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C1AB55C6A2; Fri, 26 Feb 2021 10:14: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 4Dn59J2yCXz3M0K; Fri, 26 Feb 2021 10:14: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 583ADBBF; Fri, 26 Feb 2021 10:14: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 11QAEC1M040107; Fri, 26 Feb 2021 10:14:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QAECun040106; Fri, 26 Feb 2021 10:14:12 GMT (envelope-from git) Date: Fri, 26 Feb 2021 10:14:12 GMT Message-Id: <202102261014.11QAECun040106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 172f2fc11cc5 - main - dialog: guard macros definition to avoid redifinition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 172f2fc11cc560bbd3d3b29260a8ae21df6a541b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 10:14:12 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=172f2fc11cc560bbd3d3b29260a8ae21df6a541b commit 172f2fc11cc560bbd3d3b29260a8ae21df6a541b Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2021-02-26 10:13:43 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2021-02-26 10:13:43 +0000 dialog: guard macros definition to avoid redifinition This unbreaks building libdpv --- gnu/lib/libdialog/dlg_config.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnu/lib/libdialog/dlg_config.h b/gnu/lib/libdialog/dlg_config.h index 1bd45183f509..30df29f877c6 100644 --- a/gnu/lib/libdialog/dlg_config.h +++ b/gnu/lib/libdialog/dlg_config.h @@ -9,12 +9,20 @@ #define CURSES_WACS_SYMBOLS 1 #define DIALOG_PATCHDATE 20210117 #define DIALOG_VERSION "1.3" +#ifndef GCC_NORETURN #define GCC_NORETURN __attribute__((noreturn)) +#endif #define GCC_PRINTF 1 +#ifndef GCC_PRINTFLIKE #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) +#endif #define GCC_SCANF 1 +#ifndef GCC_SCANFLIKE #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) +#endif +#ifndef GCC_UNUSED #define GCC_UNUSED __attribute__((unused)) +#endif #define HAVE_ALLOCA 1 #define HAVE_BTOWC 1 #define HAVE_COLOR 1 From owner-dev-commits-src-all@freebsd.org Fri Feb 26 10:16:50 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C113955C7CC; Fri, 26 Feb 2021 10:16: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 4Dn5DL51vLz3M8H; Fri, 26 Feb 2021 10:16: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 9AA82C9F; Fri, 26 Feb 2021 10:16: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 11QAGods040609; Fri, 26 Feb 2021 10:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QAGoGr040608; Fri, 26 Feb 2021 10:16:50 GMT (envelope-from git) Date: Fri, 26 Feb 2021 10:16:50 GMT Message-Id: <202102261016.11QAGoGr040608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger <rscheff@FreeBSD.org> Subject: git: c3aa4ba5dfc0 - stable/13 - Ensure cwnd doesn't shrink to zero with PRR 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: c3aa4ba5dfc084e40e4151b25a0d5f8d24a036ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 10:16:50 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=c3aa4ba5dfc084e40e4151b25a0d5f8d24a036ba commit c3aa4ba5dfc084e40e4151b25a0d5f8d24a036ba Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2021-02-19 12:52:06 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2021-02-26 07:39:55 +0000 Ensure cwnd doesn't shrink to zero with PRR Under some circumstances, PRR may end up with a fully collapsed cwnd when finalizing the loss recovery. Reviewed By: #transport, kbowling Reported by: Liang Tian MFC after: 5 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28780 (cherry picked from commit 853fd7a2e39802e46bd3d6476529796ac22412d9) --- sys/netinet/tcp_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 459b78cd444a..08d000611407 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3972,8 +3972,8 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) * If there is going to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg); + tp->snd_cwnd = max(maxseg, (int64_t)tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); } From owner-dev-commits-src-all@freebsd.org Fri Feb 26 12:30:38 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03C75560841; Fri, 26 Feb 2021 12:30: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 4Dn8Bj6hK3z3lFx; Fri, 26 Feb 2021 12:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8318255A; Fri, 26 Feb 2021 12:30: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 11QCUbXQ020107; Fri, 26 Feb 2021 12:30:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QCUbFe020106; Fri, 26 Feb 2021 12:30:37 GMT (envelope-from git) Date: Fri, 26 Feb 2021 12:30:37 GMT Message-Id: <202102261230.11QCUbFe020106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke <donner@FreeBSD.org> Subject: git: 26be401728dc - stable/13 - netgraph/ng_car: Add color marking code 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: 26be401728dc4e0eb30a849186d309488373e6fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 12:30:38 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=26be401728dc4e0eb30a849186d309488373e6fd commit 26be401728dc4e0eb30a849186d309488373e6fd Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-01-27 20:19:14 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-02-26 12:29:39 +0000 netgraph/ng_car: Add color marking code Chained policing should be able to reuse the classification of traffic. A new mbuf_tag type is defined to handle gereral QoS marking. A new subtype is defined to track the color marking. Reviewed by: manpages (bcr), melifaro, kp Sponsored by: IKS Service GmbH Differential Revision: https://reviews.freebsd.org/D22110 (cherry picked from commit d0d2e523bafb74180f8bebb90788790f0d2f0290) --- share/man/man4/ng_car.4 | 9 ++++-- sys/netgraph/ng_car.c | 86 +++++++++++++++++++++++++++++++++++++------------ sys/netgraph/ng_car.h | 5 ++- sys/netgraph/qos.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+), 27 deletions(-) diff --git a/share/man/man4/ng_car.4 b/share/man/man4/ng_car.4 index f3a01b6880e1..abb522ae151b 100644 --- a/share/man/man4/ng_car.4 +++ b/share/man/man4/ng_car.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2012 +.Dd January 27, 2021 .Dt NG_CAR 4 .Os .Sh NAME @@ -108,6 +108,7 @@ Traffic shaping is much more polite to the TCP traffic than rate limit on links with bandwidth * delay product less than 6-8 TCP segments, but it consumes additional system resources for queue processing. .El +.Pp By default, all information rates are measured in bits per second and bursts are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled, @@ -138,7 +139,8 @@ struct ng_car_hookconf { /* possible actions (..._action) */ enum { NG_CAR_ACTION_FORWARD = 1, - NG_CAR_ACTION_DROP + NG_CAR_ACTION_DROP, + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -149,7 +151,8 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits for opt) */ +#define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 struct ng_car_bulkconf { diff --git a/sys/netgraph/ng_car.c b/sys/netgraph/ng_car.c index 1f74c4b193d0..9474e2467439 100644 --- a/sys/netgraph/ng_car.c +++ b/sys/netgraph/ng_car.c @@ -3,6 +3,7 @@ * * Copyright (c) 2005 Nuno Antunes <nuno.antunes@gmail.com> * Copyright (c) 2007 Alexander Motin <mav@freebsd.org> + * Copyright (c) 2019 Lutz Donnerhacke <lutz@donnerhacke.de> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,9 +35,9 @@ * * TODO: * - Sanitize input config values (impose some limits) - * - Implement internal packet painting (possibly using mbuf tags) - * - Implement color-aware mode * - Implement DSCP marking for IPv4 + * - Decouple functionality into a simple classifier (g/y/r) + * and various action nodes (i.e. shape, dcsp, pcp) */ #include <sys/param.h> @@ -50,6 +51,8 @@ #include <netgraph/netgraph.h> #include <netgraph/ng_car.h> +#include "qos.h" + #define NG_CAR_QUEUE_SIZE 100 /* Maximum queue size for SHAPE mode */ #define NG_CAR_QUEUE_MIN_TH 8 /* Minimum RED threshold for SHAPE mode */ @@ -261,6 +264,8 @@ ng_car_rcvdata(hook_p hook, item_p item ) { struct hookinfo *const hinfo = NG_HOOK_PRIVATE(hook); struct mbuf *m; + struct m_qos_color *colp; + enum qos_color col; int error = 0; u_int len; @@ -272,15 +277,22 @@ ng_car_rcvdata(hook_p hook, item_p item ) m = NGI_M(item); -#define NG_CAR_PERFORM_MATCH_ACTION(a) \ +#define NG_CAR_PERFORM_MATCH_ACTION(a,col) \ do { \ switch (a) { \ case NG_CAR_ACTION_FORWARD: \ /* Do nothing. */ \ break; \ case NG_CAR_ACTION_MARK: \ - /* XXX find a way to mark packets (mbuf tag?) */ \ - ++hinfo->stats.errors; \ + if (colp == NULL) { \ + colp = (void *)m_tag_alloc( \ + M_QOS_COOKIE, M_QOS_COLOR, \ + MTAG_SIZE(m_qos_color), M_NOWAIT); \ + if (colp != NULL) \ + m_tag_prepend(m, &colp->tag); \ + } \ + if (colp != NULL) \ + colp->color = col; \ break; \ case NG_CAR_ACTION_DROP: \ default: \ @@ -298,22 +310,33 @@ ng_car_rcvdata(hook_p hook, item_p item ) len = m->m_pkthdr.len; } + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Check committed token bucket. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green. */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); } else { /* Refill only if not green without it. */ ng_car_refillhook(hinfo); /* Check committed token bucket again after refill. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); /* If not green and mode is SHAPE, enqueue packet. */ } else if (hinfo->conf.mode == NG_CAR_SHAPE) { @@ -323,40 +346,51 @@ ng_car_rcvdata(hook_p hook, item_p item ) /* If not green and mode is RED, calculate probability. */ } else if (hinfo->conf.mode == NG_CAR_RED) { /* Is packet is bigger then extended burst? */ - if (len - (hinfo->tc - len) > hinfo->conf.ebs) { + if (len - (hinfo->tc - len) > hinfo->conf.ebs || + col >= QOS_COLOR_RED) { /* This packet is definitely red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); /* Use token bucket to simulate RED-like drop probability. */ - } else if (hinfo->te + (len - hinfo->tc) < - hinfo->conf.ebs) { + } else if (hinfo->te + (len - hinfo->tc) < hinfo->conf.ebs && + col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te += len - hinfo->tc; /* Go to negative tokens. */ hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is probably red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } /* If not green and mode is SINGLE/DOUBLE RATE. */ } else { /* Check extended token bucket. */ - if (hinfo->te - len >= 0) { + if (hinfo->te - len >= 0 && col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is red */ ++hinfo->stats.red_pkts; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } } } @@ -709,12 +743,21 @@ ng_car_q_event(node_p node, hook_p hook, void *arg, int arg2) static void ng_car_enqueue(struct hookinfo *hinfo, item_p item) { - struct mbuf *m; - int len; + struct mbuf *m; + int len; + struct m_qos_color *colp; + enum qos_color col; NGI_GET_M(item, m); NG_FREE_ITEM(item); + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Lock queue mutex. */ mtx_lock(&hinfo->q_mtx); @@ -725,7 +768,8 @@ ng_car_enqueue(struct hookinfo *hinfo, item_p item) /* If queue is overflowed or we have no RED tokens. */ if ((len >= (NG_CAR_QUEUE_SIZE - 1)) || - (hinfo->te + len >= NG_CAR_QUEUE_SIZE)) { + (hinfo->te + len >= NG_CAR_QUEUE_SIZE) || + (col >= QOS_COLOR_RED)) { /* Drop packet. */ ++hinfo->stats.red_pkts; ++hinfo->stats.dropped_pkts; diff --git a/sys/netgraph/ng_car.h b/sys/netgraph/ng_car.h index 7f07f87e52b8..410161af29ee 100644 --- a/sys/netgraph/ng_car.h +++ b/sys/netgraph/ng_car.h @@ -103,8 +103,7 @@ struct ng_car_hookconf { enum { NG_CAR_ACTION_FORWARD = 1, NG_CAR_ACTION_DROP, - NG_CAR_ACTION_MARK, - NG_CAR_ACTION_SET_TOS + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -115,7 +114,7 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits in opt) */ #define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 diff --git a/sys/netgraph/qos.h b/sys/netgraph/qos.h new file mode 100644 index 000000000000..0e5dfec479eb --- /dev/null +++ b/sys/netgraph/qos.h @@ -0,0 +1,83 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Lutz Donnerhacke <lutz@donnerhacke.de> + * + * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_QOS_H_ +#define _NETGRAPH_QOS_H_ + +#include <sys/mbuf.h> + +/* ABI cookie */ +#define M_QOS_COOKIE 1571268051 +#define MTAG_SIZE(X) ( sizeof(struct X) - sizeof(struct m_tag) ) + +/* + * Definition of types within this ABI: + * - Choose a type (16bit) by i.e. "echo $((1000+$(date +%s)%64536))" + * - Retry if the type is already in use + * - Define the structure for the type according to mbuf_tags(9) + * struct m_qos_foo { + * struct m_tag tag; + * ... + * }; + * Preferred usage: + * struct m_qos_foo *p = (void *)m_tag_locate(m, + * M_QOS_COOKIE, M_QOS_FOO, ...); + * or + * p = (void *)m_tag_alloc( + * M_QOS_COOKIE, M_QOS_FOO, MTAG_SIZE(foo), ...); + m_tag_prepend(m, &p->tag); + */ + +/* Color marking type */ +#define M_QOS_COLOR 23568 +/* Keep colors ordered semantically in order to allow use of "<=" or ">=" */ +enum qos_color { + QOS_COLOR_GREEN, + QOS_COLOR_YELLOW, + QOS_COLOR_RED +}; +struct m_qos_color { + struct m_tag tag; + enum qos_color color; +}; + +/* + * Priority class + * + * Processing per priority requires an overhead, which should + * be static (i.e. for alloctating queues) and small (for memory) + * So keep your chosen range limited. + */ +#define M_QOS_PRIORITY 28858 +struct m_qos_priority { + struct m_tag tag; + uint8_t priority; /* 0 - lowest */ +}; + +#endif /* _NETGRAPH_QOS_H_ */ From owner-dev-commits-src-all@freebsd.org Fri Feb 26 12:34:21 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C947C56075E; Fri, 26 Feb 2021 12:34: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 4Dn8H15Jn3z3lbV; Fri, 26 Feb 2021 12:34: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 A918929F1; Fri, 26 Feb 2021 12:34: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 11QCYLD0024703; Fri, 26 Feb 2021 12:34:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QCYLNj024702; Fri, 26 Feb 2021 12:34:21 GMT (envelope-from git) Date: Fri, 26 Feb 2021 12:34:21 GMT Message-Id: <202102261234.11QCYLNj024702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke <donner@FreeBSD.org> Subject: git: d88ac710ce58 - stable/12 - netgraph/ng_car: Add color marking code 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: d88ac710ce5828aad6b2ea76b217f3a17ae64232 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 12:34:21 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=d88ac710ce5828aad6b2ea76b217f3a17ae64232 commit d88ac710ce5828aad6b2ea76b217f3a17ae64232 Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-01-27 20:19:14 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-02-26 12:33:57 +0000 netgraph/ng_car: Add color marking code Chained policing should be able to reuse the classification of traffic. A new mbuf_tag type is defined to handle gereral QoS marking. A new subtype is defined to track the color marking. Reviewed by: manpages (bcr), melifaro, kp Sponsored by: IKS Service GmbH Differential Revision: https://reviews.freebsd.org/D22110 (cherry picked from commit d0d2e523bafb74180f8bebb90788790f0d2f0290) --- share/man/man4/ng_car.4 | 9 ++++-- sys/netgraph/ng_car.c | 86 +++++++++++++++++++++++++++++++++++++------------ sys/netgraph/ng_car.h | 5 ++- sys/netgraph/qos.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+), 27 deletions(-) diff --git a/share/man/man4/ng_car.4 b/share/man/man4/ng_car.4 index cb1459fe6987..c42f955a106a 100644 --- a/share/man/man4/ng_car.4 +++ b/share/man/man4/ng_car.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2012 +.Dd January 27, 2021 .Dt NG_CAR 4 .Os .Sh NAME @@ -108,6 +108,7 @@ Traffic shaping is much more polite to the TCP traffic than rate limit on links with bandwidth * delay product less than 6-8 TCP segments, but it consumes additional system resources for queue processing. .El +.Pp By default, all information rates are measured in bits per second and bursts are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled, @@ -138,7 +139,8 @@ struct ng_car_hookconf { /* possible actions (..._action) */ enum { NG_CAR_ACTION_FORWARD = 1, - NG_CAR_ACTION_DROP + NG_CAR_ACTION_DROP, + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -149,7 +151,8 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits for opt) */ +#define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 struct ng_car_bulkconf { diff --git a/sys/netgraph/ng_car.c b/sys/netgraph/ng_car.c index 897576349b22..d3ac2b7042a4 100644 --- a/sys/netgraph/ng_car.c +++ b/sys/netgraph/ng_car.c @@ -3,6 +3,7 @@ * * Copyright (c) 2005 Nuno Antunes <nuno.antunes@gmail.com> * Copyright (c) 2007 Alexander Motin <mav@freebsd.org> + * Copyright (c) 2019 Lutz Donnerhacke <lutz@donnerhacke.de> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,9 +35,9 @@ * * TODO: * - Sanitize input config values (impose some limits) - * - Implement internal packet painting (possibly using mbuf tags) - * - Implement color-aware mode * - Implement DSCP marking for IPv4 + * - Decouple functionality into a simple classifier (g/y/r) + * and various action nodes (i.e. shape, dcsp, pcp) */ #include <sys/param.h> @@ -50,6 +51,8 @@ #include <netgraph/netgraph.h> #include <netgraph/ng_car.h> +#include "qos.h" + #define NG_CAR_QUEUE_SIZE 100 /* Maximum queue size for SHAPE mode */ #define NG_CAR_QUEUE_MIN_TH 8 /* Minimum RED threshold for SHAPE mode */ @@ -261,6 +264,8 @@ ng_car_rcvdata(hook_p hook, item_p item ) { struct hookinfo *const hinfo = NG_HOOK_PRIVATE(hook); struct mbuf *m; + struct m_qos_color *colp; + enum qos_color col; int error = 0; u_int len; @@ -272,15 +277,22 @@ ng_car_rcvdata(hook_p hook, item_p item ) m = NGI_M(item); -#define NG_CAR_PERFORM_MATCH_ACTION(a) \ +#define NG_CAR_PERFORM_MATCH_ACTION(a,col) \ do { \ switch (a) { \ case NG_CAR_ACTION_FORWARD: \ /* Do nothing. */ \ break; \ case NG_CAR_ACTION_MARK: \ - /* XXX find a way to mark packets (mbuf tag?) */ \ - ++hinfo->stats.errors; \ + if (colp == NULL) { \ + colp = (void *)m_tag_alloc( \ + M_QOS_COOKIE, M_QOS_COLOR, \ + MTAG_SIZE(m_qos_color), M_NOWAIT); \ + if (colp != NULL) \ + m_tag_prepend(m, &colp->tag); \ + } \ + if (colp != NULL) \ + colp->color = col; \ break; \ case NG_CAR_ACTION_DROP: \ default: \ @@ -298,23 +310,34 @@ ng_car_rcvdata(hook_p hook, item_p item ) len = m->m_pkthdr.len; } + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Check committed token bucket. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green. */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); } else { /* Refill only if not green without it. */ ng_car_refillhook(hinfo); /* Check committed token bucket again after refill. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); /* If not green and mode is SHAPE, enqueue packet. */ } else if (hinfo->conf.mode == NG_CAR_SHAPE) { @@ -324,40 +347,51 @@ ng_car_rcvdata(hook_p hook, item_p item ) /* If not green and mode is RED, calculate probability. */ } else if (hinfo->conf.mode == NG_CAR_RED) { /* Is packet is bigger then extended burst? */ - if (len - (hinfo->tc - len) > hinfo->conf.ebs) { + if (len - (hinfo->tc - len) > hinfo->conf.ebs || + col >= QOS_COLOR_RED) { /* This packet is definitely red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); /* Use token bucket to simulate RED-like drop probability. */ - } else if (hinfo->te + (len - hinfo->tc) < - hinfo->conf.ebs) { + } else if (hinfo->te + (len - hinfo->tc) < hinfo->conf.ebs && + col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te += len - hinfo->tc; /* Go to negative tokens. */ hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is probably red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } /* If not green and mode is SINGLE/DOUBLE RATE. */ } else { /* Check extended token bucket. */ - if (hinfo->te - len >= 0) { + if (hinfo->te - len >= 0 && col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is red */ ++hinfo->stats.red_pkts; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } } } @@ -711,12 +745,21 @@ ng_car_q_event(node_p node, hook_p hook, void *arg, int arg2) static void ng_car_enqueue(struct hookinfo *hinfo, item_p item) { - struct mbuf *m; - int len; + struct mbuf *m; + int len; + struct m_qos_color *colp; + enum qos_color col; NGI_GET_M(item, m); NG_FREE_ITEM(item); + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Lock queue mutex. */ mtx_lock(&hinfo->q_mtx); @@ -727,7 +770,8 @@ ng_car_enqueue(struct hookinfo *hinfo, item_p item) /* If queue is overflowed or we have no RED tokens. */ if ((len >= (NG_CAR_QUEUE_SIZE - 1)) || - (hinfo->te + len >= NG_CAR_QUEUE_SIZE)) { + (hinfo->te + len >= NG_CAR_QUEUE_SIZE) || + (col >= QOS_COLOR_RED)) { /* Drop packet. */ ++hinfo->stats.red_pkts; ++hinfo->stats.droped_pkts; diff --git a/sys/netgraph/ng_car.h b/sys/netgraph/ng_car.h index 7ca72ba929cc..d77d5dfc5f9b 100644 --- a/sys/netgraph/ng_car.h +++ b/sys/netgraph/ng_car.h @@ -103,8 +103,7 @@ struct ng_car_hookconf { enum { NG_CAR_ACTION_FORWARD = 1, NG_CAR_ACTION_DROP, - NG_CAR_ACTION_MARK, - NG_CAR_ACTION_SET_TOS + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -115,7 +114,7 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits in opt) */ #define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 diff --git a/sys/netgraph/qos.h b/sys/netgraph/qos.h new file mode 100644 index 000000000000..0e5dfec479eb --- /dev/null +++ b/sys/netgraph/qos.h @@ -0,0 +1,83 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Lutz Donnerhacke <lutz@donnerhacke.de> + * + * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_QOS_H_ +#define _NETGRAPH_QOS_H_ + +#include <sys/mbuf.h> + +/* ABI cookie */ +#define M_QOS_COOKIE 1571268051 +#define MTAG_SIZE(X) ( sizeof(struct X) - sizeof(struct m_tag) ) + +/* + * Definition of types within this ABI: + * - Choose a type (16bit) by i.e. "echo $((1000+$(date +%s)%64536))" + * - Retry if the type is already in use + * - Define the structure for the type according to mbuf_tags(9) + * struct m_qos_foo { + * struct m_tag tag; + * ... + * }; + * Preferred usage: + * struct m_qos_foo *p = (void *)m_tag_locate(m, + * M_QOS_COOKIE, M_QOS_FOO, ...); + * or + * p = (void *)m_tag_alloc( + * M_QOS_COOKIE, M_QOS_FOO, MTAG_SIZE(foo), ...); + m_tag_prepend(m, &p->tag); + */ + +/* Color marking type */ +#define M_QOS_COLOR 23568 +/* Keep colors ordered semantically in order to allow use of "<=" or ">=" */ +enum qos_color { + QOS_COLOR_GREEN, + QOS_COLOR_YELLOW, + QOS_COLOR_RED +}; +struct m_qos_color { + struct m_tag tag; + enum qos_color color; +}; + +/* + * Priority class + * + * Processing per priority requires an overhead, which should + * be static (i.e. for alloctating queues) and small (for memory) + * So keep your chosen range limited. + */ +#define M_QOS_PRIORITY 28858 +struct m_qos_priority { + struct m_tag tag; + uint8_t priority; /* 0 - lowest */ +}; + +#endif /* _NETGRAPH_QOS_H_ */ From owner-dev-commits-src-all@freebsd.org Fri Feb 26 12:37:17 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3517560B89; Fri, 26 Feb 2021 12:37: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 4Dn8LP4BCTz3lZb; Fri, 26 Feb 2021 12:37: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 7E811288C; Fri, 26 Feb 2021 12:37: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 11QCbHhj025247; Fri, 26 Feb 2021 12:37:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QCbH8R025246; Fri, 26 Feb 2021 12:37:17 GMT (envelope-from git) Date: Fri, 26 Feb 2021 12:37:17 GMT Message-Id: <202102261237.11QCbH8R025246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke <donner@FreeBSD.org> Subject: git: 21e24a8f01f7 - stable/11 - netgraph/ng_car: Add color marking code 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: 21e24a8f01f7bd7e0a93ed972b6165e2f9798be5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 12:37:17 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=21e24a8f01f7bd7e0a93ed972b6165e2f9798be5 commit 21e24a8f01f7bd7e0a93ed972b6165e2f9798be5 Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-01-27 20:19:14 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-02-26 12:36:40 +0000 netgraph/ng_car: Add color marking code Chained policing should be able to reuse the classification of traffic. A new mbuf_tag type is defined to handle gereral QoS marking. A new subtype is defined to track the color marking. Reviewed by: manpages (bcr), melifaro, kp Sponsored by: IKS Service GmbH Differential Revision: https://reviews.freebsd.org/D22110 (cherry picked from commit d0d2e523bafb74180f8bebb90788790f0d2f0290) --- share/man/man4/ng_car.4 | 9 ++++-- sys/netgraph/ng_car.c | 86 +++++++++++++++++++++++++++++++++++++------------ sys/netgraph/ng_car.h | 5 ++- sys/netgraph/qos.h | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+), 27 deletions(-) diff --git a/share/man/man4/ng_car.4 b/share/man/man4/ng_car.4 index cb1459fe6987..c42f955a106a 100644 --- a/share/man/man4/ng_car.4 +++ b/share/man/man4/ng_car.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2012 +.Dd January 27, 2021 .Dt NG_CAR 4 .Os .Sh NAME @@ -108,6 +108,7 @@ Traffic shaping is much more polite to the TCP traffic than rate limit on links with bandwidth * delay product less than 6-8 TCP segments, but it consumes additional system resources for queue processing. .El +.Pp By default, all information rates are measured in bits per second and bursts are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled, @@ -138,7 +139,8 @@ struct ng_car_hookconf { /* possible actions (..._action) */ enum { NG_CAR_ACTION_FORWARD = 1, - NG_CAR_ACTION_DROP + NG_CAR_ACTION_DROP, + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -149,7 +151,8 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits for opt) */ +#define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 struct ng_car_bulkconf { diff --git a/sys/netgraph/ng_car.c b/sys/netgraph/ng_car.c index cdbaf5a3c920..3705186f26b0 100644 --- a/sys/netgraph/ng_car.c +++ b/sys/netgraph/ng_car.c @@ -1,6 +1,7 @@ /*- * Copyright (c) 2005 Nuno Antunes <nuno.antunes@gmail.com> * Copyright (c) 2007 Alexander Motin <mav@freebsd.org> + * Copyright (c) 2019 Lutz Donnerhacke <lutz@donnerhacke.de> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,9 +33,9 @@ * * TODO: * - Sanitize input config values (impose some limits) - * - Implement internal packet painting (possibly using mbuf tags) - * - Implement color-aware mode * - Implement DSCP marking for IPv4 + * - Decouple functionality into a simple classifier (g/y/r) + * and various action nodes (i.e. shape, dcsp, pcp) */ #include <sys/param.h> @@ -48,6 +49,8 @@ #include <netgraph/netgraph.h> #include <netgraph/ng_car.h> +#include "qos.h" + #define NG_CAR_QUEUE_SIZE 100 /* Maximum queue size for SHAPE mode */ #define NG_CAR_QUEUE_MIN_TH 8 /* Minimum RED threshold for SHAPE mode */ @@ -259,6 +262,8 @@ ng_car_rcvdata(hook_p hook, item_p item ) { struct hookinfo *const hinfo = NG_HOOK_PRIVATE(hook); struct mbuf *m; + struct m_qos_color *colp; + enum qos_color col; int error = 0; u_int len; @@ -270,15 +275,22 @@ ng_car_rcvdata(hook_p hook, item_p item ) m = NGI_M(item); -#define NG_CAR_PERFORM_MATCH_ACTION(a) \ +#define NG_CAR_PERFORM_MATCH_ACTION(a,col) \ do { \ switch (a) { \ case NG_CAR_ACTION_FORWARD: \ /* Do nothing. */ \ break; \ case NG_CAR_ACTION_MARK: \ - /* XXX find a way to mark packets (mbuf tag?) */ \ - ++hinfo->stats.errors; \ + if (colp == NULL) { \ + colp = (void *)m_tag_alloc( \ + M_QOS_COOKIE, M_QOS_COLOR, \ + MTAG_SIZE(m_qos_color), M_NOWAIT); \ + if (colp != NULL) \ + m_tag_prepend(m, &colp->tag); \ + } \ + if (colp != NULL) \ + colp->color = col; \ break; \ case NG_CAR_ACTION_DROP: \ default: \ @@ -296,23 +308,34 @@ ng_car_rcvdata(hook_p hook, item_p item ) len = m->m_pkthdr.len; } + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Check committed token bucket. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green. */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); } else { /* Refill only if not green without it. */ ng_car_refillhook(hinfo); /* Check committed token bucket again after refill. */ - if (hinfo->tc - len >= 0) { + if (hinfo->tc - len >= 0 && col <= QOS_COLOR_GREEN) { /* This packet is green */ ++hinfo->stats.green_pkts; hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.green_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.green_action, + QOS_COLOR_GREEN); /* If not green and mode is SHAPE, enqueue packet. */ } else if (hinfo->conf.mode == NG_CAR_SHAPE) { @@ -322,40 +345,51 @@ ng_car_rcvdata(hook_p hook, item_p item ) /* If not green and mode is RED, calculate probability. */ } else if (hinfo->conf.mode == NG_CAR_RED) { /* Is packet is bigger then extended burst? */ - if (len - (hinfo->tc - len) > hinfo->conf.ebs) { + if (len - (hinfo->tc - len) > hinfo->conf.ebs || + col >= QOS_COLOR_RED) { /* This packet is definitely red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); /* Use token bucket to simulate RED-like drop probability. */ - } else if (hinfo->te + (len - hinfo->tc) < - hinfo->conf.ebs) { + } else if (hinfo->te + (len - hinfo->tc) < hinfo->conf.ebs && + col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te += len - hinfo->tc; /* Go to negative tokens. */ hinfo->tc -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is probably red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } /* If not green and mode is SINGLE/DOUBLE RATE. */ } else { /* Check extended token bucket. */ - if (hinfo->te - len >= 0) { + if (hinfo->te - len >= 0 && col <= QOS_COLOR_YELLOW) { /* This packet is yellow */ ++hinfo->stats.yellow_pkts; hinfo->te -= len; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.yellow_action, + QOS_COLOR_YELLOW); } else { /* This packet is red */ ++hinfo->stats.red_pkts; - NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); + NG_CAR_PERFORM_MATCH_ACTION( + hinfo->conf.red_action, + QOS_COLOR_RED); } } } @@ -709,12 +743,21 @@ ng_car_q_event(node_p node, hook_p hook, void *arg, int arg2) static void ng_car_enqueue(struct hookinfo *hinfo, item_p item) { - struct mbuf *m; - int len; + struct mbuf *m; + int len; + struct m_qos_color *colp; + enum qos_color col; NGI_GET_M(item, m); NG_FREE_ITEM(item); + /* Determine current color of the packet (default green) */ + colp = (void *)m_tag_locate(m, M_QOS_COOKIE, M_QOS_COLOR, NULL); + if ((hinfo->conf.opt & NG_CAR_COLOR_AWARE) && (colp != NULL)) + col = colp->color; + else + col = QOS_COLOR_GREEN; + /* Lock queue mutex. */ mtx_lock(&hinfo->q_mtx); @@ -725,7 +768,8 @@ ng_car_enqueue(struct hookinfo *hinfo, item_p item) /* If queue is overflowed or we have no RED tokens. */ if ((len >= (NG_CAR_QUEUE_SIZE - 1)) || - (hinfo->te + len >= NG_CAR_QUEUE_SIZE)) { + (hinfo->te + len >= NG_CAR_QUEUE_SIZE) || + (col >= QOS_COLOR_RED)) { /* Drop packet. */ ++hinfo->stats.red_pkts; ++hinfo->stats.droped_pkts; diff --git a/sys/netgraph/ng_car.h b/sys/netgraph/ng_car.h index 3fda67512dd0..09a91df0da87 100644 --- a/sys/netgraph/ng_car.h +++ b/sys/netgraph/ng_car.h @@ -101,8 +101,7 @@ struct ng_car_hookconf { enum { NG_CAR_ACTION_FORWARD = 1, NG_CAR_ACTION_DROP, - NG_CAR_ACTION_MARK, - NG_CAR_ACTION_SET_TOS + NG_CAR_ACTION_MARK }; /* operation modes (mode) */ @@ -113,7 +112,7 @@ enum { NG_CAR_SHAPE }; -/* mode options (opt) */ +/* mode options (bits in opt) */ #define NG_CAR_COLOR_AWARE 1 #define NG_CAR_COUNT_PACKETS 2 diff --git a/sys/netgraph/qos.h b/sys/netgraph/qos.h new file mode 100644 index 000000000000..0e5dfec479eb --- /dev/null +++ b/sys/netgraph/qos.h @@ -0,0 +1,83 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Lutz Donnerhacke <lutz@donnerhacke.de> + * + * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_QOS_H_ +#define _NETGRAPH_QOS_H_ + +#include <sys/mbuf.h> + +/* ABI cookie */ +#define M_QOS_COOKIE 1571268051 +#define MTAG_SIZE(X) ( sizeof(struct X) - sizeof(struct m_tag) ) + +/* + * Definition of types within this ABI: + * - Choose a type (16bit) by i.e. "echo $((1000+$(date +%s)%64536))" + * - Retry if the type is already in use + * - Define the structure for the type according to mbuf_tags(9) + * struct m_qos_foo { + * struct m_tag tag; + * ... + * }; + * Preferred usage: + * struct m_qos_foo *p = (void *)m_tag_locate(m, + * M_QOS_COOKIE, M_QOS_FOO, ...); + * or + * p = (void *)m_tag_alloc( + * M_QOS_COOKIE, M_QOS_FOO, MTAG_SIZE(foo), ...); + m_tag_prepend(m, &p->tag); + */ + +/* Color marking type */ +#define M_QOS_COLOR 23568 +/* Keep colors ordered semantically in order to allow use of "<=" or ">=" */ +enum qos_color { + QOS_COLOR_GREEN, + QOS_COLOR_YELLOW, + QOS_COLOR_RED +}; +struct m_qos_color { + struct m_tag tag; + enum qos_color color; +}; + +/* + * Priority class + * + * Processing per priority requires an overhead, which should + * be static (i.e. for alloctating queues) and small (for memory) + * So keep your chosen range limited. + */ +#define M_QOS_PRIORITY 28858 +struct m_qos_priority { + struct m_tag tag; + uint8_t priority; /* 0 - lowest */ +}; + +#endif /* _NETGRAPH_QOS_H_ */ From owner-dev-commits-src-all@freebsd.org Fri Feb 26 13:11:03 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F6E3560D74; Fri, 26 Feb 2021 13:11: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 4Dn95M3sbcz3n3c; Fri, 26 Feb 2021 13:11: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 77CA32FC8; Fri, 26 Feb 2021 13:11: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 11QDB3fW075521; Fri, 26 Feb 2021 13:11:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QDB3M6075520; Fri, 26 Feb 2021 13:11:03 GMT (envelope-from git) Date: Fri, 26 Feb 2021 13:11:03 GMT Message-Id: <202102261311.11QDB3M6075520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> Subject: git: 1bf86687c2eb - main - etc/shells: Add a reference to the ftpd manpage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bf86687c2eb744497b6d9fd02b80e9821b1f4d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 13:11:03 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1bf86687c2eb744497b6d9fd02b80e9821b1f4d6 commit 1bf86687c2eb744497b6d9fd02b80e9821b1f4d6 Author: ceri <ceri@submonkey.net> AuthorDate: 2021-02-25 17:24:19 +0000 Commit: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> CommitDate: 2021-02-26 13:09:19 +0000 etc/shells: Add a reference to the ftpd manpage While here, also fix incorrect capitalizaiton --- etc/shells | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/shells b/etc/shells index fe1e0294a010..a3107faec4c2 100644 --- a/etc/shells +++ b/etc/shells @@ -1,7 +1,7 @@ # $FreeBSD$ # # List of acceptable shells for chpass(1). -# Ftpd will not allow users to connect who are not using +# ftpd(8) will not allow users to connect who are not using # one of these shells. /bin/sh From owner-dev-commits-src-all@freebsd.org Fri Feb 26 14:20:25 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E7905626E1; Fri, 26 Feb 2021 14:20:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnBdN2B7Pz3rV2; Fri, 26 Feb 2021 14:20:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id Fdyel6RVqnRGtFdyflZHzs; Fri, 26 Feb 2021 07:20:22 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=603903a6 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=zGi-gAaqaAkRpWm3KXMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 37E9181B; Fri, 26 Feb 2021 06:20:19 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11QEKJoX006569; Fri, 26 Feb 2021 06:20:19 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102261420.11QEKJoX006569@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert <Cy.Schubert@cschubert.com> From: Cy Schubert <Cy.Schubert@cschubert.com> X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin <bapt@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database In-reply-to: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> Comments: In-reply-to Baptiste Daroussin <bapt@FreeBSD.org> message dated "Thu, 25 Feb 2021 13:27:04 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 26 Feb 2021 06:20:19 -0800 X-CMAE-Envelope: MS4xfFXHLCGTlJFjTrXCEAnOuJ4490RrxWA0qD6d19vgjah0DKtY9SwPx4MeOLoUMMgXabZX/rX07kdc81ozzfFyUX3jQ0BUDU9XF8CsGTmIM5/CJ76UE+Kr VVEeRG+DweJ5Qux/PJIw3Xy05Ef3lqbKRlTem3t/AhQGnWn3NejqhQZEnqwfLN46afOmbkje71Ayf0QoHt8v2EnMbWzcjTqgcvk0xPzjFAc3aWQ1lginDkh2 k/tdzmRZ9dgue7ZoibGSwnfDGIYJbteyy91xXNP+uNH7kn9wq9UuKdC8xELF4xUq/rf4FMwo6TSjYPvVyhdIs7rLk/P51xtNEa8dU8VC7i4= X-Rspamd-Queue-Id: 4DnBdN2B7Pz3rV2 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.139) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.70 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.229.168:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.136.139:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; REPLYTO_EQ_FROM(0.00)[]; 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)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_VERYGOOD(0.00)[64.59.136.139:from]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 14:20:25 -0000 In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste Daroussi n writes: > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae > 14376f80 > > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > Author: Baptiste Daroussin <bapt@FreeBSD.org> > AuthorDate: 2021-02-23 16:17:32 +0000 > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > CommitDate: 2021-02-25 13:25:32 +0000 > > terminfo: add terminfo database > > Tested by: manu, jbeich > --- > share/Makefile | 1 + > share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ > 2 files changed, 35 insertions(+) > > diff --git a/share/Makefile b/share/Makefile > index c4e12b05f7db..d6854b230ae5 100644 > --- a/share/Makefile > +++ b/share/Makefile > @@ -26,6 +26,7 @@ SUBDIR= ${_colldef} \ > ${_syscons} \ > tabset \ > termcap \ > + terminfo \ > ${_timedef} \ > ${_vt} \ > ${_zoneinfo} > diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile > new file mode 100644 > index 000000000000..7bb11f3fdf24 > --- /dev/null > +++ b/share/terminfo/Makefile > @@ -0,0 +1,34 @@ > +PACKAGE= runtime > + > +.PATH: ${SRCTOP}/contrib/ncurses/misc > +TINFOBUILDDIR= ${.OBJDIR}/builddir > +CLEANDIRS+= builddir > + > +.include <src.tools.mk> > + > +.if !defined(_SKIP_BUILD) > +all: terminfo > +.endif > +META_TARGETS+= terminfo install-terminfo > + > +terminfo: terminfo.src > + mkdir -p ${TINFOBUILDDIR} > + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} > + > +.if make(*install*) > +TINFOS!= cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=C sort > +TINFOSDIRS= ${TINFOS:C/(.).*/\1/g:O:u} > +.endif > + > +beforeinstall: install-terminfo > +install-terminfo: > + mkdir -p ${DESTDIR}/usr/share/terminfo > + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} > +.for f in ${TINFOS} > + ${INSTALL} ${TAG_ARGS} \ > + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} > +.endfor > + > +.include <bsd.prog.mk> > + > I think this had some unintended consequences, a POLA violation that should be documented. Our termcap didn't support alternate screen buffers while terminfo does. Termcap did through t_te and t_ti but we didn't use them. Terminfo as delivered from the ncurses factory does supply rmcup and smcup; our fullscreen apps such as nvi and top see them and use the alternate screen buffer. The use of the alternate screen buffer is one of the things I hate about Linux. After running vi or top I expect the output to remain on the screen so I can use some bit of information in my next command. We now have this behaviour too. The alternate screen buffer was added to xterm an ice age ago. Most modern terminal emulators support it. As much as I feel the need to yank out rmcup an smcup from our terminfo database, we are using a feature, as distasteful as it may feel. This change probably needs a relnotes=yes and an UPDATING entry advising users that they can either change $TERM to xterm1, vt100, or some other terminal definition that doesn't support rmcup and smcup, or learn to like it. OTOH, maybe this is something we as a community don't really want and we remove the rmcup and smcup definitions from our terminfo database. Personally, I believe this is progress -- progress I'm not particularly enamoured with but progress nonetheless. But I think we need to discuss, come to some sort of decision and document it. Thoughts? -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: https://FreeBSD.org NTP: <cy@nwtime.org> Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Fri Feb 26 14:37:17 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9F7D56309A; Fri, 26 Feb 2021 14:37:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnC0s592hz3sMs; Fri, 26 Feb 2021 14:37:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 7CEFE18F5; Fri, 26 Feb 2021 14:37:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 2817735DEE; Fri, 26 Feb 2021 15:37:14 +0100 (CET) Date: Fri, 26 Feb 2021 15:37:14 +0100 From: Baptiste Daroussin <bapt@FreeBSD.org> To: Cy Schubert <Cy.Schubert@cschubert.com> Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226143714.k24aacsrjnnhkktc@aniel.nours.eu> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <202102261420.11QEKJoX006569@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dqdw63fwvislrgvy" Content-Disposition: inline In-Reply-To: <202102261420.11QEKJoX006569@slippy.cwsent.com> X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 14:37:17 -0000 --dqdw63fwvislrgvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 26, 2021 at 06:20:19AM -0800, Cy Schubert wrote: > In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste=20 > Daroussi > n writes: > > The branch main has been updated by bapt: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e5= 993332ae > > 14376f80 > > > > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > > Author: Baptiste Daroussin <bapt@FreeBSD.org> > > AuthorDate: 2021-02-23 16:17:32 +0000 > > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > > CommitDate: 2021-02-25 13:25:32 +0000 > > > > terminfo: add terminfo database > > =20 > > Tested by: manu, jbeich > > --- > > share/Makefile | 1 + > > share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ > > 2 files changed, 35 insertions(+) > > > > diff --git a/share/Makefile b/share/Makefile > > index c4e12b05f7db..d6854b230ae5 100644 > > --- a/share/Makefile > > +++ b/share/Makefile > > @@ -26,6 +26,7 @@ SUBDIR=3D ${_colldef} \ > > ${_syscons} \ > > tabset \ > > termcap \ > > + terminfo \ > > ${_timedef} \ > > ${_vt} \ > > ${_zoneinfo} > > diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile > > new file mode 100644 > > index 000000000000..7bb11f3fdf24 > > --- /dev/null > > +++ b/share/terminfo/Makefile > > @@ -0,0 +1,34 @@ > > +PACKAGE=3D runtime > > + > > +.PATH: ${SRCTOP}/contrib/ncurses/misc > > +TINFOBUILDDIR=3D ${.OBJDIR}/builddir > > +CLEANDIRS+=3D builddir > > + > > +.include <src.tools.mk> > > + > > +.if !defined(_SKIP_BUILD) > > +all: terminfo > > +.endif > > +META_TARGETS+=3D terminfo install-terminfo > > + > > +terminfo: terminfo.src > > + mkdir -p ${TINFOBUILDDIR} > > + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} > > + > > +.if make(*install*) > > +TINFOS!=3D cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=3DC sort > > +TINFOSDIRS=3D ${TINFOS:C/(.).*/\1/g:O:u} > > +.endif > > + > > +beforeinstall: install-terminfo > > +install-terminfo: > > + mkdir -p ${DESTDIR}/usr/share/terminfo > > + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} > > +.for f in ${TINFOS} > > + ${INSTALL} ${TAG_ARGS} \ > > + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > > + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} > > +.endfor > > + > > +.include <bsd.prog.mk> > > + > > >=20 > I think this had some unintended consequences, a POLA violation that shou= ld=20 > be documented. Our termcap didn't support alternate screen buffers while= =20 > terminfo does. Termcap did through t_te and t_ti but we didn't use them.= =20 > Terminfo as delivered from the ncurses factory does supply rmcup and smcu= p;=20 > our fullscreen apps such as nvi and top see them and use the alternate=20 > screen buffer. >=20 > The use of the alternate screen buffer is one of the things I hate about= =20 > Linux. After running vi or top I expect the output to remain on the scree= n=20 > so I can use some bit of information in my next command. We now have this= =20 > behaviour too. >=20 > The alternate screen buffer was added to xterm an ice age ago. Most moder= n=20 > terminal emulators support it. As much as I feel the need to yank out rmc= up=20 > an smcup from our terminfo database, we are using a feature, as distastef= ul=20 > as it may feel. This change probably needs a relnotes=3Dyes and an UPDATI= NG=20 > entry advising users that they can either change $TERM to xterm1, vt100, = or=20 > some other terminal definition that doesn't support rmcup and smcup, or= =20 > learn to like it. >=20 > OTOH, maybe this is something we as a community don't really want and we= =20 > remove the rmcup and smcup definitions from our terminfo database.=20 > Personally, I believe this is progress -- progress I'm not particularly= =20 > enamoured with but progress nonetheless. But I think we need to discuss,= =20 > come to some sort of decision and document it. >=20 > Thoughts? I agree about UPDATING and RELNOTES. I planned to do it in a couple of days= for UPDATING, as for rmcup/smcup there have been so many people asking for it, = that I didn't think people will hate it, so yes we could/should add en entry in UPDATING. I was planning to MFC it to 13.1, I don't know how much this change is a PO= LA violation or not, imho all the other benefice of terminfo over termcap for = end users are worth the MFC, but if most people vote against, I won't MFC it. Bapt --dqdw63fwvislrgvy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAmA5B5cACgkQY4mL3PG3 PloPoA/7BlnKX+E4HfJihQJNSxGWo7sSsMQSdLrLMYk0QnVyf5vXUa00gr6yn5B1 SOPGe83JfhyOoUJXzDVAqCV0vUQtGsIkBNQJHVJZQnP5Xxm0vg5V1y/lmaBbYKNG AKGVzXdWQhQWRyNAxscKOijcVNZh4+PPpIGjubNnp8ct5xxjJdhDMLFy27D5xjN6 +4wxpDSnycinaS36EtpBU0EX9I/+5aHIxpcprIQEBEocrfFmeIcR+h2TfFpr7N8r YrQ9Mq0yTFeFFJjwJqcvRG8sbyrFf/kuq9pAuMAxyt4Ud17kY0KcgQMWUDSS+oJ/ h41/3hGDgpvTKiJaUbW15b+Z9eqnQLEOmvbDeguv2vz+GrZfp1SMkn+524rBqjEa TetukmkZDSh6mqXhbMXy9hsROwAA+yt530xunYTiMP2+wURGcfsYUifJkro7emsA WfphIOo7l8jo85jdUL92UOQX6l3ja0IMC+cXCRhN2A240SOJztqUMvkwo9XJW15g RsVfirPf3tSbsO5K7Xk8m4GlfUahCtMUqJBnO9Aw7bWFJzTMwcxvgscrlnz8UbNZ EpWPMX0MpzTlgW5mNwJ1SbJ49rt18/ORpHGi+rmDXg8xd7COouteVFObYhrTbKUS ROb4XodI7kTezP072DS/3dTz0yXfXFJxGxWzA1cO1PKaZ3iCIeY= =huCu -----END PGP SIGNATURE----- --dqdw63fwvislrgvy-- From owner-dev-commits-src-all@freebsd.org Fri Feb 26 14:48:22 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 673545631A3; Fri, 26 Feb 2021 14:48:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnCFd73W4z3t3k; Fri, 26 Feb 2021 14:48:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id FePilTleYeHr9FePjlULfU; Fri, 26 Feb 2021 07:48:20 -0700 X-Authority-Analysis: v=2.4 cv=Yq/K+6UX c=1 sm=1 tr=0 ts=60390a34 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=w16vAm4-AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=OsFhiFZIi2wW-GAr0TcA:9 a=CjuIK1q_8ugA:10 a=eWus_ag6ds_90y4h1ov8:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id E0E32865; Fri, 26 Feb 2021 06:48:17 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11QEmHlA006761; Fri, 26 Feb 2021 06:48:17 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102261448.11QEmHlA006761@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert <Cy.Schubert@cschubert.com> From: Cy Schubert <Cy.Schubert@cschubert.com> X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin <bapt@FreeBSD.org> cc: Cy Schubert <Cy.Schubert@cschubert.com>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database In-reply-to: <20210226143714.k24aacsrjnnhkktc@aniel.nours.eu> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <202102261420.11QEKJoX006569@slippy.cwsent.com> <20210226143714.k24aacsrjnnhkktc@aniel.nours.eu> Comments: In-reply-to Baptiste Daroussin <bapt@FreeBSD.org> message dated "Fri, 26 Feb 2021 15:37:14 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 26 Feb 2021 06:48:17 -0800 X-CMAE-Envelope: MS4xfPPHhN0YLQ9Ta3tcsQl2puuxDrG7WsHgE4AX3oUDosIqteOHdUmLLyhZblhENWEUlZqySPdYl4dBwKDaTwsVBVkmsdXshmcSiQ2au2D8iyiFD0r8B+OG pp8Ph+cGKR822lROMyd7hZjPN3o4AJKGsiszu3QSPlzPyHNtfUfjYA1/jl0UQcBzJ6ErX40Hqtdmy+/qHY48DhzlQSnYlbvBT3Jms4Ksugg4TVVKyeAAs+lH gv86I40HSMUEQWzIsfPLMfR/yiLfuiKZ8tWU5hVHwJLaa5RCVvzZhh+7uOUMhY+xQABXnX8ice9/wr0Y6+dpuMoAT8hMyNSnG/P6x6UvLYQ= X-Rspamd-Queue-Id: 4DnCFd73W4z3t3k 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 14:48:22 -0000 In message <20210226143714.k24aacsrjnnhkktc@aniel.nours.eu>, Baptiste Daroussin writes: > > --dqdw63fwvislrgvy > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Fri, Feb 26, 2021 at 06:20:19AM -0800, Cy Schubert wrote: > > In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste=20 > > Daroussi > > n writes: > > > The branch main has been updated by bapt: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e5= > 993332ae > > > 14376f80 > > > > > > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > > > Author: Baptiste Daroussin <bapt@FreeBSD.org> > > > AuthorDate: 2021-02-23 16:17:32 +0000 > > > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > > > CommitDate: 2021-02-25 13:25:32 +0000 > > > > > > terminfo: add terminfo database > > > =20 > > > Tested by: manu, jbeich > > > --- > > > share/Makefile | 1 + > > > share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ > > > 2 files changed, 35 insertions(+) > > > > > > diff --git a/share/Makefile b/share/Makefile > > > index c4e12b05f7db..d6854b230ae5 100644 > > > --- a/share/Makefile > > > +++ b/share/Makefile > > > @@ -26,6 +26,7 @@ SUBDIR=3D ${_colldef} \ > > > ${_syscons} \ > > > tabset \ > > > termcap \ > > > + terminfo \ > > > ${_timedef} \ > > > ${_vt} \ > > > ${_zoneinfo} > > > diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile > > > new file mode 100644 > > > index 000000000000..7bb11f3fdf24 > > > --- /dev/null > > > +++ b/share/terminfo/Makefile > > > @@ -0,0 +1,34 @@ > > > +PACKAGE=3D runtime > > > + > > > +.PATH: ${SRCTOP}/contrib/ncurses/misc > > > +TINFOBUILDDIR=3D ${.OBJDIR}/builddir > > > +CLEANDIRS+=3D builddir > > > + > > > +.include <src.tools.mk> > > > + > > > +.if !defined(_SKIP_BUILD) > > > +all: terminfo > > > +.endif > > > +META_TARGETS+=3D terminfo install-terminfo > > > + > > > +terminfo: terminfo.src > > > + mkdir -p ${TINFOBUILDDIR} > > > + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} > > > + > > > +.if make(*install*) > > > +TINFOS!=3D cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=3DC sor > t > > > +TINFOSDIRS=3D ${TINFOS:C/(.).*/\1/g:O:u} > > > +.endif > > > + > > > +beforeinstall: install-terminfo > > > +install-terminfo: > > > + mkdir -p ${DESTDIR}/usr/share/terminfo > > > + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} > > > +.for f in ${TINFOS} > > > + ${INSTALL} ${TAG_ARGS} \ > > > + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > > > + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} > > > +.endfor > > > + > > > +.include <bsd.prog.mk> > > > + > > > > >=20 > > I think this had some unintended consequences, a POLA violation that shou= > ld=20 > > be documented. Our termcap didn't support alternate screen buffers while= > =20 > > terminfo does. Termcap did through t_te and t_ti but we didn't use them.= > =20 > > Terminfo as delivered from the ncurses factory does supply rmcup and smcu= > p;=20 > > our fullscreen apps such as nvi and top see them and use the alternate=20 > > screen buffer. > >=20 > > The use of the alternate screen buffer is one of the things I hate about= > =20 > > Linux. After running vi or top I expect the output to remain on the scree= > n=20 > > so I can use some bit of information in my next command. We now have this= > =20 > > behaviour too. > >=20 > > The alternate screen buffer was added to xterm an ice age ago. Most moder= > n=20 > > terminal emulators support it. As much as I feel the need to yank out rmc= > up=20 > > an smcup from our terminfo database, we are using a feature, as distastef= > ul=20 > > as it may feel. This change probably needs a relnotes=3Dyes and an UPDATI= > NG=20 > > entry advising users that they can either change $TERM to xterm1, vt100, = > or=20 > > some other terminal definition that doesn't support rmcup and smcup, or= > =20 > > learn to like it. > >=20 > > OTOH, maybe this is something we as a community don't really want and we= > =20 > > remove the rmcup and smcup definitions from our terminfo database.=20 > > Personally, I believe this is progress -- progress I'm not particularly= > =20 > > enamoured with but progress nonetheless. But I think we need to discuss,= > =20 > > come to some sort of decision and document it. > >=20 > > Thoughts? > > I agree about UPDATING and RELNOTES. I planned to do it in a couple of days= > for > UPDATING, as for rmcup/smcup there have been so many people asking for it, = > that > I didn't think people will hate it, so yes we could/should add en entry in > UPDATING. UPDATING, yes, but also handbook documentation. Setting $TERM to xterm1 or vt100 reverts to the old behaviour but at the cost of any new functionality the current xterm or xterm-256color provides. I do think this needs a handbook page that discusses the old behaviour and how to get it back. Maybe how to set up one's own terminfo using $TERMINFO or one of the other environment variables. I say maybe because people setting up their own will screw themselves resulting in more PRs. I view this as an exercise of reducing PRs and tickets. Useless tickets waste everyone's time. > > I was planning to MFC it to 13.1, I don't know how much this change is a PO= > LA > violation or not, imho all the other benefice of terminfo over termcap for = > end > users are worth the MFC, but if most people vote against, I won't MFC it. I think this is big enough not to MFC to 13.1. -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: https://FreeBSD.org NTP: <cy@nwtime.org> Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Fri Feb 26 15:06:54 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C872C563899; Fri, 26 Feb 2021 15:06: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 4DnCg25LLDz3tvn; Fri, 26 Feb 2021 15:06: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 AA57F4D07; Fri, 26 Feb 2021 15:06: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 11QF6sD9022975; Fri, 26 Feb 2021 15:06:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QF6ssk022974; Fri, 26 Feb 2021 15:06:54 GMT (envelope-from git) Date: Fri, 26 Feb 2021 15:06:54 GMT Message-Id: <202102261506.11QF6ssk022974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers <asomers@FreeBSD.org> Subject: git: 60a632f047cd - main - fortune: add a tip about gstat MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60a632f047cdb6e5314711f593a4d3b1f1d8dde9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 15:06:54 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=60a632f047cdb6e5314711f593a4d3b1f1d8dde9 commit 60a632f047cdb6e5314711f593a4d3b1f1d8dde9 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-02-26 15:06:07 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-02-26 15:06:07 +0000 fortune: add a tip about gstat MFC after: 3 weeks --- usr.bin/fortune/datfiles/freebsd-tips | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index 3325fdce090f..46f5ec31f8d6 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -799,3 +799,9 @@ always have space left this way. -- Benedict Reuschling <bcr@FreeBSD.org> % +Sometimes a single slow HDD can cripple the performance of your entire system. You can spot one like this: + +# gstat -I5s | sort -rn -k9 | head + + -- Alan Somers <asomers@FreeBSD.org> +% From owner-dev-commits-src-all@freebsd.org Fri Feb 26 15:33:36 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3278956446B; Fri, 26 Feb 2021 15:33: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 4DnDFr0xjnz4R16; Fri, 26 Feb 2021 15:33: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 13793503E; Fri, 26 Feb 2021 15:33: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 11QFXZo4061707; Fri, 26 Feb 2021 15:33:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QFXZwu061706; Fri, 26 Feb 2021 15:33:35 GMT (envelope-from git) Date: Fri, 26 Feb 2021 15:33:35 GMT Message-Id: <202102261533.11QFXZwu061706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 888ae5725257 - main - nvi: fix catalog generation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 888ae5725257c251319f14f31c2e941717b675f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 15:33:36 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=888ae5725257c251319f14f31c2e941717b675f2 commit 888ae5725257c251319f14f31c2e941717b675f2 Author: dankm <dan.mcgregor@usask.ca> AuthorDate: 2021-02-26 15:32:01 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2021-02-26 15:32:01 +0000 nvi: fix catalog generation Upstream broke catalog generation with some over-eagre style cleanups. This brings in my pull request. Obtained from: https://github.com/lichray/nvi2/pull/88 Differential Revision: https://reviews.freebsd.org/D28594 --- contrib/nvi/catalog/dump.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/nvi/catalog/dump.c b/contrib/nvi/catalog/dump.c index 8390e5022841..74ab53b2f12c 100644 --- a/contrib/nvi/catalog/dump.c +++ b/contrib/nvi/catalog/dump.c @@ -36,24 +36,24 @@ parse(FILE *fp) { int ch, s1, s2, s3; -#define TESTD(s) do { \ +#define TESTD(s) { \ if ((s = getc(fp)) == EOF) \ return; \ if (!isdigit(s)) \ continue; \ -} while (0) -#define TESTP do { \ +} +#define TESTP { \ if ((ch = getc(fp)) == EOF) \ return; \ if (ch != '|') \ continue; \ -} while (0) -#define MOVEC(t) do { \ +} +#define MOVEC(t) { \ do { \ if ((ch = getc(fp)) == EOF) \ return; \ } while (ch != (t)); \ -} while (0) +} for (;;) { MOVEC('"'); TESTD(s1); From owner-dev-commits-src-all@freebsd.org Fri Feb 26 16:04:05 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4354565492; Fri, 26 Feb 2021 16:04:05 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) (using TLSv1.3 with cipher TLS_AES_256_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 4DnDx101N7z4TDn; Fri, 26 Feb 2021 16:04:04 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 07C28580681; Fri, 26 Feb 2021 11:04:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 26 Feb 2021 11:04:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.dev; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=p jWy5zhXhg868uXzaGIkMYNeziBKcxOt0ewqMXal5Zs=; b=tihQ+qVkSKiR5X6uQ 6wL8YccBaLesCWZsWa0DkfkaPOKVN5DurGSxHCAJRxXaEajwcDyjZsUj1q8hSrCn Cp5n1kK3BMv4c45beRGnHmi5JB9QLTwtHWmamn25+LqKhL9z7jwvGtrDY078RNx3 z8tPi3ggU7pWv8M+M1yAZNVrO4IKI8mIeOk0p2bNos2OUDzCpMPKIKKPLEqHV3uT JFvNlvRBG8w6to2eLeLmRg8SKQFZELiY4urGxi6kjqSwQJBKMv6mBDi9J+MT+w7l w7UHcGTZ0D8PUjh4gJ0Z3N3b4AqjiHgO1VAKtcdQo3goNAXeNg2jIVdcAHb5cg5J 84JLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=pjWy5zhXhg868uXzaGIkMYNeziBKcxOt0ewqMXal5 Zs=; b=MeJI7qYgWn6UaWDVUTheO195ddDCX0BWCT+uwiAKgnQ2xHTOaNfqvOtxb IeRutuSljTG8vaN1XXMr77dASZzC6h6fCYGIot5XfhRNB+j4sxB0QQ9OSxmiMYtp j1JVWoqGG1Vhrb3Wn6/Y6LgcAxaPeIyBPbNKHitIYVpbr89xXGqs7AcwDtYmW19w Ai5xtxhOungfjb2bggsEoN84kVqpDnBOZSQC/yE96z+AwurCkg/1a3H6Pm1qmG4F oouwhSU1+Vz2Pw4tHwxfgtOuGI5Ek07uhzXqvWi2vmacWepahsMVmXFzwAWp1pgI ZUp+gUe+xoSc2VIOECqoiO1vMBO8Q== X-ME-Sender: <xms:8hs5YBtEA68UyfWosJhiOsytNtb0kwVOazMVbagnrBMBtSh7kIpy8A> <xme:8hs5YB45Slh5lNK9xnQ-VLxZ1S1tEENlMKjzJZzvUKufBGTg6UuXNCU919s7WZaRc g-4B0QXUESfk-_nfiM> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrledugdekhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpegjuhhrihcu rfgrnhhkohhvuceohihurhhiphhvseihuhhrihhpvhdruggvvheqnecuggftrfgrthhtvg hrnhepveetudeuteegteeileduieetgfelvdehtdekteejveejjefhudeffeeuleetledv necuffhomhgrihhnpehfrhgvvggsshgurdhorhhgpdhprhhoghdrmhhknecukfhppeelud drvdegtddruddvgedrudefjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpeihuhhrihhpvheshihurhhiphhvrdguvghv X-ME-Proxy: <xmx:8hs5YCJOESd-h5-pDkOWZHWaFjveYKyhgJr2LgtJ2go7VVfRkxyoag> <xmx:8hs5YB5Us5rWjsMnQQRTRuP6zADTG6j7UGu_CK5qDGwRXhQzaBFfBg> <xmx:8hs5YFxA9_VaL_ed_iDjhgwb9958HMEPLlQDwsSYEQE36qNQbJIABA> <xmx:8xs5YD4BdD4iWSpgExlQLnUgNsDqBRUUiBJ6nBDyTNm_s9TiyxZFQw> Received: from [192.168.1.6] (unknown [91.240.124.137]) by mail.messagingengine.com (Postfix) with ESMTPA id EC6E1240064; Fri, 26 Feb 2021 11:04:01 -0500 (EST) Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database To: Cy Schubert <Cy.Schubert@cschubert.com>, Baptiste Daroussin <bapt@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <202102261420.11QEKJoX006569@slippy.cwsent.com> From: Yuri Pankov <yuripv@yuripv.dev> Message-ID: <68cc80bb-04fe-ef23-6f5a-2bc77db54feb@yuripv.dev> Date: Fri, 26 Feb 2021 19:04:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <202102261420.11QEKJoX006569@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DnDx101N7z4TDn X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yuripv.dev header.s=fm1 header.b=tihQ+qVk; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=MeJI7qYg; dmarc=none; spf=pass (mx1.freebsd.org: domain of yuripv@yuripv.dev designates 66.111.4.221 as permitted sender) smtp.mailfrom=yuripv@yuripv.dev X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.221]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.221:from]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yuripv.dev:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.111.4.221:from]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.221:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[yuripv.dev:s=fm1,messagingengine.com:s=fm2]; FREEFALL_USER(0.00)[yuripv]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[yuripv.dev]; SPAMHAUS_ZRD(0.00)[66.111.4.221:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 16:04:05 -0000 Cy Schubert wrote: > In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste > Daroussi > n writes: >> The branch main has been updated by bapt: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae >> 14376f80 >> >> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 >> Author: Baptiste Daroussin <bapt@FreeBSD.org> >> AuthorDate: 2021-02-23 16:17:32 +0000 >> Commit: Baptiste Daroussin <bapt@FreeBSD.org> >> CommitDate: 2021-02-25 13:25:32 +0000 >> >> terminfo: add terminfo database >> >> Tested by: manu, jbeich >> --- >> share/Makefile | 1 + >> share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ >> 2 files changed, 35 insertions(+) >> >> diff --git a/share/Makefile b/share/Makefile >> index c4e12b05f7db..d6854b230ae5 100644 >> --- a/share/Makefile >> +++ b/share/Makefile >> @@ -26,6 +26,7 @@ SUBDIR= ${_colldef} \ >> ${_syscons} \ >> tabset \ >> termcap \ >> + terminfo \ >> ${_timedef} \ >> ${_vt} \ >> ${_zoneinfo} >> diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile >> new file mode 100644 >> index 000000000000..7bb11f3fdf24 >> --- /dev/null >> +++ b/share/terminfo/Makefile >> @@ -0,0 +1,34 @@ >> +PACKAGE= runtime >> + >> +.PATH: ${SRCTOP}/contrib/ncurses/misc >> +TINFOBUILDDIR= ${.OBJDIR}/builddir >> +CLEANDIRS+= builddir >> + >> +.include <src.tools.mk> >> + >> +.if !defined(_SKIP_BUILD) >> +all: terminfo >> +.endif >> +META_TARGETS+= terminfo install-terminfo >> + >> +terminfo: terminfo.src >> + mkdir -p ${TINFOBUILDDIR} >> + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} >> + >> +.if make(*install*) >> +TINFOS!= cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=C sort >> +TINFOSDIRS= ${TINFOS:C/(.).*/\1/g:O:u} >> +.endif >> + >> +beforeinstall: install-terminfo >> +install-terminfo: >> + mkdir -p ${DESTDIR}/usr/share/terminfo >> + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} >> +.for f in ${TINFOS} >> + ${INSTALL} ${TAG_ARGS} \ >> + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ >> + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} >> +.endfor >> + >> +.include <bsd.prog.mk> >> + >> > > I think this had some unintended consequences, a POLA violation that should > be documented. Our termcap didn't support alternate screen buffers while > terminfo does. Termcap did through t_te and t_ti but we didn't use them. > Terminfo as delivered from the ncurses factory does supply rmcup and smcup; > our fullscreen apps such as nvi and top see them and use the alternate > screen buffer. I don't think this is correct, it's 'ti' and 'te' for termcap and we use those a lot in our database, e.g. xterm-clear or even default screen and tmux entries, so it's always there for me being tmux user. > The use of the alternate screen buffer is one of the things I hate about > Linux. After running vi or top I expect the output to remain on the screen > so I can use some bit of information in my next command. We now have this > behaviour too. It's matter of taste, yes, and I like it. > The alternate screen buffer was added to xterm an ice age ago. Most modern > terminal emulators support it. As much as I feel the need to yank out rmcup > an smcup from our terminfo database, we are using a feature, as distasteful > as it may feel. This change probably needs a relnotes=yes and an UPDATING > entry advising users that they can either change $TERM to xterm1, vt100, or > some other terminal definition that doesn't support rmcup and smcup, or > learn to like it. > > OTOH, maybe this is something we as a community don't really want and we > remove the rmcup and smcup definitions from our terminfo database. > Personally, I believe this is progress -- progress I'm not particularly > enamoured with but progress nonetheless. But I think we need to discuss, > come to some sort of decision and document it. Removing those entirely will break POLA which started this discussion; to not break POLA we should rather "fix" the xterm entry to exclude smcup/rmcup to be the same as termcap equivalent. From owner-dev-commits-src-all@freebsd.org Fri Feb 26 17:30:49 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AD8F567D61; Fri, 26 Feb 2021 17:30:49 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnGs455mpz4bfC; Fri, 26 Feb 2021 17:30:48 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 11QHUhfi031157; Fri, 26 Feb 2021 09:30:43 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 11QHUh8n031156; Fri, 26 Feb 2021 09:30:43 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net> Message-Id: <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database In-Reply-To: <202102261420.11QEKJoX006569@slippy.cwsent.com> To: Cy Schubert <Cy.Schubert@cschubert.com> Date: Fri, 26 Feb 2021 09:30:43 -0800 (PST) CC: Baptiste Daroussin <bapt@freebsd.org>, 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: 4DnGs455mpz4bfC X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.44 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.84)[0.844]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; SPAMHAUS_ZRD(0.00)[69.59.192.140:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(0.69)[0.694]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[69.59.192.140:from]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 17:30:49 -0000 > In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste > Daroussi > n writes: > > The branch main has been updated by bapt: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae > > 14376f80 > > > > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > > Author: Baptiste Daroussin <bapt@FreeBSD.org> > > AuthorDate: 2021-02-23 16:17:32 +0000 > > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > > CommitDate: 2021-02-25 13:25:32 +0000 > > > > terminfo: add terminfo database > > > > Tested by: manu, jbeich > > --- > > share/Makefile | 1 + > > share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ > > 2 files changed, 35 insertions(+) > > > > diff --git a/share/Makefile b/share/Makefile > > index c4e12b05f7db..d6854b230ae5 100644 > > --- a/share/Makefile > > +++ b/share/Makefile > > @@ -26,6 +26,7 @@ SUBDIR= ${_colldef} \ > > ${_syscons} \ > > tabset \ > > termcap \ > > + terminfo \ > > ${_timedef} \ > > ${_vt} \ > > ${_zoneinfo} > > diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile > > new file mode 100644 > > index 000000000000..7bb11f3fdf24 > > --- /dev/null > > +++ b/share/terminfo/Makefile > > @@ -0,0 +1,34 @@ > > +PACKAGE= runtime > > + > > +.PATH: ${SRCTOP}/contrib/ncurses/misc > > +TINFOBUILDDIR= ${.OBJDIR}/builddir > > +CLEANDIRS+= builddir > > + > > +.include <src.tools.mk> > > + > > +.if !defined(_SKIP_BUILD) > > +all: terminfo > > +.endif > > +META_TARGETS+= terminfo install-terminfo > > + > > +terminfo: terminfo.src > > + mkdir -p ${TINFOBUILDDIR} > > + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} > > + > > +.if make(*install*) > > +TINFOS!= cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=C sort > > +TINFOSDIRS= ${TINFOS:C/(.).*/\1/g:O:u} > > +.endif > > + > > +beforeinstall: install-terminfo > > +install-terminfo: > > + mkdir -p ${DESTDIR}/usr/share/terminfo > > + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} > > +.for f in ${TINFOS} > > + ${INSTALL} ${TAG_ARGS} \ > > + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > > + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} > > +.endfor > > + > > +.include <bsd.prog.mk> > > + > > > > I think this had some unintended consequences, a POLA violation that should > be documented. Our termcap didn't support alternate screen buffers while > terminfo does. Termcap did through t_te and t_ti but we didn't use them. > Terminfo as delivered from the ncurses factory does supply rmcup and smcup; > our fullscreen apps such as nvi and top see them and use the alternate > screen buffer. > > The use of the alternate screen buffer is one of the things I hate about > Linux. After running vi or top I expect the output to remain on the screen > so I can use some bit of information in my next command. We now have this > behaviour too. Oh, I so hate that mis-feature of Linux, please please tell me there is a simple knob to turn this off? I believe LESS also does this kind of stuff, or atleast "man" on linux does, and that pees me off to no end when I quit the man page and what I wanted is no longer on the screen. > The alternate screen buffer was added to xterm an ice age ago. Most modern > terminal emulators support it. As much as I feel the need to yank out rmcup > an smcup from our terminfo database, we are using a feature, as distasteful > as it may feel. This change probably needs a relnotes=yes and an UPDATING > entry advising users that they can either change $TERM to xterm1, vt100, or > some other terminal definition that doesn't support rmcup and smcup, or > learn to like it. > > OTOH, maybe this is something we as a community don't really want and we > remove the rmcup and smcup definitions from our terminfo database. > Personally, I believe this is progress -- progress I'm not particularly > enamoured with but progress nonetheless. But I think we need to discuss, > come to some sort of decision and document it. > > Thoughts? > > > -- > Cheers, > Cy Schubert <Cy.Schubert@cschubert.com> > FreeBSD UNIX: <cy@FreeBSD.org> Web: https://FreeBSD.org > NTP: <cy@nwtime.org> Web: https://nwtime.org > > The need of the many outweighs the greed of the few. > > > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Fri Feb 26 17:35:07 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A38254851E for <dev-commits-src-all@mailman.nyi.freebsd.org>; Fri, 26 Feb 2021 17:35:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 4DnGy31WK2z4cBQ for <dev-commits-src-all@freebsd.org>; Fri, 26 Feb 2021 17:35:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f45.google.com with SMTP id l12so9342206wry.2 for <dev-commits-src-all@freebsd.org>; Fri, 26 Feb 2021 09:35:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=cay5WnZ2r5olDsmFyRwEJBmZXSAO+cItbrUzoyRlQL8=; b=Fi3VNWV1h7AdpexFKmMdCyydIVrgzxWQRbrptGBRkWwWuNreMQIIPqLsU0brnNGrPE ew24EgZvKBXerXtFe1KuqRxVJh+l+SCXD0C0W4BoFg+vvk5kq0gifkl/PhWxbM7KaKqI pL+MtDtXh7yim0zH39MCDPWozhfPWDSXoMpxah5aNCn2B6iVYhgqxqAjhqL4x8KFYj4H C5SV+gB9xBOjK0UYzDxG2tL3drzvaTLg0ejarxTfCsK6qpblTpOPRjluvYlq19HZFFFX V6+jbm6sEmwFwV2VOz7+IdhcwUcGwBMafY6AmEH0hyryjbU4Cz2QMcMrIO3O3FXtK8wb /4WA== X-Gm-Message-State: AOAM530bcNNThdiP8TIHSPFYvh6EZc1HGoRUDTFw8+ke/RMZr92phdaX YtCDuWN1OyMZTNvXMhm6Qrt4ozclpiZQfw== X-Google-Smtp-Source: ABdhPJw+xMLb9hX/iP4KDwac3KhkVXdjb9n6es6YmmQ8thiMUWnNPvDqX8rMeFFKtrBt95otHHmd2w== X-Received: by 2002:a5d:620d:: with SMTP id y13mr4336055wru.88.1614360903870; Fri, 26 Feb 2021 09:35:03 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id a14sm16215317wrg.84.2021.02.26.09.35.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2021 09:35:03 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database From: Jessica Clarke <jrtc27@freebsd.org> In-Reply-To: <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> Date: Fri, 26 Feb 2021 17:35:02 +0000 Cc: Cy Schubert <Cy.Schubert@cschubert.com>, Baptiste Daroussin <bapt@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <21D85CEB-44CC-4BC6-BBD3-358383681109@freebsd.org> References: <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DnGy31WK2z4cBQ 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 17:35:07 -0000 > On 26 Feb 2021, at 17:30, Rodney W. Grimes <freebsd@gndrsh.dnsmgr.net> = wrote: >=20 >> In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, = Baptiste=20 >> Daroussi >> n writes: >>> The branch main has been updated by bapt: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e5993332ae= >>> 14376f80 >>>=20 >>> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 >>> Author: Baptiste Daroussin <bapt@FreeBSD.org> >>> AuthorDate: 2021-02-23 16:17:32 +0000 >>> Commit: Baptiste Daroussin <bapt@FreeBSD.org> >>> CommitDate: 2021-02-25 13:25:32 +0000 >>>=20 >>> terminfo: add terminfo database >>>=20 >>> Tested by: manu, jbeich >>> --- >>> share/Makefile | 1 + >>> share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ >>> 2 files changed, 35 insertions(+) >>>=20 >>> diff --git a/share/Makefile b/share/Makefile >>> index c4e12b05f7db..d6854b230ae5 100644 >>> --- a/share/Makefile >>> +++ b/share/Makefile >>> @@ -26,6 +26,7 @@ SUBDIR=3D ${_colldef} \ >>> ${_syscons} \ >>> tabset \ >>> termcap \ >>> + terminfo \ >>> ${_timedef} \ >>> ${_vt} \ >>> ${_zoneinfo} >>> diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile >>> new file mode 100644 >>> index 000000000000..7bb11f3fdf24 >>> --- /dev/null >>> +++ b/share/terminfo/Makefile >>> @@ -0,0 +1,34 @@ >>> +PACKAGE=3D runtime >>> + >>> +.PATH: ${SRCTOP}/contrib/ncurses/misc >>> +TINFOBUILDDIR=3D ${.OBJDIR}/builddir >>> +CLEANDIRS+=3D builddir >>> + >>> +.include <src.tools.mk> >>> + >>> +.if !defined(_SKIP_BUILD) >>> +all: terminfo >>> +.endif >>> +META_TARGETS+=3D terminfo install-terminfo >>> + >>> +terminfo: terminfo.src >>> + mkdir -p ${TINFOBUILDDIR} >>> + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} >>> + >>> +.if make(*install*) >>> +TINFOS!=3D cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=3DC sort >>> +TINFOSDIRS=3D ${TINFOS:C/(.).*/\1/g:O:u} >>> +.endif >>> + >>> +beforeinstall: install-terminfo >>> +install-terminfo: >>> + mkdir -p ${DESTDIR}/usr/share/terminfo >>> + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} >>> +.for f in ${TINFOS} >>> + ${INSTALL} ${TAG_ARGS} \ >>> + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ >>> + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} >>> +.endfor >>> + >>> +.include <bsd.prog.mk> >>> + >>>=20 >>=20 >> I think this had some unintended consequences, a POLA violation that = should=20 >> be documented. Our termcap didn't support alternate screen buffers = while=20 >> terminfo does. Termcap did through t_te and t_ti but we didn't use = them.=20 >> Terminfo as delivered from the ncurses factory does supply rmcup and = smcup;=20 >> our fullscreen apps such as nvi and top see them and use the = alternate=20 >> screen buffer. >>=20 >> The use of the alternate screen buffer is one of the things I hate = about=20 >> Linux. After running vi or top I expect the output to remain on the = screen=20 >> so I can use some bit of information in my next command. We now have = this=20 >> behaviour too. >=20 > Oh, I so hate that mis-feature of Linux, please please tell me there = is > a simple knob to turn this off? I believe LESS also does this kind > of stuff, or atleast "man" on linux does, and that pees me off to no > end when I quit the man page and what I wanted is no longer on the = screen. less -X may be what you want (or LESS=3D"-X"). Jess From owner-dev-commits-src-all@freebsd.org Fri Feb 26 17:36:31 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66BA65482EC; Fri, 26 Feb 2021 17:36:31 +0000 (UTC) (envelope-from bapt@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 4DnGzg2TB4z4cH7; Fri, 26 Feb 2021 17:36:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 2E1012CF3; Fri, 26 Feb 2021 17:36:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id D196B36215; Fri, 26 Feb 2021 18:36:29 +0100 (CET) Date: Fri, 26 Feb 2021 18:36:29 +0100 From: Baptiste Daroussin <bapt@FreeBSD.org> To: rgrimes@freebsd.org Cc: Cy Schubert <Cy.Schubert@cschubert.com>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="v42fwzf6tezfxlhv" Content-Disposition: inline In-Reply-To: <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 17:36:31 -0000 --v42fwzf6tezfxlhv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 26, 2021 at 09:30:43AM -0800, Rodney W. Grimes wrote: > > In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste= =20 > > Daroussi > > n writes: > > > The branch main has been updated by bapt: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9= e5993332ae > > > 14376f80 > > > > > > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > > > Author: Baptiste Daroussin <bapt@FreeBSD.org> > > > AuthorDate: 2021-02-23 16:17:32 +0000 > > > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > > > CommitDate: 2021-02-25 13:25:32 +0000 > > > > > > terminfo: add terminfo database > > > =20 > > > Tested by: manu, jbeich > > > --- > > > share/Makefile | 1 + > > > share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ > > > 2 files changed, 35 insertions(+) > > > > > > diff --git a/share/Makefile b/share/Makefile > > > index c4e12b05f7db..d6854b230ae5 100644 > > > --- a/share/Makefile > > > +++ b/share/Makefile > > > @@ -26,6 +26,7 @@ SUBDIR=3D ${_colldef} \ > > > ${_syscons} \ > > > tabset \ > > > termcap \ > > > + terminfo \ > > > ${_timedef} \ > > > ${_vt} \ > > > ${_zoneinfo} > > > diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile > > > new file mode 100644 > > > index 000000000000..7bb11f3fdf24 > > > --- /dev/null > > > +++ b/share/terminfo/Makefile > > > @@ -0,0 +1,34 @@ > > > +PACKAGE=3D runtime > > > + > > > +.PATH: ${SRCTOP}/contrib/ncurses/misc > > > +TINFOBUILDDIR=3D ${.OBJDIR}/builddir > > > +CLEANDIRS+=3D builddir > > > + > > > +.include <src.tools.mk> > > > + > > > +.if !defined(_SKIP_BUILD) > > > +all: terminfo > > > +.endif > > > +META_TARGETS+=3D terminfo install-terminfo > > > + > > > +terminfo: terminfo.src > > > + mkdir -p ${TINFOBUILDDIR} > > > + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} > > > + > > > +.if make(*install*) > > > +TINFOS!=3D cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=3DC sort > > > +TINFOSDIRS=3D ${TINFOS:C/(.).*/\1/g:O:u} > > > +.endif > > > + > > > +beforeinstall: install-terminfo > > > +install-terminfo: > > > + mkdir -p ${DESTDIR}/usr/share/terminfo > > > + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} > > > +.for f in ${TINFOS} > > > + ${INSTALL} ${TAG_ARGS} \ > > > + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > > > + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} > > > +.endfor > > > + > > > +.include <bsd.prog.mk> > > > + > > > > >=20 > > I think this had some unintended consequences, a POLA violation that sh= ould=20 > > be documented. Our termcap didn't support alternate screen buffers whil= e=20 > > terminfo does. Termcap did through t_te and t_ti but we didn't use them= =2E=20 > > Terminfo as delivered from the ncurses factory does supply rmcup and sm= cup;=20 > > our fullscreen apps such as nvi and top see them and use the alternate= =20 > > screen buffer. > >=20 > > The use of the alternate screen buffer is one of the things I hate abou= t=20 > > Linux. After running vi or top I expect the output to remain on the scr= een=20 > > so I can use some bit of information in my next command. We now have th= is=20 > > behaviour too. >=20 > Oh, I so hate that mis-feature of Linux, please please tell me there is > a simple knob to turn this off? I believe LESS also does this kind > of stuff, or atleast "man" on linux does, and that pees me off to no > end when I quit the man page and what I wanted is no longer on the screen. >=20 >=20 No this is not and I clear have 0 intention to have a complex patch on top = of the linux terminfo which would prefer easy sync in the futur. We can document how to use a definition which does not have the feature you= do not like. Best, Bapt --v42fwzf6tezfxlhv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAmA5MZsACgkQY4mL3PG3 Plrr+w//US1Iz8ryM3dOvMqDjb4xXrdPKq/UvzherByX6OvMzZam6/4/cqv8jCdo XACalXcJ+Bfbp88TiQu7pYUt0fVCSN1yBPQfj1XU1bKnvxWhX175TVAMfGvZSfvD k5Z6a59j9nW3GTGU1qTKoIBL5gm0uGkX8d8ZzueJdJUXC0fWnNb/In9FXvA/Kr2a FvMOOfLqP2ipYklzGg9imaet11WlhAugA7bYJ7uaT5NJO4N6ja9g8ZQm7kB5UhQD UTQBbdydb5hY/rhiPwTQdgpCdSJNdrYYHceZ44RoDu1QMhyTczKt6i1zd87kO73i pluKtu1t0fuSGoP7CknT0E8TGHRNCEO6juuAIn9Xq62rq/bn+eQCyWGkd8r9iIBq F01aKQc/80h7lFWwCM1AAR1ywp5c7oiyGKaKH6q9xGs/Kvrguxzioux8jrJuQWJb qcS74Axxt4QHxfK5iduD2nZXG0Hpoz6BhX7xzTiUJXnzjO7CeKZZ0gtuFw8jY23x jXaF7EPZJe5YXwnSWdL8KsC78U/bguSOhXvHTMBOmFuOQVGOxsbL9TAeicHC35x9 AtOT53xx/1rBxfhG1bR8v6zMiEdQWH/eIsTL/5MfP/Yy3otzHvFsy5g8pbE84Jhg 99uF451n+f5/ERFR/h916xOlMsM6j5m2yOk/JtrNdMxcXCb+3lE= =HChF -----END PGP SIGNATURE----- --v42fwzf6tezfxlhv-- From owner-dev-commits-src-all@freebsd.org Fri Feb 26 17:55:43 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00A5A548F8F; Fri, 26 Feb 2021 17:55:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnHPp6bGcz4dH1; Fri, 26 Feb 2021 17:55:42 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614362142; 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: in-reply-to:in-reply-to:references:references; bh=Xf7ZjCMram3IEK7OcBMw6tPAclIW3zzCiW6inD/II3E=; b=wTba8ThDMEx2iuw5vTYsoZnvQ7c5peJ8IkR8iiDpdYMbZYM18zcjhBoLDIvNo4d1Cs0JyT KHF7S9TYEG/OdfwNSE5ieYoxIluZLmUYCecaHXe4tB2H7ZttxWZfX6lC4KkTUFhYdvar/n rHJB9knOChioVU6LNytLhbaOKjlpNJ8GN2daLsIc5bOPu5omH8qzTX49DL2WQql6lJS7ZL h25OP1uRZ7oyaJ5A0s6/ddJzuE+Cs9sd/R4BOXSapDfjztptxW9uehIejjCCFYNjezQvYz 7rL8zA1t4xbkoA+jfXmU/XktWhAufWvJwh6oG7pOy5WFPfxpQJeaQmkfap3K+w== Received: by freefall.freebsd.org (Postfix, from userid 1033) id CF9D3134FC; Fri, 26 Feb 2021 17:55:42 +0000 (UTC) Date: Fri, 26 Feb 2021 17:55:42 +0000 From: Alexey Dokuchaev <danfe@freebsd.org> To: Cy Schubert <Cy.Schubert@cschubert.com> Cc: Baptiste Daroussin <bapt@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226175542.GA85424@FreeBSD.org> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <202102261420.11QEKJoX006569@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102261420.11QEKJoX006569@slippy.cwsent.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614362142; 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: in-reply-to:in-reply-to:references:references; bh=Xf7ZjCMram3IEK7OcBMw6tPAclIW3zzCiW6inD/II3E=; b=uqffdSfJx4m2tQYRFqCUXKZJTWK2YI0p9Fg1346XHbmnaN0vEy7jVHIg5AvUHfJzamzvmk ems3Qr14p3KdgrWrDbbh5xa7jCgZ1qAGyQoc1WounnZMDg3iNR12R96L6DK/udlKo16LFN YmwKTZVmyPyYb8kC/oTW8Br4eiwlXgmJbnt/Y+XjUsrZP/eml3FtpJ4xHN7HB+vEjgSX3f OEjsNHB1wSHi/s43lnITxooOOge071D6ArvT/pNFabUL0vB4rsYmMdkJU7Vj6dz9qjo4Df HuaiokqBQja2hWFsspDQ44qopFZ+6MU7HuTHjKpiPW3oG+2fbBXqzP9SNOhwBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614362142; a=rsa-sha256; cv=none; b=s8JRUq8BbWbSvw+khk+LNbYeL+MMAC8XjDcqD3xpFu+suLHT2kk8gs8YQ6nog/dP/tBbP6 +V/4S4DOwrnscENNuwpHRBhhs+79YUkES+tzQsbv4i9ODBxNgo01t6YbO0jet5uWFLs/Sc vdrWqDdAjbVQVK6ySV4wj+jIVb+gPWDUoMmK4v6sP8+4UsLfAJ4FHs3CIni5yn1cBJPQfP r5HF06kJh3QIvMS/Fr0ErVWcETHMQkUGvhjOzo9cuopc3X9TkO+bgYnKGJYfOFcoUm34l1 5t7JnATiEDDyCIiAJf/3aLkegTqekQKEQmB3YcGfEb0pEQZaNnO/tKLSFLBa9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 17:55:43 -0000 On Fri, Feb 26, 2021 at 06:20:19AM -0800, Cy Schubert wrote: > ... > The use of the alternate screen buffer is one of the things I hate about > Linux. After running vi or top I expect the output to remain on the screen > so I can use some bit of information in my next command. We now have this > behaviour too. Huge +1. On GNU/Linux, I have to suppress this shit so it won't mess with my xterm(1) screen buffer; screen(1) is particularly annoying until you put "termcapinfo xterm ti@:te@" line in your ~/.screenrc. I'm quite surprised to see this checked in, admittedly. ./danfe From owner-dev-commits-src-all@freebsd.org Fri Feb 26 17:59:00 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3902D548EEE; Fri, 26 Feb 2021 17:59:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnHTc1BWpz4dr3; Fri, 26 Feb 2021 17:59:00 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614362340; 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: in-reply-to:in-reply-to:references:references; bh=xCYLiExJq4JPbwy2AfJeC1ThkYA5Ll1/GTDy7hWHn1g=; b=tFar9gQWBNVklBkuhgs8vmjEZUYZJuceDM4MHReVpwnpSxSRCTXR37E06lfnkNWT62fj3s mn+WgoFRwRdVAnZ0mVSIJFSv8H5UEsmXGwtIrrGTZR6w5HLxNxF+hy/ByczCoaYL3ow1aI gSPddSIlWzdUYiV1q4btNPDxqKcuMTgnxXEfZgRg8kq9Q02bdhp+pqKLGLjpS7aY3cVivv LDMeM4txuUgYzza694h88w7YQezOdfoazOE2QLzeA/4OJjn37fBGGjQkEkKXUmXdqjmULt 4fM8KHvcQPmkDq1taAuCRCuIsm7L7DVUNFl0CX0K7V29qO+gwEycvNrj5FWuxw== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 1680E13A1F; Fri, 26 Feb 2021 17:59:00 +0000 (UTC) Date: Fri, 26 Feb 2021 17:58:59 +0000 From: Alexey Dokuchaev <danfe@freebsd.org> To: rgrimes@freebsd.org Cc: Cy Schubert <Cy.Schubert@cschubert.com>, Baptiste Daroussin <bapt@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226175859.GB85424@FreeBSD.org> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614362340; 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: in-reply-to:in-reply-to:references:references; bh=xCYLiExJq4JPbwy2AfJeC1ThkYA5Ll1/GTDy7hWHn1g=; b=kBigF0f4xL77pV5grMRNgrSWiiSOaa/1ZYUFlGcBZVSFiyaBlUeBgHn7/gPYEWlgixCSMx Zb/ys0W0u0JmGxIJpxkZyz06392xr8B0E19HGaI8Zhan39sRP9LR0yW3CbCZCBcyRocG5t zQh44QdqJjca4EXEwryCV6wXBeoJqTmOk59inIwWee3KXBjkvdZmiHtvk4jTvQOWYaY+Fc nKFQjhNSd+A3Bx+iKAqFGBYAaiQZ9OPVEJQQmnzrl9OE7o07s6Yi20rS9wiGq2ioYoMVgS ivA/NsvBorkgG1O5ovgnAHw7+E2lnjCcriHR6lEmP8oj9bVG6UhQ/xZbQAR1gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614362340; a=rsa-sha256; cv=none; b=Y2icfOBlh+2dzuywWVKlyxEtttLevPUL4pUCj94jgwByYOsC7i/+6/aWeuo+LBggYqk0co 4IN62i7PLnY+7yxyM6FK1mYgbee0UnI4OqPw8VxLD5m6OyfELXcZsCL2xeF9ROjp5PAnG3 c0Juo7BIdtwd3RUFM3ypfllFwjXeb0gVjccQ97VWXPGcKeo6LhgK6UyPBcCtb0b/LvHyVI c5LlSMOe24EfFT5CjdlocwAKlYpKAAjVQszcnstT4kMeealgHpBbO5RwCIE3ILQLVxpEym GYznqBleZFwhBfqgrlHd4DCcx06Ax9DBER+Hr0EHeRmm8j7/SmhrkuKjtObAjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 17:59:00 -0000 On Fri, Feb 26, 2021 at 09:30:43AM -0800, Rodney W. Grimes wrote: > ... > Oh, I so hate that mis-feature of Linux, please please tell me there is > a simple knob to turn this off? I believe LESS also does this kind > of stuff, or atleast "man" on linux does, and that pees me off to no > end when I quit the man page and what I wanted is no longer on the screen. Everyone I know hates it; GNU/Linux folks apparently not pissed by this just because they haven't seen a better OS (e.g., FreeBSD). ./danfe From owner-dev-commits-src-all@freebsd.org Fri Feb 26 18:02:43 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4788549163 for <dev-commits-src-all@mailman.nyi.freebsd.org>; Fri, 26 Feb 2021 18:02:43 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.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 4DnHYt6hgtz4fBZ for <dev-commits-src-all@freebsd.org>; Fri, 26 Feb 2021 18:02:42 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f52.google.com with SMTP id v15so9437919wrx.4 for <dev-commits-src-all@freebsd.org>; Fri, 26 Feb 2021 10:02:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SRTXI5/l8rYFNIC6TnwRnpEmaTHRCsyfun5GG2DGOgs=; b=Dmp5Ncd1e6fTXv+6YGAJkp/wPXoovuk0QHCcAizWbJ/9HW6x0+SaDvzuJA2qWa7s09 jtTkdVtDBbQ9pMgtMl0KZlrj/OD7DQv9NW/gbATS315lShg3WmrmRKFNiPu3g7iaSTVD Q2x570IBTa25X3msM7ucklMotQp2qSnb5N8bGV2WQS8o53m/soogXJGuvTXZ/NmPTnSS vkEzqqo0sKJ1/THJkjqCIubPsJ0TRp/uN7UuBBwbM149P1uoHcJvkIXqxZp5BdfRfHYl d+wxI6zvbxpsC+WovYVrJ/Meo9YRUz9MMWd0TXDzMrSI51SJB2cn60x/S18bDsK2u3W5 Nsiw== X-Gm-Message-State: AOAM530Dy0HEcn5EwIf54FsQ+rxJCedBY9y+eJRjuB+f/jy4bLB1CpsJ m0O2hIr9cBs3UvHkp5bFo3rJ0w== X-Google-Smtp-Source: ABdhPJzYPqL9QX2FfCzOaP4XqWBEmWAg8C+ydtOFeIoIWxa0s6TFLTZmO2eYMy8aY1WpjDBovMJtGA== X-Received: by 2002:a5d:404d:: with SMTP id w13mr4436922wrp.230.1614362561484; Fri, 26 Feb 2021 10:02:41 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id d17sm14621435wrv.93.2021.02.26.10.02.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2021 10:02:41 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database From: Jessica Clarke <jrtc27@freebsd.org> In-Reply-To: <20210226175859.GB85424@FreeBSD.org> Date: Fri, 26 Feb 2021 18:02:40 +0000 Cc: rgrimes@freebsd.org, Cy Schubert <Cy.Schubert@cschubert.com>, Baptiste Daroussin <bapt@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <94EAE14D-19E2-417B-ACC6-17745E77A683@freebsd.org> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226175859.GB85424@FreeBSD.org> To: Alexey Dokuchaev <danfe@freebsd.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DnHYt6hgtz4fBZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-0.998]; RCPT_COUNT_SEVEN(0.00)[7]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.221.52:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.221.52:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.52:from]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.52:from]; RCVD_TLS_ALL(0.00)[]; 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 18:02:43 -0000 On 26 Feb 2021, at 17:58, Alexey Dokuchaev <danfe@freebsd.org> wrote: > > On Fri, Feb 26, 2021 at 09:30:43AM -0800, Rodney W. Grimes wrote: >> ... >> Oh, I so hate that mis-feature of Linux, please please tell me there is >> a simple knob to turn this off? I believe LESS also does this kind >> of stuff, or atleast "man" on linux does, and that pees me off to no >> end when I quit the man page and what I wanted is no longer on the screen. > > Everyone I know hates it; GNU/Linux folks apparently not pissed by this > just because they haven't seen a better OS (e.g., FreeBSD). I use both, I don't hate it. The only time I dislike it is when my SSH connection drops whilst the alternate buffer is still in use, as that can get confusing, but most of the time I'm grateful that my scroll back isn't a mess of stuff I've since closed. Please don't spread ill-founded absolutisms; that or you need to be aware of people outside your circle of like-minded individuals. Jess From owner-dev-commits-src-all@freebsd.org Fri Feb 26 18:07:22 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93BF9549259; Fri, 26 Feb 2021 18:07:22 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnHgG3sJTz4fPg; Fri, 26 Feb 2021 18:07:22 +0000 (UTC) (envelope-from pstef@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614362842; 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: in-reply-to:in-reply-to:references:references; bh=sPlIuJprJUkslGXwd0QbVX7VCI9Y+PYB6R03/Fmda/w=; b=J7P4g2evu4fyp4YUi6mSmXF7dcVzSty7SA0EmwCd29MJ50F2AtVTs3uXZYU4BHUhIzbU10 85IuZ+9HVE7N8hnpKZWu0pHeNalT05T2B2k28HKwa1i8PXPNP6B6Tnoq6ls3c9dtp5PDLK IqHOg52CGuxYO2RegA4gfqC2abxSThfOk0dUwHrXCXX8oaSdnhp9+ncv/unRsB9GYy/rQy nMeRUG21OIn5Mr7E+2EX8uQklU4pnl++/ADip4Ife+6eFGebStjnLfT5d204pXlMKAqlI2 VecQnfFurmDo3nUt21qc10qO8rl+k1gqdNUZyRm3j8HQ/easTOACySGqdwLbuA== Received: by freefall.freebsd.org (Postfix, from userid 1403) id 6C53513F82; Fri, 26 Feb 2021 18:07:22 +0000 (UTC) Date: Fri, 26 Feb 2021 19:07:22 +0100 From: "Piotr P. Stefaniak" <pstef@freebsd.org> To: Alexey Dokuchaev <danfe@freebsd.org> Cc: rgrimes@freebsd.org, Cy Schubert <Cy.Schubert@cschubert.com>, Baptiste Daroussin <bapt@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226180722.GA29488@freefall.freebsd.org> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226175859.GB85424@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210226175859.GB85424@FreeBSD.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614362842; 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: in-reply-to:in-reply-to:references:references; bh=sPlIuJprJUkslGXwd0QbVX7VCI9Y+PYB6R03/Fmda/w=; b=XX4yx5CUAZNvGQynTpN3fpdQjXTzm2RYduzmY/a8m9JzZLCOG5S5sJ1HzMXu6O5UdAbcH2 R6ASlAhd8rhJG4q3TZf0ltPWAveFnA73p1fdWX5FHFJmYL0JiSyQMZS+GBiOlsPySSZxGu wEmZAh0WGYpkhBMSDWS8wK8BRgJbZSmseYXJzlojhFwm6JOcp+gcZIC3EaiD702EW088V3 6kvhordBy4VgN/IMOBXPikTL5jPYRTrUAiov13MI4EhqjQ+f3knJDpEFoDQWJvPNki/5Ze h3gK2zia6k+ngVseMqjcF8nkcLWQvAmyRkc2YE+u0flH+4ca6E0PBSoAy9LiVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614362842; a=rsa-sha256; cv=none; b=dtPG4si39wPIUZfTELMp0oG6RnP0EGBUBs2i2AuU9YAjN/1wFFqm5TJ7VysI/ENytc3xPf 2qpN1EczFlABJ9HnbqTDBuQQ8GWatOOb9BFr/lOwVV3g+Z5mEc9Rj8ZVhIK+II1IRnDJqE QxbVmw+E+WbZqOjcfEl8vQqvt/F31KgprS/Rt5Pq9Fb5n0BruA/KA5alil/7yH4+HC1Zbx rDammx4XUUhmByyFghgudxZmaHxaTxw2JvX2CJiaqgEWs3afyexjHh430yygfYXy/Vvo7Z R83CIt7S3su6v51E1C5kG7+5gOmyuDWzZ0w0dmdbnu7T7SHVTyKfheheVYKt4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 18:07:22 -0000 On 2021-02-26 17:58:59, Alexey Dokuchaev wrote: >On Fri, Feb 26, 2021 at 09:30:43AM -0800, Rodney W. Grimes wrote: >> ... >> Oh, I so hate that mis-feature of Linux, please please tell me there is >> a simple knob to turn this off? I believe LESS also does this kind >> of stuff, or atleast "man" on linux does, and that pees me off to no >> end when I quit the man page and what I wanted is no longer on the screen. > >Everyone I know hates it; GNU/Linux folks apparently not pissed by this >just because they haven't seen a better OS (e.g., FreeBSD). I prefer one or the other, depending on what I'm doing. Surely this is easy to improve with some machine learning. From owner-dev-commits-src-all@freebsd.org Fri Feb 26 18:16:51 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32381549FA4; Fri, 26 Feb 2021 18:16:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnHtB3G3vz4gRd; Fri, 26 Feb 2021 18:16:50 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1614363402; 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=M2ln7IYckZctsz4NLtTcC+4Cd7IhLlnOSkqivYBxxwI=; b=beYrIpYF02dKgnZCmBPCRf/aV5+4t9EqL+I2sVWAl+ZiNVcK6ytngwY9dLpHPngLQV2qoB MwHCXOGvDOaWLFaD6rZLYEOCL6cjSMCqT/43VDF5XjO2WeRhMB1cIkxJN8OVcbHKAZ3qNf U6XOSxPi3HImdp3o06cOdyfN4jgGK6s= 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 e2bd1665 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 26 Feb 2021 18:16:42 +0000 (UTC) Date: Fri, 26 Feb 2021 19:16:38 +0100 From: Emmanuel Vadot <manu@bidouilliste.com> To: Baptiste Daroussin <bapt@FreeBSD.org> Cc: rgrimes@freebsd.org, Cy Schubert <Cy.Schubert@cschubert.com>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-Id: <20210226191638.84c83ef81207217de2359a96@bidouilliste.com> In-Reply-To: <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> 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: 4DnHtB3G3vz4gRd 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 18:16:51 -0000 On Fri, 26 Feb 2021 18:36:29 +0100 Baptiste Daroussin <bapt@FreeBSD.org> wrote: > On Fri, Feb 26, 2021 at 09:30:43AM -0800, Rodney W. Grimes wrote: > > > In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste > > > Daroussi > > > n writes: > > > > The branch main has been updated by bapt: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae > > > > 14376f80 > > > > > > > > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > > > > Author: Baptiste Daroussin <bapt@FreeBSD.org> > > > > AuthorDate: 2021-02-23 16:17:32 +0000 > > > > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > > > > CommitDate: 2021-02-25 13:25:32 +0000 > > > > > > > > terminfo: add terminfo database > > > > > > > > Tested by: manu, jbeich > > > > --- > > > > share/Makefile | 1 + > > > > share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ > > > > 2 files changed, 35 insertions(+) > > > > > > > > diff --git a/share/Makefile b/share/Makefile > > > > index c4e12b05f7db..d6854b230ae5 100644 > > > > --- a/share/Makefile > > > > +++ b/share/Makefile > > > > @@ -26,6 +26,7 @@ SUBDIR= ${_colldef} \ > > > > ${_syscons} \ > > > > tabset \ > > > > termcap \ > > > > + terminfo \ > > > > ${_timedef} \ > > > > ${_vt} \ > > > > ${_zoneinfo} > > > > diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile > > > > new file mode 100644 > > > > index 000000000000..7bb11f3fdf24 > > > > --- /dev/null > > > > +++ b/share/terminfo/Makefile > > > > @@ -0,0 +1,34 @@ > > > > +PACKAGE= runtime > > > > + > > > > +.PATH: ${SRCTOP}/contrib/ncurses/misc > > > > +TINFOBUILDDIR= ${.OBJDIR}/builddir > > > > +CLEANDIRS+= builddir > > > > + > > > > +.include <src.tools.mk> > > > > + > > > > +.if !defined(_SKIP_BUILD) > > > > +all: terminfo > > > > +.endif > > > > +META_TARGETS+= terminfo install-terminfo > > > > + > > > > +terminfo: terminfo.src > > > > + mkdir -p ${TINFOBUILDDIR} > > > > + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} > > > > + > > > > +.if make(*install*) > > > > +TINFOS!= cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=C sort > > > > +TINFOSDIRS= ${TINFOS:C/(.).*/\1/g:O:u} > > > > +.endif > > > > + > > > > +beforeinstall: install-terminfo > > > > +install-terminfo: > > > > + mkdir -p ${DESTDIR}/usr/share/terminfo > > > > + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} > > > > +.for f in ${TINFOS} > > > > + ${INSTALL} ${TAG_ARGS} \ > > > > + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > > > > + ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} > > > > +.endfor > > > > + > > > > +.include <bsd.prog.mk> > > > > + > > > > > > > > > > I think this had some unintended consequences, a POLA violation that should > > > be documented. Our termcap didn't support alternate screen buffers while > > > terminfo does. Termcap did through t_te and t_ti but we didn't use them. > > > Terminfo as delivered from the ncurses factory does supply rmcup and smcup; > > > our fullscreen apps such as nvi and top see them and use the alternate > > > screen buffer. > > > > > > The use of the alternate screen buffer is one of the things I hate about > > > Linux. After running vi or top I expect the output to remain on the screen > > > so I can use some bit of information in my next command. We now have this > > > behaviour too. > > > > Oh, I so hate that mis-feature of Linux, please please tell me there is > > a simple knob to turn this off? I believe LESS also does this kind > > of stuff, or atleast "man" on linux does, and that pees me off to no > > end when I quit the man page and what I wanted is no longer on the screen. > > > > > No this is not and I clear have 0 intention to have a complex patch on top of > the linux terminfo which would prefer easy sync in the futur. > > We can document how to use a definition which does not have the feature you do > not like. > > Best, > Bapt Tips from jbeich@ via irc/gitter : xterm: Set XTerm.VT100.titeInhibit: true screen: altscreen off tmux: et -g alternate-screen off generic ncurses: export TERMCAP="${TERM}:ti@:te@:tc=${TERM}" Feel free to add this to any documentation part you feel it belongs too (even if it is, I'm almost sure, documented in each programs man/help pages). -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> From owner-dev-commits-src-all@freebsd.org Fri Feb 26 18:22:11 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D9CE54A35C; Fri, 26 Feb 2021 18:22:11 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnJ0M2kN9z4hGL; Fri, 26 Feb 2021 18:22:11 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614363731; 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: in-reply-to:in-reply-to:references:references; bh=8q4riCMk4qXnH0U+YwFu7XCEeBjK6u9PyWCerp+96tw=; b=F+nvkXxRv3M2xUXH2gn6csSDVc3oEw59+wz4j/pQ+Pi7XF/5MntQzScoDQSqUng3ZUlGa5 y0OEoXqJbUR1Abttlnpf92iEhNqELXY86F+XZBAj4TtJ7HQQYVRZjbEgHMJCoG4NE8ZSy+ pwS8xv6r3ZZ00qyoy86GHWriaoxYUfZ6MWAIZX649GP5PXXdwGaexLOa+gciYitlAAA5HG WiEQAmxC+YOCigCF9cdmVU+d1uGM9sMKJvfKGXEawmYcKcthAm7u7A/q9NpAPeDthNvY6d iophBsfOgOnVW6ElsAaFABqg++WXXlAg+tGvphhURUtqXtx+5SjrN1I7m/DvaA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 50BC91435B; Fri, 26 Feb 2021 18:22:11 +0000 (UTC) Date: Fri, 26 Feb 2021 18:22:11 +0000 From: Alexey Dokuchaev <danfe@freebsd.org> To: Emmanuel Vadot <manu@bidouilliste.com> Cc: Baptiste Daroussin <bapt@freebsd.org>, rgrimes@freebsd.org, Cy Schubert <Cy.Schubert@cschubert.com>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226182211.GA18415@FreeBSD.org> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> <20210226191638.84c83ef81207217de2359a96@bidouilliste.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210226191638.84c83ef81207217de2359a96@bidouilliste.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614363731; 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: in-reply-to:in-reply-to:references:references; bh=8q4riCMk4qXnH0U+YwFu7XCEeBjK6u9PyWCerp+96tw=; b=CqaUnRrQ8LxzDtQa/ByrAHeqWakiqLN0GveAQwGXGTnefwsY5pkjYNfzaZAL8em1NXjzXc jWglNLjZ/f8IOSELJh62pBhFqdLrHR9mxkqhZzX7EHW2kCOXIgzKvoL0DayOehfkLEjvXO 90ohmN8KdQNoQmFsHp4kawh5+VVYeSMQhYseH5Nc9mZV16t18CYPeP2B98blKcYgloKo5c BmQxXgfkBaXEVj8kz9bpOYNydCTOJ8qvN+JoyRbAcAstfhv78N6oV32Ikr3mirsyaR6keL sInRd6jfPcw3pDpnsirqX9ju9K2H1Z7TQO3TA77MkLb3krhEzX19e61SbnFD+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614363731; a=rsa-sha256; cv=none; b=hKW5SFmpkd3i8H7ka86kmmXrmKGJR35HZEPFF8x/VXQyC6wm4DzlyUQQv1rtl0d3pEq6lR ftGOoAN9O1KqeAcKNRWgpLSSTOco4ZUfUx5ED8o2ojLjNH7LXA998mRPhj75IcykmluYIN +qYI5pgSbGFdLnAzxdAJkOT87mRzq1zxPouQaUN7ZyW10Y5dojxWLC7cHvuRlfYB+vLCaY OtKEGGQ1sLqI7NqLPIqgDxPFSbMeNqRLDSuQFvsP339ABnR/oESMuOdu4QIW2ejLIdMG1K bRDbzqnWWAV/8FY08j0MZLjXxd09vpHXhzzETbOAqKfuezU1txka5qMqZrnKxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 18:22:11 -0000 On Fri, Feb 26, 2021 at 07:16:38PM +0100, Emmanuel Vadot wrote: > ... > xterm: Set XTerm.VT100.titeInhibit: true > screen: altscreen off > tmux: et -g alternate-screen off > generic ncurses: export TERMCAP="${TERM}:ti@:te@:tc=${TERM}" > > Feel free to add this to any documentation part you feel it belongs > too (even if it is, I'm almost sure, documented in each programs > man/help pages). I have a better idea: how about we simply disable alternate screen buffer by default and document how to enable it instead of having to configure it on per-program basis? ./danfe From owner-dev-commits-src-all@freebsd.org Fri Feb 26 18:47:20 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3DE654A8CD; Fri, 26 Feb 2021 18:47: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 4DnJYN4ytBz4jS1; Fri, 26 Feb 2021 18:47: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 9915F79B6; Fri, 26 Feb 2021 18:47: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 11QIlKI5011917; Fri, 26 Feb 2021 18:47:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QIlKgm011916; Fri, 26 Feb 2021 18:47:20 GMT (envelope-from git) Date: Fri, 26 Feb 2021 18:47:20 GMT Message-Id: <202102261847.11QIlKgm011916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: 34d6961108bd - main - cam: add new ASC and ASCQ values related to drive depopulation 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: 34d6961108bd47243236d086551459c52adabf49 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 18:47:20 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=34d6961108bd47243236d086551459c52adabf49 commit 34d6961108bd47243236d086551459c52adabf49 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-02-26 18:43:35 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-02-26 18:45:06 +0000 cam: add new ASC and ASCQ values related to drive depopulation Add 04/25 Depopulation restoration in progress, 31/04 Depopulation failed, and 31/05 Depopulation restoration failed. These are defined in SPC-6r2 (though 31/4 was added in an earlier draft). They relate to different aspects of in-progress or failed depopulation removal and restoration commands. --- sys/cam/scsi/scsi_all.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 1d9b74e4fe0c..1b60003a4ac7 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -1191,6 +1191,9 @@ static struct asc_table_entry asc_table[] = { /* D */ { SST(0x04, 0x24, SS_FATAL | EBUSY, "Depopulation in progress") }, + /* D */ + { SST(0x04, 0x25, SS_FATAL | EBUSY, + "Depopulation restoration in progress") }, /* DTL WROMAEBKVF */ { SST(0x05, 0x00, SS_RDEF, "Logical unit does not respond to selection") }, @@ -2072,6 +2075,12 @@ static struct asc_table_entry asc_table[] = { /* D B */ { SST(0x31, 0x03, SS_FATAL | EIO, "SANITIZE command failed") }, + /* D */ + { SST(0x31, 0x04, SS_FATAL | EIO, + "Depopulation failed") }, + /* D */ + { SST(0x31, 0x05, SS_FATAL | EIO, + "Depopulation restoration failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, "No defect spare location available") }, From owner-dev-commits-src-all@freebsd.org Fri Feb 26 19:07:24 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C13454B578; Fri, 26 Feb 2021 19:07: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 4DnK0X3XBRz4l22; Fri, 26 Feb 2021 19:07: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 6BA047F4C; Fri, 26 Feb 2021 19:07: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 11QJ7OKp039196; Fri, 26 Feb 2021 19:07:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QJ7Oaq039195; Fri, 26 Feb 2021 19:07:24 GMT (envelope-from git) Date: Fri, 26 Feb 2021 19:07:24 GMT Message-Id: <202102261907.11QJ7Oaq039195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> Subject: git: bc3bba70d834 - main - inetd: Add examples from manual page and other sources MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc3bba70d834c169475302334b192bc90c17521e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 19:07:24 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bc3bba70d834c169475302334b192bc90c17521e commit bc3bba70d834c169475302334b192bc90c17521e Author: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> AuthorDate: 2021-02-26 19:05:46 +0000 Commit: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> CommitDate: 2021-02-26 19:07:03 +0000 inetd: Add examples from manual page and other sources The manual page lists a bunch of examples, some of which already exist in this file. Since it's both easier to remember when all examples are listed in the same location, move examples so they get installed into /etc/inetd.conf This also means users won't have to copy-paste, but can simply uncomment one or more services to use them. As such, it also becomes necessary to remove the examples from the manual page, so instead add a note explaining where the previous examples as well as others may be found. Cross-references, including to ports, have also been added where applicable. The rsync example has lived in the bug tracker for too long, considering how useful it can situationally be, for example when backup jobs on client devices are run through periodic(8) weekly. The microsoft-ds entry is necessary for Windows 10 compatibility (this can be confirmed with packet capturing, as it is not readily documented at time of writing). While here, remove two examples for which compatible daemons could not be found in ports. Submitted by: David Yeske <dyeske at gmail.com> (in part, prev ver) PR: 122037 Reviewed by: kevans, brueffer, lwhsu, yuripv Differential Revision: https://reviews.freebsd.org/D28882 --- usr.sbin/inetd/inetd.8 | 88 +++++++++++++++++++++++++++++------------------ usr.sbin/inetd/inetd.conf | 42 ++++++++++++++++------ 2 files changed, 87 insertions(+), 43 deletions(-) diff --git a/usr.sbin/inetd/inetd.8 b/usr.sbin/inetd/inetd.8 index ed784564ace7..864ca2374a14 100644 --- a/usr.sbin/inetd/inetd.8 +++ b/usr.sbin/inetd/inetd.8 @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd May 14, 2020 +.Dd February 24, 2021 .Dt INETD 8 .Os .Sh NAME @@ -791,36 +791,46 @@ the pid of the currently running .Nm .El .Sh "EXAMPLES" -Here are several example service entries for the various types of services: -.Bd -literal -# The first four launch the relevant daemon when a connection on a port -# as defined by /etc/services is opened. -ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l -ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd -telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd -shell stream tcp46 nowait root /usr/libexec/rshd rshd - -# Let the system respond to date requests via tcpmux -tcpmux/+date stream tcp nowait guest /bin/date date - -# Let people access the system phonebook via tcpmux -tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook - -# Make kernel statistics accessible -rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd - -# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) -http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 - -# Set up a unix socket at /var/run/echo that echo's back whatever is written -# to it. -/var/run/echo stream unix nowait root internal - -# Run chargen for IPsec Authentication Headers -#@ ipsec ah/require -chargen stream tcp nowait root internal -#@ -.Ed +Examples for a variety of services are available in +.Pa /etc/inetd.conf . +.Pp +It includes examples for +.Nm bootpd , +.Nm comsat , +.Nm cvs , +.Nm date, +.Nm fingerd , +.Nm ftpd , +.Nm imapd , +.Nm nc , +.Nm nmbd , +.Nm nntpd , +.Nm rlogind , +.Nm rpc.rquotad , +.Nm rpc.rusersd , +.Nm rpc.rwalld , +.Nm rpc.statd , +.Nm rpc.sprayd , +.Nm rshd , +.Nm prometheus_sysctl_exporter , +.Nm smtpd , +.Nm smbd , +.Nm swat +.Nm talkd , +.Nm telnetd , +.Nm tftpd , +.Nm uucpd . +.Pp +The internal services provided by +.Nm +for daytime, time, echo, discard and chargen are also +included, as well as chargen for +.Nm ipsec +Authentication Headers +.Pp +Examples for handling auth requests via +.Nm identd , +are similarily included. .Sh "ERROR MESSAGES" The .Nm @@ -930,8 +940,11 @@ in the database. .El .Sh SEE ALSO +.Xr cvs 1 Pq Pa ports/devel/opencvs , +.Xr date 1 , .Xr nc 1 , .Xr ipsec_set_policy 3 , +.Xr ipsec 4 , .Xr hosts_access 5 , .Xr hosts_options 5 , .Xr login.conf 5 , @@ -939,15 +952,24 @@ database. .Xr passwd 5 , .Xr rpc 5 , .Xr services 5 , +.Xr bootpd 8 , .Xr comsat 8 , .Xr fingerd 8 , .Xr ftpd 8 , +.Xr imapd 8 Pq Pa ports/mail/courier-imap , +.Xr nmbd 8 Pq Pa ports/net/samba412 , .Xr rlogind 8 , -.Xr rpcbind 8 , +.Xr rpc.rquotad 8 , +.Xr rpc.rusersd 8 , +.Xr rpc.rwalld 8 , +.Xr rpc.statd 8 , .Xr rshd 8 , +.Xr prometheus_sysctl_exporter 8 , +.Xr smbd 8 Pq Pa ports/net/samba412 , .Xr talkd 8 , .Xr telnetd 8 , -.Xr tftpd 8 +.Xr tftpd 8 , +.Xr uucpd 8 Pq Pa ports/net/freebsd-uucp .Rs .%A Michael C. St. Johns .%T Identification Protocol diff --git a/usr.sbin/inetd/inetd.conf b/usr.sbin/inetd/inetd.conf index 65a3507a6dc2..7f5f6783a038 100644 --- a/usr.sbin/inetd/inetd.conf +++ b/usr.sbin/inetd/inetd.conf @@ -66,15 +66,10 @@ #rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd #rusersd/1-2 dgram rpc/udp wait root /usr/libexec/rpc.rusersd rpc.rusersd #walld/1 dgram rpc/udp wait root /usr/libexec/rpc.rwalld rpc.rwalld -#pcnfsd/1-2 dgram rpc/udp wait root /usr/local/libexec/rpc.pcnfsd rpc.pcnfsd #rquotad/1 dgram rpc/udp wait root /usr/libexec/rpc.rquotad rpc.rquotad #rquotad/1 dgram rpc/udp6 wait root /usr/libexec/rpc.rquotad rpc.rquotad #sprayd/1 dgram rpc/udp wait root /usr/libexec/rpc.sprayd rpc.sprayd # -# example entry for the optional pop3 server -# -#pop3 stream tcp nowait root /usr/local/libexec/popper popper -# # example entry for the optional imap4 server # #imap4 stream tcp nowait root /usr/local/libexec/imapd imapd @@ -110,14 +105,41 @@ # #smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-smtpd # -# Enable the following two entries to enable samba startup from inetd -# (from the Samba documentation). Enable the third entry to enable the swat -# samba configuration tool. +# Example entry for Samba sharing for the SMB protocol # -#netbios-ssn stream tcp nowait root /usr/local/sbin/smbd smbd -#netbios-ns dgram udp wait root /usr/local/sbin/nmbd nmbd +# Enable the first two entries to enable Samba startup from inetd (according to +# the Samba documentation). Enable the third entry only if you have other +# NetBIOS daemons listening on your network. Enable the fourth entry to use +# the swat Samba configuration tool. +#netbios-ssn stream tcp nowait root /usr/local/sbin/smbd smbd +#microsoft-ds stream tcp nowait root /usr/local/sbin/smbd smbd +#netbios-ns dgram udp wait root /usr/local/sbin/nmbd nmbd #swat stream tcp nowait/400 root /usr/local/sbin/swat swat # # Example entry for the Prometheus sysctl metrics exporter # #prom-sysctl stream tcp nowait nobody /usr/sbin/prometheus_sysctl_exporter prometheus_sysctl_exporter -dgh +# +# Example entry for insecure rsync server +# This is best combined with a VTI like if_ipsec(4) or wg(4) +#rsync stream tcp nowait root /usr/local/bin/rsyncd rsyncd --daemon +# +# Let the system respond to date requests via tcpmux +#tcpmux/+date stream tcp nowait guest /bin/date date +# +# Let people access the system phonebook via tcpmux +#tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook +# +# Make kernel statistics accessible +#rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd +# +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +#http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 +# +# Set up a unix socket at /var/run/echo that echo's back whatever is written to it. +#/var/run/echo stream unix nowait root internal +# +# Run chargen for IPsec Authentication Headers +#@ ipsec ah/require +#chargen stream tcp nowait root internal +#@ From owner-dev-commits-src-all@freebsd.org Fri Feb 26 19:23:57 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0128954C141; Fri, 26 Feb 2021 19:23:56 +0000 (UTC) (envelope-from bapt@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 4DnKMc50Lxz4lpp; Fri, 26 Feb 2021 19:23:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 7FF2A3E94; Fri, 26 Feb 2021 19:23:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from [127.0.0.1] (156.106.204.77.rev.sfr.net [77.204.106.156]) (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 aniel.nours.eu (Postfix) with ESMTPSA id 040223605C; Fri, 26 Feb 2021 20:23:53 +0100 (CET) Date: Fri, 26 Feb 2021 19:23:48 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: rgrimes@freebsd.org Cc: Cy Schubert <Cy.Schubert@cschubert.com>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@FreeBSD.org> In-Reply-To: <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 19:23:57 -0000 26 f=C3=A9vr. 2021 18:36:40 Baptiste Daroussin <bapt@FreeBSD.org>: > On Fri, Feb 26, 2021 at 09:30:43AM -0800, Rodney W. Grimes wrote: >>> In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste >>> Daroussi >>> n writes: >>>> The branch main has been updated by bapt: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e= 5993332ae >>>> 14376f80 >>>> >>>> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 >>>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin <bapt@FreeBSD.org> >>>> AuthorDate: 2021-02-23 16:17:32 +0000 >>>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin <bapt@FreeBSD.org> >>>> CommitDate: 2021-02-25 13:25:32 +0000 >>>> >>>> =C2=A0=C2=A0=C2=A0 terminfo: add terminfo database >>>> =C2=A0=C2=A0=C2=A0 >>>> =C2=A0=C2=A0=C2=A0 Tested by:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 manu, jbei= ch >>>> --- >>>> share/Makefile=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |= =C2=A0 1 + >>>> share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ >>>> 2 files changed, 35 insertions(+) >>>> >>>> diff --git a/share/Makefile b/share/Makefile >>>> index c4e12b05f7db..d6854b230ae5 100644 >>>> --- a/share/Makefile >>>> +++ b/share/Makefile >>>> @@ -26,6 +26,7 @@ SUBDIR=3D ${_colldef} \ >>>> =C2=A0 ${_syscons} \ >>>> =C2=A0 tabset \ >>>> =C2=A0 termcap \ >>>> + terminfo \ >>>> =C2=A0 ${_timedef} \ >>>> =C2=A0 ${_vt} \ >>>> =C2=A0 ${_zoneinfo} >>>> diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile >>>> new file mode 100644 >>>> index 000000000000..7bb11f3fdf24 >>>> --- /dev/null >>>> +++ b/share/terminfo/Makefile >>>> @@ -0,0 +1,34 @@ >>>> +PACKAGE=3D runtime >>>> + >>>> +.PATH: ${SRCTOP}/contrib/ncurses/misc >>>> +TINFOBUILDDIR=3D ${.OBJDIR}/builddir >>>> +CLEANDIRS+=3D=C2=A0 builddir >>>> + >>>> +.include <src.tools.mk> >>>> + >>>> +.if !defined(_SKIP_BUILD) >>>> +all: terminfo >>>> +.endif >>>> +META_TARGETS+=3D terminfo install-terminfo >>>> + >>>> +terminfo: terminfo.src >>>> + mkdir -p ${TINFOBUILDDIR} >>>> + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} >>>> + >>>> +.if make(*install*) >>>> +TINFOS!=3D=C2=A0 cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=3DC s= ort >>>> +TINFOSDIRS=3D=C2=A0 ${TINFOS:C/(.).*/\1/g:O:u} >>>> +.endif >>>> + >>>> +beforeinstall: install-terminfo >>>> +install-terminfo: >>>> + mkdir -p ${DESTDIR}/usr/share/terminfo >>>> + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} >>>> +.for f in ${TINFOS} >>>> + ${INSTALL} ${TAG_ARGS} \ >>>> +=C2=A0=C2=A0=C2=A0=C2=A0 -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ >>>> +=C2=A0=C2=A0=C2=A0=C2=A0 ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/t= erminfo/${f} >>>> +.endfor >>>> + >>>> +.include <bsd.prog.mk> >>>> + >>>> >>> >>> I think this had some unintended consequences, a POLA violation that sh= ould >>> be documented. Our termcap didn't support alternate screen buffers whil= e >>> terminfo does. Termcap did through t_te and t_ti but we didn't use them= . >>> Terminfo as delivered from the ncurses factory does supply rmcup and sm= cup; >>> our fullscreen apps such as nvi and top see them and use the alternate >>> screen buffer. >>> >>> The use of the alternate screen buffer is one of the things I hate abou= t >>> Linux. After running vi or top I expect the output to remain on the scr= een >>> so I can use some bit of information in my next command. We now have th= is >>> behaviour too. >> >> Oh, I so hate that mis-feature of Linux, please please tell me there is >> a simple knob to turn this off?=C2=A0 I believe LESS also does this kind >> of stuff, or atleast "man" on linux does, and that pees me off to no >> end when I quit the man page and what I wanted is no longer on the scree= n. >> >> > No this is not and I clear have 0 intention to have a complex patch on to= p of > the linux terminfo which would prefer easy sync in the futur. > > We can document how to use a definition which does not have the feature y= ou do > not like. > > Best, > Bapt Wow I think that is one of the most terrible mail I have ever written! Let me rephrase it. I won t patch ncurses terminfo as that would make the m= aintenance a huge pain. Ncurses is already not an easy beast to maintain ( = should be a bit easier now). The solution is to document how to workaround for the people who dislike th= e new behaviour Bapt From owner-dev-commits-src-all@freebsd.org Fri Feb 26 19:35:43 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0394254CC24; Fri, 26 Feb 2021 19:35:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnKdB6lKxz4nVm; Fri, 26 Feb 2021 19:35:42 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614368142; 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: in-reply-to:in-reply-to:references:references; bh=qv58JrF5elCmSj71ykqBBEqIM0QSW1Dv/D45aSzH83Y=; b=N9JdK3dC3U5nxm3Z9XMKp21hivNoUeym0a2RFmczpgsNSRN04kb7hSwIqFRe1ejTIyqKvA GZSv8k5odUNoy8bcaktwjLA2crc4zsKhbcH9h5lAp5JhTDzETaUkUUQU4ykNKnj2QaX6PW jhFnwWZhctItFZ/pPx8Y+MBlmAmPdgeYxbbmwecTzXXf9Or0AjKvUoCEwtnCvQpN8O06iB z5xhSQm2NDLSjU3V4vJsYbq61LrZN+pixHyoXGi7qMMCRfi+2OFpyRpNA6Kk0TRzhgZxGd jaCKpURtmqyFfCoahk4RGfFe2K+kqKC4p6F0PlUsx8npu7A/JlpCxvnFGfeQLA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id C971215B29; Fri, 26 Feb 2021 19:35:42 +0000 (UTC) Date: Fri, 26 Feb 2021 19:35:42 +0000 From: Alexey Dokuchaev <danfe@freebsd.org> To: Baptiste Daroussin <bapt@freebsd.org> Cc: rgrimes@freebsd.org, Cy Schubert <Cy.Schubert@cschubert.com>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226193542.GA89099@FreeBSD.org> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@FreeBSD.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614368142; 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: in-reply-to:in-reply-to:references:references; bh=qv58JrF5elCmSj71ykqBBEqIM0QSW1Dv/D45aSzH83Y=; b=eFRIJpraJHsv+brdtVvtkampv75Du4ggE9f8Z41idOWfpOXw6aqsSDfS3XqbjNtee4fhAd QfloQr55fQQ54ed5xo9VjeyOyIvjPa5XTz+fjxhScwWLJbMmUfzoo1qDxav1sleWRbn9/G Qa4SYapvYiLi2MdQC7ApZaGEqWDjrkDbEqO8bpS3GjaKcPR6uRjfdcAvcM3IhX6SqWqKe/ h+oIzopIF3ZLT51IQhjs8Z/IIxZLoB78kNUR7YA3bTSviuf4uxOnkZHNyYnrzVLiNp3tUp u5s6xUbqwpYvGDsvEb8trSmWyVJDfCy6l1G77mmZj/xIKTvaYwmenpMUR0lsig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614368142; a=rsa-sha256; cv=none; b=xGatKwroQa62nBat1YFVTif/onjeGu28Tx47CP7uXL5BgL+uVqCEjXXjUwkNFo/x2LUnNS 7+1Y5xut3hcbRYYipnrxiu89se5AB1HM5GwpI3bfUXDhp4oL2xOH8fLHn0j6XVOxzt+h6Y qAB+J/Hh2L7tcTJT+fZ3U0KoxeAHbj9fdH4OQe/Zb3XfOzwSa5HvTQNJzCJs8vlJJ//Sow XEgs1YUDa+sfRohjVvKtBO/7VmH4M6rs1ERZ+zWuq/GCeYgaQsf8bwNLya+IdpT2ff3Kjt /QQ7c084tmeVIPHkYcnKw8Peojz83e4mRMrGA3qNo+JJmsJx+ZgEjWiQ9+fO+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 19:35:43 -0000 On Fri, Feb 26, 2021 at 07:23:48PM +0000, Baptiste Daroussin wrote: > ... > Let me rephrase it. I won't patch ncurses terminfo as that would make > the maintenance a huge pain. How disabling one single mis-feature makes it huge pain to maintain? How big is the patch? We had been doing these things for contributed software since our dawn times, so our users won't have to circumvent upstream's stupidity. When did this change? > The solution is to document how to workaround for the people who dislike > the new behaviour. This is just wrong on so many different levels; I honestly don't understand what the fuck is going on here. :-( ./danfe From owner-dev-commits-src-all@freebsd.org Fri Feb 26 20:19:39 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE02054D5FC; Fri, 26 Feb 2021 20:19:39 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnLbv61czz4qZZ; Fri, 26 Feb 2021 20:19:39 +0000 (UTC) (envelope-from jbeich@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614370779; 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: references:references; bh=K0GJit3WDkTNhEMSiYPZgUSISQkrJGkHsac8sSayKW8=; b=IxmVHDKpEXSfeCs5Dx0/0DmQGTmhls1iZOukrcGhZZqByNqXkILsK6RP8/JL2U44aSErEK 8+WsNBR3qAkYFwMv3Q2asMj7COq+WG55qsUGwYzpbnBhgFp5L2z1HS44C0Ag32Kqan2EFv 3sj8+dRarMhcJf+uD6ohq3BYvAlDrGH4R/0s6SNUmar2UFCRi7Or8lRx0rTPyGkWDqm+VQ BGhzrxAKYDzgRhfsLXHBFUirbGP/WZO0/osGsdHRRVGtOoDRvdfxvdgan3q16DUswSSRbO 6hqx5vDutByjhxiDJ6WwjU6Exhh4/IMmRbCXpvDKjG8Hreh4MV7WNQIXzNh6iA== Received: by freefall.freebsd.org (Postfix, from userid 1354) id C091316482; Fri, 26 Feb 2021 20:19:39 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: Cy Schubert <Cy.Schubert@cschubert.com> Cc: Baptiste Daroussin <bapt@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <202102261420.11QEKJoX006569@slippy.cwsent.com> <20210226143714.k24aacsrjnnhkktc@aniel.nours.eu> <202102261448.11QEmHlA006761@slippy.cwsent.com> Date: Fri, 26 Feb 2021 21:19:35 +0100 Message-ID: <blc6-fup4-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614370779; 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: references:references; bh=K0GJit3WDkTNhEMSiYPZgUSISQkrJGkHsac8sSayKW8=; b=Sk4qLYz1RdaV9B7VF1nG1dLoILloWDoIwlKO/haotkXpzylB8FVAc2FqKCDEmQOYb/XCeb e0WzP+EU06CQDRic/hOQwfGNZDQ0wiWaaUWfSeMQGgCeQg+ez2kEkiY0uIzHn17OuOcOaD Na1IN6Miq3ZZYc2BthCGsGOrV+FV9sH8Ibc7cN5o3BmtJIvTEIO5duMzUvfMcNxxkKpWCn BehCFz6ThlbUwW4UqJyZUd+VbVvCUAsIGqmlhWnOrRkYYP9Ef2oeHLrwXQK5yjR0mV/Wl9 d+qi+Aao2voQiCrUEeIRSV9RcJ9KKFMJ5ecas+el8BJD3kvZewTtWGs3hgAWvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614370779; a=rsa-sha256; cv=none; b=JcUdpwMbbkRIaqx6rM+d57XRNHiNyguQSNrdRErsw8FytVNU9kGzwqJNBXu++mi5iUJxvG S74RX3r2gL15ODPNYZ4M1Bi+jkXr0u8cve74mA5DDVLygxR5bn8zphAS5aWvyz6TsEVno9 gJlpYQ1QxV6gZipE7hgGeMUsrV3E97WEwe6SyiE6kBT5gPPs3fcyYaJoQoLPpKRwRYdK0x G6ZPLPcvYepxT7TktC6Q1Ii3HqF9u9wOKXdMoUGlRnIXWSI32dF9MRex3nWjMQ4esc3EQi vgQ+sAPe7xPc1AqW8VUtTmUJNdPXma2sBG5XRzhNG1lI+jljuzQ4kgsMvj1pyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 20:19:39 -0000 Cy Schubert writes: > Baptiste Daroussin writes: >> I was planning to MFC it to 13.1, I don't know how much this change >> is a POLA violation or not, imho all the other benefice of terminfo >> over termcap for end users are worth the MFC, but if most people >> vote against, I won't MFC it. > > I think this is big enough not to MFC to 13.1. To keep POLA on 13.1 ncurses needs to look into termcap and if it can't find a match there look into terminfo. Old entries like xterm would keep working like before (ti/te disabled) while new entries like xterm-direct2, alacritty, etc. will behave like upstream intended (smcup/rmcup enabled). However, I haven't looked into ncurses source how easy it'd be to implement. >From ports/ perspective having terminfo as fallback would be enough. termcap -> terminfo conversion is often lossy and requires writing outside of /usr/local (aka PREFIX). For example, many modern terminals source xterm-256color but it's not maintained (e.g., bug 247447) From owner-dev-commits-src-all@freebsd.org Fri Feb 26 20:20:32 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A22F54DB1A for <dev-commits-src-all@mailman.nyi.freebsd.org>; Fri, 26 Feb 2021 20:20:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 4DnLcv2X5mz4qrt for <dev-commits-src-all@freebsd.org>; Fri, 26 Feb 2021 20:20:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72a.google.com with SMTP id q85so10407685qke.8 for <dev-commits-src-all@freebsd.org>; Fri, 26 Feb 2021 12:20:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZdSPJ1s5JUSGyo0hxZEdRTThiCCk/3M5sE96jkvY3qs=; b=AOtzOvgKKANBgJlTZCGwjrVrY+R+UzIB9afE1pR33USw9H+OUgD2KsvT9X7uBAkczk ZTFmiDGgNze2n3WFN6kVsCDbq46HJ7H9IDnMBKR0VqopypFx0NFKlmRtermohckDALcQ 2+ZwarWk8/meJFiYlA69I/MNjNrpjI/1+ok2GAr3CzrlfAFkgu729avir/TRJTeQ2wIy m0zNhJ+Attufz1taROcz/3h6abJiEQ2C4DgfLpI5+r5WVu1AYZCNBHCB447wRrzUw45g RA/rVLrABEsVlt5yhoQmGJhvWA+UEMhCkdUJZfs5qoDhuhWbyOKmkPQLL8vEGqUgClaP UBaQ== 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=ZdSPJ1s5JUSGyo0hxZEdRTThiCCk/3M5sE96jkvY3qs=; b=NSRy9K4DtH8hJl0qHzf5hITRZCQCm9Oap+LFVc3sItAd180DZa/oy++WZk8ei2TCKD 6LBhBRX8SEhyCh2LJnTG+4stAK+gufGkrqCtbxAGhgBdRuFVKQVWKBatYuDaw2hOhHiE zOwQWtl0tXzf1qK2eCEuzoWXR5UgCl80erHPjpVQc3BTbYVzDTcLNH2I8eePy+He1WnP OdxLQEgablI6XQ7T4yhlKjR3P+x0pTdiSXKa3jZFeXk23/KYmWahxW5pPNZurd1zxKiI ehCoYuXYDp99pZ+xHdiCIx5QnaXc3KwyNTfQKg5NJTBEdLHQL4ONswL7//Pz3lnKCCzv L8nw== X-Gm-Message-State: AOAM530Ox+3IQNZRYvIxJZa07b/lLHFeHKGloq9d5alU6syzRO43Hu2o E+3mXoFDI6zImIAy91LSKzTfQJv9CVFcdo46b8yDqA== X-Google-Smtp-Source: ABdhPJx2lU7070Wxi1ri84xB/9voAZs9V1E2lIiM0S9It3OH4KYv7CPXuWtxrzpCxocYiFa2mUXvdhLNj57cLRSjZ+U= X-Received: by 2002:a37:a151:: with SMTP id k78mr4332875qke.359.1614370830382; Fri, 26 Feb 2021 12:20:30 -0800 (PST) MIME-Version: 1.0 References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@FreeBSD.org> <20210226193542.GA89099@FreeBSD.org> In-Reply-To: <20210226193542.GA89099@FreeBSD.org> From: Warner Losh <imp@bsdimp.com> Date: Fri, 26 Feb 2021 13:20:19 -0700 Message-ID: <CANCZdfp82HJ71zd9LdbYJMFbujQy5_L7KQCJhbj1CtNXGWZPPA@mail.gmail.com> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database To: Alexey Dokuchaev <danfe@freebsd.org> Cc: Baptiste Daroussin <bapt@freebsd.org>, "Rodney W. Grimes" <rgrimes@freebsd.org>, Cy Schubert <Cy.Schubert@cschubert.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DnLcv2X5mz4qrt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=AOtzOvgK; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72a) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::72a:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72a:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::72a:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 20:20:32 -0000 On Fri, Feb 26, 2021 at 12:35 PM Alexey Dokuchaev <danfe@freebsd.org> wrote: > On Fri, Feb 26, 2021 at 07:23:48PM +0000, Baptiste Daroussin wrote: > > ... > > Let me rephrase it. I won't patch ncurses terminfo as that would make > > the maintenance a huge pain. > > How disabling one single mis-feature makes it huge pain to maintain? > How big is the patch? We had been doing these things for contributed > software since our dawn times, so our users won't have to circumvent > upstream's stupidity. When did this change? > There's not a clear and compelling agreement that this is stupid. Some love it, some hate it, some conditionally do both. As has been stated, the workaround generally is a one liner: export TERMCAP="${TERM}:ti@:te@:tc=${TERM}" in your init file. Other programs have more selective workaround should you desire to disable this on some, but not all, programs. This is quite a bit less work than whatever effort it would be to hack something together, and then keep re-hacking it each time we update. > > The solution is to document how to workaround for the people who dislike > > the new behaviour. > > This is just wrong on so many different levels; I honestly don't understand > what the fuck is going on here. :-( > This is crossing the line from advocacy and discussion into hostility and attack. Please avoid that in the future. Warner From owner-dev-commits-src-all@freebsd.org Fri Feb 26 20:20:50 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1E2054DBA1; Fri, 26 Feb 2021 20:20:50 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnLdG460gz4qjJ; Fri, 26 Feb 2021 20:20:50 +0000 (UTC) (envelope-from jbeich@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614370850; 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: in-reply-to:in-reply-to:references:references; bh=OZEJbXvXSlV4mX3iA77UJIIXo5T7Wl4jR+PhDTTSC9M=; b=B8iYYtFy45OyG5TDguR84cKZSK9TB8RP+mPiIbQujP2tzjVxYd6x7leCGNuJ7XLgZjEYHA fLVUIz/24ZqMjGNJatze5boC/ckaEx5MeCCPzb4DC4xUifCaOrwkyvW9KK1R3vMULx0Qiu 1JmCQsVkGLCS2Q2cdtecsopKjrtjAR7Bhzs+SS3i8MffbKaY0lKdKLKSUeofOHmsbxq0Xi XaOhJTkJn65CzTeDSsv2VQLExPOiYNU7AFhoC5BQiub97GvyuM73JgJJc+0MJla7BO7QRO 7j37MOWTq2EL5tBYIwUaaxByZ0MepIofhhyk2l9qI9jFr7mC5Ioj5/Sc0tIBZw== Received: by freefall.freebsd.org (Postfix, from userid 1354) id D80C7163F1; Fri, 26 Feb 2021 20:20:49 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: Cy Schubert <Cy.Schubert@cschubert.com> Cc: Baptiste Daroussin <bapt@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <202102261420.11QEKJoX006569@slippy.cwsent.com> <20210226143714.k24aacsrjnnhkktc@aniel.nours.eu> <202102261448.11QEmHlA006761@slippy.cwsent.com> <blc6-fup4-wny@FreeBSD.org> Date: Fri, 26 Feb 2021 21:20:45 +0100 In-Reply-To: <blc6-fup4-wny@FreeBSD.org> (Jan Beich's message of "Fri, 26 Feb 2021 21:19:35 +0100") Message-ID: <y2fa-eg2q-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614370850; 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: in-reply-to:in-reply-to:references:references; bh=OZEJbXvXSlV4mX3iA77UJIIXo5T7Wl4jR+PhDTTSC9M=; b=COwIvfEuLfj7h/DTjujie9IFBXOXrBezCgTjJRuvX6nr1+/zF5B3DdMa3+or/Kd5VRu2rN G1TaHgKaLUg0TsykNykwUN+Xv7/S+wpEAC7YIRgfmMcASSL+5vCy3pwQnFT0O638/CcZkK 9ENF1q8L0s/txCqmaozFBnCK9T2+XhamZPXHq2ZnJ+S+neJASgBmPIm9rqP2HZabGxhkY0 QhFHnek2pcKEae/TWQOJGMCSTkG4z3x/X2PQifMK55Kv16Y+l9mxZN74ZjFU1xH5E+/cu7 tNuV8Y/f/ontPlJ+7OE7yNUoJJayNKaTX/XBg3n1f7BsvH8HLPJSSaOVF2yLrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614370850; a=rsa-sha256; cv=none; b=UZ1C/UmzwukwGAs6lk9Q81d4aSROmEmTOGaDj+NduYacXmhsJCoAan9qn9K8CqcgiVomY/ XwIfYamooG8YveTDlbo3lKAcgEl/w2Mm6W/XFxvRw+REfCT4naurHOLeq1zTlpZJgWqRGx hXDaBrszSBXWZMge18gOycJrisa4w8KeWavA0Cx+c2YT/3dPRs2sjk22RzoUy7at6BK4dJ oEOH8sCkSsq2NYJNhqdPu1p/aWUjvmjYPOkiTYNWnAunzM/85V+E/7SVWSw2j4gQFDuQJn uSFged4wqWjrbC99UZCkZ2/AwJ5YkCjiTBz764nf04Z5lsfpjHykCcKafoqBtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 20:20:50 -0000 Jan Beich <jbeich@FreeBSD.org> writes: > From ports/ perspective having terminfo as fallback would be enough. > termcap -> terminfo conversion is often lossy and requires writing Typo: "termcap -> terminfo" should be "terminfo -> termcap" From owner-dev-commits-src-all@freebsd.org Fri Feb 26 20:26:03 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B358A54DCB5; Fri, 26 Feb 2021 20:26:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnLlH0mWxz4r8v; Fri, 26 Feb 2021 20:26:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id FjgVlmLtyHmS3FjgWlzqk5; Fri, 26 Feb 2021 13:26:01 -0700 X-Authority-Analysis: v=2.4 cv=MaypB7zf c=1 sm=1 tr=0 ts=60395959 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=1X5WsqQov_YCb2dtGS4A:9 a=wPNLvfGTeEIA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 5162F317; Fri, 26 Feb 2021 12:25:58 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11QKPwCe003888; Fri, 26 Feb 2021 12:25:58 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102262025.11QKPwCe003888@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert <Cy.Schubert@cschubert.com> From: Cy Schubert <Cy.Schubert@cschubert.com> X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin <bapt@FreeBSD.org> cc: rgrimes@freebsd.org, Cy Schubert <Cy.Schubert@cschubert.com>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database In-reply-to: <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@FreeBSD.org> References: <202102261420.11QEKJoX006569@slippy.cwsent.com> <202102261730.11QHUh8n031156@gndrsh.dnsmgr.net> <20210226173629.2sc6wlaasxjep3le@aniel.nours.eu> <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@FreeBSD.org> Comments: In-reply-to Baptiste Daroussin <bapt@FreeBSD.org> message dated "Fri, 26 Feb 2021 19:23:48 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Fri, 26 Feb 2021 12:25:58 -0800 X-CMAE-Envelope: MS4xfJX2gfGwQHXj+XaGdH08Oz1FhoQmIUmtYcumBWM/lb2Q32fwAQj5gyXU8/ptTBbBZxa9HoQ0xTdVqjsAOIsj5mFBWiq66ZgLCFPer/rt5Aa7GoBYyTIP DwztzYFiU6zqzySCY1/UuxYs/BFqpKjzVIOAqLb06JX5ZcYqU1LBn5MoSmLZSKJEFDYsTg8iz25H/zTfEYrsPMT3z4+hvfYTE1xLM68uJxx/juT2fgAg3gZZ 7W9+A4RYIKLPNEyOFyLHwbEE96kHSRm98rwdiQnP2c6ivsbxfIpsUa0zbyYZNMM7cVyh6vAtka5Du1iYmAbFiYE613pkTweNv1Fa/TvqScEhYNXTl7vAcZlA TGM9hVka X-Rspamd-Queue-Id: 4DnLlH0mWxz4r8v 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 20:26:03 -0000 In message <d0c4f575-9aba-4b04-a0f4-17e1c0fbedfb@FreeBSD.org>, Baptiste Darouss in writes: > > > 26 févr. 2021 18:36:40 Baptiste Daroussin <bapt@FreeBSD.org>: > > > On Fri, Feb 26, 2021 at 09:30:43AM -0800, Rodney W. Grimes wrote: > >>> In message <202102251327.11PDR4eC083842@gitrepo.freebsd.org>, Baptiste > >>> Daroussi > >>> n writes: > >>>> The branch main has been updated by bapt: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993 > 332ae > >>>> 14376f80 > >>>> > >>>> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > >>>> Author:     Baptiste Daroussin <bapt@FreeBSD.org> > >>>> AuthorDate: 2021-02-23 16:17:32 +0000 > >>>> Commit:     Baptiste Daroussin <bapt@FreeBSD.org> > >>>> CommitDate: 2021-02-25 13:25:32 +0000 > >>>> > >>>>     terminfo: add terminfo database > >>>>     > >>>>     Tested by:      manu, jbeich > >>>> --- > >>>> share/Makefile          |  1 + > >>>> share/terminfo/Makefile | 34 ++++++++++++++++++++++++++++++++++ > >>>> 2 files changed, 35 insertions(+) > >>>> > >>>> diff --git a/share/Makefile b/share/Makefile > >>>> index c4e12b05f7db..d6854b230ae5 100644 > >>>> --- a/share/Makefile > >>>> +++ b/share/Makefile > >>>> @@ -26,6 +26,7 @@ SUBDIR= ${_colldef} \ > >>>>   ${_syscons} \ > >>>>   tabset \ > >>>>   termcap \ > >>>> + terminfo \ > >>>>   ${_timedef} \ > >>>>   ${_vt} \ > >>>>   ${_zoneinfo} > >>>> diff --git a/share/terminfo/Makefile b/share/terminfo/Makefile > >>>> new file mode 100644 > >>>> index 000000000000..7bb11f3fdf24 > >>>> --- /dev/null > >>>> +++ b/share/terminfo/Makefile > >>>> @@ -0,0 +1,34 @@ > >>>> +PACKAGE= runtime > >>>> + > >>>> +.PATH: ${SRCTOP}/contrib/ncurses/misc > >>>> +TINFOBUILDDIR= ${.OBJDIR}/builddir > >>>> +CLEANDIRS+=  builddir > >>>> + > >>>> +.include <src.tools.mk> > >>>> + > >>>> +.if !defined(_SKIP_BUILD) > >>>> +all: terminfo > >>>> +.endif > >>>> +META_TARGETS+= terminfo install-terminfo > >>>> + > >>>> +terminfo: terminfo.src > >>>> + mkdir -p ${TINFOBUILDDIR} > >>>> + ${TIC_CMD} -x -o ${TINFOBUILDDIR} ${.ALLSRC} > >>>> + > >>>> +.if make(*install*) > >>>> +TINFOS!=  cd ${TINFOBUILDDIR} && find * -type f | LC_ALL=C sort > >>>> +TINFOSDIRS=  ${TINFOS:C/(.).*/\1/g:O:u} > >>>> +.endif > >>>> + > >>>> +beforeinstall: install-terminfo > >>>> +install-terminfo: > >>>> + mkdir -p ${DESTDIR}/usr/share/terminfo > >>>> + cd ${DESTDIR}/usr/share/terminfo; mkdir -p ${TINFOSDIRS} > >>>> +.for f in ${TINFOS} > >>>> + ${INSTALL} ${TAG_ARGS} \ > >>>> +     -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > >>>> +     ${TINFOBUILDDIR}/${f} ${DESTDIR}/usr/share/terminfo/${f} > >>>> +.endfor > >>>> + > >>>> +.include <bsd.prog.mk> > >>>> + > >>>> > >>> > >>> I think this had some unintended consequences, a POLA violation that shou > ld > >>> be documented. Our termcap didn't support alternate screen buffers while > >>> terminfo does. Termcap did through t_te and t_ti but we didn't use them. > >>> Terminfo as delivered from the ncurses factory does supply rmcup and smcu > p; > >>> our fullscreen apps such as nvi and top see them and use the alternate > >>> screen buffer. > >>> > >>> The use of the alternate screen buffer is one of the things I hate about > >>> Linux. After running vi or top I expect the output to remain on the scree > n > >>> so I can use some bit of information in my next command. We now have this > >>> behaviour too. > >> > >> Oh, I so hate that mis-feature of Linux, please please tell me there is > >> a simple knob to turn this off?  I believe LESS also does this kind > >> of stuff, or atleast "man" on linux does, and that pees me off to no > >> end when I quit the man page and what I wanted is no longer on the screen. > >> > >> > > No this is not and I clear have 0 intention to have a complex patch on top > of > > the linux terminfo which would prefer easy sync in the futur. > > > > We can document how to use a definition which does not have the feature you > do > > not like. > > > > Best, > > Bapt > > Wow I think that is one of the most terrible mail I have ever written! > > Let me rephrase it. I won t patch ncurses terminfo as that would make the mai > ntenance a huge pain. Ncurses is already not an easy beast to maintain ( shou > ld be a bit easier now). > > The solution is to document how to workaround for the people who dislike the > new behaviour I think this is the best solution. TERM=xterm1 or TERM=vt100. If we absolutely have to, we could document how people can create their own terminfo databases. Simply change rmcup= and smcup= to rmcup@ and smcup@. This is what xterm1 does. xterm1 is already in the upstream and we have it. Having unpacked the RH SRPM, I don't see where Red Hat actually removes xterm1, it's in the tarball within the SRPM but it doesn't appear in their terminfo database. Simply change your TERM to xterm1. Having said this, one would need to add tset -Q -s -m xterm1:xterm to your Red Hat and Fedora machines to make sure your FreeBSD TERM=xterm1 doesn't cause any grief. Much of the problem is that the various Linux distros have created incompatibilities which affect the traditional UNIX world (I put us in the traditional UNIX space) requiring the rest of us to either follow suit or break. I can think other changes coming down the turnpike which will affect us but that is better left for a freebsd-arch thread. Documenting how people can create their own terminfo database in say, ~/.terminfo and point $TERMINFO to it would go a long way. I will try it myself over the next week or two when I get some free time. -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: https://FreeBSD.org NTP: <cy@nwtime.org> Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Fri Feb 26 21:36:11 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF13F54F4D3; Fri, 26 Feb 2021 21:36: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 4DnNJC5VfKz4vRx; Fri, 26 Feb 2021 21:36: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 AF93F12220; Fri, 26 Feb 2021 21:36: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 11QLaBfH035866; Fri, 26 Feb 2021 21:36:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QLaB2x035865; Fri, 26 Feb 2021 21:36:11 GMT (envelope-from git) Date: Fri, 26 Feb 2021 21:36:11 GMT Message-Id: <202102262136.11QLaB2x035865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin <jhb@FreeBSD.org> Subject: git: 974504783922 - releng/13.0 - Handle partial data re-sending on ktls/sendfile on FreeBSD 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9745047839225ede45594ae4ec2b26df6bafbd22 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 21:36:11 -0000 The branch releng/13.0 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9745047839225ede45594ae4ec2b26df6bafbd22 commit 9745047839225ede45594ae4ec2b26df6bafbd22 Author: Oleksandr Tymoshenko <gonzo@FreeBSD.org> AuthorDate: 2021-02-17 22:49:30 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2021-02-26 21:35:05 +0000 Handle partial data re-sending on ktls/sendfile on FreeBSD Add a handler for EBUSY sendfile error in addition to EAGAIN. With EBUSY returned the data still can be partially sent and user code has to be notified about it, otherwise it may try to send data multiple times. PR: 251969 Approved by: re (gjb) Obtained from: OpenSSL (dfcfd17f2818cf520ce6381aed9ec3d2fc12170d) Sponsored by: Netflix (merging to FreeBSD) (cherry picked from commit 9b2f020c14af71a2606012143432dd717c7cf90e) (cherry picked from commit 63241a0764c9414e1bcce3bcb05bfbdba8f1f487) --- crypto/openssl/doc/man3/SSL_write.pod | 3 ++- crypto/openssl/include/internal/ktls.h | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/crypto/openssl/doc/man3/SSL_write.pod b/crypto/openssl/doc/man3/SSL_write.pod index 20c7953deb06..9b271d8e65a2 100644 --- a/crypto/openssl/doc/man3/SSL_write.pod +++ b/crypto/openssl/doc/man3/SSL_write.pod @@ -120,7 +120,8 @@ For SSL_sendfile(), the following return values can occur: =item Z<>>= 0 The write operation was successful, the return value is the number -of bytes of the file written to the TLS/SSL connection. +of bytes of the file written to the TLS/SSL connection. The return +value can be less than B<size> for a partial write. =item E<lt> 0 diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h index 9032c0ed6174..622d7be76d1e 100644 --- a/crypto/openssl/include/internal/ktls.h +++ b/crypto/openssl/include/internal/ktls.h @@ -192,15 +192,12 @@ static ossl_inline int ktls_read_record(int fd, void *data, size_t length) static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, size_t size, int flags) { - off_t sbytes; + off_t sbytes = 0; int ret; ret = sendfile(fd, s, off, size, NULL, &sbytes, flags); - if (ret == -1) { - if (errno == EAGAIN && sbytes != 0) - return sbytes; - return -1; - } + if (ret == -1 && sbytes == 0) + return -1; return sbytes; } From owner-dev-commits-src-all@freebsd.org Fri Feb 26 21:36:13 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A67954F4D4; Fri, 26 Feb 2021 21:36: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 4DnNJD6gW4z4vXJ; Fri, 26 Feb 2021 21:36: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 D21B612221; Fri, 26 Feb 2021 21:36: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 11QLaCiD035884; Fri, 26 Feb 2021 21:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QLaC4k035883; Fri, 26 Feb 2021 21:36:12 GMT (envelope-from git) Date: Fri, 26 Feb 2021 21:36:12 GMT Message-Id: <202102262136.11QLaC4k035883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin <jhb@FreeBSD.org> Subject: git: 310ae6a0df39 - releng/13.0 - OpenSSL: Regen manual page for the previous commit 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 310ae6a0df3949784af9b51f7c8e8622730324e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 21:36:13 -0000 The branch releng/13.0 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=310ae6a0df3949784af9b51f7c8e8622730324e6 commit 310ae6a0df3949784af9b51f7c8e8622730324e6 Author: Jung-uk Kim <jkim@FreeBSD.org> AuthorDate: 2021-02-17 23:19:13 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2021-02-26 21:35:20 +0000 OpenSSL: Regen manual page for the previous commit This is regen for 9b2f020c14af71a2606012143432dd717c7cf90e. Approved by: re (gjb) (cherry picked from commit 351d06eeb509a420f3470c96b4a265467c87e2c2) (cherry picked from commit cdba1277dd26c8f7e54a40d86d44748f2d1a8c29) --- secure/lib/libcrypto/man/man3/SSL_write.3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/secure/lib/libcrypto/man/man3/SSL_write.3 b/secure/lib/libcrypto/man/man3/SSL_write.3 index 99e76b5ac013..db4800fb059d 100644 --- a/secure/lib/libcrypto/man/man3/SSL_write.3 +++ b/secure/lib/libcrypto/man/man3/SSL_write.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "SSL_WRITE 3" -.TH SSL_WRITE 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH SSL_WRITE 3 "2021-02-17" "1.1.1j" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -245,7 +245,8 @@ For \fBSSL_sendfile()\fR, the following return values can occur: .IP ">= 0" 4 .IX Item ">= 0" The write operation was successful, the return value is the number -of bytes of the file written to the \s-1TLS/SSL\s0 connection. +of bytes of the file written to the \s-1TLS/SSL\s0 connection. The return +value can be less than \fBsize\fR for a partial write. .IP "< 0" 4 .IX Item "< 0" The write operation was not successful, because either the connection was From owner-dev-commits-src-all@freebsd.org Fri Feb 26 21:41:35 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 428A954F7EC; Fri, 26 Feb 2021 21:41:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 4DnNQQ3pbJz3Bvc; Fri, 26 Feb 2021 21:41:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x535.google.com with SMTP id t25so7007478pga.2; Fri, 26 Feb 2021 13:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mcP6dCGYOroNSDeweZaKp0HRVh29zwk3V3hZZOrCwl4=; b=e5EwYPbGDmZSpn9JjgLNDr7siKgJgfP5bZ6MNvYkAmA7pIi7/eLMiIlVld7lHi3VB1 bKIAhTwRTux6lYUSh2G+n88pLMsuQqKeUqYI91p8mEfyECAj4XiaXOGqCjo96e5hMt0H atcwbRuHT6XoFaZ7PQsURJ1G3ks8S5EOGWyj7kpj/eoDuI2izr7ho8RfhDaipqp54lzg yRrCinsvZkuI+iv5vr2iURW+oOnVZ5AVzAYPQCljtYBzT88Y71RGVxGS4OkyVjJD6x4n bFkSa1lVsBlmzHhcA18Z76sU5vpU7GTXiD/7pkyN4yJMOeNo8xtOyyJML1bur62qggxg BV9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mcP6dCGYOroNSDeweZaKp0HRVh29zwk3V3hZZOrCwl4=; b=b7zn+WWJbzrde/lUO8ANehcXknmU8N0H7yn+NAHF1e7UTs4XK2s/w7Bc/KQuXlPaeo ket3Vpg0ow+rDhdxe1wSsawh5I6eSqtY55hiWwaGb5qHIPLoeXUxDe6x7tFxSn9wMrUO 8C59IcIe1sePI9GPP9t9XhgJaXpP96bkL+a1/s+3WQta3uyDE1poADk4AW8s1uOOKO/8 522UqgkCpS1sdmtnckYAbH8ajCyD4+6rMavQHmI5JA2b6cv6lvz0nk5442jER69UkQUS TC+ZmZsNdPHMsXK/WNHENYcjJecj4fT84APTvM5qoHwnBjSvfdS+rJQN2Xpzhwcb9a13 GDsQ== X-Gm-Message-State: AOAM531gqGyOHk8P4ia+OFbsuSW+FVbjpHpq3CYcqaURru3xtSyPmXWD HXyqb2h71qJiD0DSG1vrNQCoA4cYsvVcgw== X-Google-Smtp-Source: ABdhPJzykDo1Y4YhymLdn5Z72xCv+7rLTkDTEJ5LLMHHruEJUEY5Mbvur0p1B4uhSLu3NG8ecv/mBw== X-Received: by 2002:a63:d506:: with SMTP id c6mr4601943pgg.77.1614375692526; Fri, 26 Feb 2021 13:41:32 -0800 (PST) Received: from [192.168.20.29] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id y9sm10986013pff.104.2021.02.26.13.41.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2021 13:41:32 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database From: Enji Cooper <yaneurabeya@gmail.com> In-Reply-To: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> Date: Fri, 26 Feb 2021 13:41:31 -0800 Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Content-Transfer-Encoding: quoted-printable Message-Id: <E1CBDB73-8A27-49D5-9B1A-7F33CA323528@gmail.com> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> To: Baptiste Daroussin <bapt@FreeBSD.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DnNQQ3pbJz3Bvc X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=e5EwYPbG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::535 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RECEIVED_SPAMHAUS_PBL(0.00)[73.19.52.228:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::535:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; 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)[text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::535:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::535:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 21:41:35 -0000 > On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org> = wrote: >=20 > The branch main has been updated by bapt: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e5993332ae= 14376f80 >=20 > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > Author: Baptiste Daroussin <bapt@FreeBSD.org> > AuthorDate: 2021-02-23 16:17:32 +0000 > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > CommitDate: 2021-02-25 13:25:32 +0000 >=20 > terminfo: add terminfo database >=20 > Tested by: manu, jbeich Hi Baptiste, A question and a comment: 1. Was this reviewed in Phabricator? 2. The details on why the terminfo database is being added are a = bit lean too to non-Unix users. It would be nice if the motivation for = the change was documented in the commit message. Thanks! -Enji= From owner-dev-commits-src-all@freebsd.org Fri Feb 26 21:48:17 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54DE155061E; Fri, 26 Feb 2021 21:48:17 +0000 (UTC) (envelope-from bapt@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 4DnNZ91y5Fz3CQR; Fri, 26 Feb 2021 21:48:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (unknown [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 1BDB347DA; Fri, 26 Feb 2021 21:48:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from [127.0.0.1] (10.246.39.62.rev.sfr.net [62.39.246.10]) (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 aniel.nours.eu (Postfix) with ESMTPSA id 043C13643D; Fri, 26 Feb 2021 22:48:14 +0100 (CET) Date: Fri, 26 Feb 2021 21:48:09 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: Enji Cooper <yaneurabeya@gmail.com> Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Message-ID: <44c9cd7b-e032-4613-81be-6214f37d2fbe@FreeBSD.org> In-Reply-To: <E1CBDB73-8A27-49D5-9B1A-7F33CA323528@gmail.com> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <E1CBDB73-8A27-49D5-9B1A-7F33CA323528@gmail.com> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <44c9cd7b-e032-4613-81be-6214f37d2fbe@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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 21:48:17 -0000 26 f=C3=A9vr. 2021 22:41:37 Enji Cooper <yaneurabeya@gmail.com>: > >> On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org> wrote= : >> >> The branch main has been updated by bapt: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e59= 93332ae14376f80 >> >> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 >> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin <bapt@FreeBSD.org> >> AuthorDate: 2021-02-23 16:17:32 +0000 >> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin <bapt@FreeBSD.org> >> CommitDate: 2021-02-25 13:25:32 +0000 >> >> =C2=A0=C2=A0 terminfo: add terminfo database >> >> =C2=A0=C2=A0 Tested by:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 manu, jbeich > > Hi Baptiste, > =C2=A0 A question and a comment: > =C2=A0 1. Was this reviewed in Phabricator? > =C2=A0 2. The details on why the terminfo database is being added are a b= it lean too to non-Unix users. It would be nice if the motivation for the c= hange was documented in the commit message. > Thanks! > -Enji No it was not reviewed in phabricator as it does not really bring any code,= but it was discussed on the mailing lists with a heads up on the plan and = the motivation, and all the reaction were in favor of this change. Note thay while it could have been better written this commit is the third = of a serie, where the first one explain a bit more things. Bapt From owner-dev-commits-src-all@freebsd.org Fri Feb 26 22:00:46 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEAD6550C04; Fri, 26 Feb 2021 22: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 4DnNrZ5MxWz3DF1; Fri, 26 Feb 2021 22: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 AB34A124D7; Fri, 26 Feb 2021 22: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 11QM0knr071318; Fri, 26 Feb 2021 22:00:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QM0kMA071317; Fri, 26 Feb 2021 22:00:46 GMT (envelope-from git) Date: Fri, 26 Feb 2021 22:00:46 GMT Message-Id: <202102262200.11QM0kMA071317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger <rscheff@FreeBSD.org> Subject: git: 9e83a6a556ed - main - Include new data sent in PRR calculation 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/main X-Git-Reftype: branch X-Git-Commit: 9e83a6a556ed8d9a2821de5d5f5c7d4b1292c694 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 22:00:46 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=9e83a6a556ed8d9a2821de5d5f5c7d4b1292c694 commit 9e83a6a556ed8d9a2821de5d5f5c7d4b1292c694 Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2021-02-26 21:30:33 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2021-02-26 21:31:58 +0000 Include new data sent in PRR calculation Reviewed By: #transport, kbowling MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28941 --- sys/netinet/tcp_input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 6338b7491a7f..7b0987eed358 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2595,7 +2595,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, imax(1, tp->snd_nxt - tp->snd_una); snd_cnt = howmany((long)tp->sackhint.prr_delivered * tp->snd_ssthresh, tp->sackhint.recover_fs) - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - @@ -3969,7 +3970,8 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) imax(1, tp->snd_nxt - tp->snd_una); snd_cnt = howmany((long)tp->sackhint.prr_delivered * tp->snd_ssthresh, tp->sackhint.recover_fs) - - tp->sackhint.sack_bytes_rexmit; + (tp->sackhint.sack_bytes_rexmit + + (tp->snd_nxt - tp->snd_recover)); } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - From owner-dev-commits-src-all@freebsd.org Fri Feb 26 22:03:31 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 492D3550AB0; Fri, 26 Feb 2021 22:03:31 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnNvk5H2gz3DN2; Fri, 26 Feb 2021 22:03:30 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1614377008; 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=5U12U8nzFxuYascZBGCfUWusxowOinHCTkGa8SrO/kw=; b=f4+OAdGgLdwVe60AxwnWX7QYfLhy4cApIlxuSuKtN9KYG22Oy1oxFtW4vBVf2KGF46Jvoy QVDvhDBZCpEsRXfwSOmws2YDJ+aXlUp7C10TQd88s96XgyciJgdsRXptzu1IkliDxGvQkR lKgOxPJ5asYHduBTKeOvA+WOb9m5pOY= 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 8ae885c9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 26 Feb 2021 22:03:28 +0000 (UTC) Date: Fri, 26 Feb 2021 23:03:27 +0100 From: Emmanuel Vadot <manu@bidouilliste.com> To: Enji Cooper <yaneurabeya@gmail.com> Cc: Baptiste Daroussin <bapt@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-Id: <20210226230327.2741e72fe3aef2918cc210d6@bidouilliste.com> In-Reply-To: <E1CBDB73-8A27-49D5-9B1A-7F33CA323528@gmail.com> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <E1CBDB73-8A27-49D5-9B1A-7F33CA323528@gmail.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: 4DnNvk5H2gz3DN2 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 22:03:31 -0000 On Fri, 26 Feb 2021 13:41:31 -0800 Enji Cooper <yaneurabeya@gmail.com> wrote: > > > On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org> wrote: > > > > The branch main has been updated by bapt: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae14376f80 > > > > commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > > Author: Baptiste Daroussin <bapt@FreeBSD.org> > > AuthorDate: 2021-02-23 16:17:32 +0000 > > Commit: Baptiste Daroussin <bapt@FreeBSD.org> > > CommitDate: 2021-02-25 13:25:32 +0000 > > > > terminfo: add terminfo database > > > > Tested by: manu, jbeich > > Hi Baptiste, > A question and a comment: > 1. Was this reviewed in Phabricator? > 2. The details on why the terminfo database is being added are a bit lean too to non-Unix users. Are you aware that we are developing a unix-like system ? > It would be nice if the motivation for the change was documented in the commit message. > Thanks! > -Enji -- Emmanuel Vadot <manu@bidouilliste.com> <manu@FreeBSD.org> From owner-dev-commits-src-all@freebsd.org Fri Feb 26 22:57:23 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61224551F86; Fri, 26 Feb 2021 22:57:23 +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 4DnQ5v10TDz3H0x; Fri, 26 Feb 2021 22:57:22 +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 11QMvJ0u032240; Fri, 26 Feb 2021 14:57:19 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 11QMvJsL032239; Fri, 26 Feb 2021 14:57:19 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net> Message-Id: <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database In-Reply-To: <44c9cd7b-e032-4613-81be-6214f37d2fbe@FreeBSD.org> To: Baptiste Daroussin <bapt@freebsd.org> Date: Fri, 26 Feb 2021 14:57:19 -0800 (PST) CC: Enji Cooper <yaneurabeya@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@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: 4DnQ5v10TDz3H0x 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 22:57:23 -0000 > > 26 f?vr. 2021 22:41:37 Enji Cooper <yaneurabeya@gmail.com>: > > > > >> On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org> wrote: > >> > >> The branch main has been updated by bapt: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae14376f80 > >> > >> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > >> Author:???? Baptiste Daroussin <bapt@FreeBSD.org> > >> AuthorDate: 2021-02-23 16:17:32 +0000 > >> Commit:???? Baptiste Daroussin <bapt@FreeBSD.org> > >> CommitDate: 2021-02-25 13:25:32 +0000 > >> > >> ?? terminfo: add terminfo database > >> > >> ?? Tested by:????? manu, jbeich > > > > Hi Baptiste, > > ? A question and a comment: > > ? 1. Was this reviewed in Phabricator? > > ? 2. The details on why the terminfo database is being added are a bit lean too to non-Unix users. It would be nice if the motivation for the change was documented in the commit message. > > Thanks! > > -Enji > > No it was not reviewed in phabricator as it does not really bring any code, but it was discussed on the mailing lists with a heads up on the plan and the motivation, and all the reaction were in favor of this change. On what mailing list as I do not recall such a thread, which means I probably need to add yet another list. > Note thay while it could have been better written this commit is the third of a serie, where the first one explain a bit more things. > > Bapt -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Fri Feb 26 23:06:11 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70BB6552291; Fri, 26 Feb 2021 23:06: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 4DnQJ32nclz3HbS; Fri, 26 Feb 2021 23:06: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 527C213273; Fri, 26 Feb 2021 23:06: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 11QN6BDQ054649; Fri, 26 Feb 2021 23:06:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11QN6Bk5054646; Fri, 26 Feb 2021 23:06:11 GMT (envelope-from git) Date: Fri, 26 Feb 2021 23:06:11 GMT Message-Id: <202102262306.11QN6Bk5054646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska <mm@FreeBSD.org> Subject: git: c170aa9f37e4 - main - zfs: add missing checks for unsupported features 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: c170aa9f37e4ce9338a0f26e3e983f7123ea8c1a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 23:06:11 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=c170aa9f37e4ce9338a0f26e3e983f7123ea8c1a commit c170aa9f37e4ce9338a0f26e3e983f7123ea8c1a Author: Martin Matuska <mm@FreeBSD.org> AuthorDate: 2021-02-26 21:52:41 +0000 Commit: Martin Matuska <mm@FreeBSD.org> CommitDate: 2021-02-26 23:05:50 +0000 zfs: add missing checks for unsupported features After the merge of OpenZFS master-9312e0fd1 it has become possible to import ZFS pools witn an active org.illumos:edonr feature on FreeBSD, leading to a panic. In addition, "zpool status" reported all pools without edonr as upgradable and "zpool upgrade -v" lists edonr in the list of upgradable features. This is an accepted but not yet included bugfix by upstream. Obtained from: https://github.com/openzfs/zfs/pull/11653 Differential Revision: https://reviews.freebsd.org/D28935 Reported by: garga (on freebsd-current@) Reviewed by: freqlabs X-MFC-with: ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 --- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 2 ++ sys/contrib/openzfs/cmd/ztest/ztest.c | 3 +++ sys/contrib/openzfs/lib/libzfs/libzfs_status.c | 2 ++ sys/contrib/openzfs/module/zcommon/zfeature_common.c | 2 ++ 4 files changed, 9 insertions(+) diff --git a/sys/contrib/openzfs/cmd/zpool/zpool_main.c b/sys/contrib/openzfs/cmd/zpool/zpool_main.c index 29252e6a24f4..e89eb3bea770 100644 --- a/sys/contrib/openzfs/cmd/zpool/zpool_main.c +++ b/sys/contrib/openzfs/cmd/zpool/zpool_main.c @@ -9030,6 +9030,8 @@ zpool_do_upgrade(int argc, char **argv) "---------------\n"); for (i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *fi = &spa_feature_table[i]; + if (!fi->fi_zfs_mod_supported) + continue; const char *ro = (fi->fi_flags & ZFEATURE_FLAG_READONLY_COMPAT) ? " (read-only compatible)" : ""; diff --git a/sys/contrib/openzfs/cmd/ztest/ztest.c b/sys/contrib/openzfs/cmd/ztest/ztest.c index cfa1290d78d1..1a030280704a 100644 --- a/sys/contrib/openzfs/cmd/ztest/ztest.c +++ b/sys/contrib/openzfs/cmd/ztest/ztest.c @@ -7592,6 +7592,9 @@ ztest_init(ztest_shared_t *zs) for (i = 0; i < SPA_FEATURES; i++) { char *buf; + if (!spa_feature_table[i].fi_zfs_mod_supported) + continue; + /* * 75% chance of using the log space map feature. We want ztest * to exercise both the code paths that use the log space map diff --git a/sys/contrib/openzfs/lib/libzfs/libzfs_status.c b/sys/contrib/openzfs/lib/libzfs/libzfs_status.c index fadae9388ac1..5e5cb5f5d440 100644 --- a/sys/contrib/openzfs/lib/libzfs/libzfs_status.c +++ b/sys/contrib/openzfs/lib/libzfs/libzfs_status.c @@ -482,6 +482,8 @@ check_status(nvlist_t *config, boolean_t isimport, return (ZPOOL_STATUS_COMPATIBILITY_ERR); for (i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *fi = &spa_feature_table[i]; + if (!fi->fi_zfs_mod_supported) + continue; if (pool_features[i] && !nvlist_exists(feat, fi->fi_guid)) return (ZPOOL_STATUS_FEAT_DISABLED); diff --git a/sys/contrib/openzfs/module/zcommon/zfeature_common.c b/sys/contrib/openzfs/module/zcommon/zfeature_common.c index e95a85e89ba2..fc0e09605eef 100644 --- a/sys/contrib/openzfs/module/zcommon/zfeature_common.c +++ b/sys/contrib/openzfs/module/zcommon/zfeature_common.c @@ -100,6 +100,8 @@ zfeature_is_supported(const char *guid) for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; + if (!feature->fi_zfs_mod_supported) + continue; if (strcmp(guid, feature->fi_guid) == 0) return (B_TRUE); } From owner-dev-commits-src-all@freebsd.org Fri Feb 26 23:09:06 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E205D5521E5; Fri, 26 Feb 2021 23:09:06 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_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 4DnQMQ14lQz3Hd2; Fri, 26 Feb 2021 23:09:05 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id 922D116057; Sat, 27 Feb 2021 00:08:58 +0100 (CET) Date: Sat, 27 Feb 2021 00:08:58 +0100 From: Steffen Nurpmeso <steffen@sdaoden.eu> To: "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net> Cc: Baptiste Daroussin <bapt@freebsd.org>, Enji Cooper <yaneurabeya@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Message-ID: <20210226230858.Zvbdf%steffen@sdaoden.eu> In-Reply-To: <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net> References: <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net> User-Agent: s-nail v14.9.21-105-g4b55359c OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4DnQMQ14lQz3Hd2 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of steffen@sdaoden.eu designates 217.144.132.164 as permitted sender) smtp.mailfrom=steffen@sdaoden.eu X-Spamd-Result: default: False [-0.36 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[217.144.132.164:from]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sdaoden.eu]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; RCPT_COUNT_FIVE(0.00)[6]; SPAMHAUS_ZRD(0.00)[217.144.132.164:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.94)[0.938]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE]; FREEMAIL_CC(0.00)[freebsd.org,gmail.com]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 23:09:06 -0000 Rodney W. Grimes wrote in <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net>: |On what mailing list as I do not recall such a thread, which means \ |I probably need to add yet another list. May i suggest https://www.youtube.com/watch?v=ozSLrhGZCDY (It is not about Daft Punk. ;-) It is very british indeed.) --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From owner-dev-commits-src-all@freebsd.org Fri Feb 26 23:19:33 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 783EC552783; Fri, 26 Feb 2021 23:19:33 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (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 4DnQbT2dV4z3JV0; Fri, 26 Feb 2021 23:19:33 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: by mail-oi1-x236.google.com with SMTP id w69so11507366oif.1; Fri, 26 Feb 2021 15:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gNnHD7XPIvyewMjzJrnUt38hlLiAP69hPszkvWiCbk4=; b=tjgLS9nLrK3junVo3o/864GHm28XM88UWCiSRzMafmEIn0SzlWgsJkWqMHVkCtBXht VfWldm3wJQnx8GyR0UsyMGhBDJoSu4hGI/niUput3VYe6dQxbUdUuTBodkIH7AY/5o3H T05s+KMX2IcwcKUlEYgzU2UH1no2dbAJnXMgPCEEfRGErQFHI1p9+Kmni3faQpxsHlMz J+alYd5o/d4S7PxGpDxevQavdUKV8lHwM+QIV+93U4sbMSLT4moTf9K7pqiTGtxS0bnT uv86Lyk6cpB6seyHXXoMqyfmthfe/rjdvl8fefXGVSr/gssZh9mMYi6E82nKijFgGUEC qDcg== 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=gNnHD7XPIvyewMjzJrnUt38hlLiAP69hPszkvWiCbk4=; b=BroL6jxnir/ZyCiESFVvC7/TafP9e5X30/UAcpc88xIyLoLv8Ce0F8+ESqjYeJ9N5c pobo4b87XdBeDyxYiCPjdGAB/MkMecE5jp4bGSetKvACv8AR9qvcUngPiKFMsfESQAx+ br2ZRMsw6w0FMIZwh0RUV/DbzBsUFXiO8kFjnHQ+l73Xt5gm5xJFvv1CvMFZZQfV/2HE bxT26im/lhT6eAmjncNOqKJj8OGwzCjJ7zz3GoGGM30AeRJpzeouqJ+RwtbwGrMLIo+f VTIY4S56/Tqw7rWGXd/9YLCrZ0Hy6D1TBE+ncoBbpztbzMXun7iedSNK+FmozpTLngsi m5aA== X-Gm-Message-State: AOAM533M7GFwoPAFISZS9OywbK2A+m8eighEiqaOgvDt9R2eP7Q6c3yy 3O0kMeCOWvbNSZjlF42RKS0ouTkaFUjpbTRoSf8= X-Google-Smtp-Source: ABdhPJxD2Mq5iZIx/jpCjJ8kbFPF8N+V3SLIvlQHAOuuSJGdBDGTHMSJ0emjYxaKuoUipIwWWmyFmDh8zx+GJnxViD4= X-Received: by 2002:aca:ed85:: with SMTP id l127mr3865309oih.152.1614381571436; Fri, 26 Feb 2021 15:19:31 -0800 (PST) MIME-Version: 1.0 References: <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net> <20210226230858.Zvbdf%steffen@sdaoden.eu> In-Reply-To: <20210226230858.Zvbdf%steffen@sdaoden.eu> From: Rob Wing <rob.fx907@gmail.com> Date: Fri, 26 Feb 2021 14:18:49 -0900 Message-ID: <CAF3+n_e1CyHVX8bwjnahdqCceAyg08aiE6Yn+i4Jq_Mzd2EueA@mail.gmail.com> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database To: Steffen Nurpmeso <steffen@sdaoden.eu> Cc: "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>, Baptiste Daroussin <bapt@freebsd.org>, Enji Cooper <yaneurabeya@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org> X-Rspamd-Queue-Id: 4DnQbT2dV4z3JV0 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 26 Feb 2021 23:19:33 -0000 Rod, https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076047.html not sure if that's the one Bapt was referencing...because you commented in that same thread as well, linked below. https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076051.html -Rob On Fri, Feb 26, 2021 at 2:09 PM Steffen Nurpmeso <steffen@sdaoden.eu> wrote: > Rodney W. Grimes wrote in > <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net>: > |On what mailing list as I do not recall such a thread, which means \ > |I probably need to add yet another list. > > May i suggest > > https://www.youtube.com/watch?v=ozSLrhGZCDY > > (It is not about Daft Punk. ;-) It is very british indeed.) > > --steffen > | > |Der Kragenbaer, The moon bear, > |der holt sich munter he cheerfully and one by one > |einen nach dem anderen runter wa.ks himself off > |(By Robert Gernhardt) > From owner-dev-commits-src-all@freebsd.org Sat Feb 27 02:36:35 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E754E558A1A; Sat, 27 Feb 2021 02:36:35 +0000 (UTC) (envelope-from lwhsu@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 4DnVyq69pbz3mbg; Sat, 27 Feb 2021 02:36:35 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: lwhsu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id C08FA70A2; Sat, 27 Feb 2021 02:36:35 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by mail-yb1-f178.google.com with SMTP id l8so10822396ybe.12; Fri, 26 Feb 2021 18:36:35 -0800 (PST) X-Gm-Message-State: AOAM532OuPCoulEAlMr8iFmaAs9hIlLslHMwNdSuf03aIUt0JArtfAQg 9C6qmRr2bhtufiNxWZ0VPInqyaCALi2zXWJr51I= X-Google-Smtp-Source: ABdhPJw1XcFW/nBF8811SgJzbI3kjT0wiPTcMdLKeRdnzcYxDcHWIpm0Rq3+0E+UdiBV15N5iZXo3uaDU0Nfu6/jHCk= X-Received: by 2002:a25:34d5:: with SMTP id b204mr8334370yba.497.1614393395250; Fri, 26 Feb 2021 18:36:35 -0800 (PST) MIME-Version: 1.0 References: <202102261907.11QJ7Oaq039195@gitrepo.freebsd.org> In-Reply-To: <202102261907.11QJ7Oaq039195@gitrepo.freebsd.org> From: Li-Wen Hsu <lwhsu@freebsd.org> Date: Sat, 27 Feb 2021 10:36:23 +0800 X-Gmail-Original-Message-ID: <CAKBkRUyPK9oPdHmkHsekFeLWnyZ4dLd=Foep7zsCwsQ0q95g9g@mail.gmail.com> Message-ID: <CAKBkRUyPK9oPdHmkHsekFeLWnyZ4dLd=Foep7zsCwsQ0q95g9g@mail.gmail.com> Subject: Re: git: bc3bba70d834 - main - inetd: Add examples from manual page and other sources To: Daniel Ebdrup Jensen <debdrup@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 02:36:36 -0000 On Sat, Feb 27, 2021 at 3:07 AM Daniel Ebdrup Jensen <debdrup@freebsd.org> wrote: > > The branch main has been updated by debdrup (doc committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=bc3bba70d834c169475302334b192bc90c17521e > > commit bc3bba70d834c169475302334b192bc90c17521e > Author: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> > AuthorDate: 2021-02-26 19:05:46 +0000 > Commit: Daniel Ebdrup Jensen <debdrup@FreeBSD.org> > CommitDate: 2021-02-26 19:07:03 +0000 > > inetd: Add examples from manual page and other sources ... > Reviewed by: kevans, brueffer, lwhsu, yuripv This is very minor, but for the record, I didn't click "accept" so I am a bit hesitant to be listed in the "Reviewed by" line because I think it implies I have reviewed everything and meet my standard to commit myself. I was just commenting on some very tiny stuff and help. I support the changes but I don't think my contribution is sufficient as a reviewer. I don't even list myself in the reviewers field in the differential. > Differential Revision: https://reviews.freebsd.org/D28882 ... > diff --git a/usr.sbin/inetd/inetd.conf b/usr.sbin/inetd/inetd.conf > index 65a3507a6dc2..7f5f6783a038 100644 > --- a/usr.sbin/inetd/inetd.conf > +++ b/usr.sbin/inetd/inetd.conf ... > +# Example entry for insecure rsync server > +# This is best combined with a VTI like if_ipsec(4) or wg(4) As we discussed in the differential, we can put if_wg(4) here, and they can be MFC'd together. BTW, still thanks very much for you to work on this! Best, Li-Wen From owner-dev-commits-src-all@freebsd.org Sat Feb 27 02:53:23 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0161559056; Sat, 27 Feb 2021 02:53:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 4DnWLC4K2Vz3nbg; Sat, 27 Feb 2021 02:53:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42f.google.com with SMTP id b145so7515591pfb.4; Fri, 26 Feb 2021 18:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=lv/u85Mq3jrT+0t4jeH0fcu6/qJksJzgWPoDib13ucs=; b=T5BhygvKPuYjscyrxrogf+NGvfONtanEguEtvswF9aTb93xz/HE+meq/DsBTXt2gns l9O9oZ9AryXnjDypJyQVuSVZ2ChYP5kMjFypMnsIrCmrPuwSqMU2cCz0/7XfvrHouc4A w7ix9fhuzJZUltyR2l/9XvajyRaGSGBINc8rO/JnghrpCoVuK2NiVzwEt12yS3IGlj3q q3RbPV+7lQJGZyYK4afTQVYFuUVM0jaU5/bKgkZwFiP5AjjpzzneNoMcVsNLneeC+yrJ XtMIyL4GL+wn41nZyFm8ZZDN30rvLSHhctLQoYaR+cGQpw7ALwgdFMicpkdOe7H1q1SZ GpBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=lv/u85Mq3jrT+0t4jeH0fcu6/qJksJzgWPoDib13ucs=; b=Tc8sr5mpZC9bafE9jCSPxZmbDVV+8kq1wlqqH4YWRG5tt4Le12uhd+Hlq76Se2Bd+h eoofYMpm5W7uGyYwNHvq74aXILpPGp3ZvPMb4CalbN3W9ZzXWIspQKprgfCjJO6v62E8 U1OYRFgN1oXnUlVhnfRJ6qlwRjAV/QminHRdQNt35fZN58DpUrRtFGy0KF2Q9pyQG5sV EueA+yRCLkc75mApVtrnchLCKSzdSJ5s+9FUDaqooFXPcux0rq7Ui+fr6ycRbaXGKgZk NIu+x9uMt3lT7jnM5Ktb6EREnXpHC2WmViJFl7RYH5twah6OLfP7Q6tJm5Gv8svLM351 0pSg== X-Gm-Message-State: AOAM532brLtvyTiuw/xOjQbWeKv76cSRw8dUPSwEsTF2VTnIHXxR25/S 0i/pl+kYG6YCvKnGfxvoa+YrLs8JwsLmTg== X-Google-Smtp-Source: ABdhPJxS+5uK4mTbk6q4ievv1gOFGPNt9VvA2obYsG5JdXdvL1ZU66QVbpb15QXWEnR4iXpDPic7Dw== X-Received: by 2002:aa7:8ad2:0:b029:1ee:16f0:7c70 with SMTP id b18-20020aa78ad20000b02901ee16f07c70mr6053456pfd.58.1614394401713; Fri, 26 Feb 2021 18:53:21 -0800 (PST) Received: from [192.168.20.29] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id e8sm7036336pfl.101.2021.02.26.18.53.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2021 18:53:20 -0800 (PST) From: Enji Cooper <yaneurabeya@gmail.com> Message-Id: <305BED81-416F-4A7F-B334-29A8B5DFA01D@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Date: Fri, 26 Feb 2021 18:53:20 -0800 In-Reply-To: <20210226230327.2741e72fe3aef2918cc210d6@bidouilliste.com> Cc: Baptiste Daroussin <bapt@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> To: Emmanuel Vadot <manu@bidouilliste.com> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <E1CBDB73-8A27-49D5-9B1A-7F33CA323528@gmail.com> <20210226230327.2741e72fe3aef2918cc210d6@bidouilliste.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DnWLC4K2Vz3nbg 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 02:53:23 -0000 > On Feb 26, 2021, at 2:03 PM, Emmanuel Vadot <manu@bidouilliste.com> = wrote: >=20 > On Fri, 26 Feb 2021 13:41:31 -0800 > Enji Cooper <yaneurabeya@gmail.com <mailto:yaneurabeya@gmail.com>> = wrote: >=20 >>=20 >>> On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org> = wrote: >>>=20 >>> The branch main has been updated by bapt: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e5993332ae= 14376f80 >>>=20 >>> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 >>> Author: Baptiste Daroussin <bapt@FreeBSD.org> >>> AuthorDate: 2021-02-23 16:17:32 +0000 >>> Commit: Baptiste Daroussin <bapt@FreeBSD.org> >>> CommitDate: 2021-02-25 13:25:32 +0000 >>>=20 >>> terminfo: add terminfo database >>>=20 >>> Tested by: manu, jbeich >>=20 >> Hi Baptiste, >> A question and a comment: >> 1. Was this reviewed in Phabricator? >> 2. The details on why the terminfo database is being added are a = bit lean too to non-Unix users. >=20 > Are you aware that we are developing a unix-like system ? =E2=80=9Cnon-Unix=E2=80=9D was poor wording. What I was trying to imply = was the fact that the commit message described what was done, but not = what or what could be gained after the commit. If I tried explaining this information to someone who had no idea what = terminfo was, they would be puzzled about what was gained through this = commit. Put differently: if I had to explain to my non-technical friends what I = was doing with this commit message alone, I would probably receive very = puzzled looks from them. Cheers, -Enji= From owner-dev-commits-src-all@freebsd.org Sat Feb 27 02:55:04 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90DFC55949E; Sat, 27 Feb 2021 02:55:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (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 4DnWN751JLz3nys; Sat, 27 Feb 2021 02:55:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x632.google.com with SMTP id p5so6291401plo.4; Fri, 26 Feb 2021 18:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=b1m9FrJChKUJ9gWFp7O/6SyuPyDBO09lyqK6ut7v4Tc=; b=e3S2BP+HcdvXg4N/MK99Zr4WC+seSmhKIGSgGp/whYagdhCTz7RQIXQfM3I47v/cFK uV+76hrjjqwJ4tZkzxH1hE99CVWliBiWOKIEjabfvMmaM9AyySA6p48oRrjgBckj+POg n1YaRLrKCHn0CreqQyBvZXak0hntF1FU4ILWI5tYcSGDRpe0mgu2bKzUN3Dnzafr3Kvb RCNBx3pK4t4SZJmsWfhshgHVYb6zP5h9tMi8fDJKJBiLQ6B+19XS/R1I3nHZM3ce+1gN oerTvJuk1A8cKKBEnmQXOhiu+s5c0+LK1X4EZDKlkQ3SbInY2ZXY+YloKIYZG5BwXr2r 5c5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=b1m9FrJChKUJ9gWFp7O/6SyuPyDBO09lyqK6ut7v4Tc=; b=IjF3NJhBVZkmbYGpoWmGiJpRI+I+XslUTPA5yRrkAhYNtDI4kuhY3NiYUA/wC024o0 2xTD7GNe6eq3Exgda65Y8NombBJbousuRs3zy4hgtpYBHHHXPT6jGisZeJdzalADwK+r EklAITCzVmcpOMEDZTNj58h246Zyb9mJ6qBavdFYnW0e11j1y4U+5FCR69qOuKZ9/Bwm Cj7gwT69/MN+cActZveCr4YHvfNjbhd4KNgyuYSr5v22J+7GwRCpV9Myxb+h44JtgB2X yWcS910qpVYFAeJ6FxqWJ6a7d/d0Gk0MNB9jHjsHHwnzAM3mjDiu/ljxhDYNt1tOPkW2 VoMg== X-Gm-Message-State: AOAM531cjhkJvkBlpTYVwxDX+nSigw/6yQVEdN2K3010rEMU2cdIySU+ 3QxT2N9mKCXae7WTW9y12DQ= X-Google-Smtp-Source: ABdhPJz82rqbIQ1eXH9avVYOEUXD5A7il/yAC3oWPreJbR5RlTNn14MO3k2RnbZlLWEKwyOATKIdPQ== X-Received: by 2002:a17:90a:2ac7:: with SMTP id i7mr6170268pjg.82.1614394502105; Fri, 26 Feb 2021 18:55:02 -0800 (PST) Received: from [192.168.20.29] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s13sm9893996pjm.1.2021.02.26.18.55.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2021 18:55:01 -0800 (PST) From: Enji Cooper <yaneurabeya@gmail.com> Message-Id: <C584AE80-55A4-4B7E-9896-8648A430D18D@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database Date: Fri, 26 Feb 2021 18:55:00 -0800 In-Reply-To: <305BED81-416F-4A7F-B334-29A8B5DFA01D@gmail.com> Cc: Baptiste Daroussin <bapt@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> To: Emmanuel Vadot <manu@bidouilliste.com> References: <202102251327.11PDR4eC083842@gitrepo.freebsd.org> <E1CBDB73-8A27-49D5-9B1A-7F33CA323528@gmail.com> <20210226230327.2741e72fe3aef2918cc210d6@bidouilliste.com> <305BED81-416F-4A7F-B334-29A8B5DFA01D@gmail.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DnWN751JLz3nys X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=e3S2BP+H; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::632 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-1.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[73.19.52.228:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::632:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::632:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::632: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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 02:55:04 -0000 > On Feb 26, 2021, at 6:53 PM, Enji Cooper <yaneurabeya@gmail.com> = wrote: >=20 >>=20 >> On Feb 26, 2021, at 2:03 PM, Emmanuel Vadot <manu@bidouilliste.com = <mailto:manu@bidouilliste.com>> wrote: >>=20 >> On Fri, 26 Feb 2021 13:41:31 -0800 >> Enji Cooper <yaneurabeya@gmail.com <mailto:yaneurabeya@gmail.com>> = wrote: >>=20 >>>=20 >>>> On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org = <mailto:bapt@FreeBSD.org>> wrote: >>>>=20 >>>> The branch main has been updated by bapt: >>>>=20 >>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e5993332ae= 14376f80 = <https://cgit.freebsd.org/src/commit/?id=3D2a50a9de8340f08bd876e9e5993332a= e14376f80> >>>>=20 >>>> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 >>>> Author: Baptiste Daroussin <bapt@FreeBSD.org = <mailto:bapt@FreeBSD.org>> >>>> AuthorDate: 2021-02-23 16:17:32 +0000 >>>> Commit: Baptiste Daroussin <bapt@FreeBSD.org = <mailto:bapt@FreeBSD.org>> >>>> CommitDate: 2021-02-25 13:25:32 +0000 >>>>=20 >>>> terminfo: add terminfo database >>>>=20 >>>> Tested by: manu, jbeich >>>=20 >>> Hi Baptiste, >>> A question and a comment: >>> 1. Was this reviewed in Phabricator? >>> 2. The details on why the terminfo database is being added are a = bit lean too to non-Unix users. >>=20 >> Are you aware that we are developing a unix-like system ? (Obviously it=E2=80=99s Friday night and I need to proofread before I = hit send) > =E2=80=9Cnon-Unix=E2=80=9D was poor wording. What I was trying to = imply was the fact that the commit message described what was done, but = not what or what could be gained after the commit. but not what or what -> but not why or what (that=E2=80=99s what I meant to say..) -Enji= From owner-dev-commits-src-all@freebsd.org Sat Feb 27 06:57:13 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A4BA55D8E4; Sat, 27 Feb 2021 06:57:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DnclY24YYz4VdZ; Sat, 27 Feb 2021 06:57:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 208AC972C; Sat, 27 Feb 2021 06:57:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from [127.0.0.1] (10.246.39.62.rev.sfr.net [62.39.246.10]) (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 aniel.nours.eu (Postfix) with ESMTPSA id 4FC0436B35; Sat, 27 Feb 2021 07:57:11 +0100 (CET) Date: Sat, 27 Feb 2021 06:57:07 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: "Rodney W. Grimes" <rgrimes@freebsd.org> Cc: Enji Cooper <yaneurabeya@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org> Message-ID: <f60418c3-aa57-4eb2-9d29-3e1af86cc3c2@FreeBSD.org> In-Reply-To: <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net> References: <202102262257.11QMvJsL032239@gndrsh.dnsmgr.net> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <f60418c3-aa57-4eb2-9d29-3e1af86cc3c2@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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 06:57:13 -0000 26 f=C3=A9vr. 2021 23:57:25 Rodney W. Grimes <freebsd@gndrsh.dnsmgr.net>: >> >> 26 f?vr. 2021 22:41:37 Enji Cooper <yaneurabeya@gmail.com>: >> >>> >>>> On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org> wro= te: >>>> >>>> The branch main has been updated by bapt: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D2a50a9de8340f08bd876e9e= 5993332ae14376f80 >>>> >>>> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 >>>> Author:???? Baptiste Daroussin <bapt@FreeBSD.org> >>>> AuthorDate: 2021-02-23 16:17:32 +0000 >>>> Commit:???? Baptiste Daroussin <bapt@FreeBSD.org> >>>> CommitDate: 2021-02-25 13:25:32 +0000 >>>> >>>> ?? terminfo: add terminfo database >>>> >>>> ?? Tested by:????? manu, jbeich >>> >>> Hi Baptiste, >>> ? A question and a comment: >>> ? 1. Was this reviewed in Phabricator? >>> ? 2. The details on why the terminfo database is being added are a bit = lean too to non-Unix users. It would be nice if the motivation for the chan= ge was documented in the commit message. >>> Thanks! >>> -Enji >> >> No it was not reviewed in phabricator as it does not really bring any co= de, but it was discussed on the mailing lists with a heads up on the plan a= nd the motivation, and all the reaction were in favor of this change. > > On what mailing list as I do not recall such a thread, which means I prob= ably need to add yet another list.=C2=A0 > >> Note thay while it could have been better written this commit is the thi= rd of a serie, where the first one explain a bit more things. >> >> Bapt > > -- > Rod Grimes=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= rgrimes@freebsd.org https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076051.html From owner-dev-commits-src-all@freebsd.org Sat Feb 27 08:23:17 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 317D655FEB4; Sat, 27 Feb 2021 08:23: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 4Dnffs0gf3z4Znr; Sat, 27 Feb 2021 08:23: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 09F5B1A4ED; Sat, 27 Feb 2021 08:23: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 11R8NGRN093853; Sat, 27 Feb 2021 08:23:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11R8NG8b093852; Sat, 27 Feb 2021 08:23:16 GMT (envelope-from git) Date: Sat, 27 Feb 2021 08:23:16 GMT Message-Id: <202102270823.11R8NG8b093852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: c01da939b099 - main - cardbus: Be sure to acquire Giant when calling into newbus 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: c01da939b0998f8de068a23c9016c377e761255e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 08:23:17 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c01da939b0998f8de068a23c9016c377e761255e commit c01da939b0998f8de068a23c9016c377e761255e Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-02-27 07:00:52 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-02-27 08:23:09 +0000 cardbus: Be sure to acquire Giant when calling into newbus Acquire Giant in cardbus_detach_card. This used to be done above us, but no more. Tested by: kargl@ MFC After: 3 days --- sys/dev/cardbus/cardbus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 391267944ec4..50a21dfc0b82 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -256,10 +256,11 @@ cardbus_detach_card(device_t cbdev) { int err = 0; + mtx_lock(&Giant); err = bus_generic_detach(cbdev); - if (err) - return (err); - err = device_delete_children(cbdev); + if (err == 0) + err = device_delete_children(cbdev); + mtx_unlock(&Giant); if (err) return (err); From owner-dev-commits-src-all@freebsd.org Sat Feb 27 09:27:47 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDDD45614CF; Sat, 27 Feb 2021 09:27: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 4Dnh5H5zXSz4dqv; Sat, 27 Feb 2021 09:27: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 BFF371B788; Sat, 27 Feb 2021 09:27: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 11R9RlIX073704; Sat, 27 Feb 2021 09:27:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11R9Rl5I073703; Sat, 27 Feb 2021 09:27:47 GMT (envelope-from git) Date: Sat, 27 Feb 2021 09:27:47 GMT Message-Id: <202102270927.11R9Rl5I073703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome <tsoome@FreeBSD.org> Subject: git: becaac3972f1 - main - loader: use display pixel density for font autoselection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: becaac3972f1fde4e3c44516399468ba5ca65c9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 09:27:47 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=becaac3972f1fde4e3c44516399468ba5ca65c9b commit becaac3972f1fde4e3c44516399468ba5ca65c9b Author: Toomas Soome <tsoome@FreeBSD.org> AuthorDate: 2021-02-20 08:51:28 +0000 Commit: Toomas Soome <tsoome@FreeBSD.org> CommitDate: 2021-02-27 09:26:02 +0000 loader: use display pixel density for font autoselection Calculate font size from 16 density independent pixels (dp) by using: size = 16 * ppi/160 * display_factor We are specifying font size 16dp, and assuming 1dp = 160ppi. Also apply scaling factor 2 (display_factor). MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28849 --- stand/common/gfx_fb.c | 110 +++++++++++++++++++++++++++++++++++++++++ stand/common/gfx_fb.h | 2 + stand/efi/libefi/efi_console.c | 23 ++++++--- stand/efi/loader/framebuffer.c | 96 +++++++++++++++++++++++++++++++++-- stand/i386/libi386/vbe.c | 25 ++++++---- 5 files changed, 237 insertions(+), 19 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 02a0a3d2be22..77cf1d39854f 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -1863,6 +1863,113 @@ reset_font_flags(void) } } +/* Return w^2 + h^2 or 0, if the dimensions are unknown */ +static unsigned +edid_diagonal_squared(void) +{ + unsigned w, h; + + if (edid_info == NULL) + return (0); + + w = edid_info->display.max_horizontal_image_size; + h = edid_info->display.max_vertical_image_size; + + /* If either one is 0, we have aspect ratio, not size */ + if (w == 0 || h == 0) + return (0); + + /* + * some monitors encode the aspect ratio instead of the physical size. + */ + if ((w == 16 && h == 9) || (w == 16 && h == 10) || + (w == 4 && h == 3) || (w == 5 && h == 4)) + return (0); + + /* + * translate cm to inch, note we scale by 100 here. + */ + w = w * 100 / 254; + h = h * 100 / 254; + + /* Return w^2 + h^2 */ + return (w * w + h * h); +} + +/* + * calculate pixels per inch. + */ +static unsigned +gfx_get_ppi(void) +{ + unsigned dp, di; + + di = edid_diagonal_squared(); + if (di == 0) + return (0); + + dp = gfx_state.tg_fb.fb_width * + gfx_state.tg_fb.fb_width + + gfx_state.tg_fb.fb_height * + gfx_state.tg_fb.fb_height; + + return (isqrt(dp / di)); +} + +/* + * Calculate font size from density independent pixels (dp): + * ((16dp * ppi) / 160) * display_factor. + * Here we are using fixed constants: 1dp == 160 ppi and + * display_factor 2. + * + * We are rounding font size up and are searching for font which is + * not smaller than calculated size value. + */ +static vt_font_bitmap_data_t * +gfx_get_font(void) +{ + unsigned ppi, size; + vt_font_bitmap_data_t *font = NULL; + struct fontlist *fl, *next; + + /* Text mode is not supported here. */ + if (gfx_state.tg_fb_type == FB_TEXT) + return (NULL); + + ppi = gfx_get_ppi(); + if (ppi == 0) + return (NULL); + + /* + * We will search for 16dp font. + * We are using scale up by 10 for roundup. + */ + size = (16 * ppi * 10) / 160; + /* Apply display factor 2. */ + size = roundup(size * 2, 10) / 10; + + STAILQ_FOREACH(fl, &fonts, font_next) { + next = STAILQ_NEXT(fl, font_next); + + /* + * If this is last font or, if next font is smaller, + * we have our font. Make sure, it actually is loaded. + */ + if (next == NULL || next->font_data->vfbd_height < size) { + font = fl->font_data; + if (font->vfbd_font == NULL || + fl->font_flags == FONT_RELOAD) { + if (fl->font_load != NULL && + fl->font_name != NULL) + font = fl->font_load(fl->font_name); + } + break; + } + } + + return (font); +} + static vt_font_bitmap_data_t * set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) { @@ -1887,6 +1994,9 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) } } + if (font == NULL) + font = gfx_get_font(); + if (font != NULL) { *rows = height / font->vfbd_height; *cols = width / font->vfbd_width; diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index 04076a2c6d38..ac63d7939cef 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -109,6 +109,8 @@ struct vesa_edid_info { uint8_t checksum; } __packed; +extern struct vesa_edid_info *edid_info; + #define STD_TIMINGS 8 #define DET_TIMINGS 4 diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 3cbd121c41da..0c40b362f276 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -952,13 +952,24 @@ cons_update_mode(bool use_gfx_mode) /* * setup_font() can adjust terminal size. - * Note, we do use UEFI terminal dimensions first, - * this is because the font selection will attempt - * to achieve at least this terminal dimension and - * we do not end up with too small font. + * We can see two kind of bad happening. + * We either can get too small console font - requested + * terminal size is large, display resolution is + * large, and we get very small font. + * Or, we can get too large font - requested + * terminal size is small and this will cause large + * font to be selected. + * Now, the setup_font() is updated to consider + * display density and this should give us mostly + * acceptable font. However, the catch is, not all + * display devices will give us display density. + * Still, we do hope, external monitors do - this is + * where the display size will matter the most. + * And for laptop screens, we should still get good + * results by requesting 80x25 terminal. */ - gfx_state.tg_tp.tp_row = rows; - gfx_state.tg_tp.tp_col = cols; + gfx_state.tg_tp.tp_row = 25; + gfx_state.tg_tp.tp_col = 80; setup_font(&gfx_state, fb_height, fb_width); rows = gfx_state.tg_tp.tp_row; cols = gfx_state.tg_tp.tp_col; diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index 509c41844dcb..adb9dfb62cee 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include <efilib.h> #include <efiuga.h> #include <efipciio.h> +#include <Protocol/EdidActive.h> +#include <Protocol/EdidDiscovered.h> #include <machine/metadata.h> #include "bootstrap.h" @@ -47,6 +49,12 @@ static EFI_GUID conout_guid = EFI_CONSOLE_OUT_DEVICE_GUID; EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; +static EFI_GUID active_edid_guid = EFI_EDID_ACTIVE_PROTOCOL_GUID; +static EFI_GUID discovered_edid_guid = EFI_EDID_DISCOVERED_PROTOCOL_GUID; +static EFI_HANDLE gop_handle; + +/* Cached EDID. */ +struct vesa_edid_info *edid_info = NULL; static EFI_GRAPHICS_OUTPUT *gop; static EFI_UGA_DRAW_PROTOCOL *uga; @@ -467,10 +475,71 @@ efifb_from_uga(struct efi_fb *efifb) return (0); } +/* + * Fetch EDID info. Caller must free the buffer. + */ +static struct vesa_edid_info * +efifb_gop_get_edid(EFI_HANDLE h) +{ + const uint8_t magic[] = EDID_MAGIC; + EFI_EDID_ACTIVE_PROTOCOL *edid; + struct vesa_edid_info *edid_infop; + EFI_GUID *guid; + EFI_STATUS status; + size_t size; + + guid = &active_edid_guid; + status = BS->OpenProtocol(h, guid, (void **)&edid, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (status != EFI_SUCCESS || + edid->SizeOfEdid == 0) { + guid = &discovered_edid_guid; + status = BS->OpenProtocol(h, guid, (void **)&edid, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (status != EFI_SUCCESS || + edid->SizeOfEdid == 0) + return (NULL); + } + + size = MAX(sizeof(*edid_infop), edid->SizeOfEdid); + + edid_infop = calloc(1, size); + if (edid_infop == NULL) + return (NULL); + + memcpy(edid_infop, edid->Edid, edid->SizeOfEdid); + + /* Validate EDID */ + if (memcmp(edid_infop, magic, sizeof (magic)) != 0) + goto error; + + if (edid_infop->header.version != 1) + goto error; + + return (edid_infop); +error: + free(edid_infop); + return (NULL); +} + +static bool +efifb_get_edid(edid_res_list_t *res) +{ + bool rv = false; + + if (edid_info == NULL) + edid_info = efifb_gop_get_edid(gop_handle); + + if (edid_info != NULL) + rv = gfx_get_edid_resolution(edid_info, res); + + return (rv); +} + int efi_find_framebuffer(teken_gfx_t *gfx_state) { - EFI_HANDLE h, *hlist; + EFI_HANDLE *hlist; UINTN nhandles, i, hsize; struct efi_fb efifb; EFI_STATUS status; @@ -498,23 +567,25 @@ efi_find_framebuffer(teken_gfx_t *gfx_state) /* * Search for ConOut protocol, if not found, use first handle. */ - h = *hlist; + gop_handle = *hlist; for (i = 0; i < nhandles; i++) { void *dummy = NULL; status = OpenProtocolByHandle(hlist[i], &conout_guid, &dummy); if (status == EFI_SUCCESS) { - h = hlist[i]; + gop_handle = hlist[i]; break; } } - status = OpenProtocolByHandle(h, &gop_guid, (void **)&gop); + status = OpenProtocolByHandle(gop_handle, &gop_guid, (void **)&gop); free(hlist); if (status == EFI_SUCCESS) { gfx_state->tg_fb_type = FB_GOP; gfx_state->tg_private = gop; + if (edid_info == NULL) + edid_info = efifb_gop_get_edid(gop_handle); } else { status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (status == EFI_SUCCESS) { @@ -767,9 +838,25 @@ command_gop(int argc, char *argv[]) } else if (strcmp(argv[1], "off") == 0) { (void) cons_update_mode(false); } else if (strcmp(argv[1], "get") == 0) { + edid_res_list_t res; + if (argc != 2) goto usage; + TAILQ_INIT(&res); efifb_from_gop(&efifb, gop->Mode, gop->Mode->Info); + if (efifb_get_edid(&res)) { + struct resolution *rp; + + printf("EDID"); + while ((rp = TAILQ_FIRST(&res)) != NULL) { + printf(" %dx%d", rp->width, rp->height); + TAILQ_REMOVE(&res, rp, next); + free(rp); + } + printf("\n"); + } else { + printf("no EDID information\n"); + } print_efifb(gop->Mode->Mode, &efifb, 1); printf("\n"); } else if (!strcmp(argv[1], "list")) { @@ -778,6 +865,7 @@ command_gop(int argc, char *argv[]) if (argc != 2) goto usage; + pager_open(); for (mode = 0; mode < gop->Mode->MaxMode; mode++) { status = gop->QueryMode(gop, mode, &infosz, &info); diff --git a/stand/i386/libi386/vbe.c b/stand/i386/libi386/vbe.c index 0e9f6929ac05..ef4daffa8380 100644 --- a/stand/i386/libi386/vbe.c +++ b/stand/i386/libi386/vbe.c @@ -51,6 +51,7 @@ static struct modeinfoblock *vbe_mode; static uint16_t *vbe_mode_list; static size_t vbe_mode_list_size; +struct vesa_edid_info *edid_info = NULL; /* The default VGA color palette format is 6 bits per primary color. */ int palette_format = 6; @@ -836,34 +837,40 @@ vbe_dump_mode(int modenum, struct modeinfoblock *mi) static bool vbe_get_edid(edid_res_list_t *res) { - struct vesa_edid_info *edid_info; + struct vesa_edid_info *edidp; const uint8_t magic[] = EDID_MAGIC; int ddc_caps; bool ret = false; + if (edid_info != NULL) + return (gfx_get_edid_resolution(edid_info, res)); + ddc_caps = biosvbe_ddc_caps(); if (ddc_caps == 0) { return (ret); } - edid_info = bio_alloc(sizeof (*edid_info)); - if (edid_info == NULL) + edidp = bio_alloc(sizeof(*edidp)); + if (edidp == NULL) return (ret); - memset(edid_info, 0, sizeof (*edid_info)); + memset(edidp, 0, sizeof(*edidp)); - if (VBE_ERROR(biosvbe_ddc_read_edid(0, edid_info))) + if (VBE_ERROR(biosvbe_ddc_read_edid(0, edidp))) goto done; - if (memcmp(edid_info, magic, sizeof (magic)) != 0) + if (memcmp(edidp, magic, sizeof(magic)) != 0) goto done; /* Unknown EDID version. */ - if (edid_info->header.version != 1) + if (edidp->header.version != 1) goto done; - ret = gfx_get_edid_resolution(edid_info, res); + ret = gfx_get_edid_resolution(edidp, res); + edid_info = malloc(sizeof(*edid_info)); + if (edid_info != NULL) + memcpy(edid_info, edidp, sizeof (*edid_info)); done: - bio_free(edid_info, sizeof (*edid_info)); + bio_free(edidp, sizeof(*edidp)); return (ret); } From owner-dev-commits-src-all@freebsd.org Sat Feb 27 14:26:25 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F7B854811B; Sat, 27 Feb 2021 14:26:25 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dnpjs0C7wz4vPP; Sat, 27 Feb 2021 14:26:24 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 11REQMOK035063; Sat, 27 Feb 2021 06:26:22 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 11REQMfl035062; Sat, 27 Feb 2021 06:26:22 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net> Message-Id: <202102271426.11REQMfl035062@gndrsh.dnsmgr.net> Subject: Re: git: 2a50a9de8340 - main - terminfo: add terminfo database In-Reply-To: <f60418c3-aa57-4eb2-9d29-3e1af86cc3c2@FreeBSD.org> To: Baptiste Daroussin <bapt@freebsd.org> Date: Sat, 27 Feb 2021 06:26:22 -0800 (PST) CC: "Rodney W. Grimes" <rgrimes@freebsd.org>, Enji Cooper <yaneurabeya@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@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: 4Dnpjs0C7wz4vPP 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 14:26:25 -0000 > 26 f?vr. 2021 23:57:25 Rodney W. Grimes <freebsd@gndrsh.dnsmgr.net>: > > >> > >> 26 f?vr. 2021 22:41:37 Enji Cooper <yaneurabeya@gmail.com>: > >> > >>> > >>>> On Feb 25, 2021, at 5:27 AM, Baptiste Daroussin <bapt@FreeBSD.org> wrote: > >>>> > >>>> The branch main has been updated by bapt: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae14376f80 > >>>> > >>>> commit 2a50a9de8340f08bd876e9e5993332ae14376f80 > >>>> Author:???? Baptiste Daroussin <bapt@FreeBSD.org> > >>>> AuthorDate: 2021-02-23 16:17:32 +0000 > >>>> Commit:???? Baptiste Daroussin <bapt@FreeBSD.org> > >>>> CommitDate: 2021-02-25 13:25:32 +0000 > >>>> > >>>> ?? terminfo: add terminfo database > >>>> > >>>> ?? Tested by:????? manu, jbeich > >>> > >>> Hi Baptiste, > >>> ? A question and a comment: > >>> ? 1. Was this reviewed in Phabricator? > >>> ? 2. The details on why the terminfo database is being added are a bit lean too to non-Unix users. It would be nice if the motivation for the change was documented in the commit message. > >>> Thanks! > >>> -Enji > >> > >> No it was not reviewed in phabricator as it does not really bring any code, but it was discussed on the mailing lists with a heads up on the plan and the motivation, and all the reaction were in favor of this change. > > > > On what mailing list as I do not recall such a thread, which means I probably need to add yet another list.? > > > >> Note thay while it could have been better written this commit is the third of a serie, where the first one explain a bit more things. > >> > >> Bapt > > > > -- > > Rod Grimes???????????????????????????????????????????????? rgrimes@freebsd.org > > https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076051.html A discssion indeed, which I even participated in, but it DID not in anyway discuss the impact, it didnt even imply there would be any change to base system behavior, and that should always be discussed before such visible UI behavior changes occur. I can promise you there well be feedback, probably in both directions from the userbase on this "yet another default behavior change." My understanding is that those who have been using the port of terminfo have being doing so for some time, and it does not alter the base system behavior when installed, I expected that this was what you had proposed to do, basically eliminate the port and provide the functionality that it does in the base system without altering the base system behavior. -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Sat Feb 27 15:40:30 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2823054A2D7; Sat, 27 Feb 2021 15:40: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 4DnrML0fFPz3Gl8; Sat, 27 Feb 2021 15:40: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 049742040A; Sat, 27 Feb 2021 15:40: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 11RFeTYw068094; Sat, 27 Feb 2021 15:40:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RFeTN6068093; Sat, 27 Feb 2021 15:40:29 GMT (envelope-from git) Date: Sat, 27 Feb 2021 15:40:29 GMT Message-Id: <202102271540.11RFeTN6068093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin <mav@FreeBSD.org> Subject: git: 9d9fd8b79f0e - main - Micro-optimize OOA queue processing. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d9fd8b79f0ebe59f791c8225fa01ab59858b7b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 15:40:30 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9d9fd8b79f0ebe59f791c8225fa01ab59858b7b5 commit 9d9fd8b79f0ebe59f791c8225fa01ab59858b7b5 Author: Alexander Motin <mav@FreeBSD.org> AuthorDate: 2021-02-27 15:14:05 +0000 Commit: Alexander Motin <mav@FreeBSD.org> CommitDate: 2021-02-27 15:40:24 +0000 Micro-optimize OOA queue processing. - Move ctl_get_cmd_entry() calls from every OOA traversal to when the requests first inserted, storing seridx in struct ctl_scsiio. - Move some checks out of the loop in ctl_check_ooa(). - Replace checks for errors that can not happen with asserts. - Transpose ctl_serialize_table, so that any OOA traversal accessed only one row (cache line). Compact it from enum to uint8_t. - Optimize static branch predictions in hottest places. Due to O(n) nature on deep LUN queues this can be the hottest code path in CTL, and additional 20% of IOPS I see in some 4KB I/O tests are good to have in reserve. About 50% of CPU time here according to the profiles is now spent in two memory accesses per traversed request in OOA. Sponsored by: iXsystems, Inc. MFC after: 2 weeks --- sys/cam/ctl/ctl.c | 238 ++++++++++++++++++++------------------------ sys/cam/ctl/ctl_io.h | 2 +- sys/cam/ctl/ctl_private.h | 18 ++-- sys/cam/ctl/ctl_ser_table.c | 41 ++++---- 4 files changed, 135 insertions(+), 164 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 18a82ca72d76..cae6dd4aa101 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -500,9 +500,10 @@ static int ctl_inquiry_std(struct ctl_scsiio *ctsio); static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len); static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2, bool seq); -static ctl_action ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2); +static ctl_action ctl_seq_check(union ctl_io *io1, union ctl_io *io2); static ctl_action ctl_check_for_blockage(struct ctl_lun *lun, - union ctl_io *pending_io, union ctl_io *ooa_io); + union ctl_io *pending_io, const uint8_t *serialize_row, + union ctl_io *ooa_io); static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io **starting_io); static void ctl_try_unblock_io(struct ctl_lun *lun, union ctl_io *io, @@ -2313,6 +2314,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) } entry = ctl_get_cmd_entry(ctsio, NULL); + ctsio->seridx = entry->seridx; if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) { mtx_unlock(&lun->lun_lock); goto badjuju; @@ -2333,12 +2335,6 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) bio = (union ctl_io *)LIST_NEXT(&ctsio->io_hdr, ooa_links); switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, &bio)) { - case CTL_ACTION_BLOCK: - ctsio->io_hdr.blocker = bio; - TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr, - blocked_links); - mtx_unlock(&lun->lun_lock); - break; case CTL_ACTION_PASS: case CTL_ACTION_SKIP: if (softc->ha_mode == CTL_HA_MODE_XFER) { @@ -2357,6 +2353,12 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) sizeof(msg_info.hdr), M_WAITOK); } break; + case CTL_ACTION_BLOCK: + ctsio->io_hdr.blocker = bio; + TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr, + blocked_links); + mtx_unlock(&lun->lun_lock); + break; case CTL_ACTION_OVERLAP: LIST_REMOVE(&ctsio->io_hdr, ooa_links); mtx_unlock(&lun->lun_lock); @@ -2366,14 +2368,6 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) LIST_REMOVE(&ctsio->io_hdr, ooa_links); mtx_unlock(&lun->lun_lock); ctl_set_overlapped_tag(ctsio, ctsio->tag_num); - goto badjuju; - case CTL_ACTION_ERROR: - default: - LIST_REMOVE(&ctsio->io_hdr, ooa_links); - mtx_unlock(&lun->lun_lock); - - ctl_set_internal_failure(ctsio, /*sks_valid*/ 0, - /*retry_count*/ 0); badjuju: ctl_copy_sense_data_back((union ctl_io *)ctsio, &msg_info); msg_info.hdr.original_sc = ctsio->io_hdr.remote_io; @@ -2383,6 +2377,8 @@ badjuju: sizeof(msg_info.scsi), M_WAITOK); ctl_free_io((union ctl_io *)ctsio); break; + default: + __assert_unreachable(); } } @@ -10819,8 +10815,9 @@ ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len) break; } default: + *lba = 0; + *len = UINT64_MAX; return (1); - break; /* NOTREACHED */ } return (0); @@ -10854,7 +10851,7 @@ ctl_extent_check_unmap(union ctl_io *io, uint64_t lba2, uint64_t len2) /* If not UNMAP -- go other way. */ if (io->scsiio.cdb[0] != UNMAP) - return (CTL_ACTION_ERROR); + return (CTL_ACTION_SKIP); /* If UNMAP without data -- block and wait for data. */ ptrlen = (struct ctl_ptr_len_flags *) @@ -10882,33 +10879,34 @@ ctl_extent_check(union ctl_io *io1, union ctl_io *io2, bool seq) uint64_t len1, len2; int retval; - if (ctl_get_lba_len(io2, &lba2, &len2) != 0) - return (CTL_ACTION_ERROR); + retval = ctl_get_lba_len(io2, &lba2, &len2); + KASSERT(retval == 0, ("ctl_get_lba_len() error")); retval = ctl_extent_check_unmap(io1, lba2, len2); - if (retval != CTL_ACTION_ERROR) + if (retval != CTL_ACTION_SKIP) return (retval); - if (ctl_get_lba_len(io1, &lba1, &len1) != 0) - return (CTL_ACTION_ERROR); + retval = ctl_get_lba_len(io1, &lba1, &len1); + KASSERT(retval == 0, ("ctl_get_lba_len() error")); - if (io1->io_hdr.flags & CTL_FLAG_SERSEQ_DONE) + if (seq && (io1->io_hdr.flags & CTL_FLAG_SERSEQ_DONE)) seq = FALSE; return (ctl_extent_check_lba(lba1, len1, lba2, len2, seq)); } static ctl_action -ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2) +ctl_seq_check(union ctl_io *io1, union ctl_io *io2) { uint64_t lba1, lba2; uint64_t len1, len2; + int retval; if (io1->io_hdr.flags & CTL_FLAG_SERSEQ_DONE) return (CTL_ACTION_PASS); - if (ctl_get_lba_len(io1, &lba1, &len1) != 0) - return (CTL_ACTION_ERROR); - if (ctl_get_lba_len(io2, &lba2, &len2) != 0) - return (CTL_ACTION_ERROR); + retval = ctl_get_lba_len(io1, &lba1, &len1); + KASSERT(retval == 0, ("ctl_get_lba_len() error")); + retval = ctl_get_lba_len(io2, &lba2, &len2); + KASSERT(retval == 0, ("ctl_get_lba_len() error")); if (lba1 + len1 == lba2) return (CTL_ACTION_BLOCK); @@ -10917,25 +10915,15 @@ ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2) static ctl_action ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, - union ctl_io *ooa_io) + const uint8_t *serialize_row, union ctl_io *ooa_io) { - const struct ctl_cmd_entry *pending_entry, *ooa_entry; - const ctl_serialize_action *serialize_row; - - /* - * Aborted commands are not going to be executed and may even - * not report completion, so we don't care about their order. - * Let them complete ASAP to clean the OOA queue. - */ - if (pending_io->io_hdr.flags & CTL_FLAG_ABORT) - return (CTL_ACTION_SKIP); /* * The initiator attempted multiple untagged commands at the same * time. Can't do that. */ - if ((pending_io->scsiio.tag_type == CTL_TAG_UNTAGGED) - && (ooa_io->scsiio.tag_type == CTL_TAG_UNTAGGED) + if (__predict_false(pending_io->scsiio.tag_type == CTL_TAG_UNTAGGED) + && __predict_false(ooa_io->scsiio.tag_type == CTL_TAG_UNTAGGED) && ((pending_io->io_hdr.nexus.targ_port == ooa_io->io_hdr.nexus.targ_port) && (pending_io->io_hdr.nexus.initid == @@ -10955,9 +10943,9 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, * command with the same tag number as long as the previous * instance of this tag number has been aborted somehow. */ - if ((pending_io->scsiio.tag_type != CTL_TAG_UNTAGGED) - && (ooa_io->scsiio.tag_type != CTL_TAG_UNTAGGED) - && (pending_io->scsiio.tag_num == ooa_io->scsiio.tag_num) + if (__predict_true(pending_io->scsiio.tag_type != CTL_TAG_UNTAGGED) + && __predict_true(ooa_io->scsiio.tag_type != CTL_TAG_UNTAGGED) + && __predict_false(pending_io->scsiio.tag_num == ooa_io->scsiio.tag_num) && ((pending_io->io_hdr.nexus.targ_port == ooa_io->io_hdr.nexus.targ_port) && (pending_io->io_hdr.nexus.initid == @@ -10980,75 +10968,47 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, * * XXX KDM check for other types of blockage first?? */ - if (pending_io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE) + if (__predict_false(pending_io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE)) return (CTL_ACTION_PASS); - /* - * Ordered tags have to block until all items ahead of them - * have completed. If we get called with an ordered tag, we always - * block, if something else is ahead of us in the queue. - */ - if (pending_io->scsiio.tag_type == CTL_TAG_ORDERED) - return (CTL_ACTION_BLOCK); - /* * Simple tags get blocked until all head of queue and ordered tags * ahead of them have completed. I'm lumping untagged commands in * with simple tags here. XXX KDM is that the right thing to do? */ - if (((pending_io->scsiio.tag_type == CTL_TAG_UNTAGGED) - || (pending_io->scsiio.tag_type == CTL_TAG_SIMPLE)) - && ((ooa_io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE) - || (ooa_io->scsiio.tag_type == CTL_TAG_ORDERED))) + if (__predict_false(ooa_io->scsiio.tag_type == CTL_TAG_ORDERED) || + __predict_false(ooa_io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE)) return (CTL_ACTION_BLOCK); - pending_entry = ctl_get_cmd_entry(&pending_io->scsiio, NULL); - KASSERT(pending_entry->seridx < CTL_SERIDX_COUNT, - ("%s: Invalid seridx %d for pending CDB %02x %02x @ %p", - __func__, pending_entry->seridx, pending_io->scsiio.cdb[0], - pending_io->scsiio.cdb[1], pending_io)); - ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio, NULL); - if (ooa_entry->seridx == CTL_SERIDX_INVLD) - return (CTL_ACTION_PASS); /* Unsupported command in OOA queue */ - KASSERT(ooa_entry->seridx < CTL_SERIDX_COUNT, - ("%s: Invalid seridx %d for ooa CDB %02x %02x @ %p", - __func__, ooa_entry->seridx, ooa_io->scsiio.cdb[0], - ooa_io->scsiio.cdb[1], ooa_io)); - - serialize_row = ctl_serialize_table[ooa_entry->seridx]; - - switch (serialize_row[pending_entry->seridx]) { - case CTL_SER_BLOCK: - return (CTL_ACTION_BLOCK); - case CTL_SER_EXTENT: - return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); - case CTL_SER_EXTENTOPT: - if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) != - SCP_QUEUE_ALG_UNRESTRICTED) - return (ctl_extent_check(ooa_io, pending_io, - (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); + /* Unsupported command in OOA queue. */ + if (__predict_false(ooa_io->scsiio.seridx == CTL_SERIDX_INVLD)) return (CTL_ACTION_PASS); - case CTL_SER_EXTENTSEQ: + + switch (serialize_row[ooa_io->scsiio.seridx]) { + case CTL_SER_SEQ: if (lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF) - return (ctl_extent_check_seq(ooa_io, pending_io)); - return (CTL_ACTION_PASS); + return (ctl_seq_check(ooa_io, pending_io)); + /* FALLTHROUGH */ case CTL_SER_PASS: return (CTL_ACTION_PASS); + case CTL_SER_EXTENTOPT: + if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) == + SCP_QUEUE_ALG_UNRESTRICTED) + return (CTL_ACTION_PASS); + /* FALLTHROUGH */ + case CTL_SER_EXTENT: + return (ctl_extent_check(ooa_io, pending_io, + (lun->be_lun->serseq == CTL_LUN_SERSEQ_ON))); case CTL_SER_BLOCKOPT: - if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) != + if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) == SCP_QUEUE_ALG_UNRESTRICTED) - return (CTL_ACTION_BLOCK); - return (CTL_ACTION_PASS); - case CTL_SER_SKIP: - return (CTL_ACTION_SKIP); + return (CTL_ACTION_PASS); + /* FALLTHROUGH */ + case CTL_SER_BLOCK: + return (CTL_ACTION_BLOCK); default: - panic("%s: Invalid serialization value %d for %d => %d", - __func__, serialize_row[pending_entry->seridx], - pending_entry->seridx, ooa_entry->seridx); + __assert_unreachable(); } - - return (CTL_ACTION_ERROR); } /* @@ -11061,20 +11021,41 @@ static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io **starting_io) { - union ctl_io *ooa_io; + union ctl_io *ooa_io = *starting_io; + const uint8_t *serialize_row; ctl_action action; mtx_assert(&lun->lun_lock, MA_OWNED); + /* + * Aborted commands are not going to be executed and may even + * not report completion, so we don't care about their order. + * Let them complete ASAP to clean the OOA queue. + */ + if (__predict_false(pending_io->io_hdr.flags & CTL_FLAG_ABORT)) + return (CTL_ACTION_SKIP); + + /* + * Ordered tags have to block until all items ahead of them have + * completed. If we get called with an ordered tag, we always + * block, if something else is ahead of us in the queue. + */ + if ((pending_io->scsiio.tag_type == CTL_TAG_ORDERED) && + (ooa_io != NULL)) + return (CTL_ACTION_BLOCK); + + serialize_row = ctl_serialize_table[pending_io->scsiio.seridx]; + /* * Run back along the OOA queue, starting with the current * blocked I/O and going through every I/O before it on the * queue. If starting_io is NULL, we'll just end up returning * CTL_ACTION_PASS. */ - for (ooa_io = *starting_io; ooa_io != NULL; + for (; ooa_io != NULL; ooa_io = (union ctl_io *)LIST_NEXT(&ooa_io->io_hdr, ooa_links)) { - action = ctl_check_for_blockage(lun, pending_io, ooa_io); + action = ctl_check_for_blockage(lun, pending_io, serialize_row, + ooa_io); if (action != CTL_ACTION_PASS) { *starting_io = ooa_io; return (action); @@ -11127,13 +11108,6 @@ ctl_try_unblock_io(struct ctl_lun *lun, union ctl_io *io, bool skip) io->io_hdr.blocker = NULL; switch (action) { - case CTL_ACTION_OVERLAP: - ctl_set_overlapped_cmd(&io->scsiio); - goto error; - case CTL_ACTION_OVERLAP_TAG: - ctl_set_overlapped_tag(&io->scsiio, - io->scsiio.tag_num & 0xff); - goto error; case CTL_ACTION_PASS: case CTL_ACTION_SKIP: @@ -11163,12 +11137,14 @@ ctl_try_unblock_io(struct ctl_lun *lun, union ctl_io *io, bool skip) io->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; ctl_enqueue_rtr(io); break; - case CTL_ACTION_ERROR: default: - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - + __assert_unreachable(); + case CTL_ACTION_OVERLAP: + ctl_set_overlapped_cmd(&io->scsiio); + goto error; + case CTL_ACTION_OVERLAP_TAG: + ctl_set_overlapped_tag(&io->scsiio, + io->scsiio.tag_num & 0xff); error: /* Serializing commands from the other SC are done here. */ if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) && @@ -11380,8 +11356,8 @@ ctl_failover_lun(union ctl_io *rio) /* We are master */ if (io->flags & CTL_FLAG_FROM_OTHER_SC) { if (io->flags & CTL_FLAG_IO_ACTIVE) { - io->flags |= CTL_FLAG_ABORT; - io->flags |= CTL_FLAG_FAILOVER; + io->flags |= CTL_FLAG_ABORT | + CTL_FLAG_FAILOVER; ctl_try_unblock_io(lun, (union ctl_io *)io, FALSE); } else { /* This can be only due to DATAMOVE */ @@ -11615,18 +11591,18 @@ ctl_scsiio_precheck(struct ctl_scsiio *ctsio) bio = (union ctl_io *)LIST_NEXT(&ctsio->io_hdr, ooa_links); switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, &bio)) { - case CTL_ACTION_BLOCK: - ctsio->io_hdr.blocker = bio; - TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr, - blocked_links); - mtx_unlock(&lun->lun_lock); - break; case CTL_ACTION_PASS: case CTL_ACTION_SKIP: ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; mtx_unlock(&lun->lun_lock); ctl_enqueue_rtr((union ctl_io *)ctsio); break; + case CTL_ACTION_BLOCK: + ctsio->io_hdr.blocker = bio; + TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr, + blocked_links); + mtx_unlock(&lun->lun_lock); + break; case CTL_ACTION_OVERLAP: mtx_unlock(&lun->lun_lock); ctl_set_overlapped_cmd(ctsio); @@ -11637,14 +11613,8 @@ ctl_scsiio_precheck(struct ctl_scsiio *ctsio) ctl_set_overlapped_tag(ctsio, ctsio->tag_num & 0xff); ctl_done((union ctl_io *)ctsio); break; - case CTL_ACTION_ERROR: default: - mtx_unlock(&lun->lun_lock); - ctl_set_internal_failure(ctsio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - ctl_done((union ctl_io *)ctsio); - break; + __assert_unreachable(); } } @@ -11673,6 +11643,7 @@ ctl_validate_command(struct ctl_scsiio *ctsio) uint8_t diff; entry = ctl_get_cmd_entry(ctsio, &sa); + ctsio->seridx = entry->seridx; if (entry->execute == NULL) { if (sa) ctl_set_invalid_field(ctsio, @@ -13303,10 +13274,15 @@ ctl_serseq_done(union ctl_io *io) if (lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF) return; - mtx_lock(&lun->lun_lock); - io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE; - ctl_try_unblock_others(lun, io, FALSE); - mtx_unlock(&lun->lun_lock); + + /* This is racy, but should not be a problem. */ + if (!TAILQ_EMPTY(&io->io_hdr.blocked_queue)) { + mtx_lock(&lun->lun_lock); + io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE; + ctl_try_unblock_others(lun, io, FALSE); + mtx_unlock(&lun->lun_lock); + } else + io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE; } void diff --git a/sys/cam/ctl/ctl_io.h b/sys/cam/ctl/ctl_io.h index 349cb02820d9..de312608da8e 100644 --- a/sys/cam/ctl/ctl_io.h +++ b/sys/cam/ctl/ctl_io.h @@ -326,7 +326,7 @@ struct ctl_scsiio { struct scsi_sense_data sense_data; /* sense data */ uint8_t sense_len; /* Returned sense length */ uint8_t scsi_status; /* SCSI status byte */ - uint8_t sense_residual; /* Unused. */ + uint8_t seridx; /* Serialization index. */ uint8_t priority; /* Command priority */ uint32_t residual; /* Unused */ uint32_t tag_num; /* tag number */ diff --git a/sys/cam/ctl/ctl_private.h b/sys/cam/ctl/ctl_private.h index 8940babd4904..a891041e8f50 100644 --- a/sys/cam/ctl/ctl_private.h +++ b/sys/cam/ctl/ctl_private.h @@ -65,22 +65,20 @@ struct ctl_io_pool { }; typedef enum { - CTL_SER_BLOCK, - CTL_SER_BLOCKOPT, - CTL_SER_EXTENT, - CTL_SER_EXTENTOPT, - CTL_SER_EXTENTSEQ, + CTL_SER_SEQ, CTL_SER_PASS, - CTL_SER_SKIP + CTL_SER_EXTENTOPT, + CTL_SER_EXTENT, + CTL_SER_BLOCKOPT, + CTL_SER_BLOCK, } ctl_serialize_action; typedef enum { - CTL_ACTION_BLOCK, - CTL_ACTION_OVERLAP, - CTL_ACTION_OVERLAP_TAG, CTL_ACTION_PASS, CTL_ACTION_SKIP, - CTL_ACTION_ERROR + CTL_ACTION_BLOCK, + CTL_ACTION_OVERLAP, + CTL_ACTION_OVERLAP_TAG } ctl_action; /* diff --git a/sys/cam/ctl/ctl_ser_table.c b/sys/cam/ctl/ctl_ser_table.c index 5499e63534fa..be9ca6b34631 100644 --- a/sys/cam/ctl/ctl_ser_table.c +++ b/sys/cam/ctl/ctl_ser_table.c @@ -43,11 +43,8 @@ /* TABLE ctlSerTbl */ /* */ /* The matrix which drives the serialization algorithm. The major index */ -/* (the first) into this table is the command being checked and the minor */ -/* index is the command against which the first command is being checked. */ -/* i.e., the major index (row) command is ahead of the minor index command */ -/* (column) in the queue. This allows the code to optimize by capturing */ -/* the result of the first indexing operation into a pointer. */ +/* (the first, row) into this table is the new command. The minor index */ +/* (column) is the older, possibly already running, command. */ /* */ /* Whenever a new value is added to the IDX_T type, this matrix must be */ /* expanded by one row AND one column -- Because of this, some effort */ @@ -55,29 +52,29 @@ /* */ /****************************************************************************/ -#define sK CTL_SER_SKIP /* Skip */ #define pS CTL_SER_PASS /* Pass */ #define bK CTL_SER_BLOCK /* Blocked */ #define bO CTL_SER_BLOCKOPT /* Optional block */ #define xT CTL_SER_EXTENT /* Extent check */ #define xO CTL_SER_EXTENTOPT /* Optional extent check */ -#define xS CTL_SER_EXTENTSEQ /* Sequential extent check */ +#define xS CTL_SER_SEQ /* Sequential check */ -const static ctl_serialize_action +const static uint8_t ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = { /**>IDX_ :: 2nd:TUR RD WRT UNM SYN MDSN MDSL RQSN INQ RDCP RES LSNS FMT STR*/ -/*TUR */{ pS, pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*READ */{ pS, xS, xT, bO, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*WRITE */{ pS, xT, xT, bO, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*UNMAP */{ pS, xO, xO, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*SYNC */{ pS, pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*MD_SNS */{ bK, bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, pS, bK, bK}, -/*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*RQ_SNS */{ pS, pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, -/*INQ */{ pS, pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, -/*RD_CAP */{ pS, pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, pS}, -/*RES */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, -/*LOG_SNS */{ pS, pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, pS, bK, bK}, -/*FORMAT */{ pS, bK, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK}, -/*START */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, +/*TUR */{ pS, pS, pS, pS, pS, bK, bK, pS, pS, pS, bK, pS, pS, bK}, +/*READ */{ pS, xS, xT, xO, pS, bK, bK, pS, pS, pS, bK, pS, bK, bK}, +/*WRITE */{ pS, xT, xT, xO, pS, bK, bK, pS, pS, pS, bK, pS, bK, bK}, +/*UNMAP */{ pS, bO, bO, pS, pS, bK, bK, pS, pS, pS, bK, pS, bK, bK}, +/*SYNC */{ pS, pS, bO, pS, pS, bK, bK, pS, pS, pS, bK, pS, bK, bK}, +/*MD_SNS */{ bK, bK, bK, bK, bK, pS, bK, pS, pS, pS, bK, pS, bK, bK}, +/*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, pS, pS, pS, bK, bK, bK, bK}, +/*RQ_SNS */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, pS, bK}, +/*INQ */{ pS, pS, pS, pS, pS, pS, pS, pS, pS, pS, pS, pS, pS, pS}, +/*RD_CAP */{ pS, pS, pS, pS, pS, pS, pS, pS, pS, pS, bK, pS, bK, bK}, +/*RES */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK}, +/*LOG_SNS */{ pS, pS, pS, pS, pS, pS, pS, pS, pS, pS, bK, pS, bK, bK}, +/*FORMAT */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, +/*START */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK}, }; + From owner-dev-commits-src-all@freebsd.org Sat Feb 27 16:09:08 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 106CA54BBCC; Sat, 27 Feb 2021 16:09: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 4Dns0N01JLz3KCT; Sat, 27 Feb 2021 16:09: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 E758E2057F; Sat, 27 Feb 2021 16:09: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 11RG97Ar000657; Sat, 27 Feb 2021 16:09:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RG97Ll000656; Sat, 27 Feb 2021 16:09:07 GMT (envelope-from git) Date: Sat, 27 Feb 2021 16:09:07 GMT Message-Id: <202102271609.11RG97Ll000656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: 76294b65df64 - stable/13 - iflib: Avoid double counting in rxeof 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: 76294b65df64e87f29a7d7df23c5360dd9ada5aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 16:09:08 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=76294b65df64e87f29a7d7df23c5360dd9ada5aa commit 76294b65df64e87f29a7d7df23c5360dd9ada5aa Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-02-24 15:08:53 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-02-27 16:07:46 +0000 iflib: Avoid double counting in rxeof iflib_rxeof() was counting everything twice. This was introduced when pfil hooks were added to the iflib receive path. We want to count rx packets/bytes before the pfil hooks are executed, so remove the counter adjustments that are executed after. PR: 253583 Reviewed by: gallatin, erj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28900 (cherry picked from commit b6999635b195e8c0dd5c08ac9ff268c92107cc66) --- sys/net/iflib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index a33ddbe5b8ae..9f3eff555728 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2973,8 +2973,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if (!IP_ALIGNED(m) && (m = iflib_fixup_rx(m)) == NULL) continue; #endif - rx_bytes += m->m_pkthdr.len; - rx_pkts++; #if defined(INET6) || defined(INET) if (lro_enabled) { if (!lro_possible) { From owner-dev-commits-src-all@freebsd.org Sat Feb 27 16:25:42 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDEA454B5D4; Sat, 27 Feb 2021 16:25: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 4DnsMV5SwQz3Kqc; Sat, 27 Feb 2021 16:25: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 AEA4320DAE; Sat, 27 Feb 2021 16:25: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 11RGPgU0025993; Sat, 27 Feb 2021 16:25:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RGPgoF025992; Sat, 27 Feb 2021 16:25:42 GMT (envelope-from git) Date: Sat, 27 Feb 2021 16:25:42 GMT Message-Id: <202102271625.11RGPgoF025992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson <rwatson@FreeBSD.org> Subject: git: a92c6b24c0e9 - main - Add a comment on why the call to mac_vnode_relabel() might be in the wrong place -- in the VOP rather than vn_setexttr() -- and that it is for historic reasons. We might wish to relocate it in due course, but this way at least we document the asymmetry. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a92c6b24c0e92607661a16295f4b04cde08c9230 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 16:25:42 -0000 The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=a92c6b24c0e92607661a16295f4b04cde08c9230 commit a92c6b24c0e92607661a16295f4b04cde08c9230 Author: Robert Watson <rwatson@FreeBSD.org> AuthorDate: 2021-02-27 16:22:26 +0000 Commit: Robert Watson <rwatson@FreeBSD.org> CommitDate: 2021-02-27 16:25:26 +0000 Add a comment on why the call to mac_vnode_relabel() might be in the wrong place -- in the VOP rather than vn_setexttr() -- and that it is for historic reasons. We might wish to relocate it in due course, but this way at least we document the asymmetry. --- sys/security/mac/mac_vfs.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c index 323d693387bb..3d2185fbc3c6 100644 --- a/sys/security/mac/mac_vfs.c +++ b/sys/security/mac/mac_vfs.c @@ -1021,6 +1021,10 @@ vop_stdsetlabel_ea(struct vop_setlabel_args *ap) if (error) return (error); + /* + * XXXRW: See the comment below in vn_setlabel() as to why this might + * be the wrong place to call mac_vnode_relabel(). + */ mac_vnode_relabel(ap->a_cred, vp, intlabel); return (0); @@ -1045,9 +1049,6 @@ vn_setlabel(struct vnode *vp, struct label *intlabel, struct ucred *cred) * Multi-phase commit. First check the policies to confirm the * change is OK. Then commit via the filesystem. Finally, update * the actual vnode label. - * - * Question: maybe the filesystem should update the vnode at the end - * as part of VOP_SETLABEL()? */ error = mac_vnode_check_relabel(cred, vp, intlabel); if (error) @@ -1068,6 +1069,14 @@ vn_setlabel(struct vnode *vp, struct label *intlabel, struct ucred *cred) if (error) return (error); + /* + * It would be more symmetric if mac_vnode_relabel() was called here + * rather than in VOP_SETLABEL(), but we don't for historical reasons. + * We should think about moving it so that the filesystem is + * responsible only for persistence in VOP_SETLABEL(), not the vnode + * label update itself. + */ + return (0); } From owner-dev-commits-src-all@freebsd.org Sat Feb 27 16:52:01 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B15454C94B; Sat, 27 Feb 2021 16: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 4Dnsxs29Tlz3MQ8; Sat, 27 Feb 2021 16:52: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 3D55521387; Sat, 27 Feb 2021 16:52: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 11RGq1ct064518; Sat, 27 Feb 2021 16:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RGq1YX064517; Sat, 27 Feb 2021 16:52:01 GMT (envelope-from git) Date: Sat, 27 Feb 2021 16:52:01 GMT Message-Id: <202102271652.11RGq1YX064517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson <rwatson@FreeBSD.org> Subject: git: 7bfd84444e6f - main - Provide a man page for VOP_SETLABEL(9). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bfd84444e6ff182abac2e08d6efcd2dc9ddc944 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 16:52:01 -0000 The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=7bfd84444e6ff182abac2e08d6efcd2dc9ddc944 commit 7bfd84444e6ff182abac2e08d6efcd2dc9ddc944 Author: Robert Watson <rwatson@FreeBSD.org> AuthorDate: 2021-02-27 16:51:00 +0000 Commit: Robert Watson <rwatson@FreeBSD.org> CommitDate: 2021-02-27 16:51:13 +0000 Provide a man page for VOP_SETLABEL(9). MFC after: 3 days --- share/man/man9/VOP_SETLABEL.9 | 128 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/share/man/man9/VOP_SETLABEL.9 b/share/man/man9/VOP_SETLABEL.9 new file mode 100644 index 000000000000..8b7e54e515cc --- /dev/null +++ b/share/man/man9/VOP_SETLABEL.9 @@ -0,0 +1,128 @@ +.\"- +.\" Copyright (c) 2021 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 27, 2021 +.Dt VOP_SETLABEL 9 +.Os +.Sh NAME +.Nm VOP_SETLABEL +.Nd persistently store an updated MAC label on a vnode +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.In security/mac.h +.Ft int +.Fn VOP_SETLABEL "struct vnode *vp" "label *label" +.Sh DESCRIPTION +This vnode call is made by +.Xr mac 9 +file relabeling operation has been authorized, and the filesystem must now be +updated. +.Ss Single-Label vs. Multi-Label Filesystems +Filesystems that do not implement per-file labels -- known as single-label +filesystems -- can simply leave the +.Xr vnode 9 +operation undefined. +These filesystems must not set the +.Dv MNT_MULTLABEL +flag in their +.Vt struct mount . +.Pp +Filesystems that do implement per-vnode label storage -- known as multi-label +filesystems -- will set the +.Dv MNT_MULTILABEL +flag in their +.Vt struct mount . +The UFS filesystem uses a superblock flag to persisently configure whether a +specific filesystem implements a label for each +.Xr vnode 9 , +and then keys various behaviors on whether that flag is set. +.Ss Extended Attributes +If the filesystem implements extended attributes, then the MAC Framework's +.Fn vop_stdsetlabel_ea +function can be used, and maps operations into a series of +.Xr VOP_OPENEXTATTR 9 , +.Xr VOP_WRITEEXTATTR 9 , +and +.Xr VOP_CLOSEEXTATTR 9 . +.Pp +Filesystems will also need to call +.Fn mac_vnode_create_extattr +when a new filesystem object is created, so that suitable extended attributes +can be written out, and +.Fn mac_vnode_associate_extattr +when a +.Xr vnode 9 +is associated with a filesystem object for the first time. +These utility functions use +.Xr VOP_OPENEXTATTR 9 , +.Xr VOP_READEXTATTR 9 , +.Xr VOP_WRITEEXTATTR 9 , +and +.Xr VOP_CLOSEEXTATTR 9 +as required. +.Pp +.Ss Locking and Crash Safety +In all cases, it is important that exclusive +.Xr vnode 9 +locks be held to prevent concurrent access when a MAC label may not yet be +initialized. +It is also important that operations are ordered so that a system crash does +not leave a file improperly labeled. +For example, the extended attribute for a newly created file must be written +to disk before the file is linked by its parent directory, so that there is +no opportunity for a crash to lead to an unlabeled file. +.Sh LOCKS +The vnode will be locked on entry and should remain locked on return. +.Sh RETURN VALUES +If the MAC label is successfully set, then zero is returned. +Otherwise, an appropriate error code is returned. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EOPNOTSUPP +The file system does not support +.Fn VOP_SETLABEL . +.It Bq Er ENOSPC +The file system is out of space. +.It Bq Er EROFS +The file system is read-only. +.El +.Pp +Depending on the underlying implementation of +.Fn VOP_SETLABEL , +other errors may also be possible. +.Sh SEE ALSO +.Xr VOP_CLOSEEXTATTR 9 , +.Xr VOP_OPENEXTATTR 9 , +.Xr VOP_READEXTATTR 9 , +.Xr VOP_WRITEXTATTR 9 , +.Xr mac 9 , +.Xr mount 9 , +.Xr vnode 9 , +.Sh AUTHORS +This manual page was written by +.An Robert Watson . From owner-dev-commits-src-all@freebsd.org Sat Feb 27 16:54:22 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8818654C7F1; Sat, 27 Feb 2021 16:54: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 4Dnt0Z3QMYz3N40; Sat, 27 Feb 2021 16:54: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 682B5211AB; Sat, 27 Feb 2021 16:54: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 11RGsMRf064970; Sat, 27 Feb 2021 16:54:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RGsMKL064969; Sat, 27 Feb 2021 16:54:22 GMT (envelope-from git) Date: Sat, 27 Feb 2021 16:54:22 GMT Message-Id: <202102271654.11RGsMKL064969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson <rwatson@FreeBSD.org> Subject: git: a9f11355038c - main - Add Xrefs to the new VOP_SETLABEL(9) from mac(9) and vnode(9). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9f11355038cd7d2942d925e85795ed9d13f1bfe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 16:54:22 -0000 The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=a9f11355038cd7d2942d925e85795ed9d13f1bfe commit a9f11355038cd7d2942d925e85795ed9d13f1bfe Author: Robert Watson <rwatson@FreeBSD.org> AuthorDate: 2021-02-27 16:53:53 +0000 Commit: Robert Watson <rwatson@FreeBSD.org> CommitDate: 2021-02-27 16:53:53 +0000 Add Xrefs to the new VOP_SETLABEL(9) from mac(9) and vnode(9). MFC after: 3 days --- share/man/man9/mac.9 | 5 +++-- share/man/man9/vnode.9 | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man9/mac.9 b/share/man/man9/mac.9 index 58c2f7a2484e..89238d28b61c 100644 --- a/share/man/man9/mac.9 +++ b/share/man/man9/mac.9 @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2015 +.Dd February 27, 2021 .Dt MAC 9 .Os .Sh NAME @@ -162,7 +162,8 @@ for information on the MAC Framework APIs. .Xr ucred 9 , .Xr vaccess 9 , .Xr vaccess_acl_posix1e 9 , -.Xr VFS 9 +.Xr VFS 9 , +.Xr VOP_SETLABEL 9 . .Rs .%T "The FreeBSD Architecture Handbook" .%U "https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/arch-handbook/" diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 91360a755fbc..5ff45d7a1364 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -189,6 +189,7 @@ intertwining of VM Objects and Vnodes. .Xr VOP_REVOKE 9 , .Xr VOP_SETACL 9 , .Xr VOP_SETEXTATTR 9 , +.Xr VOP_SETLABEL 9 , .Xr VOP_STRATEGY 9 , .Xr VOP_VPTOCNP 9 , .Xr VOP_VPTOFH 9 From owner-dev-commits-src-all@freebsd.org Sat Feb 27 16:55:23 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E97D54CE1E for <dev-commits-src-all@mailman.nyi.freebsd.org>; Sat, 27 Feb 2021 16:55:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 4Dnt1l1cgyz3N9t for <dev-commits-src-all@freebsd.org>; Sat, 27 Feb 2021 16:55:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f53.google.com with SMTP id i9so9505957wml.0 for <dev-commits-src-all@freebsd.org>; Sat, 27 Feb 2021 08:55:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tntcvwDbCSfgZE18WutJJ+L+peLh6DlmenprQbGIUbM=; b=dSB6+D8mBrd5VXP79KOWGbYRugUIG1w6lkd6tHVSMSiUH7EOhK2e7d7+Cb+cG7A9r7 fhF6EtEht7tVsDBeceXq6L8E5WhIiy3fFspRb71kgM7jhowMiV8LPRJLra25eylzjXL/ gHGjHwY+eVjk98ZAQp+1uHeqp7ZThTgQ2EAeOjYRfQbqg6JPKnpqkap+X9ifij6cCp5H 1MJAgvfE9bZfej81jchvQtTg7o4XfIKGa28/kZ+8ZB+rLY94DFIh/h/6bQ6TcDmrFWQ1 ydPlWZctQsUW6n8KD7dh14aniCZLK8NTPR6fLpSNJToRNFMmIdVui9ku4z0HHgJO0un7 29VA== X-Gm-Message-State: AOAM532QCMgOZXPJO0IeUNEzL7lckWNo2hRRvz3MANILrKjlnoAb0KlV TnHo6w8Jn/d0XWfRkfBB96q9rvRh9F34/w== X-Google-Smtp-Source: ABdhPJyuIVSpsd0qJJ4SOUa5yNghdwDo/0n0n1GuWwpXSaXe1QFGSjLB4JZZrDDW2TCuDypxGxE9CA== X-Received: by 2002:a7b:c305:: with SMTP id k5mr7876437wmj.57.1614444921652; Sat, 27 Feb 2021 08:55:21 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id k15sm21901900wrn.0.2021.02.27.08.55.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Feb 2021 08:55:21 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 7bfd84444e6f - main - Provide a man page for VOP_SETLABEL(9). From: Jessica Clarke <jrtc27@freebsd.org> In-Reply-To: <202102271652.11RGq1YX064517@gitrepo.freebsd.org> Date: Sat, 27 Feb 2021 16:55:20 +0000 Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Content-Transfer-Encoding: quoted-printable Message-Id: <7AAF0AD3-F975-4149-A4E0-DDE3CA0717EF@freebsd.org> References: <202102271652.11RGq1YX064517@gitrepo.freebsd.org> To: Robert Watson <rwatson@FreeBSD.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4Dnt1l1cgyz3N9t 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 16:55:23 -0000 On 27 Feb 2021, at 16:52, Robert Watson <rwatson@FreeBSD.org> wrote: >=20 > The branch main has been updated by rwatson: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D7bfd84444e6ff182abac2e08d6efcd2d= c9ddc944 >=20 > commit 7bfd84444e6ff182abac2e08d6efcd2dc9ddc944 > Author: Robert Watson <rwatson@FreeBSD.org> > AuthorDate: 2021-02-27 16:51:00 +0000 > Commit: Robert Watson <rwatson@FreeBSD.org> > CommitDate: 2021-02-27 16:51:13 +0000 >=20 > Provide a man page for VOP_SETLABEL(9). >=20 > MFC after: 3 days > --- > share/man/man9/VOP_SETLABEL.9 | 128 = ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 128 insertions(+) >=20 > diff --git a/share/man/man9/VOP_SETLABEL.9 = b/share/man/man9/VOP_SETLABEL.9 > new file mode 100644 > index 000000000000..8b7e54e515cc > --- /dev/null > +++ b/share/man/man9/VOP_SETLABEL.9 > @@ -0,0 +1,128 @@ > +.\"- > +.\" Copyright (c) 2021 Robert N. M. Watson > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or = without > +.\" modification, are permitted provided that the following = conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above = copyright > +.\" notice, this list of conditions and the following disclaimer = in the > +.\" documentation and/or other materials provided with the = distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS = IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, = THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A = PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE = LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR = CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE = GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS = INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN = CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN = ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE = POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd February 27, 2021 > +.Dt VOP_SETLABEL 9 > +.Os > +.Sh NAME > +.Nm VOP_SETLABEL > +.Nd persistently store an updated MAC label on a vnode > +.Sh SYNOPSIS > +.In sys/param.h > +.In sys/vnode.h > +.In security/mac.h > +.Ft int > +.Fn VOP_SETLABEL "struct vnode *vp" "label *label" > +.Sh DESCRIPTION > +This vnode call is made by > +.Xr mac 9 > +file relabeling operation has been authorized, and the filesystem = must now be I think you're missing some words at the start of this line? Jess From owner-dev-commits-src-all@freebsd.org Sat Feb 27 16:59:17 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC47A54CEFE; Sat, 27 Feb 2021 16:59:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [204.107.128.30]) by mx1.freebsd.org (Postfix) with ESMTP id 4Dnt6F6HDJz3NPf; Sat, 27 Feb 2021 16:59:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id E573A60107; Sat, 27 Feb 2021 16:59:16 +0000 (UTC) Date: Sat, 27 Feb 2021 16:59:16 +0000 (GMT) From: Robert Watson <rwatson@FreeBSD.org> To: Jessica Clarke <jrtc27@freebsd.org> cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: 7bfd84444e6f - main - Provide a man page for VOP_SETLABEL(9). In-Reply-To: <7AAF0AD3-F975-4149-A4E0-DDE3CA0717EF@freebsd.org> Message-ID: <2fc6bb6-3118-27bc-4860-b6454e6a4647@fledge.watson.org> References: <202102271652.11RGq1YX064517@gitrepo.freebsd.org> <7AAF0AD3-F975-4149-A4E0-DDE3CA0717EF@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4Dnt6F6HDJz3NPf 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 16:59:18 -0000 On Sat, 27 Feb 2021, Jessica Clarke wrote: >> +This vnode call is made by >> +.Xr mac 9 >> +file relabeling operation has been authorized, and the filesystem must now >> be > > I think you're missing some words at the start of this line? Indeed - the word "once". I'll pause a few minutes before fixing it in case you spot anything else :-). Robert From owner-dev-commits-src-all@freebsd.org Sat Feb 27 17:00:28 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2518F54D291 for <dev-commits-src-all@mailman.nyi.freebsd.org>; Sat, 27 Feb 2021 17:00:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 4Dnt7c0Dyzz3NLr for <dev-commits-src-all@freebsd.org>; Sat, 27 Feb 2021 17:00:27 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f47.google.com with SMTP id r3so11612952wro.9 for <dev-commits-src-all@freebsd.org>; Sat, 27 Feb 2021 09:00:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mLbCilNzxz0S2Wh5MEVxnnatAGN3VmxmKPpYWkDsFyI=; b=majLRNH4Xc/xVKV+yfiTu9VR1kRCCPzZ64gS8m6PJYFrDu6LX5g8ufbbG8h6SnUogg em7xWBjtLMyEOVaf+Ka2C74ORURhq8/rgsWKOzoVCBau4xYe4JYFXz+Ivpsp6/QB5NJh SvlHSH/BbHDxKYDT+74yMdP81KBrw0sKwe14xJHoWqeJWqgk1e1uoYOV3cZXLopvr438 ZN4XWC5haUHovA5p7Pq+0VoA0ktRjI/RiVo7OX7TxA+8/E+8nPwVoz8Kjw9vLaVJNM3v GsNF8TAJFif3b/U7gJWpGUfGyrjnQsmxA4BU6GEOJhKktyFexuUAluIBcO+lNJK+8nMW QJrg== X-Gm-Message-State: AOAM5303/eb3AR8nZ2HdvalY8SWc4Gm2IdcO1emY4jGcMMr2qJQEiRW1 /24hwGc70+mxm9VsPZxPYXJiww== X-Google-Smtp-Source: ABdhPJzOKz2tdkIpJGP/b5OQcXVWd2DJ3+MntYLJi5Xrg/gFpwSioE7ed6mlZSon0rlQCZJ3AOzvjg== X-Received: by 2002:a5d:6181:: with SMTP id j1mr8564244wru.11.1614445226502; Sat, 27 Feb 2021 09:00:26 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id z21sm16490065wma.29.2021.02.27.09.00.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Feb 2021 09:00:26 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 7bfd84444e6f - main - Provide a man page for VOP_SETLABEL(9). From: Jessica Clarke <jrtc27@freebsd.org> In-Reply-To: <2fc6bb6-3118-27bc-4860-b6454e6a4647@fledge.watson.org> Date: Sat, 27 Feb 2021 17:00:25 +0000 Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Content-Transfer-Encoding: quoted-printable Message-Id: <0C7641B1-34BA-40BB-A767-73055349DB93@freebsd.org> References: <202102271652.11RGq1YX064517@gitrepo.freebsd.org> <7AAF0AD3-F975-4149-A4E0-DDE3CA0717EF@freebsd.org> <2fc6bb6-3118-27bc-4860-b6454e6a4647@fledge.watson.org> To: Robert Watson <rwatson@FreeBSD.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4Dnt7c0Dyzz3NLr 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 17:00:28 -0000 On 27 Feb 2021, at 16:59, Robert Watson <rwatson@FreeBSD.org> wrote: >=20 > On Sat, 27 Feb 2021, Jessica Clarke wrote: >=20 >>> +This vnode call is made by >>> +.Xr mac 9 >>> +file relabeling operation has been authorized, and the filesystem = must now be >>=20 >> I think you're missing some words at the start of this line? >=20 > Indeed - the word "once". I'll pause a few minutes before fixing it = in case you spot anything else :-). Well, that and an indefinite article? Jess From owner-dev-commits-src-all@freebsd.org Sat Feb 27 21:45:43 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD0B1554F84; Sat, 27 Feb 2021 21:45: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 4Dp0Sl5KL5z4Qpb; Sat, 27 Feb 2021 21:45: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 A93BD24F1F; Sat, 27 Feb 2021 21:45: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 11RLjhCA047344; Sat, 27 Feb 2021 21:45:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RLjh2U047343; Sat, 27 Feb 2021 21:45:43 GMT (envelope-from git) Date: Sat, 27 Feb 2021 21:45:43 GMT Message-Id: <202102272145.11RLjh2U047343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing <rew@FreeBSD.org> Subject: git: b7fd9c4e5ebc - main - bhyve/snapshot: rename checkpoint_opcodes to be more generic 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/main X-Git-Reftype: branch X-Git-Commit: b7fd9c4e5ebc69934205980d9f628ef8f21fb288 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 21:45:43 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=b7fd9c4e5ebc69934205980d9f628ef8f21fb288 commit b7fd9c4e5ebc69934205980d9f628ef8f21fb288 Author: Robert Wing <rew@FreeBSD.org> AuthorDate: 2021-02-27 21:03:03 +0000 Commit: Robert Wing <rew@FreeBSD.org> CommitDate: 2021-02-27 21:03:03 +0000 bhyve/snapshot: rename checkpoint_opcodes to be more generic Generalize the naming here since the domain socket that uses these codes might be used for purposes other than the save/restore feature. - rename checkpoint_opcodes to ipc_opcode Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28877 --- usr.sbin/bhyve/snapshot.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/snapshot.h b/usr.sbin/bhyve/snapshot.h index caa7256ffbfa..62b2083b9830 100644 --- a/usr.sbin/bhyve/snapshot.h +++ b/usr.sbin/bhyve/snapshot.h @@ -60,9 +60,9 @@ struct restore_state { ucl_object_t *meta_root_obj; }; -enum checkpoint_opcodes { - START_CHECKPOINT = 0, - START_SUSPEND = 1, +enum ipc_opcode { + START_CHECKPOINT, + START_SUSPEND, }; struct checkpoint_op { From owner-dev-commits-src-all@freebsd.org Sat Feb 27 21:45:45 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 256605547EE; Sat, 27 Feb 2021 21:45: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 4Dp0Sm6RrJz4Qn1; Sat, 27 Feb 2021 21:45: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 A8B9824D4C; Sat, 27 Feb 2021 21:45: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 11RLji1G047364; Sat, 27 Feb 2021 21:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RLjikV047363; Sat, 27 Feb 2021 21:45:44 GMT (envelope-from git) Date: Sat, 27 Feb 2021 21:45:44 GMT Message-Id: <202102272145.11RLjikV047363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing <rew@FreeBSD.org> Subject: git: da9713917eb2 - main - bhyvectl: reduce code duplication 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/main X-Git-Reftype: branch X-Git-Commit: da9713917eb26b67bafc740384ccd44f7dff09f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 21:45:45 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=da9713917eb26b67bafc740384ccd44f7dff09f2 commit da9713917eb26b67bafc740384ccd44f7dff09f2 Author: Robert Wing <rew@FreeBSD.org> AuthorDate: 2021-02-27 21:05:52 +0000 Commit: Robert Wing <rew@FreeBSD.org> CommitDate: 2021-02-27 21:05:52 +0000 bhyvectl: reduce code duplication Combine send_start_checkpoint() and send_start_suspend() into a single function named snapshot_request(). snapshot_request() is equivalent to send_start_checkpoint() and send_start_suspend() except that it takes an additional argument. The additional argument, enum ipc_opcode, is used to determine the type of snapshot request being performed. Also, switch to using strlcpy instead of strncpy. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28878 --- usr.sbin/bhyvectl/bhyvectl.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 7b3a73cc3668..f9a790f5402e 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1734,25 +1734,12 @@ done: } static int -send_start_checkpoint(struct vmctx *ctx, const char *checkpoint_file) +snapshot_request(struct vmctx *ctx, const char *file, enum ipc_opcode code) { struct checkpoint_op op; - op.op = START_CHECKPOINT; - strncpy(op.snapshot_filename, checkpoint_file, MAX_SNAPSHOT_VMNAME); - op.snapshot_filename[MAX_SNAPSHOT_VMNAME - 1] = 0; - - return (send_checkpoint_op_req(ctx, &op)); -} - -static int -send_start_suspend(struct vmctx *ctx, const char *suspend_file) -{ - struct checkpoint_op op; - - op.op = START_SUSPEND; - strncpy(op.snapshot_filename, suspend_file, MAX_SNAPSHOT_VMNAME); - op.snapshot_filename[MAX_SNAPSHOT_VMNAME - 1] = 0; + op.op = code; + strlcpy(op.snapshot_filename, file, MAX_SNAPSHOT_VMNAME); return (send_checkpoint_op_req(ctx, &op)); } @@ -2416,10 +2403,10 @@ main(int argc, char *argv[]) #ifdef BHYVE_SNAPSHOT if (!error && vm_checkpoint_opt) - error = send_start_checkpoint(ctx, checkpoint_file); + error = snapshot_request(ctx, checkpoint_file, START_CHECKPOINT); if (!error && vm_suspend_opt) - error = send_start_suspend(ctx, suspend_file); + error = snapshot_request(ctx, suspend_file, START_SUSPEND); #endif free (opts); From owner-dev-commits-src-all@freebsd.org Sat Feb 27 21:45:47 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E743554F8B; Sat, 27 Feb 2021 21:45: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 4Dp0Sp2d2lz3wY4; Sat, 27 Feb 2021 21:45: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 D9FDE24CB9; Sat, 27 Feb 2021 21:45: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 11RLjjSM047386; Sat, 27 Feb 2021 21:45:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RLjjdF047385; Sat, 27 Feb 2021 21:45:45 GMT (envelope-from git) Date: Sat, 27 Feb 2021 21:45:45 GMT Message-Id: <202102272145.11RLjjdF047385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing <rew@FreeBSD.org> Subject: git: d656ce199d72 - main - bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME 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/main X-Git-Reftype: branch X-Git-Commit: d656ce199d72f1aeeef1b2e28b4a284c968a8d03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 21:45:47 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=d656ce199d72f1aeeef1b2e28b4a284c968a8d03 commit d656ce199d72f1aeeef1b2e28b4a284c968a8d03 Author: Robert Wing <rew@FreeBSD.org> AuthorDate: 2021-02-27 21:07:35 +0000 Commit: Robert Wing <rew@FreeBSD.org> CommitDate: 2021-02-27 21:07:35 +0000 bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME MAX_SNAPSHOT_VMNAME is a macro used to set the size of a character buffer that stores a filename or the path to a file - this file is used by the save/restore feature. Since the file doesn't have anything to do with a vm name, rename MAX_SNAPSHOT_VMNAME to MAX_SNAPSHOT_FILENAME. Bump the size to PATH_MAX while here. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28879 --- usr.sbin/bhyve/snapshot.h | 4 ++-- usr.sbin/bhyvectl/bhyvectl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/snapshot.h b/usr.sbin/bhyve/snapshot.h index 62b2083b9830..8a6ee67ef19d 100644 --- a/usr.sbin/bhyve/snapshot.h +++ b/usr.sbin/bhyve/snapshot.h @@ -43,7 +43,7 @@ #include <ucl.h> #define BHYVE_RUN_DIR "/var/run/bhyve/" -#define MAX_SNAPSHOT_VMNAME 100 +#define MAX_SNAPSHOT_FILENAME PATH_MAX struct vmctx; @@ -67,7 +67,7 @@ enum ipc_opcode { struct checkpoint_op { unsigned int op; - char snapshot_filename[MAX_SNAPSHOT_VMNAME]; + char snapshot_filename[MAX_SNAPSHOT_FILENAME]; }; struct checkpoint_thread_info { diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index f9a790f5402e..68cc958e66ec 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1739,7 +1739,7 @@ snapshot_request(struct vmctx *ctx, const char *file, enum ipc_opcode code) struct checkpoint_op op; op.op = code; - strlcpy(op.snapshot_filename, file, MAX_SNAPSHOT_VMNAME); + strlcpy(op.snapshot_filename, file, MAX_SNAPSHOT_FILENAME); return (send_checkpoint_op_req(ctx, &op)); } From owner-dev-commits-src-all@freebsd.org Sat Feb 27 22:28:57 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BC32556353; Sat, 27 Feb 2021 22:28: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 4Dp1Qd0CxFz4T0r; Sat, 27 Feb 2021 22:28: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 C15C0254FF; Sat, 27 Feb 2021 22:28: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 11RMSucZ000885; Sat, 27 Feb 2021 22:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RMSu79000884; Sat, 27 Feb 2021 22:28:56 GMT (envelope-from git) Date: Sat, 27 Feb 2021 22:28:56 GMT Message-Id: <202102272228.11RMSu79000884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen <tuexen@FreeBSD.org> Subject: git: 70e95f0b6917 - main - sctp: avoid integer overflow when starting the HB timer 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: 70e95f0b6917a8b8cd4a2a5f883f3e9753fc86d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 22:28:57 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=70e95f0b6917a8b8cd4a2a5f883f3e9753fc86d8 commit 70e95f0b6917a8b8cd4a2a5f883f3e9753fc86d8 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2021-02-27 22:27:30 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2021-02-27 22:27:30 +0000 sctp: avoid integer overflow when starting the HB timer MFC after: 3 days Reported by: syzbot+14b9d7c3c64208fae62f@syzkaller.appspotmail.com --- sys/netinet/sctputil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 319344842d5f..7ddb4c3710df 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2277,14 +2277,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } rndval = sctp_select_initial_TSN(&inp->sctp_ep); jitter = rndval % to_ticks; - if (jitter >= (to_ticks >> 1)) { - to_ticks = to_ticks + (jitter - (to_ticks >> 1)); + to_ticks >>= 1; + if (jitter < (UINT32_MAX - to_ticks)) { + to_ticks += jitter; } else { - to_ticks = to_ticks - jitter; + to_ticks = UINT32_MAX; } if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) && !(net->dest_state & SCTP_ADDR_PF)) { - to_ticks += net->heart_beat_delay; + if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) { + to_ticks += net->heart_beat_delay; + } else { + to_ticks = UINT32_MAX; + } } /* * Now we must convert the to_ticks that are now in ms to From owner-dev-commits-src-all@freebsd.org Sat Feb 27 22:29:55 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F7C255651B; Sat, 27 Feb 2021 22:29: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 4Dp1Rl1stJz4TCd; Sat, 27 Feb 2021 22:29: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 3386C253CD; Sat, 27 Feb 2021 22:29: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 11RMTt6Q001148; Sat, 27 Feb 2021 22:29:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RMTtmP001147; Sat, 27 Feb 2021 22:29:55 GMT (envelope-from git) Date: Sat, 27 Feb 2021 22:29:55 GMT Message-Id: <202102272229.11RMTtmP001147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik <mjg@FreeBSD.org> Subject: git: 1239a722214c - main - cache: temporarily drop the assert that dvp != vp when adding an entry 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: 1239a722214c245e642733fdea2b1348101598af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 22:29:55 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1239a722214c245e642733fdea2b1348101598af commit 1239a722214c245e642733fdea2b1348101598af Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-02-27 22:23:23 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-02-27 22:29:50 +0000 cache: temporarily drop the assert that dvp != vp when adding an entry Historically it was allowed for any names, but arguably should never be even attempted. Allow it again since there is a release pending and allowing it is bug-compatible with previous behavior. Reported by: otis --- sys/kern/vfs_cache.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index fef1e31d197b..8cae0260cbf0 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2266,7 +2266,12 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, KASSERT(cnp->cn_namelen <= NAME_MAX, ("%s: passed len %ld exceeds NAME_MAX (%d)", __func__, cnp->cn_namelen, NAME_MAX)); +#ifdef notyet + /* + * Not everything doing this is weeded out yet. + */ VNPASS(dvp != vp, dvp); +#endif VNPASS(!VN_IS_DOOMED(dvp), dvp); VNPASS(dvp->v_type != VNON, dvp); if (vp != NULL) { From owner-dev-commits-src-all@freebsd.org Sat Feb 27 22:29:56 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 723ED55624C; Sat, 27 Feb 2021 22:29: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 4Dp1Rm2sNvz4TN5; Sat, 27 Feb 2021 22:29: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 53FA9252F8; Sat, 27 Feb 2021 22:29: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 11RMTuJG001171; Sat, 27 Feb 2021 22:29:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RMTuFO001170; Sat, 27 Feb 2021 22:29:56 GMT (envelope-from git) Date: Sat, 27 Feb 2021 22:29:56 GMT Message-Id: <202102272229.11RMTuFO001170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik <mjg@FreeBSD.org> Subject: git: 1d8510c1a64d - main - zfs: add missing seqc write begin/end around zfs_acl_chown_setattr 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: 1d8510c1a64d61a85c74c8b02fb12e6f31ede5a1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 22:29:56 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1d8510c1a64d61a85c74c8b02fb12e6f31ede5a1 commit 1d8510c1a64d61a85c74c8b02fb12e6f31ede5a1 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-02-27 22:26:20 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-02-27 22:29:50 +0000 zfs: add missing seqc write begin/end around zfs_acl_chown_setattr It happens to trip over an assert but does not matter for correctness at this time. However, do it for future proofing. Reported by: avg --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index d5f0da9ecd4b..8172916c4329 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -2756,7 +2756,9 @@ zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr) err = zfs_acl_chown_setattr(zp); ASSERT(err == 0); if (attrzp) { + vn_seqc_write_begin(ZTOV(attrzp)); err = zfs_acl_chown_setattr(attrzp); + vn_seqc_write_end(ZTOV(attrzp)); ASSERT(err == 0); } } From owner-dev-commits-src-all@freebsd.org Sat Feb 27 23:15:35 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBF945574C1; Sat, 27 Feb 2021 23:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dp2SR5GDMz4WnV; Sat, 27 Feb 2021 23:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A793726153; Sat, 27 Feb 2021 23:15: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 11RNFZBa066959; Sat, 27 Feb 2021 23:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RNFZSm066958; Sat, 27 Feb 2021 23:15:35 GMT (envelope-from git) Date: Sat, 27 Feb 2021 23:15:35 GMT Message-Id: <202102272315.11RNFZSm066958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller <freqlabs@FreeBSD.org> Subject: git: 1d9ba697f99a - main - libifconfig: Set error in ifconfig_get_groups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d9ba697f99a88b321a7d8b96fa142ea774cd3be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 23:15:35 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=1d9ba697f99a88b321a7d8b96fa142ea774cd3be commit 1d9ba697f99a88b321a7d8b96fa142ea774cd3be Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-02-27 08:07:21 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-02-27 23:12:23 +0000 libifconfig: Set error in ifconfig_get_groups This should return -1 with OTHER/ENOMEM set in the handle when malloc fails, like everywhere else in libifconfig. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28964 --- lib/libifconfig/libifconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libifconfig/libifconfig.c b/lib/libifconfig/libifconfig.c index e67c4e4de04e..1733239132a0 100644 --- a/lib/libifconfig/libifconfig.c +++ b/lib/libifconfig/libifconfig.c @@ -511,7 +511,9 @@ ifconfig_get_groups(ifconfig_handle_t *h, const char *name, len = ifgr->ifgr_len; ifgr->ifgr_groups = (struct ifg_req *)malloc(len); if (ifgr->ifgr_groups == NULL) { - return (1); + h->error.errtype = OTHER; + h->error.errcode = ENOMEM; + return (-1); } bzero(ifgr->ifgr_groups, len); if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFGROUP, ifgr) == -1) { From owner-dev-commits-src-all@freebsd.org Sat Feb 27 23:27:49 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B48BF5576E0; Sat, 27 Feb 2021 23:27: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 4Dp2kY4j7lz4XBv; Sat, 27 Feb 2021 23:27: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 9419F25DDC; Sat, 27 Feb 2021 23:27: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 11RNRn4A080192; Sat, 27 Feb 2021 23:27:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RNRnmU080191; Sat, 27 Feb 2021 23:27:49 GMT (envelope-from git) Date: Sat, 27 Feb 2021 23:27:49 GMT Message-Id: <202102272327.11RNRnmU080191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: b5449c92b489 - main - Use atomic_interrupt_fence() instead of bare __compiler_membar() 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/main X-Git-Reftype: branch X-Git-Commit: b5449c92b489445635c7962875ce73b2c9211bba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 27 Feb 2021 23:27:49 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b5449c92b489445635c7962875ce73b2c9211bba commit b5449c92b489445635c7962875ce73b2c9211bba Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-02-26 23:54:17 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-02-27 23:27:29 +0000 Use atomic_interrupt_fence() instead of bare __compiler_membar() for the which which definitely use membar to sync with interrupt handlers. libc and rtld uses of __compiler_membar() seems to want compiler barriers proper. The barrier in sched_unpin_lite() after td_pinned decrement seems to be not needed and removed, instead of convertion. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28956 --- sys/kern/kern_rmlock.c | 32 +++++++++++++++----------------- sys/sys/kpilite.h | 5 ++--- sys/sys/mount.h | 4 ++-- sys/sys/sched.h | 4 ++-- sys/sys/systm.h | 6 +++--- 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 9135709d88cf..f661e209b633 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -366,7 +366,7 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) * Check to see if the IPI granted us the lock after all. The load of * rmp_flags must happen after the tracker is removed from the list. */ - __compiler_membar(); + atomic_interrupt_fence(); if (tracker->rmp_flags) { /* Just add back tracker - we hold the lock. */ rm_tracker_add(pc, tracker); @@ -448,7 +448,7 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) td->td_critnest++; /* critical_enter(); */ - __compiler_membar(); + atomic_interrupt_fence(); pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ @@ -456,7 +456,7 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) sched_pin(); - __compiler_membar(); + atomic_interrupt_fence(); td->td_critnest--; @@ -873,17 +873,15 @@ db_show_rm(const struct lock_object *lock) * Concurrent writers take turns taking the lock while going off cpu. If this is * of concern for your usecase, this is not the right primitive. * - * Neither rms_rlock nor rms_runlock use fences. Instead compiler barriers are - * inserted to prevert reordering of generated code. Execution ordering is - * provided with the use of an IPI handler. + * Neither rms_rlock nor rms_runlock use thread fences. Instead interrupt + * fences are inserted to ensure ordering with the code executed in the IPI + * handler. * * No attempt is made to track which CPUs read locked at least once, * consequently write locking sends IPIs to all of them. This will become a * problem at some point. The easiest way to lessen it is to provide a bitmap. */ -#define rms_int_membar() __compiler_membar() - #define RMS_NOOWNER ((void *)0x1) #define RMS_TRANSIENT ((void *)0x2) #define RMS_FLAGMASK 0xf @@ -1030,14 +1028,14 @@ rms_rlock(struct rmslock *rms) critical_enter(); pcpu = rms_int_pcpu(rms); rms_int_influx_enter(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); if (__predict_false(rms->writers > 0)) { rms_rlock_fallback(rms); return; } - rms_int_membar(); + atomic_interrupt_fence(); rms_int_readers_inc(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); rms_int_influx_exit(rms, pcpu); critical_exit(); } @@ -1052,15 +1050,15 @@ rms_try_rlock(struct rmslock *rms) critical_enter(); pcpu = rms_int_pcpu(rms); rms_int_influx_enter(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); if (__predict_false(rms->writers > 0)) { rms_int_influx_exit(rms, pcpu); critical_exit(); return (0); } - rms_int_membar(); + atomic_interrupt_fence(); rms_int_readers_inc(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); rms_int_influx_exit(rms, pcpu); critical_exit(); return (1); @@ -1092,14 +1090,14 @@ rms_runlock(struct rmslock *rms) critical_enter(); pcpu = rms_int_pcpu(rms); rms_int_influx_enter(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); if (__predict_false(rms->writers > 0)) { rms_runlock_fallback(rms); return; } - rms_int_membar(); + atomic_interrupt_fence(); rms_int_readers_dec(rms, pcpu); - rms_int_membar(); + atomic_interrupt_fence(); rms_int_influx_exit(rms, pcpu); critical_exit(); } diff --git a/sys/sys/kpilite.h b/sys/sys/kpilite.h index 8742ef5cfbe8..2a7e9743f799 100644 --- a/sys/sys/kpilite.h +++ b/sys/sys/kpilite.h @@ -38,7 +38,7 @@ sched_pin_lite(struct thread_lite *td) KASSERT((struct thread *)td == curthread, ("sched_pin called on non curthread")); td->td_pinned++; - __compiler_membar(); + atomic_interrupt_fence(); } static __inline void @@ -47,9 +47,8 @@ sched_unpin_lite(struct thread_lite *td) KASSERT((struct thread *)td == curthread, ("sched_unpin called on non curthread")); KASSERT(td->td_pinned > 0, ("sched_unpin called on non pinned thread")); - __compiler_membar(); + atomic_interrupt_fence(); td->td_pinned--; - __compiler_membar(); } #endif #endif diff --git a/sys/sys/mount.h b/sys/sys/mount.h index ca3261a22e62..630cd521fbd0 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1091,7 +1091,7 @@ void resume_all_fs(void); _mpcpu = vfs_mount_pcpu(mp); \ MPASS(mpcpu->mntp_thread_in_ops == 0); \ _mpcpu->mntp_thread_in_ops = 1; \ - __compiler_membar(); \ + atomic_interrupt_fence(); \ if (__predict_false(mp->mnt_vfs_ops > 0)) { \ vfs_op_thread_exit_crit(mp, _mpcpu); \ _retval_crit = false; \ @@ -1111,7 +1111,7 @@ void resume_all_fs(void); #define vfs_op_thread_exit_crit(mp, _mpcpu) do { \ MPASS(_mpcpu == vfs_mount_pcpu(mp)); \ MPASS(_mpcpu->mntp_thread_in_ops == 1); \ - __compiler_membar(); \ + atomic_interrupt_fence(); \ _mpcpu->mntp_thread_in_ops = 0; \ } while (0) diff --git a/sys/sys/sched.h b/sys/sys/sched.h index d734ec61266e..64651ffa9c90 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -173,13 +173,13 @@ static __inline void sched_pin(void) { curthread->td_pinned++; - __compiler_membar(); + atomic_interrupt_fence(); } static __inline void sched_unpin(void) { - __compiler_membar(); + atomic_interrupt_fence(); curthread->td_pinned--; } diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 5de12e5bc1e5..72a10c401af9 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -284,7 +284,7 @@ critical_enter(void) td = (struct thread_lite *)curthread; td->td_critnest++; - __compiler_membar(); + atomic_interrupt_fence(); } static __inline void @@ -295,9 +295,9 @@ critical_exit(void) td = (struct thread_lite *)curthread; KASSERT(td->td_critnest != 0, ("critical_exit: td_critnest == 0")); - __compiler_membar(); + atomic_interrupt_fence(); td->td_critnest--; - __compiler_membar(); + atomic_interrupt_fence(); if (__predict_false(td->td_owepreempt)) critical_exit_preempt(); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 00:43:28 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAE93559E2C; Sun, 28 Feb 2021 00:43: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 4Dp4Pr46tpz4cJH; Sun, 28 Feb 2021 00:43: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 7FE1727421; Sun, 28 Feb 2021 00:43: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 11S0hStO084141; Sun, 28 Feb 2021 00:43:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S0hSRv084139; Sun, 28 Feb 2021 00:43:28 GMT (envelope-from git) Date: Sun, 28 Feb 2021 00:43:28 GMT Message-Id: <202102280043.11S0hSRv084139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 5d684701ca9a - stable/13 - Delete dead CLUSTERDEBUG config option. 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: 5d684701ca9a065ae46e35a2c5f6c2bc6df58e6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 00:43:28 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5d684701ca9a065ae46e35a2c5f6c2bc6df58e6b commit 5d684701ca9a065ae46e35a2c5f6c2bc6df58e6b Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-02-18 09:12:26 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-02-28 00:42:35 +0000 Delete dead CLUSTERDEBUG config option. (cherry picked from commit 750ea20d3fb143a95ccf3ff84cfbe86cce9b9cac) --- sys/conf/NOTES | 3 --- sys/conf/options | 1 - sys/kern/vfs_cluster.c | 8 -------- 3 files changed, 12 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index b4202bb65618..f73b5a466366 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2732,9 +2732,6 @@ options NSWBUF_MIN=120 options CAM_DEBUG_DELAY -# VFS cluster debugging. -options CLUSTERDEBUG - options DEBUG # Kernel filelock debugging. diff --git a/sys/conf/options b/sys/conf/options index 2f324143c574..b6956193d841 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -570,7 +570,6 @@ TI_JUMBO_HDRSPLIT opt_ti.h # Misc debug flags. Most of these should probably be replaced with # 'DEBUG', and then let people recompile just the interesting modules # with 'make CC="cc -DDEBUG"'. -CLUSTERDEBUG opt_debug_cluster.h DEBUG_1284 opt_ppb_1284.h LPT_DEBUG opt_lpt.h PLIP_DEBUG opt_plip.h diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 6b77adf5df34..60f22fd38764 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -36,8 +36,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_debug_cluster.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -56,12 +54,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_page.h> #include <sys/sysctl.h> -#if defined(CLUSTERDEBUG) -static int rcluster= 0; -SYSCTL_INT(_debug, OID_AUTO, rcluster, CTLFLAG_RW, &rcluster, 0, - "Debug VFS clustering code"); -#endif - static MALLOC_DEFINE(M_SEGMENT, "cl_savebuf", "cluster_save buffer"); static uma_zone_t cluster_pbuf_zone; From owner-dev-commits-src-all@freebsd.org Sun Feb 28 01:10:30 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6D5355B4D7; Sun, 28 Feb 2021 01:10:30 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dp5124XMwz4dkf; Sun, 28 Feb 2021 01:10:30 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 8451622043; Sun, 28 Feb 2021 01:10:30 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 033D827C0054; Sat, 27 Feb 2021 20:10:29 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Sat, 27 Feb 2021 20:10:30 -0500 X-ME-Sender: <xms:he06YD4eJhWmp_6T9Zi_l1lO4L5LiuWfyqDJn8KMqvLtf2teAOUpIA> <xme:he06YI6whC2pAackeLHhBnqqeqjVVQH4bmJ9aJzAlJgmKstrP6G8dxXjl2GkfG--p FvDnyAwawvU1Msd> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeggdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredtreer jeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgohhnse fhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfeftddutdelgeekgedt geejkeffvdejtddthefggfevuefggfefledvgefhgfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgruhht hhhpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsughrrg hgohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: <xmx:he06YKcYZ3Y1O-W-iXeQEu0NNDy3o88xOZxdK0LuYD5VoOXhkYGjNw> <xmx:he06YEL14tpd6UvUnGBjOvqh6K1WM1CZWzbPu-9MlgR2YZVsT6XB_w> <xmx:he06YHJ9F6zEwInL6Wxr3NrqksIkXn2j2wzHMVkjdlcoBn210OLEHw> <xmx:he06YP22TSsuba0DfOiw8B0m46n4jyz2-QBiD45aczc_GNYWwU5q5w> Received: by mailuser.nyi.internal (Postfix, from userid 501) id 415BECA005D; Sat, 27 Feb 2021 20:10:29 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> In-Reply-To: <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> Date: Sat, 27 Feb 2021 19:10:08 -0600 From: "Brandon Bergren" <bdragon@FreeBSD.org> To: "Nathan Whitehorn" <nwhitehorn@freebsd.org>, "Warner Losh" <imp@bsdimp.com> Cc: "Colin Percival" <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_0b7472b3d8d2_-_main_-_Mount_the_EFI_system_partition_?= =?UTF-8?Q?(ESP)_on_newly-installed_systems.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 01:10:30 -0000 This is mistakenly detecting pseries powerpc64* as an EFI platform and causing install to error out. Please add back the uname checks so this code doesn't run on powerpc*. -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Sun Feb 28 01:22:24 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 967A155C2D8; Sun, 28 Feb 2021 01:22:24 +0000 (UTC) (envelope-from bdragon@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 4Dp5Gm3cBSz4ft3; Sun, 28 Feb 2021 01:22:24 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 6789E222B9; Sun, 28 Feb 2021 01:22:24 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 55A7227C0054; Sat, 27 Feb 2021 20:22:24 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Sat, 27 Feb 2021 20:22:24 -0500 X-ME-Sender: <xms:UPA6YISDlT85bbGcyO5qQrxvxKcQ5e_TJDKsHsXFsrFBRZIQQQM35Q> <xme:UPA6YFyzd2RpWU3n5LlDtsvZlRSBA1rAedz5R5iZypWjB1NmHzL96vl67tjENfy9_ Rxb6FEX-a8k0SCa> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeggdeffecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredtreer jeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgohhnse fhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfeftddutdelgeekgedt geejkeffvdejtddthefggfevuefggfefledvgefhgfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgruhht hhhpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsughrrg hgohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: <xmx:UPA6YF1eTGqRfpucxEGC5TZI8_0mhPon4Jc9kbYTfNX8MDdfLYesgA> <xmx:UPA6YMAn68dKfE_tzTDGeDwSTqRH6CV5o8oXoxjcmRZZnTaBeHZVtg> <xmx:UPA6YBgxGsbEVZkOdGdKToKuFnnnk4mjd5clh8hf0CTeLbwSX3aCTA> <xmx:UPA6YBcPpDnRWB9iGkWZFyFVmiXQVb5VpDV6gjFVsVrx9JxDQ1BJow> Received: by mailuser.nyi.internal (Postfix, from userid 501) id 04286CA005D; Sat, 27 Feb 2021 20:22:23 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> In-Reply-To: <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> Date: Sat, 27 Feb 2021 19:22:02 -0600 From: "Brandon Bergren" <bdragon@FreeBSD.org> To: "Brandon Bergren" <bdragon@FreeBSD.org>, "Nathan Whitehorn" <nwhitehorn@freebsd.org>, "Warner Losh" <imp@bsdimp.com> Cc: "Colin Percival" <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_0b7472b3d8d2_-_main_-_Mount_the_EFI_system_partition_?= =?UTF-8?Q?(ESP)_on_newly-installed_systems.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 01:22:24 -0000 On Sat, Feb 27, 2021, at 7:10 PM, Brandon Bergren wrote: > This is mistakenly detecting pseries powerpc64* as an EFI platform and > causing install to error out. Please add back the uname checks so this > code doesn't run on powerpc*. Specifically, the /boot/efi stuff in usr.sbin/bsdinstall/scripts/bootconfig should not run on mips / 32 bit ARM / powerpc* systems. I believe /boot/efi is always created so it can't be used to infer existence of EFI. -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Sun Feb 28 01:25:47 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4D4655C7B3 for <dev-commits-src-all@mailman.nyi.freebsd.org>; Sun, 28 Feb 2021 01:25:47 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 4Dp5Lg4Hz3z4gVv for <dev-commits-src-all@freebsd.org>; Sun, 28 Feb 2021 01:25:47 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f49.google.com with SMTP id 7so12347934wrz.0 for <dev-commits-src-all@freebsd.org>; Sat, 27 Feb 2021 17:25:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fzt51C3bax2YGOmouoWbdGfRiCppMoD8eqe3rHoQCfg=; b=WqVF5vXn5CPFzAanZxS+PCbquwhhpMKLaZbbGkZucoZRCmhF/7BRiyJ1Y/VzcMNdtX tleyUooiOMQ87Wrtb0oOXY8cHF5y6FQOZKGerA8PdYAUMO9yFwyS6cMwNuK+TX52knAz IgrvZxD+7MIsSpamHNua73M5EZcJsFT+GtfsDjm4REOVw2dZmjIWsxJi/iCWCps1et8X kbeYH3hlemdQgRTn/g1hMKoWnhEhHPSACBDqf1+zvjdLL0nwE9fE+evAYOxNmytqeDwj S18lFe+0VGLWHQ0yaAg0/JJXS1ocN8EQ1THJMm4/vQUtw+Wo7HCG0CyELYMdIgcvV3cS hp4g== X-Gm-Message-State: AOAM532rcUaYIzZXR/lfR1RF0zhsLdHySbjytBoddSvxtsnQfOstLDoL atKA/hMe/JvwuWW8tR8/AzDfcQ== X-Google-Smtp-Source: ABdhPJwRRX3MKjgS911Lb9eCzVJOXZPri1yX9aNY2jOu6bBtyuNN339MYFTDkCWU/rj+KoRfbQpbGA== X-Received: by 2002:a5d:62d1:: with SMTP id o17mr10234107wrv.111.1614475546183; Sat, 27 Feb 2021 17:25:46 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id d204sm9714414wmc.17.2021.02.27.17.25.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Feb 2021 17:25:45 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. From: Jessica Clarke <jrtc27@freebsd.org> In-Reply-To: <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> Date: Sun, 28 Feb 2021 01:25:44 +0000 Cc: Nathan Whitehorn <nwhitehorn@freebsd.org>, Warner Losh <imp@bsdimp.com>, Colin Percival <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> To: Brandon Bergren <bdragon@FreeBSD.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4Dp5Lg4Hz3z4gVv 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 01:25:47 -0000 On 28 Feb 2021, at 01:22, Brandon Bergren <bdragon@FreeBSD.org> wrote: >=20 > On Sat, Feb 27, 2021, at 7:10 PM, Brandon Bergren wrote: >> This is mistakenly detecting pseries powerpc64* as an EFI platform = and=20 >> causing install to error out. Please add back the uname checks so = this=20 >> code doesn't run on powerpc*. >=20 > Specifically, the /boot/efi stuff in = usr.sbin/bsdinstall/scripts/bootconfig should not run on mips / 32 bit = ARM / powerpc* systems. I believe /boot/efi is always created so it = can't be used to infer existence of EFI. 32-bit Arm can boot via EFI. Just mips* and powerpc*. Jess From owner-dev-commits-src-all@freebsd.org Sun Feb 28 01:56:43 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D351A55CD64; Sun, 28 Feb 2021 01:56: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 4Dp62M5bGQz4hWd; Sun, 28 Feb 2021 01:56: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 B2BFC605; Sun, 28 Feb 2021 01:56: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 11S1uhgi076970; Sun, 28 Feb 2021 01:56:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S1uhD3076969; Sun, 28 Feb 2021 01:56:43 GMT (envelope-from git) Date: Sun, 28 Feb 2021 01:56:43 GMT Message-Id: <202102280156.11S1uhD3076969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: 3fe2c68ba20f - main - nfsclient: fix panic in cache_enter_time() 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: 3fe2c68ba20fb3365ef91e0b85f88237b5369f38 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 01:56:43 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3fe2c68ba20fb3365ef91e0b85f88237b5369f38 commit 3fe2c68ba20fb3365ef91e0b85f88237b5369f38 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-02-28 01:54:05 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-02-28 01:54:05 +0000 nfsclient: fix panic in cache_enter_time() Juraj Lutter (otis@) reported a panic "dvp != vp not true" in cache_enter_time() called from the NFS client's nfsrpc_readdirplus() function. This is specific to an NFSv3 mount with the "rdirplus" mount option. Unlike NFSv4, NFSv3 replies to ReaddirPlus includes entries for the current directory. This trivial patch avoids doing a cache_enter_time() call for the current directory to avoid the panic. Reported by: otis Tested by: otis Reviewed by: mjg MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28969 --- sys/fs/nfsclient/nfs_clrpcops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index b4f2d5301d13..c95d4dc58e7a 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3761,6 +3761,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ndp->ni_vp = newvp; NFSCNHASH(cnp, HASHINIT); if (cnp->cn_namelen <= NCHNAMLEN && + ndp->ni_dvp != ndp->ni_vp && (newvp->v_type != VDIR || dctime.tv_sec != 0)) { cache_enter_time(ndp->ni_dvp, From owner-dev-commits-src-all@freebsd.org Sun Feb 28 02:20:42 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E05CC55D426; Sun, 28 Feb 2021 02:20: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 4Dp6Z262kFz4jLq; Sun, 28 Feb 2021 02:20: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 C291A73B; Sun, 28 Feb 2021 02:20: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 11S2KgLJ012181; Sun, 28 Feb 2021 02:20:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S2Kgnr012180; Sun, 28 Feb 2021 02:20:42 GMT (envelope-from git) Date: Sun, 28 Feb 2021 02:20:42 GMT Message-Id: <202102280220.11S2Kgnr012180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller <freqlabs@FreeBSD.org> Subject: git: da393346ac47 - main - sbin/ifconfig: Get carp status with libifconfig MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da393346ac47b22b5f8af4040a59971faadd2c5c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 02:20:42 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=da393346ac47b22b5f8af4040a59971faadd2c5c commit da393346ac47b22b5f8af4040a59971faadd2c5c Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-02-26 23:40:58 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-02-28 02:20:38 +0000 sbin/ifconfig: Get carp status with libifconfig A trivial change now that ifconfig is already using libifconfig. Reviewed by: kp (earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28955 --- sbin/ifconfig/carp.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c index dcf966d873ee..d6f8d78ba920 100644 --- a/sbin/ifconfig/carp.c +++ b/sbin/ifconfig/carp.c @@ -50,6 +50,8 @@ #include <err.h> #include <errno.h> +#include <libifconfig.h> + #include "ifconfig.h" static const char *carp_states[] = { CARP_STATES }; @@ -71,16 +73,16 @@ static void carp_status(int s) { struct carpreq carpr[CARP_MAXVHID]; - int i; + ifconfig_handle_t *lifh; - bzero(carpr, sizeof(struct carpreq) * CARP_MAXVHID); - carpr[0].carpr_count = CARP_MAXVHID; - ifr.ifr_data = (caddr_t)&carpr; - - if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) + lifh = ifconfig_open(); + if (lifh == NULL) return; - for (i = 0; i < carpr[0].carpr_count; i++) { + if (ifconfig_carp_get_info(lifh, name, carpr, CARP_MAXVHID) == -1) + goto close; + + for (size_t i = 0; i < carpr[0].carpr_count; i++) { printf("\tcarp: %s vhid %d advbase %d advskew %d", carp_states[carpr[i].carpr_state], carpr[i].carpr_vhid, carpr[i].carpr_advbase, carpr[i].carpr_advskew); @@ -89,6 +91,8 @@ carp_status(int s) else printf("\n"); } +close: + ifconfig_close(lifh); } static void From owner-dev-commits-src-all@freebsd.org Sun Feb 28 02:20:45 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B299155D5E2; Sun, 28 Feb 2021 02:20: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 4Dp6Z51mpHz4jC6; Sun, 28 Feb 2021 02:20: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 14BBA907; Sun, 28 Feb 2021 02:20: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 11S2Ki44012221; Sun, 28 Feb 2021 02:20:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S2KitD012220; Sun, 28 Feb 2021 02:20:44 GMT (envelope-from git) Date: Sun, 28 Feb 2021 02:20:44 GMT Message-Id: <202102280220.11S2KitD012220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller <freqlabs@FreeBSD.org> Subject: git: 9995455218ff - main - sbin/ifconfig: Drop local name var in sfp_status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9995455218ff19df9cf0dcaf0198269dc76eeb2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 02:20:45 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=9995455218ff19df9cf0dcaf0198269dc76eeb2d commit 9995455218ff19df9cf0dcaf0198269dc76eeb2d Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-02-28 02:15:11 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-02-28 02:20:38 +0000 sbin/ifconfig: Drop local name var in sfp_status There is already a globally defined name variable. MFC after: 1 week --- sbin/ifconfig/sfp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sbin/ifconfig/sfp.c b/sbin/ifconfig/sfp.c index b7bdc74d42e8..15ff22639060 100644 --- a/sbin/ifconfig/sfp.c +++ b/sbin/ifconfig/sfp.c @@ -62,15 +62,12 @@ sfp_status(int s, struct ifreq *ifr, int verbose) struct ifconfig_sfp_vendor_info vendor_info; struct ifconfig_sfp_status status; ifconfig_handle_t *lifh; - const char *name; size_t channel_count; lifh = ifconfig_open(); if (lifh == NULL) return; - name = ifr->ifr_name; - if (ifconfig_sfp_get_sfp_info(lifh, name, &info) == -1) goto close; From owner-dev-commits-src-all@freebsd.org Sun Feb 28 02:20:44 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31C0355D1FB; Sun, 28 Feb 2021 02:20: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 4Dp6Z36rhTz4jBy; Sun, 28 Feb 2021 02:20: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 D8FDF906; Sun, 28 Feb 2021 02:20: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 11S2Kh2i012203; Sun, 28 Feb 2021 02:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S2KhHt012202; Sun, 28 Feb 2021 02:20:43 GMT (envelope-from git) Date: Sun, 28 Feb 2021 02:20:43 GMT Message-Id: <202102280220.11S2KhHt012202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller <freqlabs@FreeBSD.org> Subject: git: a0ebb915045e - main - sbin/ifconfig: Get lagg status with libifconfig MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0ebb915045ed0056decec5f001471af4e999f61 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 02:20:44 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=a0ebb915045ed0056decec5f001471af4e999f61 commit a0ebb915045ed0056decec5f001471af4e999f61 Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-02-27 03:05:31 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-02-28 02:20:38 +0000 sbin/ifconfig: Get lagg status with libifconfig Also trimmed an unused block of code that never prints out LAGG_PROTOS. Reviewed by: kp (earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28961 --- sbin/ifconfig/iflagg.c | 144 ++++++++++++++++++++++++------------------------- 1 file changed, 70 insertions(+), 74 deletions(-) diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c index 5be8c67cd72a..5e726115662a 100644 --- a/sbin/ifconfig/iflagg.c +++ b/sbin/ifconfig/iflagg.c @@ -28,6 +28,8 @@ static const char rcsid[] = #include <err.h> #include <errno.h> +#include <libifconfig.h> + #include "ifconfig.h" static struct iflaggparam params = { @@ -216,93 +218,87 @@ lacp_format_peer(struct lacp_opreq *req, const char *sep) static void lagg_status(int s) { - struct lagg_protos lpr[] = LAGG_PROTOS; - struct lagg_reqport rpbuf[LAGG_MAX_PORTS]; - struct lagg_reqall ra; - struct lagg_reqopts ro; - struct lagg_reqflags rf; + struct lagg_protos protos[] = LAGG_PROTOS; + ifconfig_handle_t *lifh; + struct ifconfig_lagg_status *lagg; + struct lagg_reqall *ra; + struct lagg_reqflags *rf; + struct lagg_reqopts *ro; + struct lagg_reqport *ports; struct lacp_opreq *lp; - const char *proto = "<unknown>"; - int i; + const char *proto; - bzero(&ra, sizeof(ra)); - bzero(&ro, sizeof(ro)); + lifh = ifconfig_open(); + if (lifh == NULL) + return; - strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname)); - ra.ra_size = sizeof(rpbuf); - ra.ra_port = rpbuf; + if (ifconfig_lagg_get_lagg_status(lifh, name, &lagg) == -1) + goto close; - strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); - ioctl(s, SIOCGLAGGOPTS, &ro); + ra = lagg->ra; + rf = lagg->rf; + ro = lagg->ro; + ports = ra->ra_port; - strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); - if (ioctl(s, SIOCGLAGGFLAGS, &rf) != 0) - rf.rf_flags = 0; + proto = "<unknown>"; + for (size_t i = 0; i < nitems(protos); ++i) { + if (ra->ra_proto == protos[i].lpr_proto) { + proto = protos[i].lpr_name; + break; + } + } + printf("\tlaggproto %s", proto); - if (ioctl(s, SIOCGLAGG, &ra) == 0) { - lp = (struct lacp_opreq *)&ra.ra_lacpreq; + if (rf->rf_flags & LAGG_F_HASHMASK) { + const char *sep = ""; - for (i = 0; i < nitems(lpr); i++) { - if (ra.ra_proto == lpr[i].lpr_proto) { - proto = lpr[i].lpr_name; - break; - } + printf(" lagghash "); + if (rf->rf_flags & LAGG_F_HASHL2) { + printf("%sl2", sep); + sep = ","; } - - printf("\tlaggproto %s", proto); - if (rf.rf_flags & LAGG_F_HASHMASK) { - const char *sep = ""; - - printf(" lagghash "); - if (rf.rf_flags & LAGG_F_HASHL2) { - printf("%sl2", sep); - sep = ","; - } - if (rf.rf_flags & LAGG_F_HASHL3) { - printf("%sl3", sep); - sep = ","; - } - if (rf.rf_flags & LAGG_F_HASHL4) { - printf("%sl4", sep); - sep = ","; - } + if (rf->rf_flags & LAGG_F_HASHL3) { + printf("%sl3", sep); + sep = ","; } - putchar('\n'); - if (verbose) { - printf("\tlagg options:\n"); - printb("\t\tflags", ro.ro_opts, LAGG_OPT_BITS); - putchar('\n'); - printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift); - if (ra.ra_proto == LAGG_PROTO_ROUNDROBIN) - printf("\t\trr_limit: %d\n", ro.ro_bkt); - printf("\tlagg statistics:\n"); - printf("\t\tactive ports: %d\n", ro.ro_active); - printf("\t\tflapping: %u\n", ro.ro_flapping); - if (ra.ra_proto == LAGG_PROTO_LACP) { - printf("\tlag id: %s\n", - lacp_format_peer(lp, "\n\t\t ")); - } + if (rf->rf_flags & LAGG_F_HASHL4) { + printf("%sl4", sep); + sep = ","; } - - for (i = 0; i < ra.ra_ports; i++) { - lp = (struct lacp_opreq *)&rpbuf[i].rp_lacpreq; - printf("\tlaggport: %s ", rpbuf[i].rp_portname); - printb("flags", rpbuf[i].rp_flags, LAGG_PORT_BITS); - if (verbose && ra.ra_proto == LAGG_PROTO_LACP) - printb(" state", lp->actor_state, - LACP_STATE_BITS); - putchar('\n'); - if (verbose && ra.ra_proto == LAGG_PROTO_LACP) - printf("\t\t%s\n", - lacp_format_peer(lp, "\n\t\t ")); + } + putchar('\n'); + if (verbose) { + printf("\tlagg options:\n"); + printb("\t\tflags", ro->ro_opts, LAGG_OPT_BITS); + putchar('\n'); + printf("\t\tflowid_shift: %d\n", ro->ro_flowid_shift); + if (ra->ra_proto == LAGG_PROTO_ROUNDROBIN) + printf("\t\trr_limit: %d\n", ro->ro_bkt); + printf("\tlagg statistics:\n"); + printf("\t\tactive ports: %d\n", ro->ro_active); + printf("\t\tflapping: %u\n", ro->ro_flapping); + if (ra->ra_proto == LAGG_PROTO_LACP) { + lp = &ra->ra_lacpreq; + printf("\tlag id: %s\n", + lacp_format_peer(lp, "\n\t\t ")); } + } - if (0 /* XXX */) { - printf("\tsupported aggregation protocols:\n"); - for (i = 0; i < nitems(lpr); i++) - printf("\t\tlaggproto %s\n", lpr[i].lpr_name); - } + for (size_t i = 0; i < ra->ra_ports; ++i) { + lp = &ports[i].rp_lacpreq; + printf("\tlaggport: %s ", ports[i].rp_portname); + printb("flags", ports[i].rp_flags, LAGG_PORT_BITS); + if (verbose && ra->ra_proto == LAGG_PROTO_LACP) + printb(" state", lp->actor_state, LACP_STATE_BITS); + putchar('\n'); + if (verbose && ra->ra_proto == LAGG_PROTO_LACP) + printf("\t\t%s\n", + lacp_format_peer(lp, "\n\t\t ")); } + + ifconfig_lagg_free_lagg_status(lagg); +close: + ifconfig_close(lifh); } static From owner-dev-commits-src-all@freebsd.org Sun Feb 28 02:29:58 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1752155DB16; Sun, 28 Feb 2021 02:29:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4Dp6mj4z1nz4k2t; Sun, 28 Feb 2021 02:29:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 11S2TnJ4082146 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 28 Feb 2021 04:29:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 11S2TnJ4082146 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 11S2TnMf082145; Sun, 28 Feb 2021 04:29:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 28 Feb 2021 04:29:49 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Rick Macklem <rmacklem@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3fe2c68ba20f - main - nfsclient: fix panic in cache_enter_time() Message-ID: <YDsAHbgjfd87RHpx@kib.kiev.ua> References: <202102280156.11S1uhD3076969@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102280156.11S1uhD3076969@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4Dp6mj4z1nz4k2t 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 02:29:58 -0000 On Sun, Feb 28, 2021 at 01:56:43AM +0000, Rick Macklem wrote: > The branch main has been updated by rmacklem: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3fe2c68ba20fb3365ef91e0b85f88237b5369f38 > > commit 3fe2c68ba20fb3365ef91e0b85f88237b5369f38 > Author: Rick Macklem <rmacklem@FreeBSD.org> > AuthorDate: 2021-02-28 01:54:05 +0000 > Commit: Rick Macklem <rmacklem@FreeBSD.org> > CommitDate: 2021-02-28 01:54:05 +0000 > > nfsclient: fix panic in cache_enter_time() > > Juraj Lutter (otis@) reported a panic "dvp != vp not true" in > cache_enter_time() called from the NFS client's nfsrpc_readdirplus() > function. > This is specific to an NFSv3 mount with the "rdirplus" mount > option. Unlike NFSv4, NFSv3 replies to ReaddirPlus > includes entries for the current directory. Should we check cache_enterXXX() args for other places, like lookup, as well? Malicious or buggy server could return the vp == dvp even for case other than dot. BTW, for some cases, dotdot can result in dvp == vp as well. From owner-dev-commits-src-all@freebsd.org Sun Feb 28 02:33:03 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6347355DDA0; Sun, 28 Feb 2021 02:33:03 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dp6rH24hVz4kYh; Sun, 28 Feb 2021 02:33:03 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 389EC22815; Sun, 28 Feb 2021 02:33:03 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id E610927C0054; Sat, 27 Feb 2021 21:33:02 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Sat, 27 Feb 2021 21:33:02 -0500 X-ME-Sender: <xms:3gA7YAPwrdKl0kFXgHhQGKW96QcanCV2cSQcC2bAbmqiTq3kXRx0pw> <xme:3gA7YG__ax406Re-HV7BxuyxnbxQFv8Zqdglu3a2AY1rPpm5RatWfknKHLSWb7ML3 LKhpLJ0W0OlwA_M> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeggdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredtreer jeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgohhnse fhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeekgfeljeeuudekkefgteeg udelhfduteefhfefkeffjeegkeduveeiveffieejfeenucffohhmrghinhepohhpthhsrd hmkhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegs ughrrghgohhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddutdegvdefhe ekieegqddukedutdekheduqdgsughrrghgohhnpeephfhrvggvuefuffdrohhrghesihhm rghprdgttg X-ME-Proxy: <xmx:3gA7YHTULa871wuWa467xtAHi41J8VJwZXQLypO70a4Vh6aQdG3Z8Q> <xmx:3gA7YIsZN3tCoLMoNzMpYAo2BOKZjZoxIO4FAgILkgajR8tSfuSnVg> <xmx:3gA7YIeG0EkLCDLQE5jACHkUo0KB97UDASXm_H33nJNI7jxVZJ_zxQ> <xmx:3gA7YH5ZxnUSZYd2LLvJPRmzJDVLuGMr85dHQmc2NXxAI_ByKY2z_A> Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7024ACA005D; Sat, 27 Feb 2021 21:33:02 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <59b0dc6e-24ec-4df3-ab72-4a9c676855b2@www.fastmail.com> In-Reply-To: <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> Date: Sat, 27 Feb 2021 20:32:42 -0600 From: "Brandon Bergren" <bdragon@FreeBSD.org> To: "Jessica Clarke" <jrtc27@freebsd.org> Cc: "Nathan Whitehorn" <nwhitehorn@freebsd.org>, "Warner Losh" <imp@bsdimp.com>, "Colin Percival" <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_0b7472b3d8d2_-_main_-_Mount_the_EFI_system_partition_?= =?UTF-8?Q?(ESP)_on_newly-installed_systems.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 02:33:03 -0000 On Sat, Feb 27, 2021, at 7:25 PM, Jessica Clarke wrote: > > 32-bit Arm can boot via EFI. Just mips* and powerpc*. > > Jess Ah, thanks. Yeah, that matches with which platforms mark the EFI option as BROKEN in src.opts.mk to prevent the tools from being built. > > -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Sun Feb 28 02:39:38 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D28B55DAE2 for <dev-commits-src-all@mailman.nyi.freebsd.org>; Sun, 28 Feb 2021 02:39:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (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 4Dp6zt3Qc3z4kZq for <dev-commits-src-all@freebsd.org>; Sun, 28 Feb 2021 02:39:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf34.google.com with SMTP id k7so3876916qvo.6 for <dev-commits-src-all@freebsd.org>; Sat, 27 Feb 2021 18:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SZQtdZDkNGyYqENqZH+j0EVHFbfcTFfbcZMQXuAKhvw=; b=NwE1zbikGeFZ3I4RWirhnjsJtsMxMj13OsIXPyBn1ckQP79A9NX/4wgnNMcuVHgSUK 6qUt/Wyk1p5uWAv7eZOp1UVaW7HkGezglckWuFb+y23hqP5oKj5nXz07Iit0df/CL3tz zVYxCTpzJiuEMq3UN5ruZacusxGY/OCAPrjEZMNHyqnFusk/TZw3EDjaoF6JnGHPDull JD7jN8agonrBWFEr9FDyJtulzmkF2rcJhVtHeh8yU4THsfr07ysaQJSHgHND0Cl+xgdX ZCpdA3Yf+zf5Y/ZMGSbTUP+obhwsa1Ov56U0hQfc9p9hzI95g0krPFFT6ymuoekLwYdH abAQ== 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=SZQtdZDkNGyYqENqZH+j0EVHFbfcTFfbcZMQXuAKhvw=; b=YnbFB0daFVAgxudl9z4gzH5QOR+Pa+j0QeDjEE7BSOScHxADoN/FJ8JzbN3s4Lyh7l SRfMKwMggn3Pl2GBlurllM6YrHTMzMI0IMMN8+PVmGZ0DqcvspQfAsnCWASfEuptvlMP 6VmsBOhpm7imsPoa944FnceALfr3It2o55DE0SSWB/DN8Yst/ipRr1tJEJwO1O1/64S6 0jt8x+k6pfrttO2LSAVpdK0wuwrvHq7CxBZBF/fH1lvnk1zoBkA4C+nJ+ne/jFiaV6hm 9eegipScJEc8Z5VNkjBPT8KAU2G0/O3swZRNZ8nDoEptq4Yeo5fZcHazCW9DYJhaRk3f VrgQ== X-Gm-Message-State: AOAM533ENQ+MGtDg2N7m0W7HQB/ukdk1cRfzMvbuo5Fetb3ZJrcwYw00 35Lumj7dtW3KNzwbq2fsve6Gpz2vPgbbf4V+Tt7tpg== X-Google-Smtp-Source: ABdhPJwegWDusaTIB3bPmOpgMiGrD2mYkbQiqs76HoMQ7eqJSNZKw0GMac7Ch1kQSHF0VmZxhwOkDBBHQ5MPFnGAUOQ= X-Received: by 2002:a05:6214:15d1:: with SMTP id p17mr590706qvz.28.1614479977504; Sat, 27 Feb 2021 18:39:37 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> In-Reply-To: <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> From: Warner Losh <imp@bsdimp.com> Date: Sat, 27 Feb 2021 19:39:25 -0700 Message-ID: <CANCZdfpw1+sjHVPH4zahywMsLHJ1jKWbnd5A3RjGinu=nQFSGA@mail.gmail.com> Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Jessica Clarke <jrtc27@freebsd.org> Cc: Brandon Bergren <bdragon@freebsd.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>, Colin Percival <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Dp6zt3Qc3z4kZq 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 02:39:38 -0000 On Sat, Feb 27, 2021, 6:25 PM Jessica Clarke <jrtc27@freebsd.org> wrote: > On 28 Feb 2021, at 01:22, Brandon Bergren <bdragon@FreeBSD.org> wrote: > > > > On Sat, Feb 27, 2021, at 7:10 PM, Brandon Bergren wrote: > >> This is mistakenly detecting pseries powerpc64* as an EFI platform and > >> causing install to error out. Please add back the uname checks so this > >> code doesn't run on powerpc*. > > > > Specifically, the /boot/efi stuff in > usr.sbin/bsdinstall/scripts/bootconfig should not run on mips / 32 bit ARM > / powerpc* systems. I believe /boot/efi is always created so it can't be > used to infer existence of EFI. > > 32-bit Arm can boot via EFI. Just mips* and powerpc*. > There was some rumblings of little endian powerpc64 efi, but I don't think it's ready... > Yea, we have long since switched our preferred boot on arm to EFI... though we don't have installer images for 32bit arm, which is this runs... so it's needed for correctness, but not a practical difference... Warner > From owner-dev-commits-src-all@freebsd.org Sun Feb 28 03:01:46 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D03B755E6BD; Sun, 28 Feb 2021 03:01:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dp7TQ45kWz4m3G; Sun, 28 Feb 2021 03:01:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 7DD6922A54; Sun, 28 Feb 2021 03:01:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 4E31327C0054; Sat, 27 Feb 2021 22:01:46 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Sat, 27 Feb 2021 22:01:46 -0500 X-ME-Sender: <xms:mQc7YKywHXtsBtNo5XYskrCwNjABP-Uci4tX3E7qonhra3c8TPasTQ> <xme:mQc7YGTd5GYxY-FLbYEWRIdlllgfXIHziq2uqPHfDIbkioS3dXzi65l0ow5htfEEw yyag_K-_3sVVc8j> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeggdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredtreer jeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgohhnse fhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfeftddutdelgeekgedt geejkeffvdejtddthefggfevuefggfefledvgefhgfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgruhht hhhpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsughrrg hgohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: <xmx:mQc7YMVz6jUpWDBoGVB296odslAPGZl2DvePvc7GU-A9Hwoi7Taj0A> <xmx:mQc7YAi1VW0-4sxzuZhpvkFXceDMBPazrR0LxlsbSlFyTO365te97Q> <xmx:mQc7YMAIx51HFTq-agAZe-5nk_ExIFp-MEG7aoHW_AgAQRI3s4vvvg> <xmx:mgc7YP-nChOYjpD4lbRB5P2lvSJoWleKvQfRQ5QFXS6zv2hjKpnxNQ> Received: by mailuser.nyi.internal (Postfix, from userid 501) id D566FCA005D; Sat, 27 Feb 2021 22:01:45 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <a30870ef-00b1-40b6-b378-033d8737c7e4@www.fastmail.com> In-Reply-To: <CANCZdfpw1+sjHVPH4zahywMsLHJ1jKWbnd5A3RjGinu=nQFSGA@mail.gmail.com> References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> <CANCZdfpw1+sjHVPH4zahywMsLHJ1jKWbnd5A3RjGinu=nQFSGA@mail.gmail.com> Date: Sat, 27 Feb 2021 21:01:25 -0600 From: "Brandon Bergren" <bdragon@FreeBSD.org> To: "Warner Losh" <imp@bsdimp.com>, "Jessica Clarke" <jrtc27@freebsd.org> Cc: "Nathan Whitehorn" <nwhitehorn@freebsd.org>, "Colin Percival" <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_0b7472b3d8d2_-_main_-_Mount_the_EFI_system_partition_?= =?UTF-8?Q?(ESP)_on_newly-installed_systems.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 03:01:46 -0000 On Sat, Feb 27, 2021, at 8:39 PM, Warner Losh wrote: > > 32-bit Arm can boot via EFI. Just mips* and powerpc*. > > There was some rumblings of little endian powerpc64 efi, but I don't > think it's ready... I've never heard of such things. PAPR/LoPAPR/LoPAR (pseries) is specified as an OpenFirmware platform, and I don't see that changing in the future given the way it's baked into the spec. And PowerNV is a minimal-runtime-services platform where the runtime abstraction (OPAL) calls don't include any sort of way to access disk devices. Do you mean alternative firmware for PowerNV? I've heard people talking on and off about coreboot, but I don't see that becoming mainstream over the petitboot skiroot payload. I don't see the pseries virtualization requirements changing away from OpenFirmware in the future either, given the OpenFirmware requirement has been a constant all the way back to CHRP. > > Yea, we have long since switched our preferred boot on arm to EFI... > though we don't have installer images for 32bit arm, which is this > runs... so it's needed for correctness, but not a practical > difference... > > Warner -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Sun Feb 28 03:18:19 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D1D055E9AC for <dev-commits-src-all@mailman.nyi.freebsd.org>; Sun, 28 Feb 2021 03:18:19 +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 4Dp7rW3ctwz4mQ0 for <dev-commits-src-all@freebsd.org>; Sun, 28 Feb 2021 03:18:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id q85so13295570qke.8 for <dev-commits-src-all@freebsd.org>; Sat, 27 Feb 2021 19:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Knd7khaN2KOrfgbyUES9FOQR4oDyWLqVdv37o4CoTxM=; b=mOMgh3mYdQ8idOctXvO5MLzVIS6CRUNNugi/MNHAONFXHDkxmLQ1QqDB9AYGHKoqed 7axV15/vxRxhqZqoYgPxPAsO6lvxpKXgjE81iIyMnPVnAu7+TU0H2zo11S/Pv983uCDr XxPEbrxDIMSAqjuju9t61IBCv2d+pG6SsXx9ZaIPAYCUW+lFWwIVm6h4EOvlHGHHiLhL E1eGXlvm9Oy5y0cE9jOIYWw7rd94ACxkO5yQlhObjlLsZv2Zq8tJCpSFQc2IOZh4M0rn 8LcYhX/85MZ2JUePYlC7O3qXlDlrNljyNnSYt74EsWYLT9/+o2yEYKGvf2fISLQ7Eg2c L2Mg== 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=Knd7khaN2KOrfgbyUES9FOQR4oDyWLqVdv37o4CoTxM=; b=rF9OZO4cKD/y0eUT5OjTtqvsUBHzTEyigs0lQPwFTdwvEUtgQg/sXAI8uRLqBMxori kKEYX9SCKFnEQD8BVO8w4yxT28bilD8VyFSpAdHv6nLr9B5jaWGwhjUWNB2r3NM0CDHV /GqFQ2GsAbO1u0Qav4HG9WPXB0QZCiluDb0DwOhgSRhcEFJWGBLVtM2Rad1rMrSLMra1 a0Wu6H3ovCYOFvN/bRRArOT3kSi1BiQmk8RsKEar4QvPHYICP0+gPhpgTOtkml4ENNy9 xpZvB/cW0mKeF29CpB736INSd09g0/VWkJdsISByQq4aFO/7KDyNU1rjtjW4eHgy/6kS eUcg== X-Gm-Message-State: AOAM530Hx28t968IMU1NMHDdOHaevZOqebjSTRnNrzHzrLeXIc7wcaPG 0F46kYIOBcpgTydFtWz1SpFX2GrkenYsHA3CoaH/7A== X-Google-Smtp-Source: ABdhPJyM8HjwK310YcOfE0uiHUGfkgBkI8nuflOtey9eW4Cf8dsd7AeFeOhpgPdneFCLtbVhU3O24utiAEBptpUGWRM= X-Received: by 2002:a37:7f83:: with SMTP id a125mr1987458qkd.44.1614482298728; Sat, 27 Feb 2021 19:18:18 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> <CANCZdfpw1+sjHVPH4zahywMsLHJ1jKWbnd5A3RjGinu=nQFSGA@mail.gmail.com> <a30870ef-00b1-40b6-b378-033d8737c7e4@www.fastmail.com> In-Reply-To: <a30870ef-00b1-40b6-b378-033d8737c7e4@www.fastmail.com> From: Warner Losh <imp@bsdimp.com> Date: Sat, 27 Feb 2021 20:18:06 -0700 Message-ID: <CANCZdfqPNf-RW=-T9qk5a4o-rX3CWFVGz0H_hTav-CqnW9JJ=Q@mail.gmail.com> Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Brandon Bergren <bdragon@freebsd.org> Cc: Jessica Clarke <jrtc27@freebsd.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>, Colin Percival <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4Dp7rW3ctwz4mQ0 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 03:18:19 -0000 On Sat, Feb 27, 2021, 8:01 PM Brandon Bergren <bdragon@freebsd.org> wrote: > On Sat, Feb 27, 2021, at 8:39 PM, Warner Losh wrote: > > > 32-bit Arm can boot via EFI. Just mips* and powerpc*. > > > > There was some rumblings of little endian powerpc64 efi, but I don't > > think it's ready... > > I've never heard of such things. PAPR/LoPAPR/LoPAR (pseries) is specified > as an OpenFirmware platform, and I don't see that changing in the future > given the way it's baked into the spec. And PowerNV is a > minimal-runtime-services platform where the runtime abstraction (OPAL) > calls don't include any sort of way to access disk devices. > > Do you mean alternative firmware for PowerNV? I've heard people talking on > and off about coreboot, but I don't see that becoming mainstream over the > petitboot skiroot payload. > > I don't see the pseries virtualization requirements changing away from > OpenFirmware in the future either, given the OpenFirmware requirement has > been a constant all the way back to CHRP. > There was a working group that was defining powerpc bindings that were being worked on. When I went back to find them again I couldn't, so maybe they came to naught... Warner > > > Yea, we have long since switched our preferred boot on arm to EFI... > > though we don't have installer images for 32bit arm, which is this > > runs... so it's needed for correctness, but not a practical > > difference... > > > > Warner > > -- > Brandon Bergren > bdragon@FreeBSD.org > From owner-dev-commits-src-all@freebsd.org Sun Feb 28 03:49:05 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A4FE55F16B; Sun, 28 Feb 2021 03:49: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 4Dp8X122Nzz4pHk; Sun, 28 Feb 2021 03:49: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 388681C15; Sun, 28 Feb 2021 03:49: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 11S3n5nD024164; Sun, 28 Feb 2021 03:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S3n5UX024163; Sun, 28 Feb 2021 03:49:05 GMT (envelope-from git) Date: Sun, 28 Feb 2021 03:49:05 GMT Message-Id: <202102280349.11S3n5UX024163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang <ygy@FreeBSD.org> Subject: git: 115ea98aede3 - stable/12 - pwrite(2): add a BUGS section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 115ea98aede324e6f0c032a4d481d128df7bc81f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 03:49:05 -0000 The branch stable/12 has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=115ea98aede324e6f0c032a4d481d128df7bc81f commit 115ea98aede324e6f0c032a4d481d128df7bc81f Author: Guangyuan Yang <ygy@FreeBSD.org> AuthorDate: 2021-02-20 08:03:15 +0000 Commit: Guangyuan Yang <ygy@FreeBSD.org> CommitDate: 2021-02-28 02:58:36 +0000 pwrite(2): add a BUGS section Add a BUGS section about using pwrite(2) when O_APPEND is set on the fd. Submitted by: Ka Ho Ng <khng300@gmail.com> Reviewed by: gbe, yuripv Differential Revision: https://reviews.freebsd.org/D28372 (cherry picked from commit 504e64af32ba6c62fdcc894a3b1da76061c64796) --- lib/libc/sys/write.2 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2 index fb70c5e4186b..89b1da7f24d9 100644 --- a/lib/libc/sys/write.2 +++ b/lib/libc/sys/write.2 @@ -28,7 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd February 11, 2021 .Dt WRITE 2 .Os .Sh NAME @@ -294,3 +294,17 @@ The .Fn write function appeared in .At v1 . +.Sh BUGS +The +.Fn pwrite +system call appends the file without changing the file offset if +.Dv O_APPEND +is set, contrary to +.St -p1003.1-2008 +where +.Fn pwrite +writes into +.Fa offset +regardless of whether +.Dv O_APPEND +is set. From owner-dev-commits-src-all@freebsd.org Sun Feb 28 04:21:05 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16EB855FBAE; Sun, 28 Feb 2021 04: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 4Dp9Dx00Vdz4qSs; Sun, 28 Feb 2021 04: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 E719B1ED6; Sun, 28 Feb 2021 04:21: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 11S4L42U071744; Sun, 28 Feb 2021 04:21:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S4L43l071734; Sun, 28 Feb 2021 04:21:04 GMT (envelope-from git) Date: Sun, 28 Feb 2021 04:21:04 GMT Message-Id: <202102280421.11S4L43l071734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang <ygy@FreeBSD.org> Subject: git: 1350f1ccc156 - stable/11 - pwrite(2): add a BUGS section MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 1350f1ccc156299c4de2772afa8784283c8f6ab4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 04:21:05 -0000 The branch stable/11 has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1350f1ccc156299c4de2772afa8784283c8f6ab4 commit 1350f1ccc156299c4de2772afa8784283c8f6ab4 Author: Guangyuan Yang <ygy@FreeBSD.org> AuthorDate: 2021-02-20 08:03:15 +0000 Commit: Guangyuan Yang <ygy@FreeBSD.org> CommitDate: 2021-02-28 04:20:26 +0000 pwrite(2): add a BUGS section Add a BUGS section about using pwrite(2) when O_APPEND is set on the fd. Submitted by: Ka Ho Ng <khng300@gmail.com> Reviewed by: gbe, yuripv Differential Revision: https://reviews.freebsd.org/D28372 (cherry picked from commit 504e64af32ba6c62fdcc894a3b1da76061c64796) --- lib/libc/sys/write.2 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2 index 7c3e4096c708..75574adb0996 100644 --- a/lib/libc/sys/write.2 +++ b/lib/libc/sys/write.2 @@ -28,7 +28,11 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" +<<<<<<< HEAD .Dd October 23, 2017 +======= +.Dd February 11, 2021 +>>>>>>> 504e64af32ba (pwrite(2): add a BUGS section) .Dt WRITE 2 .Os .Sh NAME @@ -287,4 +291,22 @@ system call appeared in The .Fn write function appeared in +<<<<<<< HEAD .At v6 . +======= +.At v1 . +.Sh BUGS +The +.Fn pwrite +system call appends the file without changing the file offset if +.Dv O_APPEND +is set, contrary to +.St -p1003.1-2008 +where +.Fn pwrite +writes into +.Fa offset +regardless of whether +.Dv O_APPEND +is set. +>>>>>>> 504e64af32ba (pwrite(2): add a BUGS section) From owner-dev-commits-src-all@freebsd.org Sun Feb 28 05:06:31 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA2CE5602FC; Sun, 28 Feb 2021 05:06: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 4DpBFM5sLvz4sFj; Sun, 28 Feb 2021 05:06: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 B796C26EF; Sun, 28 Feb 2021 05:06: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 11S56Vkm030694; Sun, 28 Feb 2021 05:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S56V9m030693; Sun, 28 Feb 2021 05:06:31 GMT (envelope-from git) Date: Sun, 28 Feb 2021 05:06:31 GMT Message-Id: <202102280506.11S56V9m030693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Guangyuan Yang <ygy@FreeBSD.org> Subject: git: aed45a13aea9 - stable/11 - pwrite(2): remove git message that committed by accident MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: aed45a13aea9db0b24299a10f0eac8192776b141 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 05:06:31 -0000 The branch stable/11 has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=aed45a13aea9db0b24299a10f0eac8192776b141 commit aed45a13aea9db0b24299a10f0eac8192776b141 Author: Guangyuan Yang <ygy@FreeBSD.org> AuthorDate: 2021-02-28 04:48:04 +0000 Commit: Guangyuan Yang <ygy@FreeBSD.org> CommitDate: 2021-02-28 05:06:07 +0000 pwrite(2): remove git message that committed by accident Fix the manpage after accidentally committed 3-way merge info in 1350f1ccc156299c4de2772afa8784283c8f6ab4. --- lib/libc/sys/write.2 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2 index 75574adb0996..95f0ca9c0532 100644 --- a/lib/libc/sys/write.2 +++ b/lib/libc/sys/write.2 @@ -28,11 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -<<<<<<< HEAD -.Dd October 23, 2017 -======= .Dd February 11, 2021 ->>>>>>> 504e64af32ba (pwrite(2): add a BUGS section) .Dt WRITE 2 .Os .Sh NAME @@ -291,9 +287,6 @@ system call appeared in The .Fn write function appeared in -<<<<<<< HEAD -.At v6 . -======= .At v1 . .Sh BUGS The @@ -309,4 +302,3 @@ writes into regardless of whether .Dv O_APPEND is set. ->>>>>>> 504e64af32ba (pwrite(2): add a BUGS section) From owner-dev-commits-src-all@freebsd.org Sun Feb 28 08:06:53 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E5B1563961; Sun, 28 Feb 2021 08:06: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 4DpGFT1fR0z3H0h; Sun, 28 Feb 2021 08:06: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 2771D51A6; Sun, 28 Feb 2021 08:06: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 11S86roq067422; Sun, 28 Feb 2021 08:06:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S86rVL067421; Sun, 28 Feb 2021 08:06:53 GMT (envelope-from git) Date: Sun, 28 Feb 2021 08:06:53 GMT Message-Id: <202102280806.11S86rVL067421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger <rscheff@FreeBSD.org> Subject: git: 32ed0ef06b83 - stable/13 - PRR: use accurate rfc6675_pipe when enabled 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: 32ed0ef06b8326271c4665406cac81fa47d0d29c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 08:06:53 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=32ed0ef06b8326271c4665406cac81fa47d0d29c commit 32ed0ef06b8326271c4665406cac81fa47d0d29c Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2021-02-20 19:10:00 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2021-02-28 07:35:37 +0000 PRR: use accurate rfc6675_pipe when enabled Reviewed By: #transport, tuexen MFC after: 1 week Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28816 (cherry picked from commit a8e431e1537d056a3f9e466eaceec28c399c220b) --- sys/netinet/tcp_input.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 08d000611407..aaa9465c00e9 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2586,8 +2586,11 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, * estimate to be in the network. */ del_data = tp->sackhint.delivered_data; - pipe = (tp->snd_nxt - tp->snd_fack) + - tp->sackhint.sack_bytes_rexmit; + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(tp); + else + pipe = (tp->snd_nxt - tp->snd_fack) + + tp->sackhint.sack_bytes_rexmit; tp->sackhint.prr_delivered += del_data; if (pipe > tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) @@ -3942,7 +3945,10 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) if (SEQ_GEQ(th->th_ack, tp->snd_una)) del_data = BYTES_THIS_ACK(tp, th); del_data += tp->sackhint.delivered_data; - pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(tp); + else + pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; tp->sackhint.prr_delivered += del_data; /* * Proportional Rate Reduction From owner-dev-commits-src-all@freebsd.org Sun Feb 28 08:09:08 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3075D563AE4; Sun, 28 Feb 2021 08:09: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 4DpGJ40t5Gz3H87; Sun, 28 Feb 2021 08:09: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 0645F52E1; Sun, 28 Feb 2021 08:09: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 11S897Nb067861; Sun, 28 Feb 2021 08:09:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S897B7067860; Sun, 28 Feb 2021 08:09:07 GMT (envelope-from git) Date: Sun, 28 Feb 2021 08:09:07 GMT Message-Id: <202102280809.11S897B7067860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger <rscheff@FreeBSD.org> Subject: git: ffbf1b809ef5 - stable/13 - Address two incorrect calculations and enhance readability of PRR code 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: ffbf1b809ef5080afa130c11fa4afce9fef7e7fe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 08:09:08 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=ffbf1b809ef5080afa130c11fa4afce9fef7e7fe commit ffbf1b809ef5080afa130c11fa4afce9fef7e7fe Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2021-02-25 16:59:45 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2021-02-28 08:07:54 +0000 Address two incorrect calculations and enhance readability of PRR code - address second instance of cwnd potentially becoming zero - fix sublte bug due to implicit int to uint typecase in max() - fix bug due to typo in hand-coded CEILING() function by using howmany() macro - use int instead of long, and add a missing long typecast - replace if conditionals with easier to read imax/imin (as in pseudocode) Reviewed By: #transport, kbowling MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28813 (cherry picked from commit 48396dc77922c68377ecac0ead2f8b0b5453c451) --- sys/netinet/tcp_input.c | 60 ++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index aaa9465c00e9..96c594a4c7cd 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2577,8 +2577,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (V_tcp_do_prr && IN_FASTRECOVERY(tp->t_flags) && (tp->t_flags & TF_SACK_PERMIT)) { - long snd_cnt = 0, limit = 0; - long del_data = 0, pipe = 0; + int snd_cnt = 0, limit = 0; + int del_data = 0, pipe = 0; /* * In a duplicate ACK del_data is only the * diff_in_sack. If no SACK is used del_data @@ -2595,39 +2595,29 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (pipe > tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = - max(1, tp->snd_nxt - tp->snd_una); - snd_cnt = (tp->sackhint.prr_delivered * - tp->snd_ssthresh / - tp->sackhint.recover_fs) + - 1 - tp->sackhint.sack_bytes_rexmit; + imax(1, tp->snd_nxt - tp->snd_una); + snd_cnt = howmany((long)tp->sackhint.prr_delivered * + tp->snd_ssthresh, tp->sackhint.recover_fs) - + tp->sackhint.sack_bytes_rexmit; } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; else - if ((tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit) > - del_data) - limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit + - maxseg; - else - limit = del_data + maxseg; - if ((tp->snd_ssthresh - pipe) < limit) - snd_cnt = tp->snd_ssthresh - pipe; - else - snd_cnt = limit; + limit = imax(tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit, + del_data) + maxseg; + snd_cnt = imin(tp->snd_ssthresh - pipe, limit); } - snd_cnt = max((snd_cnt / maxseg), 0); + snd_cnt = imax(snd_cnt, 0) / maxseg; /* * Send snd_cnt new data into the network in * response to this ACK. If there is a going * to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + - (snd_cnt * maxseg); + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); } else if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -3930,7 +3920,7 @@ tcp_mssopt(struct in_conninfo *inc) void tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) { - long snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; + int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); @@ -3956,29 +3946,27 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) if (pipe > tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = - max(1, tp->snd_nxt - tp->snd_una); - snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / - tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit; + imax(1, tp->snd_nxt - tp->snd_una); + snd_cnt = howmany((long)tp->sackhint.prr_delivered * + tp->snd_ssthresh, tp->sackhint.recover_fs) - + tp->sackhint.sack_bytes_rexmit; } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; else - if ((tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit) > del_data) - limit = tp->sackhint.prr_delivered - - tp->sackhint.sack_bytes_rexmit + maxseg; - else - limit = del_data + maxseg; - snd_cnt = min((tp->snd_ssthresh - pipe), limit); + limit = imax(tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit, + del_data) + maxseg; + snd_cnt = imin((tp->snd_ssthresh - pipe), limit); } - snd_cnt = max((snd_cnt / maxseg), 0); + snd_cnt = imax(snd_cnt, 0) / maxseg; /* * Send snd_cnt new data into the network in response to this ack. * If there is going to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = max(maxseg, (int64_t)tp->snd_nxt - tp->snd_recover + + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 08:10:49 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F581563D27; Sun, 28 Feb 2021 08:10: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 4DpGL10LMnz3H29; Sun, 28 Feb 2021 08:10: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 F2742517B; Sun, 28 Feb 2021 08:10: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 11S8AmIG075564; Sun, 28 Feb 2021 08:10:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S8AmP5075563; Sun, 28 Feb 2021 08:10:48 GMT (envelope-from git) Date: Sun, 28 Feb 2021 08:10:48 GMT Message-Id: <202102280810.11S8AmP5075563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger <rscheff@FreeBSD.org> Subject: git: 25fb4c363b29 - stable/13 - PRR: Avoid accounting left-edge twice in partial ACK. 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: 25fb4c363b299c26c35158fa059379af4a007253 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 08:10:49 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=25fb4c363b299c26c35158fa059379af4a007253 commit 25fb4c363b299c26c35158fa059379af4a007253 Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2021-02-25 17:36:49 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2021-02-28 08:09:33 +0000 PRR: Avoid accounting left-edge twice in partial ACK. Reviewed By: #transport, kbowling MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28819 (cherry picked from commit 31d7a27c6e88c3d5bd0907774ec70176a92da5bb) --- sys/netinet/tcp_input.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 96c594a4c7cd..e096f2a13679 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3932,9 +3932,7 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) * (del_data) and an estimate of how many bytes are in the * network. */ - if (SEQ_GEQ(th->th_ack, tp->snd_una)) - del_data = BYTES_THIS_ACK(tp, th); - del_data += tp->sackhint.delivered_data; + del_data = tp->sackhint.delivered_data; if (V_tcp_do_rfc6675_pipe) pipe = tcp_compute_pipe(tp); else From owner-dev-commits-src-all@freebsd.org Sun Feb 28 08:22:36 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBB3656428D; Sun, 28 Feb 2021 08:22: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 4DpGbc6LZgz3Hl8; Sun, 28 Feb 2021 08:22: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 C26F251D6; Sun, 28 Feb 2021 08:22: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 11S8Maks093417; Sun, 28 Feb 2021 08:22:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11S8MakS093416; Sun, 28 Feb 2021 08:22:36 GMT (envelope-from git) Date: Sun, 28 Feb 2021 08:22:36 GMT Message-Id: <202102280822.11S8MakS093416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger <rscheff@FreeBSD.org> Subject: git: c0c928636156 - stable/13 - TCP_NOOPT may prevent the negotiation of TCP features, which a server has to take into consideration. 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: c0c928636156dd913302bc34e5ac9d70810f5cdd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 08:22:37 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=c0c928636156dd913302bc34e5ac9d70810f5cdd commit c0c928636156dd913302bc34e5ac9d70810f5cdd Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2021-02-25 18:10:55 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2021-02-28 08:11:18 +0000 TCP_NOOPT may prevent the negotiation of TCP features, which a server has to take into consideration. PR: 253576 Reviewed By: tuexen, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28652 (cherry picked from commit 2593f858d7d078efa85f78f20b6bfa0931cc1dc5) --- sys/netinet/tcp_input.c | 12 ++++++++---- sys/netinet/tcp_syncache.c | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index e096f2a13679..42f983f64502 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1649,7 +1649,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, TCPSTAT_INC(tcps_ecn_shs); } if ((to.to_flags & TOF_SCALE) && - (tp->t_flags & TF_REQ_SCALE)) { + (tp->t_flags & TF_REQ_SCALE) && + !(tp->t_flags & TF_NOOPT)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; } else @@ -1660,7 +1661,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, */ tp->snd_wnd = th->th_win; if ((to.to_flags & TOF_TS) && - (tp->t_flags & TF_REQ_TSTMP)) { + (tp->t_flags & TF_REQ_TSTMP) && + !(tp->t_flags & TF_NOOPT)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = tcp_ts_getticks(); @@ -1669,10 +1671,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && - (to.to_flags & TOF_SACKPERM) == 0) + (!(to.to_flags & TOF_SACKPERM) || + (tp->t_flags & TF_NOOPT))) tp->t_flags &= ~TF_SACK_PERMIT; if (IS_FASTOPEN(tp->t_flags)) { - if (to.to_flags & TOF_FASTOPEN) { + if ((to.to_flags & TOF_FASTOPEN) && + !(tp->t_flags & TF_NOOPT)) { uint16_t mss; if (to.to_flags & TOF_MSS) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index e59a41fc1102..771ff44b8924 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1655,7 +1655,8 @@ skip_alloc: win = imin(win, TCP_MAXWIN); sc->sc_wnd = win; - if (V_tcp_do_rfc1323) { + if (V_tcp_do_rfc1323 && + !(ltflags & TF_NOOPT)) { /* * A timestamp received in a SYN makes * it ok to send timestamp requests and replies. From owner-dev-commits-src-all@freebsd.org Sun Feb 28 14:08:38 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE5ED56C39C; Sun, 28 Feb 2021 14:08: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 4DpQGt5Vmkz3sfh; Sun, 28 Feb 2021 14:08: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 ABC2311F91; Sun, 28 Feb 2021 14:08: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 11SE8csR042527; Sun, 28 Feb 2021 14:08:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SE8cjY042526; Sun, 28 Feb 2021 14:08:38 GMT (envelope-from git) Date: Sun, 28 Feb 2021 14:08:38 GMT Message-Id: <202102281408.11SE8cjY042526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin <mav@FreeBSD.org> Subject: git: d01032736cf0 - main - Fix diroffdiroff, probably copy/paste bug. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d01032736cf067d63e66d6428ffc08e47652600f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 14:08:38 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=d01032736cf067d63e66d6428ffc08e47652600f commit d01032736cf067d63e66d6428ffc08e47652600f Author: Alexander Motin <mav@FreeBSD.org> AuthorDate: 2021-02-28 14:07:13 +0000 Commit: Alexander Motin <mav@FreeBSD.org> CommitDate: 2021-02-28 14:08:31 +0000 Fix diroffdiroff, probably copy/paste bug. Too long name looks bad in `vmstat -m`. MFC after: 1 week --- sys/fs/nfs/nfs_commonport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index a7ce2d4bd015..47038980c640 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -123,7 +123,7 @@ MALLOC_DEFINE(M_NEWNFSCLLOCKOWNER, "NFSCL lckown", "NFSCL Lock Owner"); MALLOC_DEFINE(M_NEWNFSCLLOCK, "NFSCL lck", "NFSCL Lock"); MALLOC_DEFINE(M_NEWNFSV4NODE, "NEWNFSnode", "NFS vnode"); MALLOC_DEFINE(M_NEWNFSDIRECTIO, "NEWdirectio", "NFS Direct IO buffer"); -MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroffdiroff", +MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroff", "NFS directory offset data"); MALLOC_DEFINE(M_NEWNFSDROLLBACK, "NFSD rollback", "NFS local lock rollback"); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 15:14:52 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E16B956DEB7; Sun, 28 Feb 2021 15:14: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 4DpRlJ63Fjz4RWc; Sun, 28 Feb 2021 15:14: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 BE94A12F80; Sun, 28 Feb 2021 15:14: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 11SFEq4d034209; Sun, 28 Feb 2021 15:14:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SFEqC8034208; Sun, 28 Feb 2021 15:14:52 GMT (envelope-from git) Date: Sun, 28 Feb 2021 15:14:52 GMT Message-Id: <202102281514.11SFEqC8034208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger <rscheff@FreeBSD.org> Subject: git: e9071000c9a0 - main - Improve PRR initial transmission timing 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/main X-Git-Reftype: branch X-Git-Commit: e9071000c9a04e3f685579500e24da9848944bb1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 15:14:52 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=e9071000c9a04e3f685579500e24da9848944bb1 commit e9071000c9a04e3f685579500e24da9848944bb1 Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2021-02-28 14:46:38 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2021-02-28 14:46:54 +0000 Improve PRR initial transmission timing Reviewed By: tuexen, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28953 --- sys/netinet/tcp_input.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7b0987eed358..d802bc8f47ae 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2589,7 +2589,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; tp->sackhint.prr_delivered += del_data; - if (pipe > tp->snd_ssthresh) { + if (pipe >= tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = imax(1, tp->snd_nxt - tp->snd_una); @@ -2689,7 +2689,8 @@ enter_recovery: * snd_ssthresh is already updated by * cc_cong_signal. */ - tp->sackhint.prr_delivered = 0; + tp->sackhint.prr_delivered = + tp->sackhint.sacked_bytes; tp->sackhint.sack_bytes_rexmit = 0; tp->sackhint.recover_fs = max(1, tp->snd_nxt - tp->snd_una); @@ -3964,7 +3965,7 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) /* * Proportional Rate Reduction */ - if (pipe > tp->snd_ssthresh) { + if (pipe >= tp->snd_ssthresh) { if (tp->sackhint.recover_fs == 0) tp->sackhint.recover_fs = imax(1, tp->snd_nxt - tp->snd_una); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 15:57:11 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83A2756F04B; Sun, 28 Feb 2021 15:57: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 4DpSh736rCz4TyD; Sun, 28 Feb 2021 15:57: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 5E0A6137A8; Sun, 28 Feb 2021 15:57: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 11SFvBYA086516; Sun, 28 Feb 2021 15:57:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SFvBPJ086515; Sun, 28 Feb 2021 15:57:11 GMT (envelope-from git) Date: Sun, 28 Feb 2021 15:57:11 GMT Message-Id: <202102281557.11SFvBPJ086515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: 86ebf4d3e12c - stable/13 - pf: Fix incorrect fragment handling 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: 86ebf4d3e12c3eae94d3e9a8dcf5bd5741889b58 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 15:57:11 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=86ebf4d3e12c3eae94d3e9a8dcf5bd5741889b58 commit 86ebf4d3e12c3eae94d3e9a8dcf5bd5741889b58 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-02-25 07:07:36 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-02-28 15:16:29 +0000 pf: Fix incorrect fragment handling A sequence of overlapping IPv4 fragments could crash the kernel in pf due to an assertion. Reported by: Alexander Bluhm Obtained from: OpenBSD MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5f1b1f184b7f12330cf4a027e3db7c6700c67640) --- sys/netpfil/pf/pf_norm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index b7a84437630b..d7310c7bccb4 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -549,6 +549,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, struct pf_frent *after, *next, *prev; struct pf_fragment *frag; uint16_t total; + int old_index, new_index; PF_FRAG_ASSERT(); @@ -660,8 +661,30 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, DPFPRINTF(("adjust overlap %d\n", aftercut)); if (aftercut < after->fe_len) { m_adj(after->fe_m, aftercut); + old_index = pf_frent_index(after); after->fe_off += aftercut; after->fe_len -= aftercut; + new_index = pf_frent_index(after); + if (old_index != new_index) { + DPFPRINTF(("frag index %d, new %d", + old_index, new_index)); + /* Fragment switched queue as fe_off changed */ + after->fe_off -= aftercut; + after->fe_len += aftercut; + /* Remove restored fragment from old queue */ + pf_frent_remove(frag, after); + after->fe_off += aftercut; + after->fe_len -= aftercut; + /* Insert into correct queue */ + if (pf_frent_insert(frag, after, prev)) { + DPFPRINTF( + ("fragment requeue limit exceeded")); + m_freem(after->fe_m); + uma_zfree(V_pf_frent_z, after); + /* There is not way to recover */ + goto bad_fragment; + } + } break; } From owner-dev-commits-src-all@freebsd.org Sun Feb 28 16:03:58 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 860E056F0E4; Sun, 28 Feb 2021 16:03: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 4DpSqy3MQZz4VJr; Sun, 28 Feb 2021 16:03: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 666D513A6A; Sun, 28 Feb 2021 16:03: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 11SG3wvF099909; Sun, 28 Feb 2021 16:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SG3wd6099908; Sun, 28 Feb 2021 16:03:58 GMT (envelope-from git) Date: Sun, 28 Feb 2021 16:03:58 GMT Message-Id: <202102281603.11SG3wd6099908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: f520c87f3a09 - stable/12 - Revert "pf: Limit the maximum number of fragments per packet" 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: f520c87f3a0993e9b1e872f38177639468f2e64c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 16:03:58 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f520c87f3a0993e9b1e872f38177639468f2e64c commit f520c87f3a0993e9b1e872f38177639468f2e64c Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2018-11-02 15:01:59 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-02-28 15:36:05 +0000 Revert "pf: Limit the maximum number of fragments per packet" This reverts commit r337969. We'll handle this the OpenBSD way, in upcoming commits. (cherry picked from commit 19a22ae31328d9a960732a0904116c1b5566351b) --- sys/netpfil/pf/pf_norm.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index b453bda84721..cadc7a73dca4 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -91,10 +91,8 @@ struct pf_fragment { TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; uint16_t fr_maxlen; /* maximum length of single fragment */ - uint16_t fr_entries; /* Total number of pf_fragment entries */ TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; }; -#define PF_MAX_FRENT_PER_FRAGMENT 64 struct pf_fragment_tag { uint16_t ft_hdrlen; /* header length of reassembled pkt */ @@ -386,7 +384,6 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, *(struct pf_fragment_cmp *)frag = *key; frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; - frag->fr_entries = 0; TAILQ_INIT(&frag->fr_queue); RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); @@ -398,9 +395,6 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, return (frag); } - if (frag->fr_entries >= PF_MAX_FRENT_PER_FRAGMENT) - goto bad_fragment; - KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue")); /* Remember maximum fragment len for refragmentation. */ @@ -473,8 +467,6 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, else TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); - frag->fr_entries++; - return (frag); bad_fragment: From owner-dev-commits-src-all@freebsd.org Sun Feb 28 16:03:59 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C085F56F159; Sun, 28 Feb 2021 16: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 4DpSqz4111z4V9Q; Sun, 28 Feb 2021 16: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 7CF7F13747; Sun, 28 Feb 2021 16: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 11SG3xgS099931; Sun, 28 Feb 2021 16: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 11SG3x9v099930; Sun, 28 Feb 2021 16:03:59 GMT (envelope-from git) Date: Sun, 28 Feb 2021 16:03:59 GMT Message-Id: <202102281603.11SG3x9v099930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: 1d6a2a742c1b - stable/12 - pf: Count holes rather than fragments for reassembly 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: 1d6a2a742c1bcc342408df99bc5f20dec404b1e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 16:03:59 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1d6a2a742c1bcc342408df99bc5f20dec404b1e4 commit 1d6a2a742c1bcc342408df99bc5f20dec404b1e4 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2018-11-02 15:23:57 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-02-28 15:36:10 +0000 pf: Count holes rather than fragments for reassembly Avoid traversing the list of fragment entris to check whether the pf(4) reassembly is complete. Instead count the holes that are created when inserting a fragment. If there are no holes left, the fragments are continuous. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17732 (cherry picked from commit 2b1c354ee6fb075953d2c3e81c8221f4115ce981) --- sys/netpfil/pf/pf_norm.c | 83 ++++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index cadc7a73dca4..cd94d1de7cf7 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright 2001 Niels Provos <provos@citi.umich.edu> - * Copyright 2011 Alexander Bluhm <bluhm@openbsd.org> + * Copyright 2011-2018 Alexander Bluhm <bluhm@openbsd.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -91,6 +91,7 @@ struct pf_fragment { TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; uint16_t fr_maxlen; /* maximum length of single fragment */ + u_int16_t fr_holes; /* number of holes in the queue */ TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; }; @@ -132,11 +133,11 @@ static void pf_remove_fragment(struct pf_fragment *); static int pf_normalize_tcpopt(struct pf_krule *, struct mbuf *, struct tcphdr *, int, sa_family_t); static struct pf_frent *pf_create_fragment(u_short *); +static int pf_frent_holes(struct pf_frent *frent); static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); -static int pf_isfull_fragment(struct pf_fragment *); static struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET static void pf_scrub_ip(struct mbuf **, uint32_t, uint8_t, uint8_t); @@ -333,6 +334,39 @@ pf_create_fragment(u_short *reason) return (frent); } +/* + * Calculate the additional holes that were created in the fragment + * queue by inserting this fragment. A fragment in the middle + * creates one more hole by splitting. For each connected side, + * it loses one hole. + * Fragment entry must be in the queue when calling this function. + */ +static int +pf_frent_holes(struct pf_frent *frent) +{ + struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next); + struct pf_frent *next = TAILQ_NEXT(frent, fr_next); + int holes = 1; + + if (prev == NULL) { + if (frent->fe_off == 0) + holes--; + } else { + KASSERT(frent->fe_off != 0, ("frent->fe_off != 0")); + if (frent->fe_off == prev->fe_off + prev->fe_len) + holes--; + } + if (next == NULL) { + if (!frent->fe_mff) + holes--; + } else { + KASSERT(frent->fe_mff, ("frent->fe_mff")); + if (next->fe_off == frent->fe_off + frent->fe_len) + holes--; + } + return holes; +} + static struct pf_fragment * pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, u_short *reason) @@ -384,6 +418,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, *(struct pf_fragment_cmp *)frag = *key; frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; + frag->fr_holes = 1; TAILQ_INIT(&frag->fr_queue); RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); @@ -391,6 +426,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, /* We do not have a previous fragment. */ TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); + frag->fr_holes += pf_frent_holes(frent); return (frag); } @@ -457,6 +493,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, /* This fragment is completely overlapped, lose it. */ next = TAILQ_NEXT(after, fr_next); + frag->fr_holes -= pf_frent_holes(after); m_freem(after->fe_m); TAILQ_REMOVE(&frag->fr_queue, after, fr_next); uma_zfree(V_pf_frent_z, after); @@ -466,6 +503,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); else TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); + frag->fr_holes += pf_frent_holes(frent); return (frag); @@ -476,40 +514,6 @@ drop_fragment: return (NULL); } -static int -pf_isfull_fragment(struct pf_fragment *frag) -{ - struct pf_frent *frent, *next; - uint16_t off, total; - - /* Check if we are completely reassembled */ - if (TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_mff) - return (0); - - /* Maximum data we have seen already */ - total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off + - TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len; - - /* Check if we have all the data */ - off = 0; - for (frent = TAILQ_FIRST(&frag->fr_queue); frent; frent = next) { - next = TAILQ_NEXT(frent, fr_next); - - off += frent->fe_len; - if (off < total && (next == NULL || next->fe_off != off)) { - DPFPRINTF(("missing fragment at %d, next %d, total %d", - off, next == NULL ? -1 : next->fe_off, total)); - return (0); - } - } - DPFPRINTF(("%d < %d?", off, total)); - if (off < total) - return (0); - KASSERT(off == total, ("off == total")); - - return (1); -} - static struct mbuf * pf_join_fragment(struct pf_fragment *frag) { @@ -570,8 +574,10 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) /* The mbuf is part of the fragment entry, no direct free or access */ m = *m0 = NULL; - if (!pf_isfull_fragment(frag)) + if (frag->fr_holes) { + DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes)); return (PF_PASS); /* drop because *m0 is NULL, no error */ + } /* We have all the data */ frent = TAILQ_FIRST(&frag->fr_queue); @@ -654,7 +660,8 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr, /* The mbuf is part of the fragment entry, no direct free or access. */ m = *m0 = NULL; - if (!pf_isfull_fragment(frag)) { + if (frag->fr_holes) { + DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes)); PF_FRAG_UNLOCK(); return (PF_PASS); /* Drop because *m0 is NULL, no error. */ } From owner-dev-commits-src-all@freebsd.org Sun Feb 28 16:04:02 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47D5C56F2FC; Sun, 28 Feb 2021 16:04: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 4DpSr20WJWz4VTx; Sun, 28 Feb 2021 16:04: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 BFCBA13748; Sun, 28 Feb 2021 16:04: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 11SG41jT099972; Sun, 28 Feb 2021 16:04:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SG41nX099971; Sun, 28 Feb 2021 16:04:01 GMT (envelope-from git) Date: Sun, 28 Feb 2021 16:04:01 GMT Message-Id: <202102281604.11SG41nX099971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: 8de214ad4d22 - stable/12 - pf: Limit the fragment entry queue length to 64 per bucket. 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: 8de214ad4d225418c8c7befe975637e236ddf93d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 16:04:02 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8de214ad4d225418c8c7befe975637e236ddf93d commit 8de214ad4d225418c8c7befe975637e236ddf93d Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2018-11-02 15:32:04 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-02-28 15:36:22 +0000 pf: Limit the fragment entry queue length to 64 per bucket. So we have a global limit of 1024 fragments, but it is fine grained to the region of the packet. Smaller packets may have less fragments. This costs another 16 bytes of memory per reassembly and devides the worst case for searching by 8. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17734 (cherry picked from commit 790194cd472b1d17e08940e9f839322abcf14ec9) --- sys/net/pfvar.h | 7 +++++++ sys/netpfil/pf/pf_norm.c | 34 +++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d6c2bf9120e9..3a535d04f12f 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1011,6 +1011,13 @@ struct pf_divert { */ #define PF_FRAG_ENTRY_POINTS 16 +/* + * The number of entries in the fragment queue must be limited + * to avoid DoS by linear seaching. Instead of a global limit, + * use a limit per entry point. For large packets these sum up. + */ +#define PF_FRAG_ENTRY_LIMIT 64 + /* * ioctl parameter structures */ diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 0e2fdca4c2ce..eb310e27b9ae 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -87,7 +87,10 @@ struct pf_fragment { #define fr_af fr_key.frc_af #define fr_proto fr_key.frc_proto + /* pointers to queue element */ struct pf_frent *fr_firstoff[PF_FRAG_ENTRY_POINTS]; + /* count entries between pointers */ + uint8_t fr_entries[PF_FRAG_ENTRY_POINTS]; RB_ENTRY(pf_fragment) fr_entry; TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; @@ -138,7 +141,7 @@ static int pf_frent_holes(struct pf_frent *frent); static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); static inline int pf_frent_index(struct pf_frent *); -static void pf_frent_insert(struct pf_fragment *, +static int pf_frent_insert(struct pf_fragment *, struct pf_frent *, struct pf_frent *); void pf_frent_remove(struct pf_fragment *, struct pf_frent *); @@ -392,12 +395,24 @@ pf_frent_index(struct pf_frent *frent) return frent->fe_off / (0x10000 / PF_FRAG_ENTRY_POINTS); } -static void +static int pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent, struct pf_frent *prev) { int index; + CTASSERT(PF_FRAG_ENTRY_LIMIT <= 0xff); + + /* + * A packet has at most 65536 octets. With 16 entry points, each one + * spawns 4096 octets. We limit these to 64 fragments each, which + * means on average every fragment must have at least 64 octets. + */ + index = pf_frent_index(frent); + if (frag->fr_entries[index] >= PF_FRAG_ENTRY_LIMIT) + return ENOBUFS; + frag->fr_entries[index]++; + if (prev == NULL) { TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); } else { @@ -406,7 +421,6 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent, TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); } - index = pf_frent_index(frent); if (frag->fr_firstoff[index] == NULL) { KASSERT(prev == NULL || pf_frent_index(prev) < index, ("prev == NULL || pf_frent_index(pref) < index")); @@ -424,6 +438,8 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent, } frag->fr_holes += pf_frent_holes(frent); + + return 0; } void @@ -460,6 +476,9 @@ pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent) } TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); + + KASSERT(frag->fr_entries[index] > 0, ("No fragments remaining")); + frag->fr_entries[index]--; } struct pf_frent * @@ -567,6 +586,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, *(struct pf_fragment_cmp *)frag = *key; memset(frag->fr_firstoff, 0, sizeof(frag->fr_firstoff)); + memset(frag->fr_entries, 0, sizeof(frag->fr_entries)); frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; frag->fr_holes = 1; @@ -575,7 +595,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); - /* We do not have a previous fragment. */ + /* We do not have a previous fragment, cannot fail. */ pf_frent_insert(frag, frent, NULL); return (frag); @@ -646,7 +666,11 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, uma_zfree(V_pf_frent_z, after); } - pf_frent_insert(frag, frent, prev); + /* If part of the queue gets too long, there is not way to recover. */ + if (pf_frent_insert(frag, frent, prev)) { + DPFPRINTF(("fragment queue limit exceeded")); + goto bad_fragment; + } return (frag); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 16:04:01 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AA8256F319; Sun, 28 Feb 2021 16:04: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 4DpSr06Gt3z4VQL; Sun, 28 Feb 2021 16:04: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 B1BF8136F9; Sun, 28 Feb 2021 16:04: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 11SG40Xv099950; Sun, 28 Feb 2021 16:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SG409B099949; Sun, 28 Feb 2021 16:04:00 GMT (envelope-from git) Date: Sun, 28 Feb 2021 16:04:00 GMT Message-Id: <202102281604.11SG409B099949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: 11bf4f2fbb3c - stable/12 - pf: Split the fragment reassembly queue into smaller parts 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: 11bf4f2fbb3c10ceeda799893b61cb2d3d41521d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 16:04:01 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=11bf4f2fbb3c10ceeda799893b61cb2d3d41521d commit 11bf4f2fbb3c10ceeda799893b61cb2d3d41521d Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2018-11-02 15:26:51 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-02-28 15:36:18 +0000 pf: Split the fragment reassembly queue into smaller parts Remember 16 entry points based on the fragment offset. Instead of a worst case of 8196 list traversals we now check a maximum of 512 list entries or 16 array elements. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17733 (cherry picked from commit fd2ea405e601bd5e240153c5de0f7c264946ce6f) --- sys/net/pfvar.h | 6 ++ sys/netpfil/pf/pf_norm.c | 181 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 168 insertions(+), 19 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index dcc5bf51fdf6..d6c2bf9120e9 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1005,6 +1005,12 @@ struct pf_divert { #define PFFRAG_FRENT_HIWAT 5000 /* Number of fragment entries */ #define PFR_KENTRY_HIWAT 200000 /* Number of table entries */ +/* + * Limit the length of the fragment queue traversal. Remember + * search entry points based on the fragment offset. + */ +#define PF_FRAG_ENTRY_POINTS 16 + /* * ioctl parameter structures */ diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index cd94d1de7cf7..0e2fdca4c2ce 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -87,6 +87,7 @@ struct pf_fragment { #define fr_af fr_key.frc_af #define fr_proto fr_key.frc_proto + struct pf_frent *fr_firstoff[PF_FRAG_ENTRY_POINTS]; RB_ENTRY(pf_fragment) fr_entry; TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; @@ -136,6 +137,13 @@ static struct pf_frent *pf_create_fragment(u_short *); static int pf_frent_holes(struct pf_frent *frent); static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); +static inline int pf_frent_index(struct pf_frent *); +static void pf_frent_insert(struct pf_fragment *, + struct pf_frent *, struct pf_frent *); +void pf_frent_remove(struct pf_fragment *, + struct pf_frent *); +struct pf_frent *pf_frent_previous(struct pf_fragment *, + struct pf_frent *); static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); static struct mbuf *pf_join_fragment(struct pf_fragment *); @@ -308,6 +316,7 @@ pf_remove_fragment(struct pf_fragment *frag) { PF_FRAG_ASSERT(); + KASSERT(frag, ("frag != NULL")); RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag); TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); @@ -367,9 +376,150 @@ pf_frent_holes(struct pf_frent *frent) return holes; } +static inline int +pf_frent_index(struct pf_frent *frent) +{ + /* + * We have an array of 16 entry points to the queue. A full size + * 65535 octet IP packet can have 8192 fragments. So the queue + * traversal length is at most 512 and at most 16 entry points are + * checked. We need 128 additional bytes on a 64 bit architecture. + */ + CTASSERT(((u_int16_t)0xffff &~ 7) / (0x10000 / PF_FRAG_ENTRY_POINTS) == + 16 - 1); + CTASSERT(((u_int16_t)0xffff >> 3) / PF_FRAG_ENTRY_POINTS == 512 - 1); + + return frent->fe_off / (0x10000 / PF_FRAG_ENTRY_POINTS); +} + +static void +pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent, + struct pf_frent *prev) +{ + int index; + + if (prev == NULL) { + TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); + } else { + KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off, + ("overlapping fragment")); + TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); + } + + index = pf_frent_index(frent); + if (frag->fr_firstoff[index] == NULL) { + KASSERT(prev == NULL || pf_frent_index(prev) < index, + ("prev == NULL || pf_frent_index(pref) < index")); + frag->fr_firstoff[index] = frent; + } else { + if (frent->fe_off < frag->fr_firstoff[index]->fe_off) { + KASSERT(prev == NULL || pf_frent_index(prev) < index, + ("prev == NULL || pf_frent_index(pref) < index")); + frag->fr_firstoff[index] = frent; + } else { + KASSERT(prev != NULL, ("prev != NULL")); + KASSERT(pf_frent_index(prev) == index, + ("pf_frent_index(prev) == index")); + } + } + + frag->fr_holes += pf_frent_holes(frent); +} + +void +pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent) +{ + struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next); + struct pf_frent *next = TAILQ_NEXT(frent, fr_next); + int index; + + frag->fr_holes -= pf_frent_holes(frent); + + index = pf_frent_index(frent); + KASSERT(frag->fr_firstoff[index] != NULL, ("frent not found")); + if (frag->fr_firstoff[index]->fe_off == frent->fe_off) { + if (next == NULL) { + frag->fr_firstoff[index] = NULL; + } else { + KASSERT(frent->fe_off + frent->fe_len <= next->fe_off, + ("overlapping fragment")); + if (pf_frent_index(next) == index) { + frag->fr_firstoff[index] = next; + } else { + frag->fr_firstoff[index] = NULL; + } + } + } else { + KASSERT(frag->fr_firstoff[index]->fe_off < frent->fe_off, + ("frag->fr_firstoff[index]->fe_off < frent->fe_off")); + KASSERT(prev != NULL, ("prev != NULL")); + KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off, + ("overlapping fragment")); + KASSERT(pf_frent_index(prev) == index, + ("pf_frent_index(prev) == index")); + } + + TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); +} + +struct pf_frent * +pf_frent_previous(struct pf_fragment *frag, struct pf_frent *frent) +{ + struct pf_frent *prev, *next; + int index; + + /* + * If there are no fragments after frag, take the final one. Assume + * that the global queue is not empty. + */ + prev = TAILQ_LAST(&frag->fr_queue, pf_fragq); + KASSERT(prev != NULL, ("prev != NULL")); + if (prev->fe_off <= frent->fe_off) + return prev; + /* + * We want to find a fragment entry that is before frag, but still + * close to it. Find the first fragment entry that is in the same + * entry point or in the first entry point after that. As we have + * already checked that there are entries behind frag, this will + * succeed. + */ + for (index = pf_frent_index(frent); index < PF_FRAG_ENTRY_POINTS; + index++) { + prev = frag->fr_firstoff[index]; + if (prev != NULL) + break; + } + KASSERT(prev != NULL, ("prev != NULL")); + /* + * In prev we may have a fragment from the same entry point that is + * before frent, or one that is just one position behind frent. + * In the latter case, we go back one step and have the predecessor. + * There may be none if the new fragment will be the first one. + */ + if (prev->fe_off > frent->fe_off) { + prev = TAILQ_PREV(prev, pf_fragq, fr_next); + if (prev == NULL) + return NULL; + KASSERT(prev->fe_off <= frent->fe_off, + ("prev->fe_off <= frent->fe_off")); + return prev; + } + /* + * In prev is the first fragment of the entry point. The offset + * of frag is behind it. Find the closest previous fragment. + */ + for (next = TAILQ_NEXT(prev, fr_next); next != NULL; + next = TAILQ_NEXT(next, fr_next)) { + if (next->fe_off > frent->fe_off) + break; + prev = next; + } + return prev; +} + static struct pf_fragment * pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, - u_short *reason) + u_short *reason) { struct pf_frent *after, *next, *prev; struct pf_fragment *frag; @@ -416,6 +566,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, } *(struct pf_fragment_cmp *)frag = *key; + memset(frag->fr_firstoff, 0, sizeof(frag->fr_firstoff)); frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; frag->fr_holes = 1; @@ -425,8 +576,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); /* We do not have a previous fragment. */ - TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); - frag->fr_holes += pf_frent_holes(frent); + pf_frent_insert(frag, frent, NULL); return (frag); } @@ -455,17 +605,15 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, goto bad_fragment; } - /* Find a fragment after the current one. */ - prev = NULL; - TAILQ_FOREACH(after, &frag->fr_queue, fr_next) { - if (after->fe_off > frent->fe_off) - break; - prev = after; + /* Find neighbors for newly inserted fragment */ + prev = pf_frent_previous(frag, frent); + if (prev == NULL) { + after = TAILQ_FIRST(&frag->fr_queue); + KASSERT(after != NULL, ("after != NULL")); + } else { + after = TAILQ_NEXT(prev, fr_next); } - KASSERT(prev != NULL || after != NULL, - ("prev != NULL || after != NULL")); - if (prev != NULL && prev->fe_off + prev->fe_len > frent->fe_off) { uint16_t precut; @@ -493,17 +641,12 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, /* This fragment is completely overlapped, lose it. */ next = TAILQ_NEXT(after, fr_next); - frag->fr_holes -= pf_frent_holes(after); + pf_frent_remove(frag, after); m_freem(after->fe_m); - TAILQ_REMOVE(&frag->fr_queue, after, fr_next); uma_zfree(V_pf_frent_z, after); } - if (prev == NULL) - TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); - else - TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); - frag->fr_holes += pf_frent_holes(frent); + pf_frent_insert(frag, frent, prev); return (frag); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 16:04:04 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E408D56F15B; Sun, 28 Feb 2021 16:04: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 4DpSr32VKQz4VDL; Sun, 28 Feb 2021 16:04: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 D6F0E136FA; Sun, 28 Feb 2021 16:04: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 11SG42tl099992; Sun, 28 Feb 2021 16:04:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SG42Uu099991; Sun, 28 Feb 2021 16:04:02 GMT (envelope-from git) Date: Sun, 28 Feb 2021 16:04:02 GMT Message-Id: <202102281604.11SG42Uu099991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: 555726fda685 - stable/12 - pf: Fix build if INVARIANTS is not set 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: 555726fda685ab5be9ccdbfcb73b9336dc2d75af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 16:04:05 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=555726fda685ab5be9ccdbfcb73b9336dc2d75af commit 555726fda685ab5be9ccdbfcb73b9336dc2d75af Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2018-11-02 19:23:50 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-02-28 15:36:29 +0000 pf: Fix build if INVARIANTS is not set r340061 included a number of assertions pf_frent_remove(), but these assertions were the only use of the 'prev' variable. As a result builds without INVARIANTS had an unused variable, and failed. Reported by: vangyzen@ (cherry picked from commit 58ef854f8b05508f41aff3bdaf1564c8dd4c1d4f) --- sys/netpfil/pf/pf_norm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index eb310e27b9ae..0770fcfd4c58 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -445,7 +445,9 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent, void pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent) { +#ifdef INVARIANTS struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next); +#endif struct pf_frent *next = TAILQ_NEXT(frent, fr_next); int index; From owner-dev-commits-src-all@freebsd.org Sun Feb 28 16:04:12 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CB1556F320; Sun, 28 Feb 2021 16:04: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 4DpSr518N0z4V5K; Sun, 28 Feb 2021 16:04: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 E97ED136FB; Sun, 28 Feb 2021 16:04: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 11SG43FH000113; Sun, 28 Feb 2021 16:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SG43m8000112; Sun, 28 Feb 2021 16:04:03 GMT (envelope-from git) Date: Sun, 28 Feb 2021 16:04:03 GMT Message-Id: <202102281604.11SG43m8000112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: 5f5a45463ea0 - stable/12 - pf: Fix incorrect fragment handling 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: 5f5a45463ea068983092588ab897602f7aea328b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 16:04:12 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5f5a45463ea068983092588ab897602f7aea328b commit 5f5a45463ea068983092588ab897602f7aea328b Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-02-25 07:07:36 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-02-28 15:37:07 +0000 pf: Fix incorrect fragment handling A sequence of overlapping IPv4 fragments could crash the kernel in pf due to an assertion. Reported by: Alexander Bluhm Obtained from: OpenBSD MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5f1b1f184b7f12330cf4a027e3db7c6700c67640) --- sys/netpfil/pf/pf_norm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 0770fcfd4c58..2a3c1d442fd4 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -545,6 +545,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, struct pf_frent *after, *next, *prev; struct pf_fragment *frag; uint16_t total; + int old_index, new_index; PF_FRAG_ASSERT(); @@ -656,8 +657,30 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, DPFPRINTF(("adjust overlap %d", aftercut)); if (aftercut < after->fe_len) { m_adj(after->fe_m, aftercut); + old_index = pf_frent_index(after); after->fe_off += aftercut; after->fe_len -= aftercut; + new_index = pf_frent_index(after); + if (old_index != new_index) { + DPFPRINTF(("frag index %d, new %d", + old_index, new_index)); + /* Fragment switched queue as fe_off changed */ + after->fe_off -= aftercut; + after->fe_len += aftercut; + /* Remove restored fragment from old queue */ + pf_frent_remove(frag, after); + after->fe_off += aftercut; + after->fe_len -= aftercut; + /* Insert into correct queue */ + if (pf_frent_insert(frag, after, prev)) { + DPFPRINTF( + ("fragment requeue limit exceeded")); + m_freem(after->fe_m); + uma_zfree(V_pf_frent_z, after); + /* There is not way to recover */ + goto bad_fragment; + } + } break; } From owner-dev-commits-src-all@freebsd.org Sun Feb 28 16:48:38 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72B2E538317 for <dev-commits-src-all@mailman.nyi.freebsd.org>; Sun, 28 Feb 2021 16:48:38 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) (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 4DpTqV2NPzz4XpN for <dev-commits-src-all@freebsd.org>; Sun, 28 Feb 2021 16:48:38 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb34.google.com with SMTP id m9so14423545ybk.8 for <dev-commits-src-all@freebsd.org>; Sun, 28 Feb 2021 08:48:38 -0800 (PST) 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=noz9imA/pb+7uFn8w3HZLM/YX9oXcwUkr/F2X8HSQfM=; b=JwX4WG1evI4j91Nvn4h22KRQcSQEDTXuUu2kBFVP6BSh3ELOs3vC+gqpUeXB4ZYDuc 0cGMuS5x6HZurzJpW3duXiTDvHn8DqEvreaTX1Oz/vYTS7Ja+FPs1m9zbxisgr4hOFLW cj4EI5P2a3cGiyne0u4gPoezL2gWtKoNmJysM= 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=noz9imA/pb+7uFn8w3HZLM/YX9oXcwUkr/F2X8HSQfM=; b=BUa0LuLnEuJyKhnIV2Q/PiUElgbRHbAE/qt/aht7ctGZg+7rR8If+xsplbuyaFxCbd LTNHFfIsRojHyK8TX7VlGC9jUDmGDw5rry0QgEkRmqxKx1W++H2vAFQmBXxK09wtnVsS s0mK3g4YxCM1Vg5g2K6plJot2EYVgSh3PS4hqBRoxuDaW7HxAux2bSEDsEuLT9gPhpSN ZGeNMDYmDUD3ySjvmlb7nXtJvLJeKlU8qPnFDwir6AE1Zrmr/NF/ZQZU+L5rSLY2iyNe QZQJPsEA8BH7SzPRUzpqYvjNGBhVitzbdWwa0BUQ8a3BQHN7a6cLGZx8yZ6fH6UQFI17 kIrg== X-Gm-Message-State: AOAM530nTN0Ge+sSOruew6oC+PycRdJ0ip8PVrBZHlkdc/KVOODhZD0r eev+lTSzAML/pXomT+ShQTCY4RjRGQotG4s6bZh/GA== X-Google-Smtp-Source: ABdhPJxNi/0ySHZYTKIKgwI5CCeIJrSWz0+zTBwL/kl4wWJMuCaoPEm7weVHqd1vXkAoSamElQ/yPycJIMYfYY8bUNg= X-Received: by 2002:a25:818b:: with SMTP id p11mr18933488ybk.330.1614530917144; Sun, 28 Feb 2021 08:48:37 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> <CANCZdfpw1+sjHVPH4zahywMsLHJ1jKWbnd5A3RjGinu=nQFSGA@mail.gmail.com> <a30870ef-00b1-40b6-b378-033d8737c7e4@www.fastmail.com> <CANCZdfqPNf-RW=-T9qk5a4o-rX3CWFVGz0H_hTav-CqnW9JJ=Q@mail.gmail.com> In-Reply-To: <CANCZdfqPNf-RW=-T9qk5a4o-rX3CWFVGz0H_hTav-CqnW9JJ=Q@mail.gmail.com> From: Kevin Bowling <kevin.bowling@kev009.com> Date: Sun, 28 Feb 2021 09:48:25 -0700 Message-ID: <CAK7dMtD9k5FscvG754tLO6ZeTm5+ru87F06O8+H3bVJqVjf9iQ@mail.gmail.com> Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Warner Losh <imp@bsdimp.com>, Brandon Bergren <bdragon@freebsd.org> Cc: Jessica Clarke <jrtc27@freebsd.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>, Colin Percival <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@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: 4DpTqV2NPzz4XpN 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 16:48:38 -0000 This got me interested because I did recall something like Warner mentioned. It seems like some of the folks that used to be at OzLabs did it as a PoC https://www.flamingspork.com/blog/2015/10/20/tianocore-uefi-ported-to-openpower/. One of the exciting things about OpenPower was that everything above the gates was open in a way only RISC-V seems a chance of repeating any time soon. There are no practical limits to the firmware and runtime service; if you haven't seen this you both might enjoy it https://www.flamingspork.com/blog/2016/10/30/windows-nt4-for-powerpc-guest-on-opal-on-power8-in-qemu/. Practically speaking, with Petitboot (which FreeBSD on PowerNV uses) there isn't much point to go to something like UEFI. It's literally Unix vs DOS-like. The primary targets are Raptor POWER9 hardware and LoPAPR/LoPAR VMs (kvm, PowerVM) and I don't see any near term indication of the ISA expanding to new platforms that would concern FreeBSD. Regards, Kevin On Sat, Feb 27, 2021 at 8:18 PM Warner Losh <imp@bsdimp.com> wrote: > > On Sat, Feb 27, 2021, 8:01 PM Brandon Bergren <bdragon@freebsd.org> wrote: > > > On Sat, Feb 27, 2021, at 8:39 PM, Warner Losh wrote: > > > > 32-bit Arm can boot via EFI. Just mips* and powerpc*. > > > > > > There was some rumblings of little endian powerpc64 efi, but I don't > > > think it's ready... > > > > I've never heard of such things. PAPR/LoPAPR/LoPAR (pseries) is specified > > as an OpenFirmware platform, and I don't see that changing in the future > > given the way it's baked into the spec. And PowerNV is a > > minimal-runtime-services platform where the runtime abstraction (OPAL) > > calls don't include any sort of way to access disk devices. > > > > Do you mean alternative firmware for PowerNV? I've heard people talking on > > and off about coreboot, but I don't see that becoming mainstream over the > > petitboot skiroot payload. > > > > I don't see the pseries virtualization requirements changing away from > > OpenFirmware in the future either, given the OpenFirmware requirement has > > been a constant all the way back to CHRP. > > > > > There was a working group that was defining powerpc bindings that were > being worked on. When I went back to find them again I couldn't, so maybe > they came to naught... > > Warner > > > > > > Yea, we have long since switched our preferred boot on arm to EFI... > > > though we don't have installer images for 32bit arm, which is this > > > runs... so it's needed for correctness, but not a practical > > > difference... > > > > > > Warner > > > > -- > > Brandon Bergren > > bdragon@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 Sun Feb 28 19:37:10 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDFD253FA83; Sun, 28 Feb 2021 19:37: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 4DpYYy6PQWz4nG4; Sun, 28 Feb 2021 19:37: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 CA2811668C; Sun, 28 Feb 2021 19:37: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 11SJbA2u076330; Sun, 28 Feb 2021 19:37:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SJbANM076329; Sun, 28 Feb 2021 19:37:10 GMT (envelope-from git) Date: Sun, 28 Feb 2021 19:37:10 GMT Message-Id: <202102281937.11SJbANM076329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: a9cc796fa73d - main - net80211: rx_stats add 160Mhz channel width. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9cc796fa73de2e80a2d989ba7c2c5a7c7ce9f2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 19:37:11 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a9cc796fa73de2e80a2d989ba7c2c5a7c7ce9f2e commit a9cc796fa73de2e80a2d989ba7c2c5a7c7ce9f2e Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2021-02-28 19:24:22 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2021-02-28 19:24:22 +0000 net80211: rx_stats add 160Mhz channel width. Add the missing receive stat(u)s flag for 160Mhz channel width. While here correct the comment for c_phytype to reference the correct flags. MFC-after: 3 days Sponsored-by: Rubicon Communications, LLC ("Netgate") --- sys/net80211/_ieee80211.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 928d7b0fd957..dc6773afac09 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -580,6 +580,7 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_FW_20MHZ 1 #define IEEE80211_RX_FW_40MHZ 2 #define IEEE80211_RX_FW_80MHZ 3 +#define IEEE80211_RX_FW_160MHZ 4 /* PHY type */ #define IEEE80211_RX_FP_11B 1 @@ -619,7 +620,7 @@ struct ieee80211_rx_stats { } evm; /* 32 bits */ - uint8_t c_phytype; /* PHY type, FP flags above */ + uint8_t c_phytype; /* PHY type, FW flags above */ uint8_t c_vhtnss; /* VHT - number of spatial streams */ uint8_t c_pad2[2]; }; From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:09:00 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03637548071; Sun, 28 Feb 2021 20:09: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 4DpZGg6hTtz4psm; Sun, 28 Feb 2021 20:08: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 D897E169E8; Sun, 28 Feb 2021 20:08: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 11SK8x9h016801; Sun, 28 Feb 2021 20:08:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SK8xAD016800; Sun, 28 Feb 2021 20:08:59 GMT (envelope-from git) Date: Sun, 28 Feb 2021 20:08:59 GMT Message-Id: <202102282008.11SK8xAD016800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne <mhorne@FreeBSD.org> Subject: git: 530d38441d55 - main - armv8crypto: add missing newline MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 530d38441d55b7ac62ebae6ac8ea76903a4a3b0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:09:00 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=530d38441d55b7ac62ebae6ac8ea76903a4a3b0c commit 530d38441d55b7ac62ebae6ac8ea76903a4a3b0c Author: Elliott Mitchell <ehem+freebsd@m5p.com> AuthorDate: 2021-02-28 20:03:44 +0000 Commit: Mitchell Horne <mhorne@FreeBSD.org> CommitDate: 2021-02-28 20:03:55 +0000 armv8crypto: add missing newline The missing newline mildly garbles boot-time messages and this can be troublesome if you need those. Fixes: a520f5ca580f ("armv8crypto: print a message on probe failure") Reported by: Mike Karels (mike@karels.net) Reviewed By: gonzo Differential Revision: https://reviews.freebsd.org/D28988 --- sys/crypto/armv8/armv8_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c index be39168d50f3..24f6eff5608d 100644 --- a/sys/crypto/armv8/armv8_crypto.c +++ b/sys/crypto/armv8/armv8_crypto.c @@ -122,7 +122,7 @@ armv8_crypto_probe(device_t dev) default: break; case ID_AA64ISAR0_AES_NONE: - device_printf(dev, "CPU lacks AES instructions"); + device_printf(dev, "CPU lacks AES instructions\n"); break; } From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:13:15 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 868355483E5; Sun, 28 Feb 2021 20:13:15 +0000 (UTC) (envelope-from mhorne@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 4DpZMb3DgXz4qDN; Sun, 28 Feb 2021 20:13:15 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 618E62A2CD; Sun, 28 Feb 2021 20:13:15 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-yb1-f180.google.com with SMTP id n195so14760493ybg.9; Sun, 28 Feb 2021 12:13:15 -0800 (PST) X-Gm-Message-State: AOAM532EIm5XgGx+cHrnUjqBp+pBvp9ZiO8wScPjNWpnbvyf8ECZ898e Vhi81b5fGJ6Uz5baUDUAGHTN5/Ylj6vjcWCKtHI= X-Google-Smtp-Source: ABdhPJyiZn/gi2gEPGaC7wFfbmEC9K28vfC/rXyY/D/yVftZNqmHbwJz3hhxq3bn0jCTPmZl/4mjmxWLFfYgxI19YzQ= X-Received: by 2002:a25:1883:: with SMTP id 125mr18371041yby.465.1614543194858; Sun, 28 Feb 2021 12:13:14 -0800 (PST) MIME-Version: 1.0 References: <202102282008.11SK8xAD016800@gitrepo.freebsd.org> In-Reply-To: <202102282008.11SK8xAD016800@gitrepo.freebsd.org> From: Mitchell Horne <mhorne@freebsd.org> Date: Sun, 28 Feb 2021 16:13:04 -0400 X-Gmail-Original-Message-ID: <CADeAsy1qD-afd2Fdxy7evgFBgKApEPeH3JAa7j4HBYGbwPnNRA@mail.gmail.com> Message-ID: <CADeAsy1qD-afd2Fdxy7evgFBgKApEPeH3JAa7j4HBYGbwPnNRA@mail.gmail.com> Subject: Re: git: 530d38441d55 - main - armv8crypto: add missing newline To: Mitchell Horne <mhorne@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:13:15 -0000 On Sun, Feb 28, 2021 at 4:09 PM Mitchell Horne <mhorne@freebsd.org> wrote: > > The branch main has been updated by mhorne: > > URL: https://cgit.FreeBSD.org/src/commit/?id=530d38441d55b7ac62ebae6ac8ea76903a4a3b0c > > commit 530d38441d55b7ac62ebae6ac8ea76903a4a3b0c > Author: Elliott Mitchell <ehem+freebsd@m5p.com> > AuthorDate: 2021-02-28 20:03:44 +0000 > Commit: Mitchell Horne <mhorne@FreeBSD.org> > CommitDate: 2021-02-28 20:03:55 +0000 > > armv8crypto: add missing newline > > The missing newline mildly garbles boot-time messages and this can be > troublesome if you need those. > > Fixes: a520f5ca580f ("armv8crypto: print a message on probe failure") > Reported by: Mike Karels (mike@karels.net) > Reviewed By: gonzo > Differential Revision: https://reviews.freebsd.org/D28988 MFC after: 3 days > --- > sys/crypto/armv8/armv8_crypto.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c > index be39168d50f3..24f6eff5608d 100644 > --- a/sys/crypto/armv8/armv8_crypto.c > +++ b/sys/crypto/armv8/armv8_crypto.c > @@ -122,7 +122,7 @@ armv8_crypto_probe(device_t dev) > default: > break; > case ID_AA64ISAR0_AES_NONE: > - device_printf(dev, "CPU lacks AES instructions"); > + device_printf(dev, "CPU lacks AES instructions\n"); > break; > } > From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:25:24 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE36C5490B2 for <dev-commits-src-all@mailman.nyi.freebsd.org>; Sun, 28 Feb 2021 20:25:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 4DpZdc4sRPz4qtq for <dev-commits-src-all@freebsd.org>; Sun, 28 Feb 2021 20:25:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72a.google.com with SMTP id s7so4492180qkg.4 for <dev-commits-src-all@freebsd.org>; Sun, 28 Feb 2021 12:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xQ8dzRf8Ng+PttZxu8m++PWT7Op7/JEhf1S5CT6bsCU=; b=A2/FTVFWl5VvMS1GBgKddVkhMgdaulUScpst3eXVnCTAMLb4cZD22NSa3pOeyEv736 5Ww7JARghv5v26Y/A94p6ac527t31g5yw+nnczAUuxLgrGCvmCWuCE7yr000mMTS3CcL BSIRZJnyMk4InJGXQKaGoiTMepxIpPjN9nNJ9SbuAr4gBuUS/KXxiuJqW6SQWja30YiE fittmi9q84iNAmGR05+6mEB7bNv1notrHJDEHAx8s7QXasw3/W9l5B+4vFSPFSe+jy0z nspXDVwCHpaFQPxwf6jg61nPAUoryaGndJ0zXS5zccotHbM2D191rVVPDl6+XlcjDVEK Cq5w== 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=xQ8dzRf8Ng+PttZxu8m++PWT7Op7/JEhf1S5CT6bsCU=; b=aGjrGKO7+8U40nJJzcgm5xRacMbm1FoaTEX8iIO3pxZ256ga14BpgeWJ3kNa8gYWos zchyDZqgh9IGwjqP5ygfQ3XU4bKxgQKU2Z1m21t/kdPuA/whYutLOBSnqQyf+lzVJ7DP zpOP+RaySGZSIjA8RVhOFgWIaMnmqL4ua7J/7DDOGCpB/LWF6UULAAr2YzV6G5Wynkc5 L8k6aqfxhB/SRfMpHqrfGdwNZ0U2j4PjGAY6HNdhvBH9Vaqhz0aNlNQHPg29YFSgpoIP uWl3jTHh6ESKBPfs9nfBaBIbybMfleE6YE6iZ8oUROqxNOP7Ql64gp1atfuv310VgQ5O Qyaw== X-Gm-Message-State: AOAM533wyUEo6FWIjzZmSYmMJtWKVvL6dBOhAHN0nNXIjwyXXdQBm9fk tNSikrIJzDLfXvuGl+laIqYZxaFDz3qp5Bbd8o84DBZMxT4wBw== X-Google-Smtp-Source: ABdhPJxPqTad23aRCc5n4DfIlFBg5PQx1dTCffeqnyFOeBvpsXjSjttCz6mi8oavyyBr/fzh0wRS4Abk5Spo3nUCLZ0= X-Received: by 2002:a37:a085:: with SMTP id j127mr11267092qke.206.1614543923532; Sun, 28 Feb 2021 12:25:23 -0800 (PST) MIME-Version: 1.0 References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> <CANCZdfpw1+sjHVPH4zahywMsLHJ1jKWbnd5A3RjGinu=nQFSGA@mail.gmail.com> <a30870ef-00b1-40b6-b378-033d8737c7e4@www.fastmail.com> <CANCZdfqPNf-RW=-T9qk5a4o-rX3CWFVGz0H_hTav-CqnW9JJ=Q@mail.gmail.com> <CAK7dMtD9k5FscvG754tLO6ZeTm5+ru87F06O8+H3bVJqVjf9iQ@mail.gmail.com> In-Reply-To: <CAK7dMtD9k5FscvG754tLO6ZeTm5+ru87F06O8+H3bVJqVjf9iQ@mail.gmail.com> From: Warner Losh <imp@bsdimp.com> Date: Sun, 28 Feb 2021 13:25:12 -0700 Message-ID: <CANCZdfrej=mY0uZnY4Cg0PxTtPjJdCUVsM2trBO83z--Qks7JA@mail.gmail.com> Subject: Re: git: 0b7472b3d8d2 - main - Mount the EFI system partition (ESP) on newly-installed systems. To: Kevin Bowling <kevin.bowling@kev009.com> Cc: Brandon Bergren <bdragon@freebsd.org>, Jessica Clarke <jrtc27@freebsd.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>, Colin Percival <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DpZdc4sRPz4qtq 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 <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:25:24 -0000 On Sun, Feb 28, 2021 at 9:48 AM Kevin Bowling <kevin.bowling@kev009.com> wrote: > This got me interested because I did recall something like Warner > mentioned. It seems like some of the folks that used to be at OzLabs > did it as a PoC > > https://www.flamingspork.com/blog/2015/10/20/tianocore-uefi-ported-to-openpower/ > . > Ah yes, it was OzLabs' tianocore port that I recalled. > One of the exciting things about OpenPower was that everything above > the gates was open in a way only RISC-V seems a chance of repeating > any time soon. There are no practical limits to the firmware and > runtime service; if you haven't seen this you both might enjoy it > > https://www.flamingspork.com/blog/2016/10/30/windows-nt4-for-powerpc-guest-on-opal-on-power8-in-qemu/ > . > > Practically speaking, with Petitboot (which FreeBSD on PowerNV uses) > there isn't much point to go to something like UEFI. It's literally > Unix vs DOS-like. The primary targets are Raptor POWER9 hardware and > LoPAPR/LoPAR VMs (kvm, PowerVM) and I don't see any near term > indication of the ISA expanding to new platforms that would concern > FreeBSD. > Yes. I agree as well. I was just hoping to say just that: EFI is barely theoretically possible, but in reality we'll likely never use it.... The net effect is that we don't want to install efi on powerpc on freebsd. Warner > Regards, > Kevin > > On Sat, Feb 27, 2021 at 8:18 PM Warner Losh <imp@bsdimp.com> wrote: > > > > On Sat, Feb 27, 2021, 8:01 PM Brandon Bergren <bdragon@freebsd.org> > wrote: > > > > > On Sat, Feb 27, 2021, at 8:39 PM, Warner Losh wrote: > > > > > 32-bit Arm can boot via EFI. Just mips* and powerpc*. > > > > > > > > There was some rumblings of little endian powerpc64 efi, but I don't > > > > think it's ready... > > > > > > I've never heard of such things. PAPR/LoPAPR/LoPAR (pseries) is > specified > > > as an OpenFirmware platform, and I don't see that changing in the > future > > > given the way it's baked into the spec. And PowerNV is a > > > minimal-runtime-services platform where the runtime abstraction (OPAL) > > > calls don't include any sort of way to access disk devices. > > > > > > Do you mean alternative firmware for PowerNV? I've heard people > talking on > > > and off about coreboot, but I don't see that becoming mainstream over > the > > > petitboot skiroot payload. > > > > > > I don't see the pseries virtualization requirements changing away from > > > OpenFirmware in the future either, given the OpenFirmware requirement > has > > > been a constant all the way back to CHRP. > > > > > > > > > There was a working group that was defining powerpc bindings that were > > being worked on. When I went back to find them again I couldn't, so maybe > > they came to naught... > > > > Warner > > > > > > > > > Yea, we have long since switched our preferred boot on arm to EFI... > > > > though we don't have installer images for 32bit arm, which is this > > > > runs... so it's needed for correctness, but not a practical > > > > difference... > > > > > > > > Warner > > > > > > -- > > > Brandon Bergren > > > bdragon@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 Sun Feb 28 20:40:25 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29D235495BF; Sun, 28 Feb 2021 20:40: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 4DpZyx0HTDz4rqv; Sun, 28 Feb 2021 20:40: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 F026C17324; Sun, 28 Feb 2021 20:40: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 11SKeOZ8063584; Sun, 28 Feb 2021 20:40:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SKeO5u063583; Sun, 28 Feb 2021 20:40:24 GMT (envelope-from git) Date: Sun, 28 Feb 2021 20:40:24 GMT Message-Id: <202102282040.11SKeO5u063583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller <freqlabs@FreeBSD.org> Subject: git: 6f497e47e925 - main - sbin/ifconfig: Get bridge status with libifconfig MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f497e47e925f6886f444a8e31e2e939fca264f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:40:25 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=6f497e47e925f6886f444a8e31e2e939fca264f2 commit 6f497e47e925f6886f444a8e31e2e939fca264f2 Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-02-26 23:04:38 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-02-28 20:29:23 +0000 sbin/ifconfig: Get bridge status with libifconfig Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28954 --- sbin/ifconfig/ifbridge.c | 169 +++++++++++++++++++---------------------------- 1 file changed, 69 insertions(+), 100 deletions(-) diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index f4c51632bc98..cc1520a2e3f0 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -61,6 +61,8 @@ static const char rcsid[] = #include <err.h> #include <errno.h> +#include <libifconfig.h> + #include "ifconfig.h" static const char *stpstates[] = { STP_STATES }; @@ -116,74 +118,6 @@ do_bridgeflag(int sock, const char *ifs, int flag, int set) err(1, "unable to set bridge flags"); } -static void -bridge_interfaces(int s, const char *prefix) -{ - struct ifbifconf bifc; - struct ifbreq *req; - char *inbuf = NULL, *ninbuf; - char *p, *pad; - int i, len = 8192; - - pad = strdup(prefix); - if (pad == NULL) - err(1, "strdup"); - /* replace the prefix with whitespace */ - for (p = pad; *p != '\0'; p++) { - if(isprint(*p)) - *p = ' '; - } - - for (;;) { - ninbuf = realloc(inbuf, len); - if (ninbuf == NULL) - err(1, "unable to allocate interface buffer"); - bifc.ifbic_len = len; - bifc.ifbic_buf = inbuf = ninbuf; - if (do_cmd(s, BRDGGIFS, &bifc, sizeof(bifc), 0) < 0) - err(1, "unable to get interface list"); - if ((bifc.ifbic_len + sizeof(*req)) < len) - break; - len *= 2; - } - - for (i = 0; i < bifc.ifbic_len / sizeof(*req); i++) { - req = bifc.ifbic_req + i; - printf("%s%s ", prefix, req->ifbr_ifsname); - printb("flags", req->ifbr_ifsflags, IFBIFBITS); - printf("\n"); - - printf("%s", pad); - printf("ifmaxaddr %u", req->ifbr_addrmax); - printf(" port %u priority %u", req->ifbr_portno, - req->ifbr_priority); - printf(" path cost %u", req->ifbr_path_cost); - - if (req->ifbr_ifsflags & IFBIF_STP) { - if (req->ifbr_proto < nitems(stpproto)) - printf(" proto %s", stpproto[req->ifbr_proto]); - else - printf(" <unknown proto %d>", - req->ifbr_proto); - - printf("\n%s", pad); - if (req->ifbr_role < nitems(stproles)) - printf("role %s", stproles[req->ifbr_role]); - else - printf("<unknown role %d>", - req->ifbr_role); - if (req->ifbr_state < nitems(stpstates)) - printf(" state %s", stpstates[req->ifbr_state]); - else - printf(" <unknown state %d>", - req->ifbr_state); - } - printf("\n"); - } - free(pad); - free(inbuf); -} - static void bridge_addresses(int s, const char *prefix) { @@ -222,44 +156,79 @@ bridge_addresses(int s, const char *prefix) static void bridge_status(int s) { - struct ifbropreq ifbp; - struct ifbrparam param; - u_int16_t pri; - u_int8_t ht, fd, ma, hc, pro; - u_int8_t lladdr[ETHER_ADDR_LEN]; - u_int16_t bprio; - u_int32_t csize, ctime; + ifconfig_handle_t *lifh; + struct ifconfig_bridge_status *bridge; + struct ifbropreq *params; + const char *pad, *prefix; + uint8_t lladdr[ETHER_ADDR_LEN]; + uint16_t bprio; - if (do_cmd(s, BRDGGCACHE, ¶m, sizeof(param), 0) < 0) - return; - csize = param.ifbrp_csize; - if (do_cmd(s, BRDGGTO, ¶m, sizeof(param), 0) < 0) - return; - ctime = param.ifbrp_ctime; - if (do_cmd(s, BRDGPARAM, &ifbp, sizeof(ifbp), 0) < 0) + lifh = ifconfig_open(); + if (lifh == NULL) return; - pri = ifbp.ifbop_priority; - pro = ifbp.ifbop_protocol; - ht = ifbp.ifbop_hellotime; - fd = ifbp.ifbop_fwddelay; - hc = ifbp.ifbop_holdcount; - ma = ifbp.ifbop_maxage; - - PV2ID(ifbp.ifbop_bridgeid, bprio, lladdr); - printf("\tid %s priority %u hellotime %u fwddelay %u\n", - ether_ntoa((struct ether_addr *)lladdr), pri, ht, fd); - printf("\tmaxage %u holdcnt %u proto %s maxaddr %u timeout %u\n", - ma, hc, stpproto[pro], csize, ctime); - PV2ID(ifbp.ifbop_designated_root, bprio, lladdr); - printf("\troot id %s priority %d ifcost %u port %u\n", - ether_ntoa((struct ether_addr *)lladdr), bprio, - ifbp.ifbop_root_path_cost, ifbp.ifbop_root_port & 0xfff); + if (ifconfig_bridge_get_bridge_status(lifh, name, &bridge) == -1) + goto close; - bridge_interfaces(s, "\tmember: "); + params = bridge->params; - return; + PV2ID(params->ifbop_bridgeid, bprio, lladdr); + printf("\tid %s priority %u hellotime %u fwddelay %u\n", + ether_ntoa((struct ether_addr *)lladdr), + params->ifbop_priority, + params->ifbop_hellotime, + params->ifbop_fwddelay); + printf("\tmaxage %u holdcnt %u proto %s maxaddr %u timeout %u\n", + params->ifbop_maxage, + params->ifbop_holdcount, + stpproto[params->ifbop_protocol], + bridge->cache_size, + bridge->cache_lifetime); + PV2ID(params->ifbop_designated_root, bprio, lladdr); + printf("\troot id %s priority %d ifcost %u port %u\n", + ether_ntoa((struct ether_addr *)lladdr), + bprio, + params->ifbop_root_path_cost, + params->ifbop_root_port & 0xfff); + + prefix = "\tmember: "; + pad = "\t "; + for (size_t i = 0; i < bridge->members_count; ++i) { + struct ifbreq *member = &bridge->members[i]; + + printf("%s%s ", prefix, member->ifbr_ifsname); + printb("flags", member->ifbr_ifsflags, IFBIFBITS); + printf("\n%s", pad); + printf("ifmaxaddr %u port %u priority %u path cost %u", + member->ifbr_addrmax, + member->ifbr_portno, + member->ifbr_priority, + member->ifbr_path_cost); + if (member->ifbr_ifsflags & IFBIF_STP) { + uint8_t proto = member->ifbr_proto; + uint8_t role = member->ifbr_role; + uint8_t state = member->ifbr_state; + + if (proto < nitems(stpproto)) + printf(" proto %s", stpproto[proto]); + else + printf(" <unknown proto %d>", proto); + printf("\n%s", pad); + if (role < nitems(stproles)) + printf("role %s", stproles[role]); + else + printf("<unknown role %d>", role); + if (state < nitems(stpstates)) + printf(" state %s", stpstates[state]); + else + printf(" <unknown state %d>", state); + } + printf("\n"); + } + ifconfig_bridge_free_bridge_status(bridge); +close: + ifconfig_close(lifh); } static void From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:40:26 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A0CE549803; Sun, 28 Feb 2021 20:40: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 4DpZyy19xyz4rwH; Sun, 28 Feb 2021 20:40: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 1B3D216FEC; Sun, 28 Feb 2021 20:40: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 11SKeQNW063606; Sun, 28 Feb 2021 20:40:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SKeQaG063605; Sun, 28 Feb 2021 20:40:26 GMT (envelope-from git) Date: Sun, 28 Feb 2021 20:40:26 GMT Message-Id: <202102282040.11SKeQaG063605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller <freqlabs@FreeBSD.org> Subject: git: 64bacab177f7 - main - sbin/ifconfig: Get groups with libifconfig MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64bacab177f7c743af3268a3e1ffcddaf77a68d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:40:26 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=64bacab177f7c743af3268a3e1ffcddaf77a68d0 commit 64bacab177f7c743af3268a3e1ffcddaf77a68d0 Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-02-27 08:17:04 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-02-28 20:38:50 +0000 sbin/ifconfig: Get groups with libifconfig Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28965 --- sbin/ifconfig/ifgroup.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/sbin/ifconfig/ifgroup.c b/sbin/ifconfig/ifgroup.c index 50d17ca6429e..2b13227af4f3 100644 --- a/sbin/ifconfig/ifgroup.c +++ b/sbin/ifconfig/ifgroup.c @@ -43,6 +43,8 @@ static const char rcsid[] = #include <string.h> #include <unistd.h> +#include <libifconfig.h> + #include "ifconfig.h" /* ARGSUSED */ @@ -84,33 +86,21 @@ unsetifgroup(const char *group_name, int d, int s, const struct afswtch *rafp) static void getifgroups(int s) { - int len, cnt; - struct ifgroupreq ifgr; - struct ifg_req *ifg; - - memset(&ifgr, 0, sizeof(ifgr)); - strlcpy(ifgr.ifgr_name, name, IFNAMSIZ); + ifconfig_handle_t *lifh; + struct ifgroupreq ifgr; + size_t cnt; - if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) { - if (errno == EINVAL || errno == ENOTTY) - return; - else - err(1, "SIOCGIFGROUP"); - } + lifh = ifconfig_open(); + if (lifh == NULL) + return; - len = ifgr.ifgr_len; - ifgr.ifgr_groups = - (struct ifg_req *)calloc(len / sizeof(struct ifg_req), - sizeof(struct ifg_req)); - if (ifgr.ifgr_groups == NULL) - err(1, "getifgroups"); - if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) - err(1, "SIOCGIFGROUP"); + if (ifconfig_get_groups(lifh, name, &ifgr) == -1) + goto close; cnt = 0; - ifg = ifgr.ifgr_groups; - for (; ifg && len >= sizeof(struct ifg_req); ifg++) { - len -= sizeof(struct ifg_req); + for (size_t i = 0; i < ifgr.ifgr_len / sizeof(struct ifg_req); ++i) { + struct ifg_req *ifg = &ifgr.ifgr_groups[i]; + if (strcmp(ifg->ifgrq_group, "all")) { if (cnt == 0) printf("\tgroups:"); @@ -122,6 +112,8 @@ getifgroups(int s) printf("\n"); free(ifgr.ifgr_groups); +close: + ifconfig_close(lifh); } static void From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:44:23 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31D28549C38; Sun, 28 Feb 2021 20:44:23 +0000 (UTC) (envelope-from bdragon@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 4Dpb3W0ZV5z4stg; Sun, 28 Feb 2021 20:44:23 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id F38512AE71; Sun, 28 Feb 2021 20:44:22 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 8A3E727C005B; Sun, 28 Feb 2021 15:44:22 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Sun, 28 Feb 2021 15:44:22 -0500 X-ME-Sender: <xms:pQA8YLgSmg80H9INiFN_dbvNLRA1aOsG-TnFZO6nKbU8Z08SELXr9Q> <xme:pQA8YIBkASvofg-Evs1sXBKEQEoQabkpbbWWkMVppvk729WehdXcg2KupgE7tkcLI vyPGwqzGOCev1TS> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigddugedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder reejnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepjefhfedtuddtleegkeeg tdegjeekffdvjedttdehgffgveeugffgfeelvdeghffgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsggurhgrghhonhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddtgedvfeehkeeigedqudekuddtkeehuddqsggurh grghhonheppefhrhgvvgeuufffrdhorhhgsehimhgrphdrtggt X-ME-Proxy: <xmx:pQA8YLEiQy1gP1h29ElT5q4pzvrDjwCHgwmm93RSora_wRqTmcWFtg> <xmx:pQA8YIQ30FTW3nIc0TSqG58Q6sFheZR1OxfrZVUwElWO9bd2gO1ySg> <xmx:pQA8YIz_exBoiYJ-D1jF54zyRh90kHjauYZU1sACWVVL6B8pAVcVjw> <xmx:pgA8YHpRbWdofXB4Y3kJ-anzhAnBNb2t07Zw19WODhp-4g70UNBC-w> Received: by mailuser.nyi.internal (Postfix, from userid 501) id B9449CA005D; Sun, 28 Feb 2021 15:44:21 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <8215cd95-6905-49da-ab07-65796845613c@www.fastmail.com> In-Reply-To: <CANCZdfrej=mY0uZnY4Cg0PxTtPjJdCUVsM2trBO83z--Qks7JA@mail.gmail.com> References: <202102232124.11NLOT27012354@gitrepo.freebsd.org> <01000177d0e7f033-389acb59-2004-4040-ba7c-762878ef86b4-000000@email.amazonses.com> <dba58a1f-5eb0-da87-7d18-d930aa5d422a@freebsd.org> <CANCZdfoL3QFg9NvpkPW8pfVrNvUK-cTPD2ZGbBr2xxh-0dv=eA@mail.gmail.com> <dc61048c-2cfa-0ff5-0470-e93aa5233aae@freebsd.org> <583f83d8-c78b-d961-d2c5-9693bd36563b@freebsd.org> <743fd126-2077-49b1-9c85-7ccc61616b98@www.fastmail.com> <460ceb98-e0c1-42b3-8e3c-2587c5ce8398@www.fastmail.com> <F4E1978D-DE96-4082-885F-D6686A5D005C@freebsd.org> <CANCZdfpw1+sjHVPH4zahywMsLHJ1jKWbnd5A3RjGinu=nQFSGA@mail.gmail.com> <a30870ef-00b1-40b6-b378-033d8737c7e4@www.fastmail.com> <CANCZdfqPNf-RW=-T9qk5a4o-rX3CWFVGz0H_hTav-CqnW9JJ=Q@mail.gmail.com> <CAK7dMtD9k5FscvG754tLO6ZeTm5+ru87F06O8+H3bVJqVjf9iQ@mail.gmail.com> <CANCZdfrej=mY0uZnY4Cg0PxTtPjJdCUVsM2trBO83z--Qks7JA@mail.gmail.com> Date: Sun, 28 Feb 2021 14:44:02 -0600 From: "Brandon Bergren" <bdragon@FreeBSD.org> To: "Warner Losh" <imp@bsdimp.com>, "Kevin Bowling" <kevin.bowling@kev009.com> Cc: "Jessica Clarke" <jrtc27@freebsd.org>, "Nathan Whitehorn" <nwhitehorn@freebsd.org>, "Colin Percival" <cperciva@tarsnap.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org Subject: =?UTF-8?Q?Re:_git:_0b7472b3d8d2_-_main_-_Mount_the_EFI_system_partition_?= =?UTF-8?Q?(ESP)_on_newly-installed_systems.?= Content-Type: text/plain X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:44:23 -0000 On Sun, Feb 28, 2021, at 2:25 PM, Warner Losh wrote: > Yes. I agree as well. I was just hoping to say just that: EFI is barely > theoretically possible, but in reality we'll likely never use it.... > > The net effect is that we don't want to install efi on powerpc on freebsd. > > Warner > Yeah. The code before the change excluded mips and powerpc platforms, and it should continue to do so instead of using the existence of a /boot/efi directory as the only clue. Currently bsdinstall bails out and leaves powerpc* in a half-installed state because the die in the uname case propagates to the main script, so it never runs the bits after the bootconfig. -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:51:32 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AC9354A060; Sun, 28 Feb 2021 20:51: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 4DpbCm1Dsyz4tCj; Sun, 28 Feb 2021 20:51: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 1D5831778F; Sun, 28 Feb 2021 20:51: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 11SKpWee080288; Sun, 28 Feb 2021 20:51:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SKpWpp080287; Sun, 28 Feb 2021 20:51:32 GMT (envelope-from git) Date: Sun, 28 Feb 2021 20:51:32 GMT Message-Id: <202102282051.11SKpWpp080287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: 18b6283014a2 - releng/13.0 - iflib: Avoid double counting in rxeof 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 18b6283014a291f5fe546092ee16d774a0102691 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:51:32 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=18b6283014a291f5fe546092ee16d774a0102691 commit 18b6283014a291f5fe546092ee16d774a0102691 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-02-24 15:08:53 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-02-28 20:51:21 +0000 iflib: Avoid double counting in rxeof iflib_rxeof() was counting everything twice. This was introduced when pfil hooks were added to the iflib receive path. We want to count rx packets/bytes before the pfil hooks are executed, so remove the counter adjustments that are executed after. Approved by: re (gjb) PR: 253583 Reviewed by: gallatin, erj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28900 (cherry picked from commit b6999635b195e8c0dd5c08ac9ff268c92107cc66) (cherry picked from commit 76294b65df64e87f29a7d7df23c5360dd9ada5aa) --- sys/net/iflib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 506861b65570..70c0ec6a129f 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2973,8 +2973,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) if (!IP_ALIGNED(m) && (m = iflib_fixup_rx(m)) == NULL) continue; #endif - rx_bytes += m->m_pkthdr.len; - rx_pkts++; #if defined(INET6) || defined(INET) if (lro_enabled) { if (!lro_possible) { From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:52:06 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8EF354A30F; Sun, 28 Feb 2021 20:52: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 4DpbDQ4M8Zz4td4; Sun, 28 Feb 2021 20:52: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 88B62176C4; Sun, 28 Feb 2021 20:52: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 11SKq6q1081338; Sun, 28 Feb 2021 20:52:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SKq6rp081337; Sun, 28 Feb 2021 20:52:06 GMT (envelope-from git) Date: Sun, 28 Feb 2021 20:52:06 GMT Message-Id: <202102282052.11SKq6rp081337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: 5966aae9c7c2 - stable/13 - pmap: Fix largemap restart checks in the kernel_maps sysctl handler 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: 5966aae9c7c25707c785ec056cb8462a037a480e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:52:06 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5966aae9c7c25707c785ec056cb8462a037a480e commit 5966aae9c7c25707c785ec056cb8462a037a480e Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-02-25 23:49:47 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-02-28 20:51:51 +0000 pmap: Fix largemap restart checks in the kernel_maps sysctl handler The purpose of these checks is to ensure that the address of the next-level page table page is valid, since nothing is synchronizing with a concurrent update of the large map and large map PTPs are freed to the system. However, if PG_PS is set, there is no next level. Reported by: rpokala Reviewed by: kib Tested by: rpokala Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28922 (cherry picked from commit aac25e222525780db8939d07a594d3e090c0a148) --- sys/amd64/amd64/pmap.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 0e1d1c02d1fc..bd23fd176e88 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -11349,9 +11349,6 @@ restart: continue; } pa = pdpe & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pdpe & PG_PS) != 0) { sva = rounddown2(sva, NBPDP); sysctl_kmaps_check(sb, &range, sva, pml4e, pdpe, @@ -11360,6 +11357,15 @@ restart: sva += NBPDP; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map may be + * freed. Validate the next-level address + * before descending. + */ + goto restart; + } pd = (pd_entry_t *)PHYS_TO_DMAP(pa); for (k = pmap_pde_index(sva); k < NPDEPG; k++) { @@ -11371,9 +11377,6 @@ restart: continue; } pa = pde & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pde & PG_PS) != 0) { sva = rounddown2(sva, NBPDR); sysctl_kmaps_check(sb, &range, sva, @@ -11382,6 +11385,15 @@ restart: sva += NBPDR; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map + * may be freed. Validate the + * next-level address before descending. + */ + goto restart; + } pt = (pt_entry_t *)PHYS_TO_DMAP(pa); for (l = pmap_pte_index(sva); l < NPTEPG; l++, From owner-dev-commits-src-all@freebsd.org Sun Feb 28 20:52:41 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D320254A12F; Sun, 28 Feb 2021 20:52: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 4DpbF55NyMz4tkd; Sun, 28 Feb 2021 20:52: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 A1C4D175B7; Sun, 28 Feb 2021 20:52: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 11SKqf5U081526; Sun, 28 Feb 2021 20:52:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SKqfZ0081525; Sun, 28 Feb 2021 20:52:41 GMT (envelope-from git) Date: Sun, 28 Feb 2021 20:52:41 GMT Message-Id: <202102282052.11SKqfZ0081525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: 39e2c45679a5 - stable/12 - pmap: Fix largemap restart checks in the kernel_maps sysctl handler 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: 39e2c45679a58ba3a5eaed1ac63212c7dc54b0f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 20:52:41 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=39e2c45679a58ba3a5eaed1ac63212c7dc54b0f3 commit 39e2c45679a58ba3a5eaed1ac63212c7dc54b0f3 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-02-25 23:49:47 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-02-28 20:52:37 +0000 pmap: Fix largemap restart checks in the kernel_maps sysctl handler The purpose of these checks is to ensure that the address of the next-level page table page is valid, since nothing is synchronizing with a concurrent update of the large map and large map PTPs are freed to the system. However, if PG_PS is set, there is no next level. Reported by: rpokala Reviewed by: kib Tested by: rpokala Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28922 (cherry picked from commit aac25e222525780db8939d07a594d3e090c0a148) --- sys/amd64/amd64/pmap.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 876a77902eea..d67823729a48 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -10356,9 +10356,6 @@ restart: continue; } pa = pdpe & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pdpe & PG_PS) != 0) { sva = rounddown2(sva, NBPDP); sysctl_kmaps_check(sb, &range, sva, pml4e, pdpe, @@ -10367,6 +10364,15 @@ restart: sva += NBPDP; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map may be + * freed. Validate the next-level address + * before descending. + */ + goto restart; + } pd = (pd_entry_t *)PHYS_TO_DMAP(pa); for (k = pmap_pde_index(sva); k < NPDEPG; k++) { @@ -10378,9 +10384,6 @@ restart: continue; } pa = pde & PG_FRAME; - if (PMAP_ADDRESS_IN_LARGEMAP(sva) && - vm_phys_paddr_to_vm_page(pa) == NULL) - goto restart; if ((pde & PG_PS) != 0) { sva = rounddown2(sva, NBPDR); sysctl_kmaps_check(sb, &range, sva, @@ -10389,6 +10392,15 @@ restart: sva += NBPDR; continue; } + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) { + /* + * Page table pages for the large map + * may be freed. Validate the + * next-level address before descending. + */ + goto restart; + } pt = (pt_entry_t *)PHYS_TO_DMAP(pa); for (l = pmap_pte_index(sva); l < NPTEPG; l++, From owner-dev-commits-src-all@freebsd.org Sun Feb 28 21:47:06 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F15F54CED3; Sun, 28 Feb 2021 21:47: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 4DpcRs71Qgz3Fyn; Sun, 28 Feb 2021 21:47: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 DF8C9180C0; Sun, 28 Feb 2021 21:47: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 11SLl5lW048146; Sun, 28 Feb 2021 21:47:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SLl5ad048145; Sun, 28 Feb 2021 21:47:05 GMT (envelope-from git) Date: Sun, 28 Feb 2021 21:47:05 GMT Message-Id: <202102282147.11SLl5ad048145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller <freqlabs@FreeBSD.org> Subject: git: b12a960e4274 - main - libifconfig: Add a function to get down reason MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b12a960e4274926171dc7a4f9887a0d0a5195b44 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 21:47:06 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=b12a960e4274926171dc7a4f9887a0d0a5195b44 commit b12a960e4274926171dc7a4f9887a0d0a5195b44 Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-02-28 09:34:30 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-02-28 21:43:54 +0000 libifconfig: Add a function to get down reason For use in ifconfig. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28991 --- lib/libifconfig/Symbol.map | 1 + lib/libifconfig/libifconfig.h | 9 +++++++++ lib/libifconfig/libifconfig_media.c | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/lib/libifconfig/Symbol.map b/lib/libifconfig/Symbol.map index 4f82c8185d0b..b3e81d6ee497 100644 --- a/lib/libifconfig/Symbol.map +++ b/lib/libifconfig/Symbol.map @@ -31,6 +31,7 @@ FBSD_1.6 { ifconfig_media_get_status; ifconfig_media_get_subtype; ifconfig_media_get_type; + ifconfig_media_get_downreason; ifconfig_open; ifconfig_set_capability; ifconfig_set_description; diff --git a/lib/libifconfig/libifconfig.h b/lib/libifconfig/libifconfig.h index 46a13ae27d69..d8245ea13b23 100644 --- a/lib/libifconfig/libifconfig.h +++ b/lib/libifconfig/libifconfig.h @@ -207,6 +207,15 @@ const char *ifconfig_media_get_subtype(int ifmw); const char *ifconfig_media_get_status(const struct ifmediareq *ifmr); void ifconfig_media_get_options_string(int ifmw, char *buf, size_t buflen); +/** Retrieve the reason the interface is down + * @param h An open ifconfig state object + * @param name The interface name + * @param ifdr Return argument. + * @return 0 on success, nonzero on failure + */ +int ifconfig_media_get_downreason(ifconfig_handle_t *h, const char *name, + struct ifdownreason *ifdr); + int ifconfig_carp_get_info(ifconfig_handle_t *h, const char *name, struct carpreq *carpr, int ncarpr); diff --git a/lib/libifconfig/libifconfig_media.c b/lib/libifconfig/libifconfig_media.c index f7302d8a9b24..d7ef507604be 100644 --- a/lib/libifconfig/libifconfig_media.c +++ b/lib/libifconfig/libifconfig_media.c @@ -392,3 +392,13 @@ ifconfig_media_get_options_string(int ifmw, char *buf, size_t buflen) } } } + +int +ifconfig_media_get_downreason(ifconfig_handle_t *h, const char *name, + struct ifdownreason *ifdr) +{ + + (void)memset(ifdr, 0, sizeof(*ifdr)); + (void)strlcpy(ifdr->ifdr_name, name, sizeof(ifdr->ifdr_name)); + return (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFDOWNREASON, ifdr)); +} From owner-dev-commits-src-all@freebsd.org Sun Feb 28 22:17:07 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41B1254D1D1; Sun, 28 Feb 2021 22:17: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 4Dpd6W1NVXz3HVG; Sun, 28 Feb 2021 22:17: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 1399418A08; Sun, 28 Feb 2021 22:17: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 11SMH6Sl088189; Sun, 28 Feb 2021 22:17:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SMH6h6088188; Sun, 28 Feb 2021 22:17:06 GMT (envelope-from git) Date: Sun, 28 Feb 2021 22:17:06 GMT Message-Id: <202102282217.11SMH6h6088188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: 3e04ab36ba5c - main - nfsclient: add checks for a server returning the current directory 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: 3e04ab36ba5ce5cbbf6d22f17a01a391a04e465f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 22:17:07 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3e04ab36ba5ce5cbbf6d22f17a01a391a04e465f commit 3e04ab36ba5ce5cbbf6d22f17a01a391a04e465f Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-02-28 22:15:32 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-02-28 22:15:32 +0000 nfsclient: add checks for a server returning the current directory Commit 3fe2c68ba20f dealt with a panic in cache_enter_time() where the vnode referred to the directory argument. It would also be possible to get these panics if a broken NFS server were to return the directory as an new object being created within the directory or in a Lookup reply. This patch adds checks to avoid the panics and logs messages to indicate that the server is broken for the file object creation cases. Reviewd by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28987 --- sys/fs/nfsclient/nfs_clvnops.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 80317cfd7a50..fc5445ef1e76 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1423,7 +1423,7 @@ nfs_lookup(struct vop_lookup_args *ap) } if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; - if ((cnp->cn_flags & MAKEENTRY) && + if ((cnp->cn_flags & MAKEENTRY) && dvp != newvp && (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) && attrflag != 0 && (newvp->v_type != VDIR || dattrflag != 0)) cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, @@ -1752,9 +1752,14 @@ again: } } if (!error) { - if ((cnp->cn_flags & MAKEENTRY) && attrflag) - cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, - NULL); + if ((cnp->cn_flags & MAKEENTRY) && attrflag) { + if (dvp != newvp) + cache_enter_time(dvp, newvp, cnp, + &nfsva.na_ctime, NULL); + else + printf("nfs_create: bogus NFS server returned " + "the directory as the new file object\n"); + } *ap->a_vpp = newvp; } else if (NFS_ISV4(dvp)) { error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, @@ -2126,7 +2131,11 @@ nfs_link(struct vop_link_args *ap) */ if (VFSTONFS(vp->v_mount)->nm_negnametimeo != 0 && (cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) { - cache_enter_time(tdvp, vp, cnp, &nfsva.na_ctime, NULL); + if (tdvp != vp) + cache_enter_time(tdvp, vp, cnp, &nfsva.na_ctime, NULL); + else + printf("nfs_link: bogus NFS server returned " + "the directory as the new link\n"); } if (error && NFS_ISV4(vp)) error = nfscl_maperr(cnp->cn_thread, error, (uid_t)0, @@ -2205,7 +2214,12 @@ nfs_symlink(struct vop_symlink_args *ap) */ if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && (cnp->cn_flags & MAKEENTRY) && attrflag != 0 && error == 0) { - cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, NULL); + if (dvp != newvp) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, + NULL); + else + printf("nfs_symlink: bogus NFS server returned " + "the directory as the new file object\n"); } return (error); } @@ -2278,9 +2292,15 @@ nfs_mkdir(struct vop_mkdir_args *ap) */ if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && (cnp->cn_flags & MAKEENTRY) && - attrflag != 0 && dattrflag != 0) - cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime, - &dnfsva.na_ctime); + attrflag != 0 && dattrflag != 0) { + if (dvp != newvp) + cache_enter_time(dvp, newvp, cnp, + &nfsva.na_ctime, &dnfsva.na_ctime); + else + printf("nfs_mkdir: bogus NFS server returned " + "the directory that the directory was " + "created in as the new file object\n"); + } *ap->a_vpp = newvp; } return (error); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 22:32:37 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4158A54DC70; Sun, 28 Feb 2021 22:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DpdSP1MFVz3JMv; Sun, 28 Feb 2021 22:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2183418E9C; Sun, 28 Feb 2021 22:32: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 11SMWbre013272; Sun, 28 Feb 2021 22:32:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SMWbuq013271; Sun, 28 Feb 2021 22:32:37 GMT (envelope-from git) Date: Sun, 28 Feb 2021 22:32:37 GMT Message-Id: <202102282232.11SMWbuq013271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Juraj Lutter <otis@FreeBSD.org> Subject: git: c7d27b225df8 - main - newsyslog(8): Implement a new 'E' flag to not rotate empty log files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: otis X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7d27b225df8d7fb36a31a21737d4309593c4604 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 22:32:37 -0000 The branch main has been updated by otis (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c7d27b225df8d7fb36a31a21737d4309593c4604 commit c7d27b225df8d7fb36a31a21737d4309593c4604 Author: Juraj Lutter <otis@FreeBSD.org> AuthorDate: 2021-02-28 22:07:14 +0000 Commit: Juraj Lutter <otis@FreeBSD.org> CommitDate: 2021-02-28 22:32:19 +0000 newsyslog(8): Implement a new 'E' flag to not rotate empty log files Based on an idea from dvl's coworker, László DANIELISZ, implement a new flag, 'E', that prevents newsyslog(8) from rotating the empty log files. This 'E' flag ist mostly usable in conjunction with 'B' flag that instructs newsyslog(8) to not insert an informational message into the log file after rotation, keeping it still empty. Reviewed by: markj, ian, manpages (rpokala) Approved by: markj, ian, manpages (rpokala) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28940 --- usr.sbin/newsyslog/newsyslog.c | 11 ++++++++++- usr.sbin/newsyslog/newsyslog.conf.5 | 14 +++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index dc3ea51c8032..8f8bb54e9b46 100644 --- a/usr.sbin/newsyslog/newsyslog.c +++ b/usr.sbin/newsyslog/newsyslog.c @@ -114,7 +114,8 @@ __FBSDID("$FreeBSD$"); #define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ #define CE_PLAIN0 0x0800 /* Do not compress zero'th history file */ #define CE_RFC5424 0x1000 /* Use RFC5424 format rotation message */ - +#define CE_NOEMPTY 0x2000 /* Do not rotate the file when its size */ + /* is zero */ #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ @@ -531,6 +532,11 @@ do_entry(struct conf_entry * ent) printf("does not exist, skipped%s.\n", temp_reason); } } else { + if (ent->flags & CE_NOEMPTY && ent->fsize == 0) { + if (verbose) + printf("--> Not rotating empty file\n"); + return (free_or_keep); + } if (ent->flags & CE_TRIMAT && !force && !rotatereq && !oversized) { diffsecs = ptimeget_diff(timenow, ent->trim_at); @@ -1291,6 +1297,9 @@ no_trimat: case 'd': working->flags |= CE_NODUMP; break; + case 'e': + working->flags |= CE_NOEMPTY; + break; case 'g': working->flags |= CE_GLOB; break; diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5 index d6b1191aa8b2..b897389b99dd 100644 --- a/usr.sbin/newsyslog/newsyslog.conf.5 +++ b/usr.sbin/newsyslog/newsyslog.conf.5 @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd August 21, 2018 +.Dd February 26, 2021 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -286,6 +286,18 @@ this log file. This option would affect how the .Xr dump 8 command treats the log file when making a file system backup. +.It Cm E +indicates that the log file should not be rotated when its +size is zero. +The +.Cm E +flag is mostly useful in conjunction with +.Cm B +flag to prevent +.Xr newsyslog 8 +from inserting an informational +.Tn ASCII +message into the new file. .It Cm G indicates that the specified .Ar logfile_name From owner-dev-commits-src-all@freebsd.org Sun Feb 28 22:55:44 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD1A554E962; Sun, 28 Feb 2021 22:55: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 4Dpdz44vFNz3KF6; Sun, 28 Feb 2021 22:55: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 9B0A819092; Sun, 28 Feb 2021 22:55: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 11SMtiua040208; Sun, 28 Feb 2021 22:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SMtih6040207; Sun, 28 Feb 2021 22:55:44 GMT (envelope-from git) Date: Sun, 28 Feb 2021 22:55:44 GMT Message-Id: <202102282255.11SMtih6040207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: 15bed8c46b32 - main - nfsclient: add nfs node locking around uses of n_direofoffset 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: 15bed8c46b32dec19e922cb89e12c8970867a303 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 22:55:44 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=15bed8c46b32dec19e922cb89e12c8970867a303 commit 15bed8c46b32dec19e922cb89e12c8970867a303 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-02-28 22:53:54 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-02-28 22:53:54 +0000 nfsclient: add nfs node locking around uses of n_direofoffset During code inspection I noticed that the n_direofoffset field of the NFS node was being manipulated without any lock being held to make it SMP safe. This patch adds locking of the NFS node's mutex around handling of n_direofoffset to make it SMP safe. I have not seen any failure that could be attributed to n_direofoffset being manipulated concurrently by multiple processors, but I think this is possible, since directories are read with shared vnode locking, plus locks only on individual buffer cache blocks. However, there have been as yet unexplained issues w.r.t reading large directories over NFS that could have conceivably been caused by concurrent manipulation of n_direofoffset. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clbio.c | 10 ++++++++++ sys/fs/nfsclient/nfs_clsubs.c | 3 ++- sys/fs/nfsclient/nfs_clvnops.c | 21 ++++++++++++++++----- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 832b44b99c8d..ff9f446ff1ef 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -584,11 +584,14 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) break; case VDIR: NFSINCRGLOBAL(nfsstatsv1.biocache_readdirs); + NFSLOCKNODE(np); if (np->n_direofoffset && uio->uio_offset >= np->n_direofoffset) { + NFSUNLOCKNODE(np); error = 0; goto out; } + NFSUNLOCKNODE(np); lbn = (uoff_t)uio->uio_offset / NFS_DIRBLKSIZ; on = uio->uio_offset & (NFS_DIRBLKSIZ - 1); bp = nfs_getcacheblk(vp, lbn, NFS_DIRBLKSIZ, td); @@ -620,11 +623,14 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) * NFSERR_BAD_COOKIE (double yuch!). */ for (i = 0; i <= lbn && !error; i++) { + NFSLOCKNODE(np); if (np->n_direofoffset && (i * NFS_DIRBLKSIZ) >= np->n_direofoffset) { + NFSUNLOCKNODE(np); error = 0; goto out; } + NFSUNLOCKNODE(np); bp = nfs_getcacheblk(vp, i, NFS_DIRBLKSIZ, td); if (!bp) { error = newnfs_sigintr(nmp, td); @@ -667,11 +673,13 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) * (You need the current block first, so that you have the * directory offset cookie of the next block.) */ + NFSLOCKNODE(np); if (nmp->nm_readahead > 0 && (bp->b_flags & B_INVAL) == 0 && (np->n_direofoffset == 0 || (lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) && incore(&vp->v_bufobj, lbn + 1) == NULL) { + NFSUNLOCKNODE(np); rabp = nfs_getcacheblk(vp, lbn + 1, NFS_DIRBLKSIZ, td); if (rabp) { if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) { @@ -688,6 +696,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) brelse(rabp); } } + NFSLOCKNODE(np); } /* * Unlike VREG files, whos buffer size ( bp->b_bcount ) is @@ -704,6 +713,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) n = lmin(uio->uio_resid, NFS_DIRBLKSIZ - bp->b_resid - on); if (np->n_direofoffset && n > np->n_direofoffset - uio->uio_offset) n = np->n_direofoffset - uio->uio_offset; + NFSUNLOCKNODE(np); break; default: printf(" ncl_bioread: type %x unexpected\n", vp->v_type); diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c index f26ad0452e07..d361c175aa8e 100644 --- a/sys/fs/nfsclient/nfs_clsubs.c +++ b/sys/fs/nfsclient/nfs_clsubs.c @@ -118,6 +118,7 @@ ncl_uninit(struct vfsconf *vfsp) #endif } +/* Returns with NFSLOCKNODE() held. */ void ncl_dircookie_lock(struct nfsnode *np) { @@ -125,7 +126,6 @@ ncl_dircookie_lock(struct nfsnode *np) while (np->n_flag & NDIRCOOKIELK) (void) msleep(&np->n_flag, &np->n_mtx, PZERO, "nfsdirlk", 0); np->n_flag |= NDIRCOOKIELK; - NFSUNLOCKNODE(np); } void @@ -330,6 +330,7 @@ ncl_invaldir(struct vnode *vp) KASSERT(vp->v_type == VDIR, ("nfs: invaldir not dir")); ncl_dircookie_lock(np); np->n_direofoffset = 0; + NFSUNLOCKNODE(np); np->n_cookieverf.nfsuquad[0] = 0; np->n_cookieverf.nfsuquad[1] = 0; if (LIST_FIRST(&np->n_cookies)) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index fc5445ef1e76..217290b080b3 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -2369,8 +2369,10 @@ nfs_readdir(struct vop_readdir_args *ap) /* * First, check for hit on the EOF offset cache */ + NFSLOCKNODE(np); if (np->n_direofoffset > 0 && uio->uio_offset >= np->n_direofoffset && (np->n_flag & NMODIFIED) == 0) { + NFSUNLOCKNODE(np); if (VOP_GETATTR(vp, &vattr, ap->a_cred) == 0) { NFSLOCKNODE(np); if ((NFS_ISV4(vp) && np->n_change == vattr.va_filerev) || @@ -2383,7 +2385,8 @@ nfs_readdir(struct vop_readdir_args *ap) } else NFSUNLOCKNODE(np); } - } + } else + NFSUNLOCKNODE(np); /* * NFS always guarantees that directory entries don't straddle @@ -2436,6 +2439,7 @@ ncl_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, * If there is no cookie, assume directory was stale. */ ncl_dircookie_lock(dnp); + NFSUNLOCKNODE(dnp); cookiep = ncl_getcookie(dnp, uiop->uio_offset, 0); if (cookiep) { cookie = *cookiep; @@ -2458,12 +2462,15 @@ ncl_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, * We are now either at the end of the directory or have filled * the block. */ - if (eof) + if (eof) { + NFSLOCKNODE(dnp); dnp->n_direofoffset = uiop->uio_offset; - else { + NFSUNLOCKNODE(dnp); + } else { if (uiop->uio_resid > 0) printf("EEK! readdirrpc resid > 0\n"); ncl_dircookie_lock(dnp); + NFSUNLOCKNODE(dnp); cookiep = ncl_getcookie(dnp, uiop->uio_offset, 1); *cookiep = cookie; ncl_dircookie_unlock(dnp); @@ -2496,6 +2503,7 @@ ncl_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, * If there is no cookie, assume directory was stale. */ ncl_dircookie_lock(dnp); + NFSUNLOCKNODE(dnp); cookiep = ncl_getcookie(dnp, uiop->uio_offset, 0); if (cookiep) { cookie = *cookiep; @@ -2517,12 +2525,15 @@ ncl_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, * We are now either at end of the directory or have filled the * the block. */ - if (eof) + if (eof) { + NFSLOCKNODE(dnp); dnp->n_direofoffset = uiop->uio_offset; - else { + NFSUNLOCKNODE(dnp); + } else { if (uiop->uio_resid > 0) printf("EEK! readdirplusrpc resid > 0\n"); ncl_dircookie_lock(dnp); + NFSUNLOCKNODE(dnp); cookiep = ncl_getcookie(dnp, uiop->uio_offset, 1); *cookiep = cookie; ncl_dircookie_unlock(dnp); From owner-dev-commits-src-all@freebsd.org Sun Feb 28 23:39:01 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DBB554F7E3; Sun, 28 Feb 2021 23:39: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 4Dpfx11MDYz3LyP; Sun, 28 Feb 2021 23:39: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 1EDAC19A58; Sun, 28 Feb 2021 23:39: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 11SNd1pT093545; Sun, 28 Feb 2021 23:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11SNd1IB093544; Sun, 28 Feb 2021 23:39:01 GMT (envelope-from git) Date: Sun, 28 Feb 2021 23:39:01 GMT Message-Id: <202102282339.11SNd1IB093544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 55eb51ab6649 - main - Add VOP_READ_PGCACHE(9) 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/main X-Git-Reftype: branch X-Git-Commit: 55eb51ab6649c3c10bf201f82a4ec410fe4da4a2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 28 Feb 2021 23:39:01 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=55eb51ab6649c3c10bf201f82a4ec410fe4da4a2 commit 55eb51ab6649c3c10bf201f82a4ec410fe4da4a2 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-02-28 01:08:37 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-02-28 23:38:33 +0000 Add VOP_READ_PGCACHE(9) PR: 253894 Reviewed by: gbe, rwatson Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28980 --- share/man/man9/Makefile | 1 + share/man/man9/VOP_RDWR.9 | 1 + share/man/man9/VOP_READ_PGCACHE.9 | 134 ++++++++++++++++++++++++++++++++++++++ share/man/man9/vnode.9 | 1 + 4 files changed, 137 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 7b55bf8516c7..50e760d3e047 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -425,6 +425,7 @@ MAN= accept_filter.9 \ VOP_PATHCONF.9 \ VOP_PRINT.9 \ VOP_RDWR.9 \ + VOP_READ_PGCACHE.9 \ VOP_READDIR.9 \ VOP_READLINK.9 \ VOP_REALLOCBLKS.9 \ diff --git a/share/man/man9/VOP_RDWR.9 b/share/man/man9/VOP_RDWR.9 index 4719ebabd094..2de7f9c9e7d2 100644 --- a/share/man/man9/VOP_RDWR.9 +++ b/share/man/man9/VOP_RDWR.9 @@ -83,6 +83,7 @@ Data already in VMIO space. .El .Sh LOCKS The file should be locked on entry and will still be locked on exit. +Rangelock covering the whole i/o range should be owned around the call. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh ERRORS diff --git a/share/man/man9/VOP_READ_PGCACHE.9 b/share/man/man9/VOP_READ_PGCACHE.9 new file mode 100644 index 000000000000..3e6ae9be4fc7 --- /dev/null +++ b/share/man/man9/VOP_READ_PGCACHE.9 @@ -0,0 +1,134 @@ +.\" Copyright (c) 2021 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 28, 2021 +.Dt VOP_READ_PGCACHE 9 +.Os +.Sh NAME +.Nm VOP_READ_PGCACHE +.Nd read a file, fast +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.In sys/uio.h +.Ft int +.Fo VOP_READ_PGCACHE +.Fa "struct vnode *vp" +.Fa "struct uio *uio" +.Fa "int ioflag" +.Fa "struct ucred *cred" +.Fc +.Sh DESCRIPTION +This entry point reads the contents of a file. +The intent is to provide the data from caches, which do not require +expensive operations or any disk IO. +For instance, if filesystem uses normal VM page cache and maintains +.Dv v_object +lifetime, it can use +.Xr vn_read_from_obj 9 +helper to return data from the resident +.Dv vp->v_object +pages. +.Pp +The filesystem indicates support for the +.Nm +on specific vnode by setting the +.Dv VIRF_PGREAD +flag in +.Dv vp->v_irflag . +.Pp +The function does not need to satisfy the whole request; it also might choose +to not provide any data. +In these cases, the +.Fa uio +must be advanced by the amount of read data, +.Nm +should return +.Er EJUSTRETURN , +and VFS would handle the rest of the read operation using the +.Xr VOP_READ 9 . +.Pp +The VFS layer does the same deadlock avoidance for accessing userspace +pages from +.Nm +as for +.Xr VOP_READ 9 . +.Pp +Vnode is not locked on the call entry and should not be locked on return. +For a filesystem that requires vnode lock to return any data, it does +not make sense to implement +.Nm +(and set +.Dv VIRF_PGREAD +flag) since VFS arranges the call to +.Xr VOP_READ 9 +as needed. +.Pp +The arguments are: +.Bl -tag -width ioflag +.It Fa vp +The vnode of the file. +.It Fa uio +The location of the data to be read. +.It Fa ioflag +Various flags, see +.Xr VOP_READ 9 +for the list. +.It Fa cred +The credentials of the caller. +.El +.Pp +.Nm +does not handle non-zero +.Fa ioflag +argument. +.Sh LOCKS +The file should be referenced on entry on entry and will still be +referenced on exit. +Rangelock covering the whole read range should be owned around the call. +.Sh RETURN VALUES +Zero is returned on success, when the whole request is satisfied, and no +more data cannot be provided for it by any means. +If more data can be returned, but +.Nm +was unable to provide it, +.Er EJUSTRETURN +must be returned. +The +.Dv uio +records should be updated according to the partial operation done. +.Pp +Otherwise an error code is returned, +same as from +.Xr VOP_READ 9 +.Sh SEE ALSO +.Xr uiomove 9 , +.Xr vnode 9 , +.Xr VOP_READ 9 diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 5ff45d7a1364..8d8da46b93ea 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -181,6 +181,7 @@ intertwining of VM Objects and Vnodes. .Xr VOP_PATHCONF 9 , .Xr VOP_PRINT 9 , .Xr VOP_RDWR 9 , +.Xr VOP_READ_PGCACHE 9 , .Xr VOP_READDIR 9 , .Xr VOP_READLINK 9 , .Xr VOP_REALLOCBLKS 9 ,